VYPR
Medium severity6.3NVD Advisory· Published Apr 9, 2026· Updated Apr 24, 2026

CVE-2026-5831

CVE-2026-5831

Description

A security flaw has been discovered in Agions taskflow-ai up to 2.1.8. This impacts an unknown function of the file src/mcp/server/handlers.ts of the component terminal_execute. Performing a manipulation results in os command injection. The attack is possible to be carried out remotely. Upgrading to version 2.1.9 will fix this issue. The patch is named c1550b445b9f24f38c4414e9a545f5f79f23a0fe. Upgrading the affected component is recommended. The vendor was contacted early, responded in a very professional manner and quickly released a fixed version of the affected product.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
taskflow-ainpm
< 2.1.92.1.9

Affected products

1

Patches

1
c1550b445b9f

fix: resolve command injection vulnerability (CWE-78)

https://github.com/Agions/taskflow-aiAgionsMar 27, 2026via ghsa
300 files changed · +72063 0
  • assets/logo.svg+109 0 added
    @@ -0,0 +1,109 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<svg width="400" height="160" viewBox="0 0 400 160" xmlns="http://www.w3.org/2000/svg">
    +  <defs>
    +    <linearGradient id="primaryGradient" x1="0%" y1="0%" x2="100%" y2="100%">
    +      <stop offset="0%" style="stop-color:#00D2FF;stop-opacity:1" />
    +      <stop offset="100%" style="stop-color:#3A7BD5;stop-opacity:1" />
    +    </linearGradient>
    +    
    +    <linearGradient id="accentGradient" x1="0%" y1="0%" x2="100%" y2="0%">
    +      <stop offset="0%" style="stop-color:#FF6B6B;stop-opacity:1" />
    +      <stop offset="100%" style="stop-color:#4ECDC4;stop-opacity:1" />
    +    </linearGradient>
    +    
    +    <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
    +      <feDropShadow dx="2" dy="2" stdDeviation="3" flood-color="#000000" flood-opacity="0.2"/>
    +    </filter>
    +  </defs>
    +  
    +  <!-- 背景 -->
    +  <rect width="400" height="160" rx="12" ry="12" fill="#FFFFFF" stroke="#E5E7EB" stroke-width="1"/>
    +  
    +  <!-- 主图标区域 -->
    +  <g transform="translate(20, 30)">
    +    <!-- 流程图标 -->
    +    <g filter="url(#shadow)">
    +      <!-- 主要流程节点 -->
    +      <rect x="10" y="20" width="35" height="20" rx="4" fill="url(#primaryGradient)"/>
    +      <rect x="65" y="20" width="35" height="20" rx="4" fill="url(#primaryGradient)"/>
    +      <rect x="120" y="20" width="35" height="20" rx="4" fill="url(#primaryGradient)"/>
    +      
    +      <!-- 连接线和箭头 -->
    +      <line x1="45" y1="30" x2="65" y2="30" stroke="url(#accentGradient)" stroke-width="3" stroke-linecap="round"/>
    +      <line x1="100" y1="30" x2="120" y2="30" stroke="url(#accentGradient)" stroke-width="3" stroke-linecap="round"/>
    +      
    +      <polygon points="60,27 65,30 60,33" fill="url(#accentGradient)"/>
    +      <polygon points="115,27 120,30 115,33" fill="url(#accentGradient)"/>
    +      
    +      <!-- 节点标签 -->
    +      <text x="27.5" y="34" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="#FFFFFF" font-weight="600">PRD</text>
    +      <text x="82.5" y="34" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="#FFFFFF" font-weight="600">AI</text>
    +      <text x="137.5" y="34" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="#FFFFFF" font-weight="600">任务</text>
    +      
    +      <!-- 底部图标 -->
    +      <!-- 文档图标 -->
    +      <rect x="15" y="60" width="25" height="30" rx="3" fill="#F8FAFC" stroke="url(#primaryGradient)" stroke-width="2"/>
    +      <line x1="20" y1="70" x2="35" y2="70" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="20" y1="75" x2="35" y2="75" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="20" y1="80" x2="30" y2="80" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      
    +      <!-- AI 大脑图标 -->
    +      <circle cx="82.5" cy="75" r="18" fill="url(#primaryGradient)" opacity="0.1"/>
    +      <circle cx="82.5" cy="75" r="15" fill="none" stroke="url(#primaryGradient)" stroke-width="2"/>
    +      <circle cx="78" cy="70" r="2" fill="url(#primaryGradient)"/>
    +      <circle cx="87" cy="70" r="2" fill="url(#primaryGradient)"/>
    +      <path d="M 75 82 Q 82.5 87 90 82" stroke="url(#primaryGradient)" stroke-width="2" fill="none" stroke-linecap="round"/>
    +      
    +      <!-- 任务列表图标 -->
    +      <rect x="125" y="60" width="25" height="30" rx="3" fill="#F8FAFC" stroke="url(#primaryGradient)" stroke-width="2"/>
    +      <circle cx="130" cy="68" r="2" fill="url(#accentGradient)"/>
    +      <circle cx="130" cy="75" r="2" fill="url(#accentGradient)"/>
    +      <circle cx="130" cy="82" r="2" fill="url(#accentGradient)"/>
    +      <line x1="135" y1="68" x2="145" y2="68" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="135" y1="75" x2="145" y2="75" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="135" y1="82" x2="145" y2="82" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +    </g>
    +  </g>
    +  
    +  <!-- 文字区域 -->
    +  <g transform="translate(190, 40)">
    +    <!-- TaskFlow 文字 -->
    +    <text x="0" y="25" font-family="Arial, sans-serif" font-size="32" font-weight="bold" fill="url(#primaryGradient)">
    +      TaskFlow
    +    </text>
    +    
    +    <!-- AI 文字 -->
    +    <text x="150" y="25" font-family="Arial, sans-serif" font-size="32" font-weight="bold" fill="url(#accentGradient)">
    +      AI
    +    </text>
    +    
    +    <!-- 副标题 -->
    +    <text x="0" y="45" font-family="Arial, sans-serif" font-size="12" fill="#6B7280">
    +      智能PRD文档解析与任务管理助手
    +    </text>
    +    
    +    <!-- 特性标签 -->
    +    <g transform="translate(0, 65)">
    +      <rect x="0" y="0" width="40" height="16" rx="8" fill="url(#primaryGradient)" opacity="0.15"/>
    +      <text x="20" y="11" font-family="Arial, sans-serif" font-size="9" text-anchor="middle" fill="url(#primaryGradient)" font-weight="600">
    +        MCP
    +      </text>
    +      
    +      <rect x="45" y="0" width="30" height="16" rx="8" fill="url(#accentGradient)" opacity="0.15"/>
    +      <text x="60" y="11" font-family="Arial, sans-serif" font-size="9" text-anchor="middle" fill="url(#accentGradient)" font-weight="600">
    +        AI
    +      </text>
    +      
    +      <rect x="80" y="0" width="50" height="16" rx="8" fill="#10B981" opacity="0.15"/>
    +      <text x="105" y="11" font-family="Arial, sans-serif" font-size="9" text-anchor="middle" fill="#10B981" font-weight="600">
    +        多模型
    +      </text>
    +    </g>
    +  </g>
    +  
    +  <!-- 装饰性元素 -->
    +  <g opacity="0.08">
    +    <circle cx="360" cy="30" r="15" fill="url(#primaryGradient)"/>
    +    <circle cx="375" cy="130" r="10" fill="url(#accentGradient)"/>
    +  </g>
    +</svg>
    \ No newline at end of file
    
  • bin/index.js+2 0 added
    @@ -0,0 +1,2 @@
    +#!/usr/bin/env node
    +require('../dist/cli/index.js');
    
  • build.js+116 0 added
    @@ -0,0 +1,116 @@
    +#!/usr/bin/env node
    +
    +/**
    + * 构建脚本 - 支持增量构建
    + */
    +
    +import { execSync } from 'child_process';
    +import path from 'path';
    +import fs from 'fs';
    +import { fileURLToPath } from 'url';
    +
    +const __filename = fileURLToPath(import.meta.url);
    +const __dirname = path.dirname(__filename);
    +
    +const rootDir = process.cwd();
    +const distDir = path.join(rootDir, 'dist');
    +
    +const startTime = Date.now();
    +
    +// 解析命令行参数
    +const args = process.argv.slice(2);
    +const isWatch = args.includes('--watch');
    +const isClean = args.includes('--clean');
    +const isIncremental = !isClean && !args.includes('--full');
    +
    +console.log('🚀 TaskFlow AI 构建...\n');
    +console.log(`   模式: ${isClean ? '完全清理' : isWatch ? '监听' : '增量'}`);
    +
    +try {
    +  // 检查是否需要清理
    +  if (isClean && fs.existsSync(distDir)) {
    +    console.log('🧹 清理旧的构建文件...');
    +    fs.rmSync(distDir, { recursive: true, force: true });
    +  }
    +
    +  // 检查增量构建条件
    +  const needsFullBuild = isClean || !fs.existsSync(distDir);
    +  
    +  if (!needsFullBuild && isIncremental) {
    +    // 增量构建:只编译修改过的文件
    +    console.log('⚡ 增量编译...');
    +    const tscCmd = isWatch 
    +      ? 'npx tsc -p tsconfig.build.json --watch --incremental'
    +      : 'npx tsc -p tsconfig.build.json --incremental';
    +    
    +    if (isWatch) {
    +      execSync(tscCmd, { cwd: rootDir, stdio: 'inherit' });
    +      console.log('👀 监听模式开启,按 Ctrl+C 退出');
    +    } else {
    +      execSync(tscCmd, { cwd: rootDir, stdio: 'inherit' });
    +    }
    +  } else {
    +    // 完全构建
    +    console.log('📦 完全编译...');
    +    
    +    // 清理旧的构建文件
    +    if (fs.existsSync(distDir)) {
    +      fs.rmSync(distDir, { recursive: true, force: true });
    +    }
    +    
    +    execSync('npx tsc -p tsconfig.build.json', { cwd: rootDir, stdio: 'inherit' });
    +  }
    +
    +  // 创建 bin 目录和入口文件
    +  const binDir = path.join(rootDir, 'bin');
    +  fs.mkdirSync(binDir, { recursive: true });
    +
    +  const cliIndexPath = path.join(distDir, 'cli', 'index.js');
    +  const binIndexPath = path.join(binDir, 'index.js');
    +  const distIndexPath = path.join(distDir, 'index.js');
    +
    +  // 创建主入口文件
    +  if (fs.existsSync(cliIndexPath)) {
    +    const binContent = `#!/usr/bin/env node
    +require('../dist/cli/index.js');
    +`;
    +    const distContent = `#!/usr/bin/env node
    +require('./cli/index.js');
    +`;
    +    fs.writeFileSync(distIndexPath, distContent);
    +    fs.writeFileSync(binIndexPath, binContent);
    +    fs.chmodSync(binIndexPath, 0o755);
    +    fs.chmodSync(distIndexPath, 0o755);
    +  }
    +
    +  // 计算构建大小
    +  const getDirectorySize = (dirPath) => {
    +    let size = 0;
    +    if (fs.existsSync(dirPath)) {
    +      const files = fs.readdirSync(dirPath, { withFileTypes: true });
    +      for (const file of files) {
    +        const filePath = path.join(dirPath, file.name);
    +        if (file.isDirectory()) {
    +          size += getDirectorySize(filePath);
    +        } else {
    +          size += fs.statSync(filePath).size;
    +        }
    +      }
    +    }
    +    return size;
    +  };
    +
    +  if (!isWatch) {
    +    const totalSize = getDirectorySize(distDir);
    +    const elapsedTime = ((Date.now() - startTime) / 1000).toFixed(2);
    +    
    +    console.log(`\n✅ 构建完成!`);
    +    console.log(`   输出目录: dist/`);
    +    console.log(`   总大小: ${(totalSize / 1024).toFixed(2)} KB`);
    +    console.log(`   耗时: ${elapsedTime}s`);
    +  }
    +
    +} catch (error) {
    +  console.error('\n❌ 构建失败:', error.message);
    +  process.exit(1);
    +}
    
  • CHANGELOG.md+139 0 added
    @@ -0,0 +1,139 @@
    +# Changelog
    +
    +所有 TaskFlow AI 的显著变更都将记录在此文件中。
    +
    +格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
    +并且本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
    +
    +## [Unreleased]
    +
    +### Added
    +- 新增专业级 CLI UI 组件库
    +  - 统一颜色主题系统
    +  - ASCII Logo 展示
    +  - 加载动画 (Spinner)
    +  - 信息框组件 (成功/错误/警告/信息)
    +  - 列表和表格展示
    +  - 进度条组件
    +  - 交互式提示 (确认/输入/选择/向导)
    +  - 仪表板组件 (项目状态/系统信息/任务列表/时间线)
    +- 新增 NPM 发布脚本
    +  - `npm run publish:patch` - 发布补丁版本
    +  - `npm run publish:minor` - 发布次要版本
    +  - `npm run publish:major` - 发布主要版本
    +  - `npm run publish:beta` - 发布 Beta 版本
    +  - `npm run publish:alpha` - 发布 Alpha 版本
    +- 优化 CI/CD 工作流
    +  - 增强的 npm-publish.yml
    +  - 改进的 ci.yml (支持 Node 18/20/22)
    +  - 增强的 release.yml
    +
    +### Changed
    +- 优化 package.json 发布配置
    +  - 添加 publishConfig
    +  - 优化 files 字段
    +  - 添加 prepublishOnly 脚本
    +
    +## [2.1.0] - 2026-02-22
    +
    +### Added
    +- ✨ 新增 Agent 系统
    +  - 自主任务执行能力
    +  - 工具调用框架
    +  - 状态机管理
    +- 🔌 MCP 集成增强
    +  - 支持 Cursor/VSCode/Windsurf/Trae/Claude Desktop
    +  - MCP 服务器自动发现
    +  - 安全沙箱机制
    +- 🧠 思维链可视化优化
    +  - Mermaid 流程图导出
    +  - 思维导图支持
    +  - 置信度评估
    +- ⚡ 工作流性能提升
    +  - 并行执行优化
    +  - 缓存机制
    +  - 内存管理改进
    +
    +### Changed
    +- 重构核心配置模块
    +- 优化 AI 路由算法
    +- 改进错误处理机制
    +
    +### Fixed
    +- 修复 MCP 连接稳定性问题
    +- 修复工作流状态持久化 bug
    +- 修复多模型切换时的内存泄漏
    +
    +## [2.0.0] - 2026-01-15
    +
    +### Added
    +- 🎉 全新架构设计
    +  - 模块化架构
    +  - 插件系统
    +  - 事件驱动
    +- 🤖 多模型智能路由
    +  - 统一接口调用所有模型
    +  - 智能路由策略 (smart/cost/speed/priority)
    +  - 级联降级机制
    +- 📝 智能 PRD 解析
    +  - Markdown/Word/PDF 支持
    +  - AI 驱动的任务分解
    +  - 工时估算
    +- 🧩 插件系统
    +  - 钩子机制
    +  - 配置扩展
    +  - 自定义命令
    +
    +### Changed
    +- 完全重构 CLI 架构
    +- 新的配置管理系统
    +- 改进的日志系统
    +
    +### Removed
    +- 废弃 v1.x 的 API 接口
    +- 移除旧版配置格式支持
    +
    +## [1.2.0] - 2025-12-10
    +
    +### Added
    +- Docker MCP 注册表
    +- 容器化部署支持
    +- 环境变量配置
    +
    +### Fixed
    +- 修复 Windows 路径问题
    +- 修复并发任务冲突
    +
    +## [1.1.0] - 2025-11-20
    +
    +### Added
    +- CI/CD 工作流支持
    +- GitHub Actions 集成
    +- 自动化测试
    +
    +### Changed
    +- 优化 PRD 解析算法
    +- 改进任务分配逻辑
    +
    +## [1.0.0] - 2025-10-01
    +
    +### Added
    +- 🎉 初始版本发布
    +- 基础 CLI 功能
    +- PRD 文档解析
    +- 任务管理
    +- 多模型 AI 支持
    +
    +---
    +
    +## 版本说明
    +
    +- **主版本号 (X.y.z)**: 不兼容的 API 变更
    +- **次版本号 (x.Y.z)**: 向下兼容的功能新增
    +- **修订号 (x.y.Z)**: 向下兼容的问题修复
    +
    +## 标签说明
    +
    +- `latest` - 最新稳定版本
    +- `beta` - 公测版本,功能基本完整
    +- `alpha` - 内测版本,可能包含未完成的功能
    
  • config/config.development.json+72 0 added
    @@ -0,0 +1,72 @@
    +{
    +  "app": {
    +    "name": "TaskFlow AI",
    +    "version": "1.3.0",
    +    "environment": "development",
    +    "debug": true
    +  },
    +  "server": {
    +    "port": 3000,
    +    "host": "localhost"
    +  },
    +  "database": {
    +    "type": "sqlite",
    +    "path": "./data/taskflow.db"
    +  },
    +  "models": {
    +    "default": "deepseek",
    +    "providers": {
    +      "deepseek": {
    +        "apiKey": "${DEEPSEEK_API_KEY}",
    +        "endpoint": "https://api.deepseek.com/v1",
    +        "model": "deepseek-chat"
    +      },
    +      "zhipu": {
    +        "apiKey": "${ZHIPU_API_KEY}",
    +        "endpoint": "https://open.bigmodel.cn/api/paas/v4",
    +        "model": "glm-4"
    +      },
    +      "baidu": {
    +        "apiKey": "${BAIDU_API_KEY}",
    +        "secretKey": "${BAIDU_SECRET_KEY}",
    +        "endpoint": "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat"
    +      },
    +      "qwen": {
    +        "apiKey": "${QWEN_API_KEY}",
    +        "endpoint": "https://dashscope.aliyuncs.com/api/v1",
    +        "model": "qwen-turbo"
    +      },
    +      "spark": {
    +        "apiKey": "${SPARK_API_KEY}",
    +        "appId": "${SPARK_APP_ID}",
    +        "apiSecret": "${SPARK_API_SECRET}",
    +        "endpoint": "wss://spark-api.xf-yun.com/v3.5/chat"
    +      },
    +      "moonshot": {
    +        "apiKey": "${MOONSHOT_API_KEY}",
    +        "endpoint": "https://api.moonshot.cn/v1",
    +        "model": "moonshot-v1-8k"
    +      }
    +    }
    +  },
    +  "logger": {
    +    "level": "debug",
    +    "output": "both",
    +    "file": "./logs/taskflow.log"
    +  },
    +  "features": {
    +    "multiModel": true,
    +    "intelligentOrchestration": true,
    +    "mcpIntegration": true,
    +    "performanceOptimization": true
    +  },
    +  "security": {
    +    "enableEncryption": false,
    +    "allowedOrigins": ["http://localhost:3000"],
    +    "rateLimiting": {
    +      "enabled": false,
    +      "maxRequests": 100,
    +      "windowMs": 900000
    +    }
    +  }
    +}
    
  • config/nginx.conf+158 0 added
    @@ -0,0 +1,158 @@
    +# TaskFlow AI - Nginx 反向代理配置
    +
    +user nginx;
    +worker_processes auto;
    +error_log /var/log/nginx/error.log warn;
    +pid /var/run/nginx.pid;
    +
    +events {
    +    worker_connections 1024;
    +    use epoll;
    +    multi_accept on;
    +}
    +
    +http {
    +    include /etc/nginx/mime.types;
    +    default_type application/octet-stream;
    +
    +    # 日志格式
    +    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    +                    '$status $body_bytes_sent "$http_referer" '
    +                    '"$http_user_agent" "$http_x_forwarded_for"';
    +
    +    access_log /var/log/nginx/access.log main;
    +
    +    # 基本配置
    +    sendfile on;
    +    tcp_nopush on;
    +    tcp_nodelay on;
    +    keepalive_timeout 65;
    +    types_hash_max_size 2048;
    +    server_tokens off;
    +
    +    # Gzip 压缩
    +    gzip on;
    +    gzip_vary on;
    +    gzip_min_length 1024;
    +    gzip_proxied any;
    +    gzip_comp_level 6;
    +    gzip_types
    +        text/plain
    +        text/css
    +        text/xml
    +        text/javascript
    +        application/json
    +        application/javascript
    +        application/xml+rss
    +        application/atom+xml
    +        image/svg+xml;
    +
    +    # 上游服务器配置
    +    upstream taskflow_backend {
    +        least_conn;
    +        server taskflow-app:3000 max_fails=3 fail_timeout=30s;
    +        keepalive 32;
    +    }
    +
    +    # 限流配置
    +    limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
    +    limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
    +
    +    # 主服务器配置
    +    server {
    +        listen 80;
    +        server_name localhost;
    +
    +        # 安全头
    +        add_header X-Frame-Options DENY;
    +        add_header X-Content-Type-Options nosniff;
    +        add_header X-XSS-Protection "1; mode=block";
    +        add_header Referrer-Policy "strict-origin-when-cross-origin";
    +
    +        # 客户端配置
    +        client_max_body_size 10M;
    +        client_body_timeout 60s;
    +        client_header_timeout 60s;
    +
    +        # API 代理
    +        location /api/ {
    +            limit_req zone=api burst=20 nodelay;
    +            
    +            proxy_pass http://taskflow_backend;
    +            proxy_http_version 1.1;
    +            proxy_set_header Upgrade $http_upgrade;
    +            proxy_set_header Connection 'upgrade';
    +            proxy_set_header Host $host;
    +            proxy_set_header X-Real-IP $remote_addr;
    +            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    +            proxy_set_header X-Forwarded-Proto $scheme;
    +            proxy_cache_bypass $http_upgrade;
    +            
    +            proxy_connect_timeout 30s;
    +            proxy_send_timeout 30s;
    +            proxy_read_timeout 30s;
    +        }
    +
    +        # 健康检查
    +        location /health {
    +            proxy_pass http://taskflow_backend;
    +            proxy_set_header Host $host;
    +            access_log off;
    +        }
    +
    +        # Metrics (仅内部访问)
    +        location /metrics {
    +            allow 172.0.0.0/8;
    +            deny all;
    +            proxy_pass http://taskflow_backend;
    +        }
    +
    +        # 静态文件缓存
    +        location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
    +            expires 1y;
    +            add_header Cache-Control "public, immutable";
    +            add_header Vary Accept-Encoding;
    +        }
    +
    +        # 默认代理
    +        location / {
    +            proxy_pass http://taskflow_backend;
    +            proxy_http_version 1.1;
    +            proxy_set_header Upgrade $http_upgrade;
    +            proxy_set_header Connection 'upgrade';
    +            proxy_set_header Host $host;
    +            proxy_set_header X-Real-IP $remote_addr;
    +            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    +            proxy_set_header X-Forwarded-Proto $scheme;
    +            proxy_cache_bypass $http_upgrade;
    +        }
    +
    +        # 错误页面
    +        error_page 404 /404.html;
    +        error_page 500 502 503 504 /50x.html;
    +        
    +        location = /50x.html {
    +            root /usr/share/nginx/html;
    +        }
    +    }
    +
    +    # HTTPS 配置 (可选)
    +    # server {
    +    #     listen 443 ssl http2;
    +    #     server_name localhost;
    +    #
    +    #     ssl_certificate /etc/nginx/ssl/cert.pem;
    +    #     ssl_certificate_key /etc/nginx/ssl/key.pem;
    +    #     ssl_session_timeout 1d;
    +    #     ssl_session_cache shared:SSL:50m;
    +    #     ssl_session_tickets off;
    +    #
    +    #     ssl_protocols TLSv1.2 TLSv1.3;
    +    #     ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384;
    +    #     ssl_prefer_server_ciphers off;
    +    #
    +    #     add_header Strict-Transport-Security "max-age=63072000" always;
    +    #
    +    #     # 其他配置与 HTTP 相同
    +    # }
    +}
    
  • config/prometheus.yml+65 0 added
    @@ -0,0 +1,65 @@
    +# TaskFlow AI - Prometheus 监控配置
    +
    +global:
    +  scrape_interval: 15s
    +  evaluation_interval: 15s
    +  external_labels:
    +    monitor: 'taskflow-monitor'
    +
    +rule_files:
    +  # - "first_rules.yml"
    +  # - "second_rules.yml"
    +
    +scrape_configs:
    +  # Prometheus 自身监控
    +  - job_name: 'prometheus'
    +    static_configs:
    +      - targets: ['localhost:9090']
    +
    +  # TaskFlow AI 应用监控
    +  - job_name: 'taskflow-ai'
    +    static_configs:
    +      - targets: ['taskflow-app:9464']
    +    metrics_path: '/metrics'
    +    scrape_interval: 30s
    +    scrape_timeout: 10s
    +    honor_labels: true
    +    params:
    +      format: ['prometheus']
    +
    +  # Redis 监控 (需要 redis_exporter)
    +  - job_name: 'redis'
    +    static_configs:
    +      - targets: ['redis-exporter:9121']
    +    scrape_interval: 30s
    +
    +  # Nginx 监控 (需要 nginx-prometheus-exporter)
    +  - job_name: 'nginx'
    +    static_configs:
    +      - targets: ['nginx-exporter:9113']
    +    scrape_interval: 30s
    +
    +  # Node Exporter (系统监控)
    +  - job_name: 'node'
    +    static_configs:
    +      - targets: ['node-exporter:9100']
    +    scrape_interval: 30s
    +
    +  # Docker 容器监控 (需要 cAdvisor)
    +  - job_name: 'cadvisor'
    +    static_configs:
    +      - targets: ['cadvisor:8080']
    +    scrape_interval: 30s
    +
    +# 告警规则配置
    +alerting:
    +  alertmanagers:
    +    - static_configs:
    +        - targets:
    +          # - alertmanager:9093
    +
    +# 存储配置
    +storage:
    +  tsdb:
    +    retention.time: 30d
    +    retention.size: 10GB
    
  • config/redis.conf+50 0 added
    @@ -0,0 +1,50 @@
    +# TaskFlow AI - Redis 生产环境配置
    +
    +# 基本配置
    +bind 0.0.0.0
    +port 6379
    +timeout 300
    +tcp-keepalive 60
    +
    +# 内存配置
    +maxmemory 1gb
    +maxmemory-policy allkeys-lru
    +maxmemory-samples 5
    +
    +# 持久化配置
    +save 900 1
    +save 300 10
    +save 60 10000
    +
    +# AOF 配置
    +appendonly yes
    +appendfilename "appendonly.aof"
    +appendfsync everysec
    +no-appendfsync-on-rewrite no
    +auto-aof-rewrite-percentage 100
    +auto-aof-rewrite-min-size 64mb
    +
    +# 日志配置
    +loglevel notice
    +logfile ""
    +
    +# 安全配置
    +protected-mode yes
    +# requirepass your-redis-password
    +
    +# 性能优化
    +tcp-backlog 511
    +databases 16
    +stop-writes-on-bgsave-error yes
    +rdbcompression yes
    +rdbchecksum yes
    +
    +# 客户端配置
    +maxclients 10000
    +
    +# 慢查询日志
    +slowlog-log-slower-than 10000
    +slowlog-max-len 128
    +
    +# 延迟监控
    +latency-monitor-threshold 100
    
  • docs/api/ai-orchestrator.md+668 0 added
    @@ -0,0 +1,668 @@
    +# AI编排器 API
    +
    +## 概述
    +
    +AI编排器负责管理和协调多个AI模型,提供智能模型选择、负载均衡、故障转移等功能。本文档详细介绍AI编排器的API接口和使用方法。
    +
    +## 🏗️ 架构设计
    +
    +```typescript
    +interface AIOrchestrator {
    +  // 模型管理
    +  registerModel(model: AIModel): Promise<void>
    +  unregisterModel(modelId: string): Promise<void>
    +  getAvailableModels(): Promise<AIModel[]>
    +  
    +  // 智能处理
    +  processText(text: string, options: ProcessingOptions): Promise<ProcessingResult>
    +  selectOptimalModel(task: string, context: ProcessingContext): Promise<string>
    +  
    +  // 负载均衡
    +  balanceLoad(models: string[]): Promise<string>
    +  getModelLoad(modelId: string): Promise<ModelLoad>
    +  
    +  // 健康检查
    +  healthCheck(modelId?: string): Promise<HealthStatus>
    +  testConnection(modelId: string): Promise<ConnectionResult>
    +  
    +  // 性能监控
    +  getPerformanceMetrics(modelId?: string): Promise<PerformanceMetrics>
    +  getUsageStatistics(period?: TimePeriod): Promise<UsageStatistics>
    +}
    +```
    +
    +## 🤖 模型管理
    +
    +### registerModel
    +
    +注册AI模型。
    +
    +```typescript
    +async registerModel(model: AIModel): Promise<void>
    +```
    +
    +**示例**:
    +```typescript
    +import { AIOrchestrator, AIModel } from 'taskflow-ai'
    +
    +const orchestrator = new AIOrchestrator()
    +
    +// 注册DeepSeek模型
    +await orchestrator.registerModel({
    +  id: 'deepseek',
    +  name: 'DeepSeek Chat',
    +  provider: 'deepseek',
    +  endpoint: 'https://api.deepseek.com/v1/chat/completions',
    +  apiKey: process.env.DEEPSEEK_API_KEY,
    +  capabilities: ['text-generation', 'code-analysis', 'reasoning'],
    +  limits: {
    +    maxTokens: 4000,
    +    requestsPerMinute: 60,
    +    tokensPerMinute: 100000
    +  },
    +  pricing: {
    +    inputTokens: 0.0014,  // per 1K tokens
    +    outputTokens: 0.0028
    +  }
    +})
    +
    +// 注册智谱AI模型
    +await orchestrator.registerModel({
    +  id: 'zhipu',
    +  name: 'GLM-4',
    +  provider: 'zhipu',
    +  endpoint: 'https://open.bigmodel.cn/api/paas/v4/chat/completions',
    +  apiKey: process.env.ZHIPU_API_KEY,
    +  capabilities: ['text-generation', 'chinese-understanding', 'reasoning'],
    +  limits: {
    +    maxTokens: 8000,
    +    requestsPerMinute: 100,
    +    tokensPerMinute: 150000
    +  }
    +})
    +```
    +
    +### getAvailableModels
    +
    +获取可用模型列表。
    +
    +```typescript
    +async getAvailableModels(): Promise<AIModel[]>
    +```
    +
    +**示例**:
    +```typescript
    +const models = await orchestrator.getAvailableModels()
    +
    +console.log('可用模型:')
    +models.forEach(model => {
    +  console.log(`- ${model.name} (${model.id})`)
    +  console.log(`  能力: ${model.capabilities.join(', ')}`)
    +  console.log(`  状态: ${model.status}`)
    +  console.log(`  负载: ${model.currentLoad}%`)
    +})
    +```
    +
    +## 🧠 智能处理
    +
    +### processText
    +
    +处理文本内容。
    +
    +```typescript
    +async processText(
    +  text: string, 
    +  options: ProcessingOptions
    +): Promise<ProcessingResult>
    +```
    +
    +**示例**:
    +```typescript
    +// 基本文本处理
    +const result = await orchestrator.processText(
    +  'PRD文档内容...',
    +  {
    +    task: 'prd-analysis',
    +    preferredModel: 'deepseek',
    +    fallbackModels: ['zhipu', 'qwen'],
    +    maxTokens: 2000,
    +    temperature: 0.7
    +  }
    +)
    +
    +// 多模型对比处理
    +const comparison = await orchestrator.processText(
    +  'PRD文档内容...',
    +  {
    +    task: 'prd-analysis',
    +    multiModel: true,
    +    models: ['deepseek', 'zhipu', 'qwen'],
    +    compareResults: true
    +  }
    +)
    +
    +console.log('处理结果:')
    +console.log(`- 使用模型: ${result.modelUsed}`)
    +console.log(`- 处理时间: ${result.processingTime}ms`)
    +console.log(`- 置信度: ${result.confidence}`)
    +console.log(`- 结果: ${result.content}`)
    +```
    +
    +### selectOptimalModel
    +
    +选择最优模型。
    +
    +```typescript
    +async selectOptimalModel(
    +  task: string, 
    +  context: ProcessingContext
    +): Promise<string>
    +```
    +
    +**示例**:
    +```typescript
    +// 根据任务类型选择模型
    +const modelForCode = await orchestrator.selectOptimalModel(
    +  'code-analysis',
    +  {
    +    language: 'typescript',
    +    complexity: 'medium',
    +    domain: 'web-development'
    +  }
    +)
    +
    +const modelForBusiness = await orchestrator.selectOptimalModel(
    +  'business-analysis',
    +  {
    +    language: 'chinese',
    +    domain: 'e-commerce',
    +    documentType: 'requirements'
    +  }
    +)
    +
    +console.log(`代码分析推荐模型: ${modelForCode}`)
    +console.log(`业务分析推荐模型: ${modelForBusiness}`)
    +```
    +
    +## ⚖️ 负载均衡
    +
    +### balanceLoad
    +
    +负载均衡选择模型。
    +
    +```typescript
    +async balanceLoad(models: string[]): Promise<string>
    +```
    +
    +**示例**:
    +```typescript
    +// 在多个模型间进行负载均衡
    +const availableModels = ['deepseek', 'zhipu', 'qwen']
    +const selectedModel = await orchestrator.balanceLoad(availableModels)
    +
    +console.log(`负载均衡选择的模型: ${selectedModel}`)
    +
    +// 获取各模型当前负载
    +for (const modelId of availableModels) {
    +  const load = await orchestrator.getModelLoad(modelId)
    +  console.log(`${modelId} 负载: ${load.currentRequests}/${load.maxRequests}`)
    +}
    +```
    +
    +### getModelLoad
    +
    +获取模型负载信息。
    +
    +```typescript
    +async getModelLoad(modelId: string): Promise<ModelLoad>
    +```
    +
    +**示例**:
    +```typescript
    +const load = await orchestrator.getModelLoad('deepseek')
    +
    +console.log(`DeepSeek 模型负载:`)
    +console.log(`- 当前请求数: ${load.currentRequests}`)
    +console.log(`- 最大请求数: ${load.maxRequests}`)
    +console.log(`- 负载百分比: ${load.loadPercentage}%`)
    +console.log(`- 平均响应时间: ${load.averageResponseTime}ms`)
    +console.log(`- 队列长度: ${load.queueLength}`)
    +```
    +
    +## 🏥 健康检查
    +
    +### healthCheck
    +
    +检查模型健康状态。
    +
    +```typescript
    +async healthCheck(modelId?: string): Promise<HealthStatus>
    +```
    +
    +**示例**:
    +```typescript
    +// 检查所有模型健康状态
    +const overallHealth = await orchestrator.healthCheck()
    +
    +console.log(`系统健康状态: ${overallHealth.status}`)
    +console.log(`可用模型数: ${overallHealth.availableModels}/${overallHealth.totalModels}`)
    +
    +// 检查特定模型
    +const deepseekHealth = await orchestrator.healthCheck('deepseek')
    +
    +if (deepseekHealth.status === 'healthy') {
    +  console.log('DeepSeek 模型运行正常')
    +} else {
    +  console.log(`DeepSeek 模型异常: ${deepseekHealth.issues.join(', ')}`)
    +}
    +```
    +
    +### testConnection
    +
    +测试模型连接。
    +
    +```typescript
    +async testConnection(modelId: string): Promise<ConnectionResult>
    +```
    +
    +**示例**:
    +```typescript
    +const connectionTest = await orchestrator.testConnection('zhipu')
    +
    +console.log(`智谱AI 连接测试:`)
    +console.log(`- 连接状态: ${connectionTest.success ? '成功' : '失败'}`)
    +console.log(`- 响应时间: ${connectionTest.responseTime}ms`)
    +console.log(`- API状态: ${connectionTest.apiStatus}`)
    +
    +if (!connectionTest.success) {
    +  console.log(`错误信息: ${connectionTest.error}`)
    +}
    +```
    +
    +## 📊 性能监控
    +
    +### getPerformanceMetrics
    +
    +获取性能指标。
    +
    +```typescript
    +async getPerformanceMetrics(modelId?: string): Promise<PerformanceMetrics>
    +```
    +
    +**示例**:
    +```typescript
    +// 获取所有模型的性能指标
    +const overallMetrics = await orchestrator.getPerformanceMetrics()
    +
    +console.log('整体性能指标:')
    +console.log(`- 平均响应时间: ${overallMetrics.averageResponseTime}ms`)
    +console.log(`- 成功率: ${overallMetrics.successRate}%`)
    +console.log(`- 吞吐量: ${overallMetrics.throughput} 请求/分钟`)
    +
    +// 获取特定模型的性能指标
    +const deepseekMetrics = await orchestrator.getPerformanceMetrics('deepseek')
    +
    +console.log('DeepSeek 性能指标:')
    +console.log(`- 响应时间: ${deepseekMetrics.averageResponseTime}ms`)
    +console.log(`- 成功率: ${deepseekMetrics.successRate}%`)
    +console.log(`- 错误率: ${deepseekMetrics.errorRate}%`)
    +console.log(`- 缓存命中率: ${deepseekMetrics.cacheHitRate}%`)
    +```
    +
    +### getUsageStatistics
    +
    +获取使用统计。
    +
    +```typescript
    +async getUsageStatistics(period?: TimePeriod): Promise<UsageStatistics>
    +```
    +
    +**示例**:
    +```typescript
    +// 获取本月使用统计
    +const monthlyStats = await orchestrator.getUsageStatistics({
    +  start: new Date('2024-01-01'),
    +  end: new Date('2024-01-31')
    +})
    +
    +console.log('本月使用统计:')
    +console.log(`- 总请求数: ${monthlyStats.totalRequests}`)
    +console.log(`- 总Token数: ${monthlyStats.totalTokens}`)
    +console.log(`- 总费用: $${monthlyStats.totalCost}`)
    +
    +console.log('按模型分布:')
    +monthlyStats.byModel.forEach(stat => {
    +  console.log(`- ${stat.modelId}: ${stat.requests} 请求, $${stat.cost}`)
    +})
    +
    +console.log('按任务类型分布:')
    +monthlyStats.byTask.forEach(stat => {
    +  console.log(`- ${stat.taskType}: ${stat.requests} 请求`)
    +})
    +```
    +
    +## 🔧 类型定义
    +
    +### AIModel
    +
    +AI模型定义。
    +
    +```typescript
    +interface AIModel {
    +  // 基本信息
    +  id: string
    +  name: string
    +  provider: string
    +  version?: string
    +  
    +  // 连接信息
    +  endpoint: string
    +  apiKey: string
    +  headers?: Record<string, string>
    +  
    +  // 能力描述
    +  capabilities: ModelCapability[]
    +  supportedTasks: string[]
    +  
    +  // 限制和配额
    +  limits: {
    +    maxTokens: number
    +    requestsPerMinute: number
    +    tokensPerMinute: number
    +    maxConcurrentRequests?: number
    +  }
    +  
    +  // 定价信息
    +  pricing?: {
    +    inputTokens: number   // per 1K tokens
    +    outputTokens: number  // per 1K tokens
    +    fixedCost?: number    // per request
    +  }
    +  
    +  // 状态信息
    +  status: ModelStatus
    +  currentLoad: number
    +  lastHealthCheck: Date
    +  
    +  // 配置参数
    +  defaultParams: {
    +    temperature?: number
    +    maxTokens?: number
    +    topP?: number
    +    frequencyPenalty?: number
    +  }
    +}
    +```
    +
    +### ProcessingOptions
    +
    +处理选项。
    +
    +```typescript
    +interface ProcessingOptions {
    +  // 任务类型
    +  task: string
    +  
    +  // 模型选择
    +  preferredModel?: string
    +  fallbackModels?: string[]
    +  multiModel?: boolean
    +  models?: string[]
    +  
    +  // 处理参数
    +  maxTokens?: number
    +  temperature?: number
    +  topP?: number
    +  
    +  // 质量控制
    +  compareResults?: boolean
    +  minConfidence?: number
    +  maxRetries?: number
    +  
    +  // 缓存控制
    +  useCache?: boolean
    +  cacheKey?: string
    +  cacheTTL?: number
    +  
    +  // 回调函数
    +  onProgress?: (progress: ProcessingProgress) => void
    +  onModelSelected?: (modelId: string) => void
    +  onError?: (error: ProcessingError) => void
    +}
    +```
    +
    +### ProcessingResult
    +
    +处理结果。
    +
    +```typescript
    +interface ProcessingResult {
    +  // 基本结果
    +  success: boolean
    +  content: string
    +  
    +  // 模型信息
    +  modelUsed: string
    +  modelsAttempted: string[]
    +  
    +  // 性能指标
    +  processingTime: number
    +  tokenUsage: {
    +    input: number
    +    output: number
    +    total: number
    +  }
    +  
    +  // 质量指标
    +  confidence: number
    +  quality: QualityMetrics
    +  
    +  // 成本信息
    +  cost: {
    +    amount: number
    +    currency: string
    +    breakdown: CostBreakdown
    +  }
    +  
    +  // 元数据
    +  metadata: {
    +    timestamp: Date
    +    requestId: string
    +    version: string
    +  }
    +  
    +  // 错误信息
    +  errors?: ProcessingError[]
    +  warnings?: ProcessingWarning[]
    +}
    +```
    +
    +## 🎯 使用示例
    +
    +### 基本使用
    +
    +```typescript
    +import { AIOrchestrator } from 'taskflow-ai'
    +
    +async function basicUsage() {
    +  const orchestrator = new AIOrchestrator()
    +  
    +  // 处理PRD文档
    +  const result = await orchestrator.processText(
    +    'PRD文档内容...',
    +    {
    +      task: 'prd-analysis',
    +      preferredModel: 'deepseek',
    +      maxTokens: 2000
    +    }
    +  )
    +  
    +  if (result.success) {
    +    console.log('解析结果:', result.content)
    +    console.log('使用模型:', result.modelUsed)
    +    console.log('处理时间:', result.processingTime, 'ms')
    +    console.log('费用:', result.cost.amount, result.cost.currency)
    +  } else {
    +    console.error('处理失败:', result.errors)
    +  }
    +}
    +```
    +
    +### 多模型协同
    +
    +```typescript
    +async function multiModelProcessing() {
    +  const orchestrator = new AIOrchestrator()
    +  
    +  // 多模型协同处理
    +  const result = await orchestrator.processText(
    +    '复杂的PRD文档内容...',
    +    {
    +      task: 'complex-analysis',
    +      multiModel: true,
    +      models: ['deepseek', 'zhipu', 'qwen'],
    +      compareResults: true,
    +      minConfidence: 0.8
    +    }
    +  )
    +  
    +  console.log('多模型处理结果:')
    +  console.log(`- 主要结果: ${result.content}`)
    +  console.log(`- 置信度: ${result.confidence}`)
    +  console.log(`- 尝试的模型: ${result.modelsAttempted.join(', ')}`)
    +  console.log(`- 最终选择: ${result.modelUsed}`)
    +  
    +  // 如果有对比结果
    +  if (result.metadata.comparisons) {
    +    console.log('模型对比结果:')
    +    result.metadata.comparisons.forEach(comp => {
    +      console.log(`- ${comp.modelId}: 置信度 ${comp.confidence}`)
    +    })
    +  }
    +}
    +```
    +
    +### 智能模型选择
    +
    +```typescript
    +async function intelligentModelSelection() {
    +  const orchestrator = new AIOrchestrator()
    +  
    +  // 配置智能选择策略
    +  await orchestrator.configureSelection({
    +    strategy: 'performance-cost-balanced',
    +    factors: {
    +      performance: 0.4,
    +      cost: 0.3,
    +      availability: 0.3
    +    },
    +    learningEnabled: true
    +  })
    +  
    +  // 处理不同类型的任务
    +  const tasks = [
    +    { content: '技术规格文档...', type: 'technical-analysis' },
    +    { content: '业务需求文档...', type: 'business-analysis' },
    +    { content: '代码审查内容...', type: 'code-review' }
    +  ]
    +  
    +  for (const task of tasks) {
    +    const optimalModel = await orchestrator.selectOptimalModel(
    +      task.type,
    +      { content: task.content }
    +    )
    +    
    +    console.log(`${task.type} 推荐模型: ${optimalModel}`)
    +    
    +    const result = await orchestrator.processText(task.content, {
    +      task: task.type,
    +      preferredModel: optimalModel
    +    })
    +    
    +    // 记录结果用于学习
    +    await orchestrator.recordResult(task.type, optimalModel, result)
    +  }
    +}
    +```
    +
    +### 性能监控和优化
    +
    +```typescript
    +async function performanceMonitoring() {
    +  const orchestrator = new AIOrchestrator()
    +  
    +  // 启用实时监控
    +  orchestrator.enableMonitoring({
    +    interval: 60000, // 1分钟
    +    metrics: ['response-time', 'success-rate', 'cost', 'load'],
    +    alerts: {
    +      responseTimeThreshold: 5000,
    +      errorRateThreshold: 0.05,
    +      costThreshold: 100
    +    }
    +  })
    +  
    +  // 监听性能事件
    +  orchestrator.on('performanceAlert', (alert) => {
    +    console.log(`性能告警: ${alert.type} - ${alert.message}`)
    +    
    +    if (alert.type === 'high-response-time') {
    +      // 自动切换到更快的模型
    +      orchestrator.temporaryModelSwitch(alert.modelId, 'faster-model')
    +    }
    +  })
    +  
    +  // 定期生成性能报告
    +  setInterval(async () => {
    +    const metrics = await orchestrator.getPerformanceMetrics()
    +    console.log('性能报告:', metrics)
    +    
    +    // 自动优化建议
    +    const suggestions = await orchestrator.getOptimizationSuggestions()
    +    if (suggestions.length > 0) {
    +      console.log('优化建议:', suggestions)
    +    }
    +  }, 3600000) // 每小时
    +}
    +```
    +
    +## 🔄 事件和钩子
    +
    +### 模型事件
    +
    +```typescript
    +orchestrator.on('modelRegistered', (model: AIModel) => {
    +  console.log(`模型注册: ${model.name}`)
    +})
    +
    +orchestrator.on('modelHealthChanged', (modelId: string, status: ModelStatus) => {
    +  console.log(`模型 ${modelId} 健康状态变更: ${status}`)
    +})
    +
    +orchestrator.on('loadBalanced', (selectedModel: string, availableModels: string[]) => {
    +  console.log(`负载均衡选择: ${selectedModel} (可选: ${availableModels.join(', ')})`)
    +})
    +```
    +
    +### 处理事件
    +
    +```typescript
    +orchestrator.on('processingStart', (requestId: string, options: ProcessingOptions) => {
    +  console.log(`开始处理请求: ${requestId}`)
    +})
    +
    +orchestrator.on('processingComplete', (result: ProcessingResult) => {
    +  console.log(`处理完成: ${result.modelUsed}, 耗时: ${result.processingTime}ms`)
    +})
    +
    +orchestrator.on('processingError', (error: ProcessingError) => {
    +  console.error(`处理错误: ${error.message}`)
    +})
    +```
    +
    +## 📚 相关文档
    +
    +- [PRD解析器 API](./prd-parser.md) - PRD文档解析
    +- [任务管理器 API](./task-manager.md) - 任务管理
    +- [配置管理 API](./config-manager.md) - 配置管理
    +- [类型定义](./types/model.md) - 模型相关类型
    
  • docs/api/config-manager.md+311 0 added
    @@ -0,0 +1,311 @@
    +# 配置管理 API
    +
    +## 概述
    +
    +配置管理器负责TaskFlow AI的系统配置管理,包括AI模型配置、用户设置、性能参数等。
    +
    +## 🏗️ 核心接口
    +
    +```typescript
    +interface ConfigManager {
    +  // 基本配置操作
    +  get(key: string): Promise<any>
    +  set(key: string, value: any): Promise<void>
    +  unset(key: string): Promise<void>
    +  has(key: string): Promise<boolean>
    +  
    +  // 批量操作
    +  getAll(): Promise<Record<string, any>>
    +  setMultiple(config: Record<string, any>): Promise<void>
    +  
    +  // 配置验证
    +  validate(config?: Record<string, any>): Promise<ValidationResult>
    +  
    +  // 环境管理
    +  setEnvironment(env: string): Promise<void>
    +  getEnvironment(): Promise<string>
    +  
    +  // 配置模板
    +  exportTemplate(excludeSecrets?: boolean): Promise<ConfigTemplate>
    +  importTemplate(template: ConfigTemplate, merge?: boolean): Promise<void>
    +}
    +```
    +
    +## ⚙️ 基本操作
    +
    +### get / set
    +
    +获取和设置配置值。
    +
    +```typescript
    +import { ConfigManager } from 'taskflow-ai'
    +
    +const config = new ConfigManager()
    +
    +// 设置AI模型配置
    +await config.set('models.deepseek.apiKey', 'your-api-key')
    +await config.set('models.deepseek.endpoint', 'https://api.deepseek.com')
    +
    +// 获取配置值
    +const apiKey = await config.get('models.deepseek.apiKey')
    +const allModels = await config.get('models')
    +
    +// 设置复杂配置
    +await config.set('multiModel', {
    +  enabled: true,
    +  primary: 'deepseek',
    +  fallback: ['zhipu', 'qwen'],
    +  loadBalancing: true
    +})
    +```
    +
    +### 批量操作
    +
    +```typescript
    +// 批量设置配置
    +await config.setMultiple({
    +  'logging.level': 'debug',
    +  'performance.cacheSize': 100,
    +  'team.defaultAssignee': '张三'
    +})
    +
    +// 获取所有配置
    +const allConfig = await config.getAll()
    +console.log('当前配置:', allConfig)
    +```
    +
    +## 🔧 配置结构
    +
    +### 标准配置键
    +
    +```typescript
    +// AI模型配置
    +'models.deepseek.apiKey'
    +'models.deepseek.endpoint'
    +'models.zhipu.apiKey'
    +'models.qwen.apiKey'
    +
    +// 多模型配置
    +'multiModel.enabled'
    +'multiModel.primary'
    +'multiModel.fallback'
    +'multiModel.loadBalancing'
    +
    +// 项目配置
    +'project.name'
    +'project.type'
    +'project.workDir'
    +
    +// 团队配置
    +'team.members'
    +'team.defaultAssignee'
    +
    +// 性能配置
    +'performance.cacheSize'
    +'performance.timeout'
    +'performance.concurrency'
    +
    +// 日志配置
    +'logging.level'
    +'logging.file'
    +'logging.maxSize'
    +```
    +
    +## 🎯 使用示例
    +
    +### 完整配置设置
    +
    +```typescript
    +async function setupConfiguration() {
    +  const config = new ConfigManager()
    +  
    +  // AI模型配置
    +  await config.setMultiple({
    +    'models.deepseek.apiKey': process.env.DEEPSEEK_API_KEY,
    +    'models.zhipu.apiKey': process.env.ZHIPU_API_KEY,
    +    'multiModel.enabled': true,
    +    'multiModel.primary': 'deepseek',
    +    'multiModel.fallback': ['zhipu', 'qwen']
    +  })
    +  
    +  // 项目配置
    +  await config.setMultiple({
    +    'project.name': 'My Project',
    +    'project.type': 'web-app',
    +    'team.members': ['张三', '李四', '王五']
    +  })
    +  
    +  // 性能优化
    +  await config.setMultiple({
    +    'performance.cacheSize': 200,
    +    'performance.timeout': 30000,
    +    'logging.level': 'info'
    +  })
    +  
    +  // 验证配置
    +  const validation = await config.validate()
    +  if (!validation.isValid) {
    +    console.error('配置验证失败:', validation.errors)
    +  }
    +}
    +```
    +
    +### 环境配置管理
    +
    +```typescript
    +// 开发环境配置
    +await config.setEnvironment('development')
    +await config.setMultiple({
    +  'logging.level': 'debug',
    +  'performance.cacheSize': 50
    +})
    +
    +// 生产环境配置
    +await config.setEnvironment('production')
    +await config.setMultiple({
    +  'logging.level': 'error',
    +  'performance.cacheSize': 500
    +})
    +```
    +
    +## 🌐 MCP 配置管理
    +
    +> **重要说明**: TaskFlow AI 遵循标准 MCP 协议,服务由编辑器自动启动和管理。ConfigManager 专注于配置文件的生成、验证和测试。
    +
    +### generateMCPConfig(editor: EditorType): Promise&lt;MCPConfig&gt;
    +为指定编辑器生成MCP配置。
    +
    +```typescript
    +const mcpConfig = await config.generateMCPConfig('cursor')
    +console.log('生成的MCP配置:', mcpConfig)
    +```
    +
    +### validateMCPConfig(config: MCPConfig): Promise&lt;ValidationResult&gt;
    +验证MCP配置的有效性。
    +
    +```typescript
    +const result = await config.validateMCPConfig(mcpConfig)
    +if (!result.valid) {
    +  console.error('MCP配置错误:', result.errors)
    +}
    +```
    +
    +### exportMCPConfig(editor: EditorType): Promise&lt;string&gt;
    +导出MCP配置为JSON字符串。
    +
    +```typescript
    +const configJson = await config.exportMCPConfig('windsurf')
    +```
    +
    +### importMCPConfig(editor: EditorType, config: string): Promise&lt;void&gt;
    +导入MCP配置。
    +
    +```typescript
    +await config.importMCPConfig('vscode', configJson)
    +```
    +
    +### testMCPConfiguration(editor: EditorType): Promise&lt;TestResult&gt;
    +测试MCP配置的有效性。
    +
    +```typescript
    +const result = await config.testMCPConfiguration('cursor')
    +if (result.valid) {
    +  console.log('配置有效')
    +} else {
    +  console.error('配置错误:', result.errors)
    +}
    +```
    +
    +### getMCPCapabilities(): Promise&lt;MCPCapabilities&gt;
    +获取MCP服务支持的能力。
    +
    +```typescript
    +const capabilities = await config.getMCPCapabilities()
    +console.log('支持的能力:', capabilities)
    +```
    +
    +## 🎯 MCP 使用示例
    +
    +### 完整MCP配置流程
    +
    +```typescript
    +async function setupMCPIntegration() {
    +  const config = new ConfigManager()
    +
    +  // 1. 生成所有编辑器的MCP配置
    +  const editors: EditorType[] = ['windsurf', 'trae', 'cursor', 'vscode']
    +
    +  for (const editor of editors) {
    +    const mcpConfig = await config.generateMCPConfig(editor)
    +
    +    // 验证配置
    +    const validation = await config.validateMCPConfig(mcpConfig)
    +    if (!validation.valid) {
    +      console.error(`${editor} MCP配置无效:`, validation.errors)
    +      continue
    +    }
    +
    +    console.log(`✅ ${editor} MCP配置生成成功`)
    +  }
    +
    +  // 2. 测试配置有效性
    +  for (const editor of editors) {
    +    const result = await config.testMCPConfiguration(editor)
    +    if (result.valid) {
    +      console.log(`✅ ${editor} 配置测试通过`)
    +    } else {
    +      console.warn(`⚠️ ${editor} 配置测试失败:`, result.errors)
    +    }
    +  }
    +
    +  // 3. 获取MCP能力
    +  const capabilities = await config.getMCPCapabilities()
    +  console.log('MCP支持的能力:', capabilities)
    +}
    +```
    +
    +### MCP配置类型定义
    +
    +```typescript
    +interface MCPConfig {
    +  editor: EditorType
    +  serverConfig: MCPServerConfig
    +  capabilities: MCPCapabilities
    +  environment: Record&lt;string, string&gt;
    +}
    +
    +interface MCPServerConfig {
    +  command: string
    +  args: string[]
    +  timeout?: number
    +  retries?: number
    +}
    +
    +interface MCPCapabilities {
    +  resources: boolean
    +  tools: boolean
    +  prompts: boolean
    +  streaming: boolean
    +}
    +
    +type EditorType = 'windsurf' | 'trae' | 'cursor' | 'vscode'
    +
    +interface TestResult {
    +  valid: boolean
    +  errors?: string[]
    +  warnings?: string[]
    +}
    +
    +interface ValidationResult {
    +  valid: boolean
    +  errors?: string[]
    +  warnings?: string[]
    +}
    +```
    +
    +## 📚 相关文档
    +
    +- [MCP 集成指南](../guide/mcp-integration.md) - MCP 集成详细说明
    +- [MCP 配置参考](../reference/mcp-configuration.md) - MCP 配置参考
    +- [项目配置管理 API](./project-config.md) - 项目集成配置
    +- [类型定义](./types/config.md) - 配置相关类型
    
  • docs/api/index.md+443 0 added
    @@ -0,0 +1,443 @@
    +# TaskFlow AI API 文档
    +
    +## 概述
    +
    +TaskFlow AI 提供了完整的 TypeScript API,专注于PRD文档解析和任务管理功能。本文档详细介绍了所有可用的 API 接口、类型定义和使用示例。
    +
    +## 核心模块
    +
    +### 1. PRD 解析器 (PRD Parser)
    +
    +#### `PRDParser` 类
    +
    +智能PRD文档解析器,支持多种格式的文档解析。
    +
    +```typescript
    +import { PRDParser, ParseOptions } from 'taskflow-ai';
    +
    +const parser = new PRDParser();
    +
    +// 解析Markdown文档
    +const result = await parser.parseFromFile('requirements.md', {
    +  modelType: 'deepseek',
    +  extractSections: true,
    +  extractFeatures: true
    +});
    +
    +// 解析文本内容
    +const textResult = await parser.parseFromText(content, {
    +  format: 'markdown',
    +  language: 'zh-CN'
    +});
    +```
    +
    +#### 接口定义
    +
    +```typescript
    +interface ParseOptions {
    +  modelType?: string;
    +  extractSections?: boolean;
    +  extractFeatures?: boolean;
    +  prioritize?: boolean;
    +  multiModel?: MultiModelOptions;
    +}
    +
    +interface ParseResult {
    +  success: boolean;
    +  data?: ParsedPRD;
    +  error?: string;
    +  metadata: {
    +    processingTime: number;
    +    modelUsed: string;
    +    confidence: number;
    +  };
    +}
    +
    +interface ParsedPRD {
    +  title: string;
    +  description: string;
    +  requirements: Requirement[];
    +  features: Feature[];
    +  tasks: Task[];
    +  dependencies: Dependency[];
    +}
    +```
    +
    +#### 方法
    +
    +| 方法 | 描述 | 参数 | 返回值 |
    +|------|------|------|--------|
    +| `parseFromFile(filePath, options?)` | 从文件解析PRD | `string, ParseOptions?` | `Promise<ParseResult>` |
    +| `parseFromText(content, options?)` | 从文本解析PRD | `string, ParseOptions?` | `Promise<ParseResult>` |
    +| `parseFromUrl(url, options?)` | 从URL解析PRD | `string, ParseOptions?` | `Promise<ParseResult>` |
    +| `validatePRD(prd)` | 验证PRD结构 | `ParsedPRD` | `ValidationResult` |
    +
    +### 2. 任务管理器 (Task Manager)
    +
    +#### `TaskManager` 类
    +
    +完整的任务生命周期管理系统。
    +
    +```typescript
    +import { TaskManager, Task, TaskStatus } from 'taskflow-ai';
    +
    +const taskManager = new TaskManager();
    +
    +// 创建任务
    +const task = await taskManager.createTask({
    +  name: '实现用户登录功能',
    +  description: '开发用户登录页面和认证逻辑',
    +  priority: 'high',
    +  estimatedHours: 8,
    +  dependencies: ['task-001']
    +});
    +
    +// 更新任务状态
    +await taskManager.updateTaskStatus(task.id, TaskStatus.IN_PROGRESS);
    +
    +// 获取任务列表
    +const tasks = await taskManager.getTasks({
    +  status: TaskStatus.NOT_STARTED,
    +  priority: 'high'
    +});
    +```
    +
    +#### 接口定义
    +
    +```typescript
    +interface Task {
    +  id: string;
    +  name: string;
    +  description: string;
    +  status: TaskStatus;
    +  priority: TaskPriority;
    +  type?: TaskType;
    +  dependencies: string[];
    +  estimatedHours?: number;
    +  actualHours?: number;
    +  assignee?: string;
    +  tags: string[];
    +  createdAt: Date;
    +  updatedAt: Date;
    +  startedAt?: Date;
    +  completedAt?: Date;
    +  dueDate?: Date;
    +  acceptance?: string[];
    +  notes?: string;
    +  progress?: number;
    +  subtasks?: Task[];
    +}
    +
    +enum TaskStatus {
    +  NOT_STARTED = 'not_started',
    +  IN_PROGRESS = 'in_progress',
    +  COMPLETED = 'completed',
    +  BLOCKED = 'blocked',
    +  CANCELLED = 'cancelled'
    +}
    +
    +enum TaskPriority {
    +  LOW = 'low',
    +  MEDIUM = 'medium',
    +  HIGH = 'high',
    +  CRITICAL = 'critical'
    +}
    +```
    +
    +#### 方法
    +
    +| 方法 | 描述 | 参数 | 返回值 |
    +|------|------|------|--------|
    +| `createTask(taskData)` | 创建新任务 | `Partial<Task>` | `Promise<Task>` |
    +| `updateTask(id, updates)` | 更新任务 | `string, Partial<Task>` | `Promise<Task>` |
    +| `deleteTask(id)` | 删除任务 | `string` | `Promise<boolean>` |
    +| `getTask(id)` | 获取单个任务 | `string` | `Promise<Task \| null>` |
    +| `getTasks(filter?)` | 获取任务列表 | `TaskFilter?` | `Promise<Task[]>` |
    +| `updateTaskStatus(id, status)` | 更新任务状态 | `string, TaskStatus` | `Promise<Task>` |
    +| `getTaskDependencies(id)` | 获取任务依赖 | `string` | `Promise<Task[]>` |
    +| `getTaskProgress(id)` | 获取任务进度 | `string` | `Promise<number>` |
    +
    +### 3. AI 编排器 (AI Orchestrator)
    +
    +#### `AIOrchestrator` 类
    +
    +多模型AI智能编排系统。
    +
    +```typescript
    +import { AIOrchestrator, ModelType } from 'taskflow-ai';
    +
    +const orchestrator = new AIOrchestrator({
    +  models: {
    +    primary: ModelType.DEEPSEEK,
    +    fallback: [ModelType.ZHIPU, ModelType.QWEN],
    +    loadBalancing: true
    +  }
    +});
    +
    +// 智能文本处理
    +const result = await orchestrator.processText(
    +  '请分析这个需求的技术难点',
    +  {
    +    task: 'analysis',
    +    context: 'technical',
    +    preferredModel: ModelType.DEEPSEEK
    +  }
    +);
    +
    +// 多模型协同
    +const comparison = await orchestrator.compareModels(
    +  '设计用户界面的最佳实践',
    +  [ModelType.DEEPSEEK, ModelType.ZHIPU]
    +);
    +```
    +
    +#### 接口定义
    +
    +```typescript
    +interface AIOrchestrationOptions {
    +  models: {
    +    primary: ModelType;
    +    fallback: ModelType[];
    +    loadBalancing?: boolean;
    +    costOptimization?: boolean;
    +  };
    +  timeout?: number;
    +  retryAttempts?: number;
    +}
    +
    +interface ProcessingOptions {
    +  task: 'analysis' | 'generation' | 'translation' | 'summarization';
    +  context?: string;
    +  preferredModel?: ModelType;
    +  temperature?: number;
    +  maxTokens?: number;
    +}
    +
    +interface ProcessingResult {
    +  content: string;
    +  model: ModelType;
    +  confidence: number;
    +  processingTime: number;
    +  tokenUsage: {
    +    input: number;
    +    output: number;
    +    total: number;
    +  };
    +}
    +```
    +
    +### 4. 项目配置管理器 (Project Config Manager)
    +
    +#### `ProjectConfigManager` 类
    +
    +项目配置和集成管理系统。
    +
    +```typescript
    +import { ProjectConfigManager } from 'taskflow-ai';
    +
    +const configManager = new ProjectConfigManager();
    +
    +// 初始化项目配置
    +const config = await configManager.initializeProject({
    +  name: 'my-existing-project',
    +  type: 'web-app',
    +  workDir: './src',
    +  team: ['张三', '李四']
    +});
    +
    +// 获取项目信息
    +const projectInfo = await configManager.getProjectInfo();
    +
    +// 更新项目配置
    +await configManager.updateConfig({
    +  team: ['张三', '李四', '王五'],
    +  workDir: './app'
    +});
    +```
    +
    +#### 接口定义
    +
    +```typescript
    +interface ProjectConfig {
    +  name: string;
    +  type: string;
    +  workDir: string;
    +  team: string[];
    +  createdAt: Date;
    +  updatedAt: Date;
    +}
    +
    +interface ProjectInfo {
    +  config: ProjectConfig;
    +  taskCount: number;
    +  completedTasks: number;
    +  progress: number;
    +}
    +```
    +
    +### 5. 配置管理器 (Configuration Manager)
    +
    +#### `ConfigManager` 类
    +
    +统一的配置管理系统。
    +
    +```typescript
    +import { ConfigManager } from 'taskflow-ai';
    +
    +const config = ConfigManager.getInstance();
    +
    +// 设置配置
    +config.set('models.deepseek.apiKey', 'your-api-key');
    +config.set('logging.level', 'debug');
    +
    +// 获取配置
    +const apiKey = config.get('models.deepseek.apiKey');
    +const logLevel = config.get('logging.level', 'info'); // 默认值
    +
    +// 验证配置
    +const validation = config.validate();
    +if (!validation.isValid) {
    +  console.error('配置错误:', validation.errors);
    +}
    +
    +// 保存配置到文件
    +config.saveToFile('./taskflow.config.json');
    +
    +// 从文件加载配置
    +config.loadFromFile('./taskflow.config.json');
    +```
    +
    +#### 配置模式
    +
    +```typescript
    +interface TaskFlowConfig {
    +  version: string;
    +  models: {
    +    deepseek?: {
    +      apiKey: string;
    +      baseUrl?: string;
    +    };
    +    zhipu?: {
    +      apiKey: string;
    +    };
    +    qwen?: {
    +      apiKey: string;
    +    };
    +  };
    +  logging: {
    +    level: 'debug' | 'info' | 'warn' | 'error';
    +    output: 'console' | 'file' | 'both';
    +    file?: string;
    +  };
    +  performance: {
    +    enableMonitoring: boolean;
    +    cacheSize: number;
    +  };
    +}
    +```
    +
    +## 错误处理
    +
    +### 统一错误类型
    +
    +```typescript
    +import { TaskFlowError, ErrorType } from 'taskflow-ai';
    +
    +try {
    +  const result = await parser.parseFromFile('invalid-file.md');
    +} catch (error) {
    +  if (error instanceof TaskFlowError) {
    +    console.error(`错误类型: ${error.code}`);
    +    console.error(`错误消息: ${error.message}`);
    +    console.error(`错误上下文:`, error.context);
    +    
    +    // 获取恢复建议
    +    const suggestions = error.getRecoveryActions();
    +    console.log('建议:', suggestions);
    +  }
    +}
    +```
    +
    +### 错误类型枚举
    +
    +```typescript
    +enum ErrorType {
    +  VALIDATION_ERROR = 'VALIDATION_ERROR',
    +  CONFIGURATION_ERROR = 'CONFIGURATION_ERROR',
    +  NETWORK_ERROR = 'NETWORK_ERROR',
    +  API_ERROR = 'API_ERROR',
    +  FILESYSTEM_ERROR = 'FILESYSTEM_ERROR',
    +  PARSE_ERROR = 'PARSE_ERROR',
    +  UNKNOWN_ERROR = 'UNKNOWN_ERROR'
    +}
    +```
    +
    +## 事件系统
    +
    +### 事件监听
    +
    +```typescript
    +import { EventEmitter } from 'taskflow-ai';
    +
    +const events = EventEmitter.getInstance();
    +
    +// 监听任务状态变化
    +events.on('task:status:changed', (data) => {
    +  console.log(`任务 ${data.taskId} 状态变更为 ${data.newStatus}`);
    +});
    +
    +// 监听解析完成事件
    +events.on('parse:completed', (data) => {
    +  console.log(`PRD解析完成,生成了 ${data.taskCount} 个任务`);
    +});
    +
    +// 监听错误事件
    +events.on('error', (error) => {
    +  console.error('系统错误:', error);
    +});
    +```
    +
    +## 性能监控
    +
    +### 性能指标
    +
    +```typescript
    +import { PerformanceMonitor } from 'taskflow-ai';
    +
    +const monitor = PerformanceMonitor.getInstance();
    +
    +// 获取性能统计
    +const stats = monitor.getStats('parse-operation');
    +console.log('平均执行时间:', stats.avgExecutionTime);
    +console.log('成功率:', stats.successRate);
    +
    +// 生成性能报告
    +const report = monitor.generateReport();
    +console.log(report);
    +```
    +
    +## 类型定义
    +
    +完整的TypeScript类型定义可以在以下文件中找到:
    +
    +- `src/types/task.ts` - 任务相关类型
    +- `src/types/config.ts` - 配置相关类型
    +- `src/types/model.ts` - AI模型相关类型
    +- `src/types/strict-types.ts` - 严格类型定义
    +- `src/types/enhanced-types.ts` - 增强类型定义
    +
    +## 示例项目
    +
    +查看 `examples/` 目录获取完整的使用示例:
    +
    +- `examples/basic-usage/` - 基本使用示例
    +- `examples/advanced-features/` - 高级功能示例
    +- `examples/custom-templates/` - 自定义模板示例
    +- `examples/ai-integration/` - AI集成示例
    +
    +## 更多资源
    +
    +- [CLI 命令参考](../cli/commands.md)
    +- [配置参考](../reference/configuration.md)
    +- [故障排除](../troubleshooting/common-issues.md)
    +- [贡献指南](../../CONTRIBUTING.md)
    
  • docs/api/prd-parser.md+607 0 added
    @@ -0,0 +1,607 @@
    +# PRD解析器 API
    +
    +## 概述
    +
    +PRD解析器是TaskFlow AI的核心组件,负责智能解析产品需求文档(PRD),提取结构化信息,并生成开发任务。本文档详细介绍PRD解析器的API接口和使用方法。
    +
    +## 🏗️ 架构设计
    +
    +```typescript
    +interface PRDParser {
    +  parseFromFile(filePath: string, options?: ParseOptions): Promise<ParseResult>
    +  parseFromText(content: string, options?: ParseOptions): Promise<ParseResult>
    +  validatePRD(prd: ParsedPRD): ValidationResult
    +  extractSections(content: string): Promise<DocumentSection[]>
    +  generateTasks(prd: ParsedPRD, options?: TaskGenerationOptions): Promise<Task[]>
    +}
    +```
    +
    +## 📄 核心接口
    +
    +### parseFromFile
    +
    +从文件解析PRD文档。
    +
    +```typescript
    +async parseFromFile(
    +  filePath: string, 
    +  options?: ParseOptions
    +): Promise<ParseResult>
    +```
    +
    +**参数**:
    +- `filePath` (string): PRD文档文件路径
    +- `options` (ParseOptions, 可选): 解析选项
    +
    +**返回值**: `Promise<ParseResult>` - 解析结果
    +
    +**示例**:
    +```typescript
    +import { PRDParser } from 'taskflow-ai'
    +
    +const parser = new PRDParser()
    +
    +// 基本解析
    +const result = await parser.parseFromFile('docs/requirements.md')
    +
    +// 带选项的解析
    +const result = await parser.parseFromFile('docs/requirements.md', {
    +  model: 'deepseek',
    +  extractSections: true,
    +  generateTasks: true,
    +  prioritize: true
    +})
    +```
    +
    +### parseFromText
    +
    +从文本内容解析PRD。
    +
    +```typescript
    +async parseFromText(
    +  content: string, 
    +  options?: ParseOptions
    +): Promise<ParseResult>
    +```
    +
    +**参数**:
    +- `content` (string): PRD文档文本内容
    +- `options` (ParseOptions, 可选): 解析选项
    +
    +**示例**:
    +```typescript
    +const content = `
    +# 用户管理系统
    +
    +## 功能需求
    +### 用户登录
    +- 用户可以通过邮箱和密码登录
    +- 支持记住登录状态
    +`
    +
    +const result = await parser.parseFromText(content, {
    +  model: 'zhipu',
    +  extractFeatures: true
    +})
    +```
    +
    +### validatePRD
    +
    +验证PRD文档的完整性和质量。
    +
    +```typescript
    +validatePRD(prd: ParsedPRD): ValidationResult
    +```
    +
    +**参数**:
    +- `prd` (ParsedPRD): 已解析的PRD对象
    +
    +**返回值**: `ValidationResult` - 验证结果
    +
    +**示例**:
    +```typescript
    +const validation = parser.validatePRD(parsedPRD)
    +
    +if (!validation.isValid) {
    +  console.log('验证失败:', validation.errors)
    +  console.log('建议:', validation.suggestions)
    +}
    +```
    +
    +### extractSections
    +
    +提取文档章节结构。
    +
    +```typescript
    +async extractSections(content: string): Promise<DocumentSection[]>
    +```
    +
    +**示例**:
    +```typescript
    +const sections = await parser.extractSections(content)
    +sections.forEach(section => {
    +  console.log(`${section.level}: ${section.title}`)
    +  console.log(`内容: ${section.content.substring(0, 100)}...`)
    +})
    +```
    +
    +### generateTasks
    +
    +基于解析的PRD生成开发任务。
    +
    +```typescript
    +async generateTasks(
    +  prd: ParsedPRD, 
    +  options?: TaskGenerationOptions
    +): Promise<Task[]>
    +```
    +
    +**示例**:
    +```typescript
    +const tasks = await parser.generateTasks(parsedPRD, {
    +  includeEstimation: true,
    +  analyzeDependencies: true,
    +  prioritize: true
    +})
    +```
    +
    +## 🔧 类型定义
    +
    +### ParseOptions
    +
    +解析选项配置。
    +
    +```typescript
    +interface ParseOptions {
    +  // AI模型选择
    +  model?: 'deepseek' | 'zhipu' | 'qwen' | 'baidu' | 'auto'
    +  
    +  // 多模型协同
    +  multiModel?: boolean
    +  
    +  // 解析功能开关
    +  extractSections?: boolean
    +  extractFeatures?: boolean
    +  generateTasks?: boolean
    +  analyzeDependencies?: boolean
    +  prioritize?: boolean
    +  
    +  // 输出控制
    +  includeMetadata?: boolean
    +  includeStatistics?: boolean
    +  
    +  // 缓存控制
    +  useCache?: boolean
    +  cacheKey?: string
    +  
    +  // 自定义规则
    +  customRules?: ParseRule[]
    +  
    +  // 回调函数
    +  onProgress?: (progress: ParseProgress) => void
    +  onSection?: (section: DocumentSection) => void
    +}
    +```
    +
    +### ParseResult
    +
    +解析结果对象。
    +
    +```typescript
    +interface ParseResult {
    +  // 基本信息
    +  success: boolean
    +  timestamp: Date
    +  duration: number
    +  
    +  // 解析内容
    +  prd: ParsedPRD
    +  tasks: Task[]
    +  sections: DocumentSection[]
    +  
    +  // 元数据
    +  metadata: ParseMetadata
    +  statistics: ParseStatistics
    +  
    +  // 错误信息
    +  errors?: ParseError[]
    +  warnings?: ParseWarning[]
    +}
    +```
    +
    +### ParsedPRD
    +
    +解析后的PRD对象。
    +
    +```typescript
    +interface ParsedPRD {
    +  // 基本信息
    +  title: string
    +  description: string
    +  version?: string
    +  
    +  // 项目信息
    +  project: {
    +    name: string
    +    type: ProjectType
    +    scope: string
    +    objectives: string[]
    +  }
    +  
    +  // 功能需求
    +  requirements: Requirement[]
    +  
    +  // 非功能性需求
    +  nonFunctionalRequirements: NonFunctionalRequirement[]
    +  
    +  // 技术约束
    +  technicalConstraints: TechnicalConstraint[]
    +  
    +  // 验收标准
    +  acceptanceCriteria: AcceptanceCriterion[]
    +  
    +  // 优先级信息
    +  priorities: Priority[]
    +  
    +  // 依赖关系
    +  dependencies: Dependency[]
    +}
    +```
    +
    +### Requirement
    +
    +功能需求定义。
    +
    +```typescript
    +interface Requirement {
    +  id: string
    +  name: string
    +  description: string
    +  type: 'functional' | 'non-functional'
    +  priority: 'high' | 'medium' | 'low'
    +  
    +  // 用户故事
    +  userStory?: {
    +    as: string      // 作为...
    +    want: string    // 我希望...
    +    so: string      // 以便...
    +  }
    +  
    +  // 验收标准
    +  acceptanceCriteria: string[]
    +  
    +  // 依赖关系
    +  dependencies: string[]
    +  
    +  // 估算信息
    +  estimation?: {
    +    complexity: 'simple' | 'medium' | 'complex'
    +    hours: number
    +    confidence: number
    +  }
    +  
    +  // 标签和分类
    +  tags: string[]
    +  category: string
    +}
    +```
    +
    +### Task
    +
    +生成的开发任务。
    +
    +```typescript
    +interface Task {
    +  id: string
    +  name: string
    +  description: string
    +  
    +  // 状态信息
    +  status: TaskStatus
    +  priority: TaskPriority
    +  
    +  // 分配信息
    +  assignee?: string
    +  team?: string
    +  
    +  // 时间信息
    +  estimatedHours: number
    +  actualHours?: number
    +  startDate?: Date
    +  endDate?: Date
    +  
    +  // 依赖关系
    +  dependencies: string[]
    +  blockers: string[]
    +  
    +  // 关联需求
    +  requirementIds: string[]
    +  
    +  // 验收标准
    +  acceptanceCriteria: string[]
    +  
    +  // 元数据
    +  metadata: {
    +    source: 'prd-parser'
    +    confidence: number
    +    generatedAt: Date
    +    model: string
    +  }
    +}
    +```
    +
    +## 🎯 使用示例
    +
    +### 基本使用
    +
    +```typescript
    +import { PRDParser, ParseOptions } from 'taskflow-ai'
    +
    +async function basicUsage() {
    +  const parser = new PRDParser()
    +  
    +  // 解析PRD文件
    +  const result = await parser.parseFromFile('docs/requirements.md')
    +  
    +  if (result.success) {
    +    console.log(`解析成功,生成 ${result.tasks.length} 个任务`)
    +    
    +    // 显示任务列表
    +    result.tasks.forEach(task => {
    +      console.log(`- ${task.name} (${task.priority}, ${task.estimatedHours}h)`)
    +    })
    +  } else {
    +    console.error('解析失败:', result.errors)
    +  }
    +}
    +```
    +
    +### 高级配置
    +
    +```typescript
    +async function advancedUsage() {
    +  const parser = new PRDParser()
    +  
    +  const options: ParseOptions = {
    +    model: 'deepseek',
    +    multiModel: true,
    +    extractSections: true,
    +    extractFeatures: true,
    +    generateTasks: true,
    +    analyzeDependencies: true,
    +    prioritize: true,
    +    
    +    // 进度回调
    +    onProgress: (progress) => {
    +      console.log(`解析进度: ${progress.percentage}%`)
    +    },
    +    
    +    // 章节回调
    +    onSection: (section) => {
    +      console.log(`处理章节: ${section.title}`)
    +    }
    +  }
    +  
    +  const result = await parser.parseFromFile('docs/complex-requirements.md', options)
    +  
    +  // 验证PRD质量
    +  const validation = parser.validatePRD(result.prd)
    +  if (!validation.isValid) {
    +    console.warn('PRD质量问题:', validation.suggestions)
    +  }
    +  
    +  return result
    +}
    +```
    +
    +### 批量处理
    +
    +```typescript
    +async function batchProcessing() {
    +  const parser = new PRDParser()
    +  const files = ['feature-a.md', 'feature-b.md', 'feature-c.md']
    +  
    +  const results = await Promise.all(
    +    files.map(file => parser.parseFromFile(`docs/${file}`))
    +  )
    +  
    +  // 合并所有任务
    +  const allTasks = results.flatMap(result => result.tasks)
    +  
    +  // 分析任务依赖关系
    +  const dependencies = analyzeCrossDependencies(allTasks)
    +  
    +  return {
    +    tasks: allTasks,
    +    dependencies,
    +    statistics: generateStatistics(results)
    +  }
    +}
    +```
    +
    +### 自定义解析规则
    +
    +```typescript
    +async function customRules() {
    +  const parser = new PRDParser()
    +  
    +  const customRules: ParseRule[] = [
    +    {
    +      name: 'extract-api-endpoints',
    +      pattern: /API\s+(\w+)\s*:\s*(.+)/g,
    +      handler: (match) => ({
    +        type: 'api-endpoint',
    +        method: match[1],
    +        description: match[2]
    +      })
    +    },
    +    {
    +      name: 'extract-user-roles',
    +      pattern: /作为\s*(\w+)/g,
    +      handler: (match) => ({
    +        type: 'user-role',
    +        role: match[1]
    +      })
    +    }
    +  ]
    +  
    +  const result = await parser.parseFromFile('docs/api-requirements.md', {
    +    customRules,
    +    extractFeatures: true
    +  })
    +  
    +  return result
    +}
    +```
    +
    +## 🔄 事件和钩子
    +
    +### 解析事件
    +
    +```typescript
    +parser.on('parseStart', (filePath: string) => {
    +  console.log(`开始解析: ${filePath}`)
    +})
    +
    +parser.on('parseProgress', (progress: ParseProgress) => {
    +  console.log(`解析进度: ${progress.percentage}%`)
    +})
    +
    +parser.on('parseComplete', (result: ParseResult) => {
    +  console.log(`解析完成: ${result.tasks.length} 个任务`)
    +})
    +
    +parser.on('parseError', (error: ParseError) => {
    +  console.error(`解析错误: ${error.message}`)
    +})
    +```
    +
    +### 自定义钩子
    +
    +```typescript
    +// 任务生成前钩子
    +parser.addHook('beforeTaskGeneration', async (prd: ParsedPRD) => {
    +  // 自定义处理逻辑
    +  return enhancePRD(prd)
    +})
    +
    +// 任务生成后钩子
    +parser.addHook('afterTaskGeneration', async (tasks: Task[]) => {
    +  // 自定义任务处理
    +  return optimizeTasks(tasks)
    +})
    +```
    +
    +## 🔧 配置和优化
    +
    +### 性能优化
    +
    +```typescript
    +// 启用缓存
    +const parser = new PRDParser({
    +  cache: {
    +    enabled: true,
    +    ttl: 3600000, // 1小时
    +    maxSize: 100
    +  }
    +})
    +
    +// 并发控制
    +const parser = new PRDParser({
    +  concurrency: {
    +    maxConcurrent: 3,
    +    timeout: 30000
    +  }
    +})
    +```
    +
    +### 模型配置
    +
    +```typescript
    +const parser = new PRDParser({
    +  models: {
    +    primary: 'deepseek',
    +    fallback: ['zhipu', 'qwen'],
    +    loadBalancing: true,
    +    retryAttempts: 3
    +  }
    +})
    +```
    +
    +## 🐛 错误处理
    +
    +### 错误类型
    +
    +```typescript
    +enum ParseErrorType {
    +  FILE_NOT_FOUND = 'FILE_NOT_FOUND',
    +  INVALID_FORMAT = 'INVALID_FORMAT',
    +  MODEL_ERROR = 'MODEL_ERROR',
    +  NETWORK_ERROR = 'NETWORK_ERROR',
    +  TIMEOUT = 'TIMEOUT',
    +  VALIDATION_ERROR = 'VALIDATION_ERROR'
    +}
    +
    +interface ParseError {
    +  type: ParseErrorType
    +  message: string
    +  details?: any
    +  stack?: string
    +}
    +```
    +
    +### 错误处理示例
    +
    +```typescript
    +try {
    +  const result = await parser.parseFromFile('docs/requirements.md')
    +} catch (error) {
    +  if (error instanceof ParseError) {
    +    switch (error.type) {
    +      case ParseErrorType.FILE_NOT_FOUND:
    +        console.error('文件不存在:', error.message)
    +        break
    +      case ParseErrorType.MODEL_ERROR:
    +        console.error('AI模型错误:', error.message)
    +        break
    +      default:
    +        console.error('解析错误:', error.message)
    +    }
    +  }
    +}
    +```
    +
    +## 📊 统计和分析
    +
    +### 解析统计
    +
    +```typescript
    +interface ParseStatistics {
    +  // 文档统计
    +  documentSize: number
    +  sectionCount: number
    +  requirementCount: number
    +  
    +  // 任务统计
    +  taskCount: number
    +  estimatedHours: number
    +  complexityDistribution: Record<string, number>
    +  
    +  // 质量指标
    +  completenessScore: number
    +  clarityScore: number
    +  consistencyScore: number
    +  
    +  // 性能指标
    +  parseTime: number
    +  modelResponseTime: number
    +  cacheHitRate: number
    +}
    +```
    +
    +## 📚 相关文档
    +
    +- [任务管理器 API](./task-manager.md) - 任务管理接口
    +- [AI编排器 API](./ai-orchestrator.md) - AI模型管理
    +- [配置管理 API](./config-manager.md) - 配置管理接口
    +- [类型定义](./types/core.md) - 核心类型定义
    
  • docs/api/project-config.md+204 0 added
    @@ -0,0 +1,204 @@
    +# 项目配置管理 API
    +
    +## 概述
    +
    +项目配置管理器负责TaskFlow AI在现有项目中的集成配置,包括项目初始化、配置管理、环境设置等功能。
    +
    +## 🏗️ 核心接口
    +
    +```typescript
    +interface ProjectConfigManager {
    +  // 项目初始化
    +  initializeProject(options: ProjectInitOptions): Promise<ProjectConfig>
    +  validateProject(path: string): Promise<ValidationResult>
    +  
    +  // 配置管理
    +  getConfig(): Promise<ProjectConfig>
    +  updateConfig(updates: Partial<ProjectConfig>): Promise<ProjectConfig>
    +  resetConfig(): Promise<void>
    +  
    +  // 环境管理
    +  setEnvironment(env: Environment): Promise<void>
    +  getEnvironment(): Promise<Environment>
    +  
    +  // 项目信息
    +  getProjectInfo(): Promise<ProjectInfo>
    +  detectProjectType(): Promise<ProjectType>
    +}
    +```
    +
    +## 📋 项目初始化
    +
    +### initializeProject
    +
    +在现有项目中初始化TaskFlow AI。
    +
    +```typescript
    +async initializeProject(options: ProjectInitOptions): Promise<ProjectConfig>
    +```
    +
    +**示例**:
    +```typescript
    +import { ProjectConfigManager } from 'taskflow-ai'
    +
    +const configManager = new ProjectConfigManager()
    +
    +// 基本初始化
    +const config = await configManager.initializeProject({
    +  projectPath: process.cwd(),
    +  configDir: '.taskflow',
    +  force: false
    +})
    +
    +// 高级初始化
    +const advancedConfig = await configManager.initializeProject({
    +  projectPath: '/path/to/project',
    +  configDir: '.taskflow',
    +  force: true,
    +  projectInfo: {
    +    name: '我的项目',
    +    type: 'web-app',
    +    description: '一个React Web应用'
    +  },
    +  teamInfo: {
    +    members: ['张三', '李四'],
    +    roles: ['developer', 'designer']
    +  }
    +})
    +```
    +
    +### validateProject
    +
    +验证项目是否适合集成TaskFlow AI。
    +
    +```typescript
    +async validateProject(path: string): Promise<ValidationResult>
    +```
    +
    +**示例**:
    +```typescript
    +const validation = await configManager.validateProject('/path/to/project')
    +
    +if (validation.isValid) {
    +  console.log('项目验证通过')
    +  console.log('检测到的项目类型:', validation.detectedType)
    +} else {
    +  console.log('验证失败:', validation.errors)
    +  console.log('建议:', validation.suggestions)
    +}
    +```
    +
    +## ⚙️ 配置管理
    +
    +### getConfig / updateConfig
    +
    +获取和更新项目配置。
    +
    +```typescript
    +// 获取当前配置
    +const config = await configManager.getConfig()
    +
    +// 更新配置
    +const updatedConfig = await configManager.updateConfig({
    +  project: {
    +    name: '新项目名称',
    +    type: 'api'
    +  },
    +  ai: {
    +    primaryModel: 'deepseek',
    +    fallbackModels: ['zhipu', 'qwen']
    +  }
    +})
    +```
    +
    +## 🔧 类型定义
    +
    +### ProjectConfig
    +
    +```typescript
    +interface ProjectConfig {
    +  // 项目基本信息
    +  project: {
    +    name: string
    +    type: ProjectType
    +    description?: string
    +    version?: string
    +    workDir: string
    +  }
    +  
    +  // AI配置
    +  ai: {
    +    primaryModel: string
    +    fallbackModels: string[]
    +    multiModelEnabled: boolean
    +  }
    +  
    +  // 团队配置
    +  team: {
    +    members: TeamMember[]
    +    roles: string[]
    +    defaultAssignee?: string
    +  }
    +  
    +  // 工作流配置
    +  workflow: {
    +    defaultPriority: TaskPriority
    +    autoAssignment: boolean
    +    notificationsEnabled: boolean
    +  }
    +}
    +```
    +
    +### ProjectType
    +
    +```typescript
    +enum ProjectType {
    +  WEB_APP = 'web-app',
    +  MOBILE_APP = 'mobile-app',
    +  API = 'api',
    +  DESKTOP_APP = 'desktop-app',
    +  LIBRARY = 'library',
    +  OTHER = 'other'
    +}
    +```
    +
    +## 🎯 使用示例
    +
    +### 完整项目集成
    +
    +```typescript
    +async function integrateProject() {
    +  const configManager = new ProjectConfigManager()
    +  
    +  // 1. 验证项目
    +  const validation = await configManager.validateProject(process.cwd())
    +  if (!validation.isValid) {
    +    throw new Error('项目验证失败')
    +  }
    +  
    +  // 2. 初始化配置
    +  const config = await configManager.initializeProject({
    +    projectPath: process.cwd(),
    +    projectInfo: {
    +      name: 'My Web App',
    +      type: 'web-app'
    +    }
    +  })
    +  
    +  // 3. 配置AI模型
    +  await configManager.updateConfig({
    +    ai: {
    +      primaryModel: 'deepseek',
    +      fallbackModels: ['zhipu'],
    +      multiModelEnabled: true
    +    }
    +  })
    +  
    +  console.log('项目集成完成')
    +}
    +```
    +
    +## 📚 相关文档
    +
    +- [配置管理 API](./config-manager.md) - 系统配置管理
    +- [类型定义](./types/config.md) - 配置相关类型
    
  • docs/api-reference.md+644 0 added
    @@ -0,0 +1,644 @@
    +# TaskFlow AI API 文档
    +
    +## 概述
    +
    +TaskFlow AI 提供了丰富的API接口,包括CLI命令行接口和MCP服务器接口。本文档详细描述了所有可用的API和配置选项。
    +
    +## CLI API
    +
    +### 全局选项
    +
    +所有CLI命令都支持以下全局选项:
    +
    +| 选项              | 简写 | 描述             | 默认值                  |
    +| ----------------- | ---- | ---------------- | ----------------------- |
    +| `--help`          | `-h` | 显示帮助信息     | -                       |
    +| `--version`       | `-V` | 显示版本信息     | -                       |
    +| `--verbose`       | `-v` | 详细输出模式     | false                   |
    +| `--config <path>` | `-c` | 指定配置文件路径 | `.taskflow/config.json` |
    +
    +### 命令详细说明
    +
    +#### `taskflow init`
    +
    +初始化TaskFlow项目配置。
    +
    +**语法:**
    +
    +```bash
    +taskflow init [options]
    +```
    +
    +**选项:**
    +
    +| 选项                    | 简写 | 类型    | 描述             | 默认值     |
    +| ----------------------- | ---- | ------- | ---------------- | ---------- |
    +| `--force`               | `-f` | boolean | 强制覆盖现有配置 | false      |
    +| `--skip-ai`             |      | boolean | 跳过AI模型配置   | false      |
    +| `--template <name>`     | `-t` | string  | 使用预定义模板   | 'default'  |
    +| `--project-name <name>` | `-n` | string  | 设置项目名称     | 当前目录名 |
    +
    +**模板选项:**
    +
    +- `default` - 默认配置
    +- `agile` - 敏捷开发配置
    +- `waterfall` - 瀑布模型配置
    +- `lean` - 精益开发配置
    +
    +**示例:**
    +
    +```bash
    +# 基本初始化
    +taskflow init
    +
    +# 强制覆盖现有配置
    +taskflow init --force
    +
    +# 使用敏捷模板
    +taskflow init --template agile --project-name "My Project"
    +
    +# 跳过AI配置
    +taskflow init --skip-ai
    +```
    +
    +**交互式提示:**
    +
    +1. 项目名称输入
    +2. AI模型选择(除非使用--skip-ai)
    +3. MCP配置选择
    +4. 其他项目设置
    +
    +#### `taskflow parse <file>`
    +
    +解析PRD文档并生成任务。
    +
    +**语法:**
    +
    +```bash
    +taskflow parse <file> [options]
    +```
    +
    +**参数:**
    +
    +| 参数     | 类型   | 必需 | 描述        |
    +| -------- | ------ | ---- | ----------- |
    +| `<file>` | string | 是   | PRD文档路径 |
    +
    +**选项:**
    +
    +| 选项                | 简写 | 类型    | 描述                   | 默认值         |
    +| ------------------- | ---- | ------- | ---------------------- | -------------- |
    +| `--output <path>`   | `-o` | string  | 输出目录               | `./output`     |
    +| `--format <format>` | `-f` | string  | 输出格式               | `json`         |
    +| `--no-tasks`        |      | boolean | 只解析文档,不生成任务 | false          |
    +| `--interactive`     | `-i` | boolean | 交互式模式             | false          |
    +| `--model <model>`   | `-m` | string  | 指定AI模型             | 配置的默认模型 |
    +
    +**支持的格式:**
    +
    +- `json` - JSON格式输出
    +- `markdown` - Markdown格式输出
    +- `yaml` - YAML格式输出
    +
    +**示例:**
    +
    +```bash
    +# 基本解析
    +taskflow parse requirements.md
    +
    +# 指定输出格式和目录
    +taskflow parse prd.md --format markdown --output ./docs
    +
    +# 交互式模式
    +taskflow parse prd.md --interactive
    +
    +# 只解析文档结构
    +taskflow parse prd.md --no-tasks
    +```
    +
    +**输出结构:**
    +
    +```json
    +{
    +  "document": {
    +    "title": "项目名称",
    +    "version": "1.0.0",
    +    "sections": [...],
    +    "metadata": {...}
    +  },
    +  "tasks": [...],
    +  "statistics": {
    +    "totalTasks": 29,
    +    "estimatedHours": 350,
    +    "complexity": "medium"
    +  }
    +}
    +```
    +
    +#### `taskflow status`
    +
    +查看项目状态和统计信息。
    +
    +**语法:**
    +
    +```bash
    +taskflow status [options]
    +```
    +
    +**选项:**
    +
    +| 选项         | 简写 | 类型    | 描述         | 默认值 |
    +| ------------ | ---- | ------- | ------------ | ------ |
    +| `--json`     |      | boolean | JSON格式输出 | false  |
    +| `--detailed` | `-d` | boolean | 显示详细信息 | false  |
    +| `--tasks`    | `-t` | boolean | 显示任务列表 | false  |
    +| `--stats`    | `-s` | boolean | 显示统计信息 | false  |
    +
    +**示例:**
    +
    +```bash
    +# 基本状态显示
    +taskflow status
    +
    +# 详细信息
    +taskflow status --detailed
    +
    +# JSON格式输出
    +taskflow status --json
    +
    +# 显示任务和统计
    +taskflow status --tasks --stats
    +```
    +
    +#### `taskflow visualize`
    +
    +生成项目可视化报告。
    +
    +**语法:**
    +
    +```bash
    +taskflow visualize [options]
    +```
    +
    +**选项:**
    +
    +| 选项                | 简写 | 类型    | 描述           | 默认值      |
    +| ------------------- | ---- | ------- | -------------- | ----------- |
    +| `--type <type>`     | `-t` | string  | 图表类型       | `gantt`     |
    +| `--output <path>`   | `-o` | string  | 输出路径       | `./reports` |
    +| `--format <format>` | `-f` | string  | 输出格式       | `html`      |
    +| `--theme <theme>`   |      | string  | 图表主题       | `default`   |
    +| `--interactive`     | `-i` | boolean | 交互式配置     | false       |
    +| `--open`            |      | boolean | 生成后自动打开 | false       |
    +
    +**图表类型:**
    +
    +- `gantt` - 甘特图
    +- `pie` - 饼图
    +- `bar` - 柱状图
    +- `timeline` - 时间线
    +- `kanban` - 看板视图
    +
    +**输出格式:**
    +
    +- `html` - HTML交互式报告
    +- `svg` - SVG矢量图
    +- `png` - PNG图片
    +- `pdf` - PDF文档
    +
    +**主题选项:**
    +
    +- `default` - 默认主题
    +- `dark` - 深色主题
    +- `light` - 浅色主题
    +- `colorful` - 多彩主题
    +
    +**示例:**
    +
    +```bash
    +# 生成甘特图
    +taskflow visualize --type gantt
    +
    +# 生成深色主题的HTML报告
    +taskflow visualize --theme dark --format html --open
    +
    +# 交互式配置
    +taskflow visualize --interactive
    +```
    +
    +#### `taskflow mcp`
    +
    +MCP服务器管理命令。
    +
    +**语法:**
    +
    +```bash
    +taskflow mcp <command> [options]
    +```
    +
    +**子命令:**
    +
    +##### `taskflow mcp start`
    +
    +启动MCP服务器。
    +
    +**选项:**
    +
    +| 选项            | 简写 | 类型    | 描述       | 默认值    |
    +| --------------- | ---- | ------- | ---------- | --------- |
    +| `--port <port>` | `-p` | number  | 服务器端口 | 3000      |
    +| `--host <host>` | `-h` | string  | 服务器主机 | localhost |
    +| `--verbose`     | `-v` | boolean | 详细日志   | false     |
    +| `--daemon`      | `-d` | boolean | 后台运行   | false     |
    +
    +**示例:**
    +
    +```bash
    +# 启动服务器
    +taskflow mcp start
    +
    +# 指定端口和主机
    +taskflow mcp start --port 8080 --host 0.0.0.0
    +
    +# 后台运行
    +taskflow mcp start --daemon
    +```
    +
    +##### `taskflow mcp stop`
    +
    +停止MCP服务器。
    +
    +**示例:**
    +
    +```bash
    +taskflow mcp stop
    +```
    +
    +##### `taskflow mcp status`
    +
    +查看MCP服务器状态。
    +
    +**示例:**
    +
    +```bash
    +taskflow mcp status
    +```
    +
    +##### `taskflow mcp tools`
    +
    +管理MCP工具。
    +
    +**选项:**
    +
    +| 选项                  | 简写 | 类型    | 描述         | 默认值 |
    +| --------------------- | ---- | ------- | ------------ | ------ |
    +| `--list`              | `-l` | boolean | 列出所有工具 | false  |
    +| `--register <tool>`   | `-r` | string  | 注册新工具   | -      |
    +| `--unregister <tool>` | `-u` | string  | 注销工具     | -      |
    +
    +**示例:**
    +
    +```bash
    +# 列出所有工具
    +taskflow mcp tools --list
    +
    +# 注册新工具
    +taskflow mcp tools --register my-tool
    +```
    +
    +#### `taskflow config`
    +
    +配置管理命令。
    +
    +**语法:**
    +
    +```bash
    +taskflow config <command> [options]
    +```
    +
    +**子命令:**
    +
    +##### `taskflow config get <key>`
    +
    +获取配置值。
    +
    +**示例:**
    +
    +```bash
    +taskflow config get aiModels.0.provider
    +```
    +
    +##### `taskflow config set <key> <value>`
    +
    +设置配置值。
    +
    +**示例:**
    +
    +```bash
    +taskflow config set projectName "New Project Name"
    +```
    +
    +##### `taskflow config list`
    +
    +列出所有配置。
    +
    +**示例:**
    +
    +```bash
    +taskflow config list
    +```
    +
    +## MCP API
    +
    +### 服务器端点
    +
    +MCP服务器提供以下HTTP端点:
    +
    +#### 基础端点
    +
    +| 端点       | 方法 | 描述       | 认证 |
    +| ---------- | ---- | ---------- | ---- |
    +| `/health`  | GET  | 健康检查   | 否   |
    +| `/version` | GET  | 版本信息   | 否   |
    +| `/status`  | GET  | 服务器状态 | 否   |
    +
    +#### 工具端点
    +
    +| 端点                | 方法 | 描述         | 认证 |
    +| ------------------- | ---- | ------------ | ---- |
    +| `/tools`            | GET  | 获取所有工具 | 是   |
    +| `/tools/:name`      | GET  | 获取特定工具 | 是   |
    +| `/tools/:name/call` | POST | 调用工具     | 是   |
    +
    +#### 资源端点
    +
    +| 端点                  | 方法 | 描述         | 认证 |
    +| --------------------- | ---- | ------------ | ---- |
    +| `/resources`          | GET  | 获取所有资源 | 是   |
    +| `/resources/tasks`    | GET  | 获取任务列表 | 是   |
    +| `/resources/projects` | GET  | 获取项目信息 | 是   |
    +| `/resources/config`   | GET  | 获取配置信息 | 是   |
    +
    +### 工具API
    +
    +#### file_read
    +
    +读取文件内容。
    +
    +**参数:**
    +
    +```json
    +{
    +  "path": "string",
    +  "encoding": "utf8|base64"
    +}
    +```
    +
    +**返回:**
    +
    +```json
    +{
    +  "content": "string",
    +  "size": "number",
    +  "mtime": "string"
    +}
    +```
    +
    +#### file_write
    +
    +写入文件内容。
    +
    +**参数:**
    +
    +```json
    +{
    +  "path": "string",
    +  "content": "string",
    +  "encoding": "utf8|base64"
    +}
    +```
    +
    +**返回:**
    +
    +```json
    +{
    +  "success": "boolean",
    +  "size": "number"
    +}
    +```
    +
    +#### shell_exec
    +
    +执行Shell命令。
    +
    +**参数:**
    +
    +```json
    +{
    +  "command": "string",
    +  "cwd": "string",
    +  "timeout": "number"
    +}
    +```
    +
    +**返回:**
    +
    +```json
    +{
    +  "stdout": "string",
    +  "stderr": "string",
    +  "exitCode": "number"
    +}
    +```
    +
    +#### project_analyze
    +
    +分析项目结构。
    +
    +**参数:**
    +
    +```json
    +{
    +  "path": "string",
    +  "includeHidden": "boolean"
    +}
    +```
    +
    +**返回:**
    +
    +```json
    +{
    +  "files": "number",
    +  "directories": "number",
    +  "size": "number",
    +  "structure": "object"
    +}
    +```
    +
    +#### task_create
    +
    +创建新任务。
    +
    +**参数:**
    +
    +```json
    +{
    +  "title": "string",
    +  "description": "string",
    +  "type": "string",
    +  "priority": "string",
    +  "estimatedHours": "number"
    +}
    +```
    +
    +**返回:**
    +
    +```json
    +{
    +  "id": "string",
    +  "created": "boolean",
    +  "task": "object"
    +}
    +```
    +
    +## 配置API
    +
    +### 配置文件结构
    +
    +配置文件位于 `.taskflow/config.json`:
    +
    +```json
    +{
    +  "projectName": "string",
    +  "version": "string",
    +  "aiModels": [
    +    {
    +      "provider": "string",
    +      "modelName": "string",
    +      "apiKey": "string",
    +      "baseUrl": "string",
    +      "enabled": "boolean",
    +      "priority": "number",
    +      "maxTokens": "number",
    +      "temperature": "number"
    +    }
    +  ],
    +  "mcpSettings": {
    +    "enabled": "boolean",
    +    "port": "number",
    +    "host": "string",
    +    "security": {
    +      "authRequired": "boolean",
    +      "apiKey": "string",
    +      "rateLimit": {
    +        "enabled": "boolean",
    +        "maxRequests": "number",
    +        "windowMs": "number"
    +      }
    +    }
    +  },
    +  "outputSettings": {
    +    "defaultFormat": "string",
    +    "defaultOutput": "string",
    +    "autoOpen": "boolean"
    +  },
    +  "visualizationSettings": {
    +    "defaultTheme": "string",
    +    "defaultType": "string",
    +    "interactive": "boolean"
    +  }
    +}
    +```
    +
    +### 环境变量
    +
    +TaskFlow AI 支持以下环境变量:
    +
    +| 变量名                 | 描述          | 默认值                  |
    +| ---------------------- | ------------- | ----------------------- |
    +| `TASKFLOW_CONFIG_PATH` | 配置文件路径  | `.taskflow/config.json` |
    +| `TASKFLOW_LOG_LEVEL`   | 日志级别      | `info`                  |
    +| `TASKFLOW_MCP_PORT`    | MCP服务器端口 | `3000`                  |
    +| `TASKFLOW_MCP_HOST`    | MCP服务器主机 | `localhost`             |
    +| `TASKFLOW_API_KEY`     | API密钥       | -                       |
    +
    +## 错误处理
    +
    +### 错误码
    +
    +| 错误码              | 描述             | 解决方案             |
    +| ------------------- | ---------------- | -------------------- |
    +| `CONFIG_NOT_FOUND`  | 配置文件不存在   | 运行 `taskflow init` |
    +| `INVALID_CONFIG`    | 配置文件格式错误 | 检查配置文件语法     |
    +| `AI_MODEL_ERROR`    | AI模型调用失败   | 检查API密钥和网络    |
    +| `FILE_NOT_FOUND`    | 文件不存在       | 检查文件路径         |
    +| `PERMISSION_DENIED` | 权限不足         | 检查文件权限         |
    +| `MCP_SERVER_ERROR`  | MCP服务器错误    | 检查服务器状态       |
    +
    +### 错误响应格式
    +
    +```json
    +{
    +  "error": {
    +    "code": "string",
    +    "message": "string",
    +    "details": "object"
    +  }
    +}
    +```
    +
    +## 性能优化
    +
    +### 最佳实践
    +
    +1. **配置优化**
    +   - 使用本地AI模型减少网络延迟
    +   - 合理设置并发限制
    +   - 启用缓存机制
    +
    +2. **内存管理**
    +   - 大文件分块处理
    +   - 及时释放资源
    +   - 使用流式处理
    +
    +3. **网络优化**
    +   - 使用连接池
    +   - 启用压缩
    +   - 设置合理的超时时间
    +
    +### 监控指标
    +
    +- **响应时间** - API调用响应时间
    +- **吞吐量** - 每秒处理请求数
    +- **错误率** - 错误请求占比
    +- **内存使用** - 内存占用情况
    +- **CPU使用** - CPU占用情况
    +
    +## 安全考虑
    +
    +### 认证和授权
    +
    +- API密钥认证
    +- 基于角色的访问控制
    +- 请求签名验证
    +
    +### 数据保护
    +
    +- 敏感信息加密
    +- 安全的密钥存储
    +- 数据传输加密
    +
    +### 安全最佳实践
    +
    +- 定期更新密钥
    +- 启用日志记录
    +- 监控异常访问
    +- 使用HTTPS传输
    +
    +---
    +
    +## 版本兼容性
    +
    +本API文档适用于TaskFlow AI v2.0.0及以上版本。
    +
    +如有问题或建议,请访问 [GitHub Issues](https://github.com/Agions/taskflow-ai/issues)。
    
  • docs/api/task-manager.md+667 0 added
    @@ -0,0 +1,667 @@
    +# 任务管理器 API
    +
    +## 概述
    +
    +任务管理器是TaskFlow AI的核心组件,负责任务的完整生命周期管理,包括创建、更新、查询、删除以及状态跟踪。本文档详细介绍任务管理器的API接口和使用方法。
    +
    +## 🏗️ 架构设计
    +
    +```typescript
    +interface TaskManager {
    +  // 基本CRUD操作
    +  createTask(taskData: Partial<Task>): Promise<Task>
    +  updateTask(id: string, updates: Partial<Task>): Promise<Task>
    +  getTask(id: string): Promise<Task | null>
    +  getTasks(filter?: TaskFilter): Promise<Task[]>
    +  deleteTask(id: string): Promise<boolean>
    +  
    +  // 状态管理
    +  updateStatus(id: string, status: TaskStatus, comment?: string): Promise<Task>
    +  getTasksByStatus(status: TaskStatus): Promise<Task[]>
    +  
    +  // 依赖关系管理
    +  addDependency(taskId: string, dependsOn: string): Promise<void>
    +  removeDependency(taskId: string, dependsOn: string): Promise<void>
    +  getDependencies(taskId: string): Promise<Task[]>
    +  getDependents(taskId: string): Promise<Task[]>
    +  
    +  // 批量操作
    +  batchUpdate(updates: BatchTaskUpdate[]): Promise<Task[]>
    +  batchCreate(tasks: Partial<Task>[]): Promise<Task[]>
    +  
    +  // 查询和分析
    +  searchTasks(query: string): Promise<Task[]>
    +  getTaskStatistics(): Promise<TaskStatistics>
    +  analyzeProgress(): Promise<ProgressAnalysis>
    +}
    +```
    +
    +## 📋 核心接口
    +
    +### createTask
    +
    +创建新任务。
    +
    +```typescript
    +async createTask(taskData: Partial<Task>): Promise<Task>
    +```
    +
    +**参数**:
    +- `taskData` (Partial&lt;Task&gt;): 任务数据
    +
    +**返回值**: `Promise&lt;Task&gt;` - 创建的任务对象
    +
    +**示例**:
    +```typescript
    +import { TaskManager, TaskPriority, TaskStatus } from 'taskflow-ai'
    +
    +const taskManager = new TaskManager()
    +
    +// 创建基本任务
    +const task = await taskManager.createTask({
    +  name: '实现用户登录功能',
    +  description: '创建用户登录组件,包含表单验证和错误处理',
    +  priority: TaskPriority.HIGH,
    +  estimatedHours: 8,
    +  assignee: '张三'
    +})
    +
    +// 创建带依赖的任务
    +const dependentTask = await taskManager.createTask({
    +  name: '实现用户仪表板',
    +  description: '用户登录后的主页面',
    +  priority: TaskPriority.MEDIUM,
    +  estimatedHours: 12,
    +  dependencies: [task.id]
    +})
    +```
    +
    +### updateTask
    +
    +更新现有任务。
    +
    +```typescript
    +async updateTask(id: string, updates: Partial<Task>): Promise<Task>
    +```
    +
    +**示例**:
    +```typescript
    +// 更新任务信息
    +const updatedTask = await taskManager.updateTask('task-001', {
    +  status: TaskStatus.IN_PROGRESS,
    +  actualHours: 4,
    +  assignee: '李四'
    +})
    +
    +// 添加备注
    +const taskWithComment = await taskManager.updateTask('task-001', {
    +  comments: [
    +    ...task.comments,
    +    {
    +      text: '已完成UI设计,开始编码实现',
    +      author: '张三',
    +      timestamp: new Date()
    +    }
    +  ]
    +})
    +```
    +
    +### getTasks
    +
    +查询任务列表。
    +
    +```typescript
    +async getTasks(filter?: TaskFilter): Promise<Task[]>
    +```
    +
    +**示例**:
    +```typescript
    +// 获取所有任务
    +const allTasks = await taskManager.getTasks()
    +
    +// 按状态过滤
    +const inProgressTasks = await taskManager.getTasks({
    +  status: TaskStatus.IN_PROGRESS
    +})
    +
    +// 按优先级和分配人过滤
    +const highPriorityTasks = await taskManager.getTasks({
    +  priority: TaskPriority.HIGH,
    +  assignee: '张三'
    +})
    +
    +// 复杂查询
    +const complexFilter = await taskManager.getTasks({
    +  status: [TaskStatus.NOT_STARTED, TaskStatus.IN_PROGRESS],
    +  priority: [TaskPriority.HIGH, TaskPriority.MEDIUM],
    +  tags: ['frontend', 'urgent'],
    +  createdAfter: new Date('2024-01-01'),
    +  estimatedHours: { min: 4, max: 16 }
    +})
    +```
    +
    +### updateStatus
    +
    +更新任务状态。
    +
    +```typescript
    +async updateStatus(
    +  id: string, 
    +  status: TaskStatus, 
    +  comment?: string
    +): Promise<Task>
    +```
    +
    +**示例**:
    +```typescript
    +// 开始任务
    +await taskManager.updateStatus('task-001', TaskStatus.IN_PROGRESS)
    +
    +// 完成任务并添加备注
    +await taskManager.updateStatus(
    +  'task-001', 
    +  TaskStatus.COMPLETED,
    +  '功能实现完成,已通过单元测试'
    +)
    +
    +// 阻塞任务
    +await taskManager.updateStatus(
    +  'task-002', 
    +  TaskStatus.BLOCKED,
    +  '等待后端API接口完成'
    +)
    +```
    +
    +## 🔗 依赖关系管理
    +
    +### addDependency
    +
    +添加任务依赖关系。
    +
    +```typescript
    +async addDependency(taskId: string, dependsOn: string): Promise<void>
    +```
    +
    +**示例**:
    +```typescript
    +// 设置任务依赖
    +await taskManager.addDependency('task-002', 'task-001')
    +
    +// 批量设置依赖
    +const dependencies = ['task-001', 'task-003', 'task-004']
    +for (const dep of dependencies) {
    +  await taskManager.addDependency('task-005', dep)
    +}
    +```
    +
    +### getDependencies
    +
    +获取任务依赖关系。
    +
    +```typescript
    +async getDependencies(taskId: string): Promise<Task[]>
    +```
    +
    +**示例**:
    +```typescript
    +// 获取任务的所有依赖
    +const dependencies = await taskManager.getDependencies('task-005')
    +console.log(`任务 task-005 依赖于 ${dependencies.length} 个任务`)
    +
    +// 检查依赖是否完成
    +const incompleteDeps = dependencies.filter(dep => 
    +  dep.status !== TaskStatus.COMPLETED
    +)
    +
    +if (incompleteDeps.length > 0) {
    +  console.log('以下依赖任务尚未完成:', incompleteDeps.map(t => t.name))
    +}
    +```
    +
    +## 📊 批量操作
    +
    +### batchUpdate
    +
    +批量更新任务。
    +
    +```typescript
    +async batchUpdate(updates: BatchTaskUpdate[]): Promise<Task[]>
    +```
    +
    +**示例**:
    +```typescript
    +// 批量更新任务状态
    +const batchUpdates = [
    +  { id: 'task-001', updates: { status: TaskStatus.COMPLETED } },
    +  { id: 'task-002', updates: { status: TaskStatus.IN_PROGRESS, assignee: '李四' } },
    +  { id: 'task-003', updates: { priority: TaskPriority.HIGH } }
    +]
    +
    +const updatedTasks = await taskManager.batchUpdate(batchUpdates)
    +console.log(`批量更新了 ${updatedTasks.length} 个任务`)
    +```
    +
    +### batchCreate
    +
    +批量创建任务。
    +
    +```typescript
    +async batchCreate(tasks: Partial<Task>[]): Promise<Task[]>
    +```
    +
    +**示例**:
    +```typescript
    +const newTasks = [
    +  {
    +    name: '设计用户界面',
    +    description: '创建用户登录和注册页面的UI设计',
    +    priority: TaskPriority.HIGH,
    +    estimatedHours: 6
    +  },
    +  {
    +    name: '实现表单验证',
    +    description: '添加客户端和服务端表单验证',
    +    priority: TaskPriority.MEDIUM,
    +    estimatedHours: 4
    +  }
    +]
    +
    +const createdTasks = await taskManager.batchCreate(newTasks)
    +```
    +
    +## 🔍 查询和搜索
    +
    +### searchTasks
    +
    +搜索任务。
    +
    +```typescript
    +async searchTasks(query: string): Promise<Task[]>
    +```
    +
    +**示例**:
    +```typescript
    +// 文本搜索
    +const loginTasks = await taskManager.searchTasks('登录')
    +
    +// 搜索特定分配人的任务
    +const zhangTasks = await taskManager.searchTasks('assignee:张三')
    +
    +// 复合搜索
    +const urgentFrontendTasks = await taskManager.searchTasks('priority:high tag:frontend')
    +```
    +
    +### getTaskStatistics
    +
    +获取任务统计信息。
    +
    +```typescript
    +async getTaskStatistics(): Promise<TaskStatistics>
    +```
    +
    +**示例**:
    +```typescript
    +const stats = await taskManager.getTaskStatistics()
    +
    +console.log(`
    +任务统计:
    +- 总任务数: ${stats.total}
    +- 已完成: ${stats.completed} (${stats.completionRate}%)
    +- 进行中: ${stats.inProgress}
    +- 未开始: ${stats.notStarted}
    +- 已阻塞: ${stats.blocked}
    +
    +工时统计:
    +- 总预估工时: ${stats.totalEstimatedHours}小时
    +- 已消耗工时: ${stats.totalActualHours}小时
    +- 剩余工时: ${stats.remainingHours}小时
    +
    +优先级分布:
    +- 高优先级: ${stats.priorityDistribution.high}
    +- 中优先级: ${stats.priorityDistribution.medium}
    +- 低优先级: ${stats.priorityDistribution.low}
    +`)
    +```
    +
    +## 📈 进度分析
    +
    +### analyzeProgress
    +
    +分析项目进度。
    +
    +```typescript
    +async analyzeProgress(): Promise<ProgressAnalysis>
    +```
    +
    +**示例**:
    +```typescript
    +const analysis = await taskManager.analyzeProgress()
    +
    +console.log(`
    +进度分析:
    +- 整体完成度: ${analysis.overallProgress}%
    +- 预计完成时间: ${analysis.estimatedCompletion}
    +- 当前速度: ${analysis.velocity} 任务/天
    +- 风险评估: ${analysis.riskLevel}
    +
    +里程碑进度:
    +${analysis.milestones.map(m => 
    +  `- ${m.name}: ${m.progress}% (${m.status})`
    +).join('\n')}
    +
    +团队效率:
    +${analysis.teamEfficiency.map(t => 
    +  `- ${t.member}: ${t.completionRate}% 完成率`
    +).join('\n')}
    +`)
    +```
    +
    +## 🔧 类型定义
    +
    +### Task
    +
    +任务对象定义。
    +
    +```typescript
    +interface Task {
    +  // 基本信息
    +  id: string
    +  name: string
    +  description: string
    +  
    +  // 状态信息
    +  status: TaskStatus
    +  priority: TaskPriority
    +  
    +  // 分配信息
    +  assignee?: string
    +  team?: string
    +  
    +  // 时间信息
    +  estimatedHours: number
    +  actualHours?: number
    +  startDate?: Date
    +  endDate?: Date
    +  dueDate?: Date
    +  
    +  // 依赖关系
    +  dependencies: string[]
    +  dependents: string[]
    +  blockers: string[]
    +  
    +  // 分类和标签
    +  category?: string
    +  tags: string[]
    +  
    +  // 验收标准
    +  acceptanceCriteria: string[]
    +  
    +  // 备注和历史
    +  comments: TaskComment[]
    +  history: TaskHistoryEntry[]
    +  
    +  // 元数据
    +  metadata: {
    +    source: string
    +    createdBy: string
    +    createdAt: Date
    +    updatedAt: Date
    +    version: number
    +  }
    +}
    +```
    +
    +### TaskStatus
    +
    +任务状态枚举。
    +
    +```typescript
    +enum TaskStatus {
    +  NOT_STARTED = 'not_started',
    +  IN_PROGRESS = 'in_progress',
    +  COMPLETED = 'completed',
    +  BLOCKED = 'blocked',
    +  CANCELLED = 'cancelled',
    +  ON_HOLD = 'on_hold'
    +}
    +```
    +
    +### TaskPriority
    +
    +任务优先级枚举。
    +
    +```typescript
    +enum TaskPriority {
    +  LOW = 'low',
    +  MEDIUM = 'medium',
    +  HIGH = 'high',
    +  URGENT = 'urgent'
    +}
    +```
    +
    +### TaskFilter
    +
    +任务过滤器。
    +
    +```typescript
    +interface TaskFilter {
    +  // 状态过滤
    +  status?: TaskStatus | TaskStatus[]
    +  priority?: TaskPriority | TaskPriority[]
    +  
    +  // 分配过滤
    +  assignee?: string | string[]
    +  team?: string | string[]
    +  
    +  // 时间过滤
    +  createdAfter?: Date
    +  createdBefore?: Date
    +  dueAfter?: Date
    +  dueBefore?: Date
    +  
    +  // 工时过滤
    +  estimatedHours?: {
    +    min?: number
    +    max?: number
    +  }
    +  
    +  // 标签过滤
    +  tags?: string | string[]
    +  category?: string | string[]
    +  
    +  // 依赖过滤
    +  hasDependencies?: boolean
    +  hasBlockers?: boolean
    +  
    +  // 排序
    +  sortBy?: 'createdAt' | 'updatedAt' | 'priority' | 'dueDate' | 'estimatedHours'
    +  sortOrder?: 'asc' | 'desc'
    +  
    +  // 分页
    +  limit?: number
    +  offset?: number
    +}
    +```
    +
    +## 🎯 使用示例
    +
    +### 基本任务管理
    +
    +```typescript
    +import { TaskManager, TaskStatus, TaskPriority } from 'taskflow-ai'
    +
    +async function basicTaskManagement() {
    +  const taskManager = new TaskManager()
    +  
    +  // 创建任务
    +  const task = await taskManager.createTask({
    +    name: '实现用户认证',
    +    description: '实现JWT基础的用户认证系统',
    +    priority: TaskPriority.HIGH,
    +    estimatedHours: 16,
    +    assignee: '张三',
    +    tags: ['backend', 'security'],
    +    acceptanceCriteria: [
    +      '用户可以注册新账号',
    +      '用户可以登录和登出',
    +      'JWT token正确生成和验证',
    +      '密码安全存储(加密)'
    +    ]
    +  })
    +  
    +  // 开始任务
    +  await taskManager.updateStatus(task.id, TaskStatus.IN_PROGRESS)
    +  
    +  // 更新进度
    +  await taskManager.updateTask(task.id, {
    +    actualHours: 8,
    +    comments: [
    +      {
    +        text: '已完成用户注册功能',
    +        author: '张三',
    +        timestamp: new Date()
    +      }
    +    ]
    +  })
    +  
    +  // 完成任务
    +  await taskManager.updateStatus(
    +    task.id, 
    +    TaskStatus.COMPLETED,
    +    '认证系统实现完成,所有测试通过'
    +  )
    +}
    +```
    +
    +### 依赖关系管理
    +
    +```typescript
    +async function dependencyManagement() {
    +  const taskManager = new TaskManager()
    +  
    +  // 创建有依赖关系的任务
    +  const dbTask = await taskManager.createTask({
    +    name: '设计数据库表结构',
    +    priority: TaskPriority.HIGH,
    +    estimatedHours: 4
    +  })
    +  
    +  const apiTask = await taskManager.createTask({
    +    name: '实现用户API',
    +    priority: TaskPriority.HIGH,
    +    estimatedHours: 8,
    +    dependencies: [dbTask.id]
    +  })
    +  
    +  const frontendTask = await taskManager.createTask({
    +    name: '实现前端用户界面',
    +    priority: TaskPriority.MEDIUM,
    +    estimatedHours: 12,
    +    dependencies: [apiTask.id]
    +  })
    +  
    +  // 检查任务是否可以开始
    +  const canStart = await taskManager.canStartTask(frontendTask.id)
    +  if (!canStart.allowed) {
    +    console.log('任务无法开始,原因:', canStart.reasons)
    +  }
    +  
    +  // 获取关键路径
    +  const criticalPath = await taskManager.getCriticalPath()
    +  console.log('关键路径任务:', criticalPath.map(t => t.name))
    +}
    +```
    +
    +### 团队协作
    +
    +```typescript
    +async function teamCollaboration() {
    +  const taskManager = new TaskManager()
    +  
    +  // 按团队成员查看任务
    +  const teamMembers = ['张三', '李四', '王五']
    +  
    +  for (const member of teamMembers) {
    +    const memberTasks = await taskManager.getTasks({
    +      assignee: member,
    +      status: [TaskStatus.NOT_STARTED, TaskStatus.IN_PROGRESS]
    +    })
    +    
    +    console.log(`${member} 的任务 (${memberTasks.length}):`)
    +    memberTasks.forEach(task => {
    +      console.log(`  - ${task.name} (${task.status}, ${task.priority})`)
    +    })
    +  }
    +  
    +  // 工作负载平衡
    +  const workload = await taskManager.getWorkloadDistribution()
    +  const overloadedMembers = workload.filter(w => w.totalHours > 40)
    +  
    +  if (overloadedMembers.length > 0) {
    +    console.log('工作负载过重的成员:', overloadedMembers.map(m => m.member))
    +    
    +    // 重新分配任务
    +    await taskManager.rebalanceWorkload({
    +      maxHoursPerPerson: 40,
    +      strategy: 'even-distribution'
    +    })
    +  }
    +}
    +```
    +
    +## 🔄 事件和钩子
    +
    +### 任务事件
    +
    +```typescript
    +taskManager.on('taskCreated', (task: Task) => {
    +  console.log(`新任务创建: ${task.name}`)
    +})
    +
    +taskManager.on('taskUpdated', (task: Task, changes: Partial<Task>) => {
    +  console.log(`任务更新: ${task.name}`, changes)
    +})
    +
    +taskManager.on('statusChanged', (task: Task, oldStatus: TaskStatus, newStatus: TaskStatus) => {
    +  console.log(`任务 ${task.name} 状态从 ${oldStatus} 变更为 ${newStatus}`)
    +})
    +
    +taskManager.on('taskCompleted', (task: Task) => {
    +  console.log(`任务完成: ${task.name}`)
    +  // 自动开始依赖任务
    +  taskManager.startDependentTasks(task.id)
    +})
    +```
    +
    +### 自定义钩子
    +
    +```typescript
    +// 任务创建前验证
    +taskManager.addHook('beforeCreate', async (taskData: Partial<Task>) => {
    +  if (!taskData.name || taskData.name.length < 5) {
    +    throw new Error('任务名称至少需要5个字符')
    +  }
    +  return taskData
    +})
    +
    +// 任务完成后自动化
    +taskManager.addHook('afterComplete', async (task: Task) => {
    +  // 自动创建代码审查任务
    +  if (task.tags.includes('development')) {
    +    await taskManager.createTask({
    +      name: `代码审查: ${task.name}`,
    +      description: `对任务 ${task.name} 的代码进行审查`,
    +      priority: TaskPriority.MEDIUM,
    +      estimatedHours: 2,
    +      dependencies: [task.id]
    +    })
    +  }
    +})
    +```
    +
    +## 📚 相关文档
    +
    +- [PRD解析器 API](./prd-parser.md) - PRD文档解析
    +- [AI编排器 API](./ai-orchestrator.md) - AI模型管理
    +- [项目配置管理 API](./project-config.md) - 项目配置
    +- [类型定义](./types/task.md) - 任务相关类型
    
  • docs/api/task-orchestration.md+395 0 added
    @@ -0,0 +1,395 @@
    +# 任务编排引擎 API
    +
    +## 概述
    +
    +TaskFlow AI 的任务编排引擎提供了智能的任务排序、关键路径分析和并行优化功能。基于先进的项目管理算法,能够显著提升项目执行效率。
    +
    +## 核心类
    +
    +### `TaskOrchestrationEngine`
    +
    +智能任务编排引擎的主要实现类。
    +
    +#### 构造函数
    +
    +```typescript
    +constructor(config?: TaskOrchestrationConfig)
    +```
    +
    +**参数:**
    +- `config` - 编排配置选项(可选)
    +
    +**示例:**
    +```typescript
    +import { TaskOrchestrationEngine } from 'taskflow-ai';
    +
    +const engine = new TaskOrchestrationEngine({
    +  enableCriticalPath: true,
    +  enableParallelOptimization: true,
    +  schedulingStrategy: SchedulingStrategy.CRITICAL_PATH,
    +  optimizationGoal: OptimizationGoal.MINIMIZE_DURATION
    +});
    +```
    +
    +#### 主要方法
    +
    +##### `orchestrate(tasks: Task[]): Promise<TaskOrchestrationResult>`
    +
    +执行任务编排,返回优化后的任务安排。
    +
    +**参数:**
    +- `tasks` - 待编排的任务列表
    +
    +**返回值:**
    +- `Promise<TaskOrchestrationResult>` - 编排结果
    +
    +**示例:**
    +```typescript
    +const tasks = await taskManager.getAllTasks();
    +const result = await engine.orchestrate(tasks);
    +
    +console.log(`项目预计持续时间: ${result.totalDuration} 小时`);
    +console.log(`关键路径任务: ${result.criticalPath.length} 个`);
    +console.log(`并行任务组: ${result.parallelGroups.length} 个`);
    +```
    +
    +##### `updateTaskTimeInfo(tasks: Task[]): Task[]`
    +
    +更新任务的时间信息,包括最早/最晚开始时间、浮动时间等。
    +
    +**参数:**
    +- `tasks` - 任务列表
    +
    +**返回值:**
    +- `Task[]` - 更新后的任务列表
    +
    +##### `getOrchestrationStats(): OrchestrationStats`
    +
    +获取编排统计信息。
    +
    +**返回值:**
    +- `OrchestrationStats` - 统计信息对象
    +
    +## 工厂类
    +
    +### `OrchestrationFactory`
    +
    +提供预设编排策略的工厂类。
    +
    +#### 静态方法
    +
    +##### `createEngine(preset?: OrchestrationPreset, customConfig?: Partial<TaskOrchestrationConfig>): TaskOrchestrationEngine`
    +
    +创建编排引擎实例。
    +
    +**参数:**
    +- `preset` - 预设策略(可选)
    +- `customConfig` - 自定义配置(可选)
    +
    +**示例:**
    +```typescript
    +import { OrchestrationFactory, OrchestrationPreset } from 'taskflow-ai';
    +
    +// 使用敏捷冲刺预设
    +const agileEngine = OrchestrationFactory.createEngine(
    +  OrchestrationPreset.AGILE_SPRINT
    +);
    +
    +// 使用自定义配置
    +const customEngine = OrchestrationFactory.createEngine(
    +  OrchestrationPreset.ENTERPRISE,
    +  {
    +    maxParallelTasks: 15,
    +    bufferPercentage: 0.2
    +  }
    +);
    +```
    +
    +##### `getAvailablePresets(): PresetInfo[]`
    +
    +获取所有可用的预设策略。
    +
    +**返回值:**
    +- `PresetInfo[]` - 预设信息列表
    +
    +##### `recommendPreset(characteristics: ProjectCharacteristics): OrchestrationPreset`
    +
    +根据项目特征推荐合适的预设策略。
    +
    +**参数:**
    +- `characteristics` - 项目特征
    +
    +**示例:**
    +```typescript
    +const recommended = OrchestrationFactory.recommendPreset({
    +  teamSize: 8,
    +  projectDuration: 60,
    +  uncertaintyLevel: 6,
    +  isAgile: true
    +});
    +
    +console.log(`推荐策略: ${recommended}`);
    +```
    +
    +## 类型定义
    +
    +### `TaskOrchestrationConfig`
    +
    +编排配置接口。
    +
    +```typescript
    +interface TaskOrchestrationConfig {
    +  enableCriticalPath?: boolean;           // 启用关键路径分析
    +  enableParallelOptimization?: boolean;   // 启用并行优化
    +  enableResourceLeveling?: boolean;       // 启用资源平衡
    +  enableRiskAnalysis?: boolean;           // 启用风险分析
    +  schedulingStrategy?: SchedulingStrategy; // 调度策略
    +  optimizationGoal?: OptimizationGoal;    // 优化目标
    +  maxParallelTasks?: number;              // 最大并行任务数
    +  workingHoursPerDay?: number;            // 每日工作小时数
    +  workingDaysPerWeek?: number;            // 每周工作天数
    +  bufferPercentage?: number;              // 缓冲时间百分比
    +}
    +```
    +
    +### `TaskOrchestrationResult`
    +
    +编排结果接口。
    +
    +```typescript
    +interface TaskOrchestrationResult {
    +  tasks: Task[];                          // 编排后的任务列表
    +  criticalPath: string[];                 // 关键路径任务ID列表
    +  totalDuration: number;                  // 项目总持续时间
    +  parallelGroups: string[][];             // 可并行执行的任务组
    +  resourceUtilization: ResourceUtilization[]; // 资源利用率
    +  riskAssessment: RiskAssessment;         // 风险评估
    +  recommendations: string[];              // 优化建议
    +  metadata: OrchestrationMetadata;        // 编排元数据
    +}
    +```
    +
    +### `SchedulingStrategy`
    +
    +调度策略枚举。
    +
    +```typescript
    +enum SchedulingStrategy {
    +  CRITICAL_PATH = 'critical_path',        // 关键路径优先
    +  PRIORITY_FIRST = 'priority_first',      // 优先级优先
    +  SHORTEST_FIRST = 'shortest_first',      // 最短任务优先
    +  LONGEST_FIRST = 'longest_first',        // 最长任务优先
    +  RESOURCE_LEVELING = 'resource_leveling', // 资源平衡
    +  EARLY_START = 'early_start',            // 最早开始
    +  LATE_START = 'late_start'               // 最晚开始
    +}
    +```
    +
    +### `OptimizationGoal`
    +
    +优化目标枚举。
    +
    +```typescript
    +enum OptimizationGoal {
    +  MINIMIZE_DURATION = 'minimize_duration', // 最小化项目持续时间
    +  MINIMIZE_COST = 'minimize_cost',         // 最小化项目成本
    +  MAXIMIZE_QUALITY = 'maximize_quality',   // 最大化项目质量
    +  BALANCE_RESOURCES = 'balance_resources', // 平衡资源使用
    +  MINIMIZE_RISK = 'minimize_risk'          // 最小化项目风险
    +}
    +```
    +
    +### `OrchestrationPreset`
    +
    +预设策略枚举。
    +
    +```typescript
    +enum OrchestrationPreset {
    +  AGILE_SPRINT = 'agile_sprint',           // 敏捷冲刺
    +  WATERFALL = 'waterfall',                 // 瀑布模型
    +  CRITICAL_CHAIN = 'critical_chain',       // 关键链
    +  LEAN_STARTUP = 'lean_startup',           // 精益创业
    +  RAPID_PROTOTYPE = 'rapid_prototype',     // 快速原型
    +  ENTERPRISE = 'enterprise',               // 企业级
    +  RESEARCH = 'research',                   // 研究项目
    +  MAINTENANCE = 'maintenance'              // 维护项目
    +}
    +```
    +
    +## 使用示例
    +
    +### 基本编排
    +
    +```typescript
    +import { TaskOrchestrationEngine, TaskManager } from 'taskflow-ai';
    +
    +async function basicOrchestration() {
    +  // 加载任务
    +  const taskManager = new TaskManager();
    +  await taskManager.loadTasks();
    +  const tasks = taskManager.getAllTasks();
    +  
    +  // 创建编排引擎
    +  const engine = new TaskOrchestrationEngine({
    +    enableCriticalPath: true,
    +    enableParallelOptimization: true
    +  });
    +  
    +  // 执行编排
    +  const result = await engine.orchestrate(tasks);
    +  
    +  // 显示结果
    +  console.log('编排完成!');
    +  console.log(`总持续时间: ${result.totalDuration} 小时`);
    +  console.log(`关键任务: ${result.criticalPath.length} 个`);
    +  
    +  // 保存更新后的任务
    +  const updatedTasks = engine.updateTaskTimeInfo(result.tasks);
    +  for (const task of updatedTasks) {
    +    await taskManager.updateTask(task.id, task);
    +  }
    +}
    +```
    +
    +### 使用预设策略
    +
    +```typescript
    +import { OrchestrationFactory, OrchestrationPreset } from 'taskflow-ai';
    +
    +async function usePresetStrategy() {
    +  // 创建敏捷冲刺引擎
    +  const agileEngine = OrchestrationFactory.createEngine(
    +    OrchestrationPreset.AGILE_SPRINT
    +  );
    +  
    +  // 执行编排
    +  const result = await agileEngine.orchestrate(tasks);
    +  
    +  // 显示敏捷相关的建议
    +  console.log('敏捷冲刺编排建议:');
    +  result.recommendations.forEach((rec, index) => {
    +    console.log(`${index + 1}. ${rec}`);
    +  });
    +}
    +```
    +
    +### 风险分析
    +
    +```typescript
    +async function riskAnalysis() {
    +  const engine = new TaskOrchestrationEngine({
    +    enableRiskAnalysis: true,
    +    enableCriticalPath: true
    +  });
    +  
    +  const result = await engine.orchestrate(tasks);
    +  
    +  // 显示风险评估
    +  console.log(`整体风险等级: ${result.riskAssessment.overallRiskLevel}/10`);
    +  
    +  result.riskAssessment.riskFactors.forEach(risk => {
    +    console.log(`风险: ${risk.name} (${risk.category})`);
    +    console.log(`  概率: ${risk.probability * 100}%`);
    +    console.log(`  影响: ${risk.impact}/10`);
    +    console.log(`  评分: ${risk.riskScore}`);
    +  });
    +  
    +  // 显示缓解建议
    +  console.log('\n缓解建议:');
    +  result.riskAssessment.mitigationSuggestions.forEach((suggestion, index) => {
    +    console.log(`${index + 1}. ${suggestion}`);
    +  });
    +}
    +```
    +
    +### 资源优化
    +
    +```typescript
    +async function resourceOptimization() {
    +  const engine = new TaskOrchestrationEngine({
    +    enableResourceLeveling: true,
    +    optimizationGoal: OptimizationGoal.BALANCE_RESOURCES
    +  });
    +  
    +  const result = await engine.orchestrate(tasks);
    +  
    +  // 显示资源利用率
    +  console.log('资源利用率:');
    +  result.resourceUtilization.forEach(resource => {
    +    console.log(`${resource.resourceName}: ${(resource.utilizationRate * 100).toFixed(1)}%`);
    +    
    +    if (resource.overallocation > 0) {
    +      console.log(`  ⚠️ 超分配: ${resource.overallocation} 单位`);
    +    }
    +  });
    +}
    +```
    +
    +## 最佳实践
    +
    +### 1. 选择合适的策略
    +
    +根据项目特征选择合适的编排策略:
    +
    +- **敏捷项目**: 使用 `AGILE_SPRINT` 预设
    +- **传统项目**: 使用 `WATERFALL` 预设
    +- **大型企业项目**: 使用 `ENTERPRISE` 预设
    +- **研究项目**: 使用 `RESEARCH` 预设
    +
    +### 2. 配置缓冲时间
    +
    +为项目设置合理的缓冲时间:
    +
    +```typescript
    +const config = {
    +  bufferPercentage: 0.15, // 15% 缓冲时间
    +  enableRiskAnalysis: true
    +};
    +```
    +
    +### 3. 监控关键路径
    +
    +重点关注关键路径上的任务:
    +
    +```typescript
    +const criticalTasks = result.tasks.filter(task => 
    +  result.criticalPath.includes(task.id)
    +);
    +
    +console.log('关键任务需要特别关注:');
    +criticalTasks.forEach(task => {
    +  console.log(`- ${task.name} (${task.estimatedHours}h)`);
    +});
    +```
    +
    +### 4. 利用并行机会
    +
    +识别并利用并行执行机会:
    +
    +```typescript
    +console.log('可并行执行的任务组:');
    +result.parallelGroups.forEach((group, index) => {
    +  console.log(`组 ${index + 1}: ${group.join(', ')}`);
    +});
    +```
    +
    +## 错误处理
    +
    +```typescript
    +try {
    +  const result = await engine.orchestrate(tasks);
    +  // 处理成功结果
    +} catch (error) {
    +  if (error.message.includes('循环依赖')) {
    +    console.error('检测到任务间的循环依赖,请检查任务依赖关系');
    +  } else {
    +    console.error('编排失败:', error.message);
    +  }
    +}
    +```
    +
    +## 性能考虑
    +
    +- 对于大型项目(>100个任务),建议启用资源平衡以优化性能
    +- 复杂的依赖关系可能增加计算时间,考虑简化依赖结构
    +- 风险分析会增加计算开销,可根据需要选择性启用
    
  • docs/api/types/config.md+714 0 added
    @@ -0,0 +1,714 @@
    +# 配置类型定义
    +
    +## 概述
    +
    +本文档定义了TaskFlow AI中配置管理相关的所有类型,包括项目配置、系统配置、AI模型配置等。
    +
    +## 🏗️ 项目配置类型
    +
    +### ProjectConfig - 项目配置
    +```typescript
    +interface ProjectConfig extends BaseEntity {
    +  // 项目基本信息
    +  project: ProjectInfo
    +  
    +  // AI配置
    +  ai: AIConfig
    +  
    +  // 团队配置
    +  team: TeamConfig
    +  
    +  // 工作流配置
    +  workflow: WorkflowConfig
    +  
    +  // 性能配置
    +  performance: PerformanceConfig
    +  
    +  // 安全配置
    +  security: SecurityConfig
    +  
    +  // 网络配置
    +  network: NetworkConfig
    +  
    +  // 日志配置
    +  logging: LoggingConfig
    +  
    +  // 环境配置
    +  environment: Environment
    +}
    +
    +// 项目信息
    +interface ProjectInfo {
    +  name: string
    +  type: ProjectType
    +  description?: string
    +  version?: string
    +  workDir: string
    +  language?: string
    +  framework?: string
    +  repository?: RepositoryInfo
    +}
    +
    +// 项目类型
    +enum ProjectType {
    +  WEB_APP = 'web-app',
    +  MOBILE_APP = 'mobile-app',
    +  API = 'api',
    +  DESKTOP_APP = 'desktop-app',
    +  LIBRARY = 'library',
    +  MICROSERVICE = 'microservice',
    +  OTHER = 'other'
    +}
    +
    +// 仓库信息
    +interface RepositoryInfo {
    +  url: string
    +  branch: string
    +  provider: 'github' | 'gitlab' | 'bitbucket' | 'other'
    +  private: boolean
    +}
    +```
    +
    +## 🤖 AI配置类型
    +
    +### AIConfig - AI配置
    +```typescript
    +interface AIConfig {
    +  // 模型配置
    +  models: ModelConfigs
    +  
    +  // 多模型配置
    +  multiModel: MultiModelConfig
    +  
    +  // 解析配置
    +  parsing: ParsingConfig
    +  
    +  // 生成配置
    +  generation: GenerationConfig
    +}
    +
    +// 模型配置集合
    +interface ModelConfigs {
    +  deepseek: ModelConfig
    +  zhipu: ModelConfig
    +  qwen: ModelConfig
    +  baidu: ModelConfig
    +  [key: string]: ModelConfig
    +}
    +
    +// 单个模型配置
    +interface ModelConfig {
    +  enabled: boolean
    +  apiKey: string
    +  endpoint?: string
    +  model?: string
    +  parameters: ModelParameters
    +  limits: ModelLimits
    +  pricing?: ModelPricing
    +}
    +
    +// 模型参数
    +interface ModelParameters {
    +  temperature: number
    +  maxTokens: number
    +  topP: number
    +  frequencyPenalty: number
    +  presencePenalty: number
    +  stopSequences?: string[]
    +}
    +
    +// 模型限制
    +interface ModelLimits {
    +  requestsPerMinute: number
    +  tokensPerMinute: number
    +  maxConcurrentRequests: number
    +  dailyQuota?: number
    +}
    +
    +// 模型定价
    +interface ModelPricing {
    +  inputTokens: number    // per 1K tokens
    +  outputTokens: number   // per 1K tokens
    +  fixedCost?: number     // per request
    +  currency: string
    +}
    +
    +// 多模型配置
    +interface MultiModelConfig {
    +  enabled: boolean
    +  primary: string
    +  fallback: string[]
    +  loadBalancing: boolean
    +  selectionStrategy: ModelSelectionStrategy
    +  costOptimization: boolean
    +  qualityThreshold: number
    +}
    +
    +// 模型选择策略
    +enum ModelSelectionStrategy {
    +  PERFORMANCE = 'performance',
    +  COST = 'cost',
    +  BALANCED = 'balanced',
    +  ROUND_ROBIN = 'round_robin',
    +  RANDOM = 'random',
    +  CUSTOM = 'custom'
    +}
    +```
    +
    +## 👥 团队配置类型
    +
    +### TeamConfig - 团队配置
    +```typescript
    +interface TeamConfig {
    +  // 团队成员
    +  members: TeamMember[]
    +  
    +  // 角色定义
    +  roles: TeamRole[]
    +  
    +  // 默认设置
    +  defaults: TeamDefaults
    +  
    +  // 协作设置
    +  collaboration: CollaborationConfig
    +  
    +  // 通知设置
    +  notifications: NotificationConfig
    +}
    +
    +// 团队成员
    +interface TeamMember {
    +  id: ID
    +  name: string
    +  email: string
    +  role: string
    +  skills: string[]
    +  availability: Availability
    +  timezone: string
    +  active: boolean
    +  joinedAt: Timestamp
    +}
    +
    +// 可用性
    +interface Availability {
    +  hoursPerWeek: number
    +  workingDays: number[]  // 0-6, 0=Sunday
    +  workingHours: {
    +    start: string  // HH:mm
    +    end: string    // HH:mm
    +  }
    +  vacations: VacationPeriod[]
    +}
    +
    +// 假期时间
    +interface VacationPeriod {
    +  start: Timestamp
    +  end: Timestamp
    +  type: 'vacation' | 'sick' | 'personal' | 'holiday'
    +  description?: string
    +}
    +
    +// 团队角色
    +interface TeamRole {
    +  id: ID
    +  name: string
    +  permissions: Permission[]
    +  responsibilities: string[]
    +  canAssignTasks: boolean
    +  canUpdateStatus: boolean
    +  canDeleteTasks: boolean
    +  isAdmin: boolean
    +}
    +
    +// 团队默认设置
    +interface TeamDefaults {
    +  assignee?: string
    +  reviewer?: string
    +  priority: TaskPriority
    +  estimationMethod: 'hours' | 'story_points' | 'tshirt'
    +  autoAssignment: boolean
    +  workingHours: number
    +}
    +```
    +
    +## 🔄 工作流配置类型
    +
    +### WorkflowConfig - 工作流配置
    +```typescript
    +interface WorkflowConfig {
    +  // 任务工作流
    +  taskWorkflow: TaskWorkflowConfig
    +  
    +  // 自动化规则
    +  automation: AutomationConfig
    +  
    +  // 集成配置
    +  integrations: IntegrationConfig
    +  
    +  // 报告配置
    +  reporting: ReportingConfig
    +}
    +
    +// 任务工作流配置
    +interface TaskWorkflowConfig {
    +  defaultStatus: TaskStatus
    +  statusTransitions: TaskStatusTransition[]
    +  approvalRequired: boolean
    +  reviewRequired: boolean
    +  testingRequired: boolean
    +  autoStatusUpdate: boolean
    +}
    +
    +// 自动化配置
    +interface AutomationConfig {
    +  enabled: boolean
    +  rules: AutomationRule[]
    +  triggers: AutomationTrigger[]
    +  actions: AutomationAction[]
    +}
    +
    +// 自动化规则
    +interface AutomationRule {
    +  id: ID
    +  name: string
    +  description: string
    +  enabled: boolean
    +  trigger: AutomationTrigger
    +  conditions: AutomationCondition[]
    +  actions: AutomationAction[]
    +  priority: number
    +}
    +
    +// 自动化触发器
    +interface AutomationTrigger {
    +  type: 'event' | 'schedule' | 'webhook' | 'manual'
    +  event?: EventType
    +  schedule?: ScheduleConfig
    +  webhook?: WebhookConfig
    +}
    +
    +// 自动化条件
    +interface AutomationCondition {
    +  field: string
    +  operator: 'equals' | 'not_equals' | 'contains' | 'greater_than' | 'less_than'
    +  value: any
    +  logicalOperator?: 'and' | 'or'
    +}
    +
    +// 自动化动作
    +interface AutomationAction {
    +  type: 'update_task' | 'send_notification' | 'create_task' | 'assign_task' | 'webhook'
    +  parameters: Record<string, any>
    +}
    +```
    +
    +## ⚡ 性能配置类型
    +
    +### PerformanceConfig - 性能配置
    +```typescript
    +interface PerformanceConfig {
    +  // 缓存配置
    +  cache: CacheConfig
    +  
    +  // 并发配置
    +  concurrency: ConcurrencyConfig
    +  
    +  // 超时配置
    +  timeout: TimeoutConfig
    +  
    +  // 监控配置
    +  monitoring: MonitoringConfig
    +  
    +  // 优化配置
    +  optimization: OptimizationConfig
    +}
    +
    +// 缓存配置
    +interface CacheConfig {
    +  enabled: boolean
    +  size: number
    +  ttl: number
    +  compression: boolean
    +  strategy: 'lru' | 'lfu' | 'fifo'
    +  levels: CacheLevelConfig[]
    +}
    +
    +// 缓存层级配置
    +interface CacheLevelConfig {
    +  name: string
    +  type: 'memory' | 'disk' | 'redis'
    +  size: number
    +  ttl: number
    +  enabled: boolean
    +}
    +
    +// 并发配置
    +interface ConcurrencyConfig {
    +  maxConcurrency: number
    +  queueSize: number
    +  timeout: number
    +  strategy: 'fifo' | 'lifo' | 'priority'
    +  adaptive: boolean
    +}
    +
    +// 超时配置
    +interface TimeoutConfig {
    +  request: number
    +  parsing: number
    +  generation: number
    +  database: number
    +  network: number
    +}
    +
    +// 监控配置
    +interface MonitoringConfig {
    +  enabled: boolean
    +  interval: number
    +  metrics: MonitoringMetric[]
    +  alerts: AlertConfig[]
    +  retention: number
    +}
    +
    +// 监控指标
    +enum MonitoringMetric {
    +  RESPONSE_TIME = 'response_time',
    +  THROUGHPUT = 'throughput',
    +  ERROR_RATE = 'error_rate',
    +  MEMORY_USAGE = 'memory_usage',
    +  CPU_USAGE = 'cpu_usage',
    +  CACHE_HIT_RATE = 'cache_hit_rate'
    +}
    +
    +// 告警配置
    +interface AlertConfig {
    +  metric: MonitoringMetric
    +  threshold: number
    +  operator: 'greater_than' | 'less_than' | 'equals'
    +  duration: number
    +  actions: AlertAction[]
    +}
    +
    +// 告警动作
    +interface AlertAction {
    +  type: 'email' | 'slack' | 'webhook' | 'log'
    +  target: string
    +  template?: string
    +}
    +```
    +
    +## 🔒 安全配置类型
    +
    +### SecurityConfig - 安全配置
    +```typescript
    +interface SecurityConfig {
    +  // 认证配置
    +  authentication: AuthenticationConfig
    +  
    +  // 授权配置
    +  authorization: AuthorizationConfig
    +  
    +  // 加密配置
    +  encryption: EncryptionConfig
    +  
    +  // 审计配置
    +  audit: AuditConfig
    +  
    +  // 访问控制
    +  accessControl: AccessControlConfig
    +}
    +
    +// 认证配置
    +interface AuthenticationConfig {
    +  enabled: boolean
    +  method: 'local' | 'oauth' | 'ldap' | 'saml'
    +  sessionTimeout: number
    +  maxLoginAttempts: number
    +  lockoutDuration: number
    +  passwordPolicy: PasswordPolicy
    +}
    +
    +// 密码策略
    +interface PasswordPolicy {
    +  minLength: number
    +  requireUppercase: boolean
    +  requireLowercase: boolean
    +  requireNumbers: boolean
    +  requireSpecialChars: boolean
    +  maxAge: number
    +  historyCount: number
    +}
    +
    +// 授权配置
    +interface AuthorizationConfig {
    +  enabled: boolean
    +  defaultRole: string
    +  roleHierarchy: RoleHierarchy[]
    +  resourcePermissions: ResourcePermission[]
    +}
    +
    +// 角色层级
    +interface RoleHierarchy {
    +  parent: string
    +  children: string[]
    +}
    +
    +// 资源权限
    +interface ResourcePermission {
    +  resource: string
    +  roles: string[]
    +  permissions: Permission[]
    +}
    +
    +// 加密配置
    +interface EncryptionConfig {
    +  enabled: boolean
    +  algorithm: 'AES-256-GCM' | 'AES-256-CBC' | 'ChaCha20-Poly1305'
    +  keyRotation: boolean
    +  keyRotationInterval: number
    +  encryptApiKeys: boolean
    +  encryptDatabase: boolean
    +}
    +
    +// 审计配置
    +interface AuditConfig {
    +  enabled: boolean
    +  logLevel: 'minimal' | 'standard' | 'detailed'
    +  retention: number
    +  storage: 'file' | 'database' | 'external'
    +  events: AuditEvent[]
    +}
    +
    +// 审计事件
    +enum AuditEvent {
    +  LOGIN = 'login',
    +  LOGOUT = 'logout',
    +  TASK_CREATE = 'task_create',
    +  TASK_UPDATE = 'task_update',
    +  TASK_DELETE = 'task_delete',
    +  CONFIG_CHANGE = 'config_change',
    +  PERMISSION_CHANGE = 'permission_change'
    +}
    +```
    +
    +## 🌐 网络配置类型
    +
    +### NetworkConfig - 网络配置
    +```typescript
    +interface NetworkConfig {
    +  // 代理配置
    +  proxy: ProxyConfig
    +  
    +  // SSL配置
    +  ssl: SSLConfig
    +  
    +  // 重试配置
    +  retry: RetryConfig
    +  
    +  // 连接池配置
    +  connectionPool: ConnectionPoolConfig
    +  
    +  // 限流配置
    +  rateLimit: RateLimitConfig
    +}
    +
    +// 重试配置
    +interface RetryConfig {
    +  enabled: boolean
    +  maxAttempts: number
    +  initialDelay: number
    +  maxDelay: number
    +  backoffStrategy: 'linear' | 'exponential' | 'fixed'
    +  retryableErrors: string[]
    +}
    +
    +// 连接池配置
    +interface ConnectionPoolConfig {
    +  maxConnections: number
    +  maxIdleConnections: number
    +  idleTimeout: number
    +  connectionTimeout: number
    +  keepAlive: boolean
    +}
    +
    +// 限流配置
    +interface RateLimitConfig {
    +  enabled: boolean
    +  requestsPerSecond: number
    +  burstSize: number
    +  strategy: 'token_bucket' | 'sliding_window' | 'fixed_window'
    +}
    +```
    +
    +## 📊 集成配置类型
    +
    +### IntegrationConfig - 集成配置
    +```typescript
    +interface IntegrationConfig {
    +  // 第三方集成
    +  thirdParty: ThirdPartyIntegration[]
    +  
    +  // Webhook配置
    +  webhooks: WebhookConfig[]
    +  
    +  // API配置
    +  api: APIConfig
    +  
    +  // 导入导出配置
    +  importExport: ImportExportConfig
    +}
    +
    +// 第三方集成
    +interface ThirdPartyIntegration {
    +  name: string
    +  type: 'jira' | 'github' | 'slack' | 'teams' | 'trello' | 'asana'
    +  enabled: boolean
    +  config: Record<string, any>
    +  syncEnabled: boolean
    +  syncInterval: number
    +  mapping: FieldMapping[]
    +}
    +
    +// 字段映射
    +interface FieldMapping {
    +  localField: string
    +  remoteField: string
    +  transformation?: string
    +  required: boolean
    +}
    +
    +// Webhook配置
    +interface WebhookConfig {
    +  id: ID
    +  name: string
    +  url: string
    +  events: EventType[]
    +  headers: Record<string, string>
    +  secret?: string
    +  enabled: boolean
    +  retryPolicy: RetryConfig
    +}
    +
    +// API配置
    +interface APIConfig {
    +  enabled: boolean
    +  port: number
    +  host: string
    +  cors: CORSConfig
    +  authentication: boolean
    +  rateLimit: RateLimitConfig
    +  documentation: boolean
    +}
    +
    +// CORS配置
    +interface CORSConfig {
    +  enabled: boolean
    +  origins: string[]
    +  methods: string[]
    +  headers: string[]
    +  credentials: boolean
    +}
    +```
    +
    +## 📋 配置验证类型
    +
    +### ConfigValidation - 配置验证
    +```typescript
    +interface ConfigValidation {
    +  schema: ConfigSchema
    +  rules: ValidationRule[]
    +  customValidators: CustomValidator[]
    +}
    +
    +// 配置模式
    +interface ConfigSchema {
    +  type: 'object'
    +  properties: Record<string, ConfigPropertySchema>
    +  required: string[]
    +  additionalProperties: boolean
    +}
    +
    +// 配置属性模式
    +interface ConfigPropertySchema {
    +  type: 'string' | 'number' | 'boolean' | 'object' | 'array'
    +  description?: string
    +  default?: any
    +  enum?: any[]
    +  minimum?: number
    +  maximum?: number
    +  pattern?: string
    +  items?: ConfigPropertySchema
    +  properties?: Record<string, ConfigPropertySchema>
    +}
    +
    +// 自定义验证器
    +interface CustomValidator {
    +  name: string
    +  description: string
    +  validator: (value: any, config: ProjectConfig) => ValidationResult
    +}
    +```
    +
    +## 🔧 配置管理类型
    +
    +### ConfigManager - 配置管理器类型
    +```typescript
    +// 配置操作选项
    +interface ConfigOperationOptions {
    +  validate?: boolean
    +  backup?: boolean
    +  notify?: boolean
    +  merge?: boolean
    +  overwrite?: boolean
    +}
    +
    +// 配置模板
    +interface ConfigTemplate {
    +  name: string
    +  description: string
    +  version: string
    +  config: Partial<ProjectConfig>
    +  metadata: ConfigTemplateMetadata
    +}
    +
    +// 配置模板元数据
    +interface ConfigTemplateMetadata {
    +  author: string
    +  createdAt: Timestamp
    +  tags: string[]
    +  category: string
    +  compatibility: string[]
    +  dependencies: string[]
    +}
    +
    +// 配置备份
    +interface ConfigBackup {
    +  id: ID
    +  timestamp: Timestamp
    +  config: ProjectConfig
    +  reason: string
    +  createdBy: string
    +  size: number
    +}
    +
    +// 配置差异
    +interface ConfigDiff {
    +  added: ConfigChange[]
    +  modified: ConfigChange[]
    +  removed: ConfigChange[]
    +}
    +
    +// 配置变更
    +interface ConfigChange {
    +  path: string
    +  oldValue?: any
    +  newValue?: any
    +  type: 'added' | 'modified' | 'removed'
    +}
    +```
    +
    +## 📚 相关文档
    +
    +- [核心类型](./core.md) - 基础类型定义
    +- [任务类型](./task.md) - 任务相关类型
    +- [模型类型](./model.md) - AI模型相关类型
    +- [配置管理 API](../config-manager.md) - 配置管理接口
    
  • docs/api/types/core.md+565 0 added
    @@ -0,0 +1,565 @@
    +# 核心类型定义
    +
    +## 概述
    +
    +本文档定义了TaskFlow AI的核心类型,包括基础数据结构、枚举类型和接口定义。
    +
    +## 🏗️ 基础类型
    +
    +### ID类型
    +```typescript
    +// 唯一标识符类型
    +type ID = string
    +
    +// 时间戳类型
    +type Timestamp = number | Date
    +
    +// 版本号类型
    +type Version = string
    +```
    +
    +### 通用接口
    +```typescript
    +// 基础实体接口
    +interface BaseEntity {
    +  id: ID
    +  createdAt: Timestamp
    +  updatedAt: Timestamp
    +  version: Version
    +}
    +
    +// 可命名实体接口
    +interface NamedEntity extends BaseEntity {
    +  name: string
    +  description?: string
    +}
    +
    +// 可标记实体接口
    +interface TaggableEntity {
    +  tags: string[]
    +  category?: string
    +}
    +```
    +
    +## 📊 结果类型
    +
    +### 操作结果
    +```typescript
    +// 通用操作结果
    +interface Result<T = any> {
    +  success: boolean
    +  data?: T
    +  error?: Error
    +  message?: string
    +  timestamp: Timestamp
    +}
    +
    +// 异步操作结果
    +type AsyncResult<T = any> = Promise<Result<T>>
    +
    +// 分页结果
    +interface PaginatedResult<T = any> extends Result<T[]> {
    +  pagination: {
    +    page: number
    +    limit: number
    +    total: number
    +    hasNext: boolean
    +    hasPrev: boolean
    +  }
    +}
    +```
    +
    +### 验证结果
    +```typescript
    +// 验证结果
    +interface ValidationResult {
    +  isValid: boolean
    +  errors: ValidationError[]
    +  warnings: ValidationWarning[]
    +  suggestions: string[]
    +}
    +
    +// 验证错误
    +interface ValidationError {
    +  field: string
    +  message: string
    +  code: string
    +  severity: 'error' | 'warning' | 'info'
    +}
    +
    +// 验证警告
    +interface ValidationWarning {
    +  field: string
    +  message: string
    +  suggestion?: string
    +}
    +```
    +
    +## 🔧 配置类型
    +
    +### 基础配置
    +```typescript
    +// 配置项接口
    +interface ConfigItem<T = any> {
    +  key: string
    +  value: T
    +  type: ConfigType
    +  required: boolean
    +  default?: T
    +  description?: string
    +  validation?: ValidationRule[]
    +}
    +
    +// 配置类型枚举
    +enum ConfigType {
    +  STRING = 'string',
    +  NUMBER = 'number',
    +  BOOLEAN = 'boolean',
    +  OBJECT = 'object',
    +  ARRAY = 'array'
    +}
    +
    +// 验证规则
    +interface ValidationRule {
    +  type: 'required' | 'min' | 'max' | 'pattern' | 'custom'
    +  value?: any
    +  message?: string
    +  validator?: (value: any) => boolean
    +}
    +```
    +
    +### 环境配置
    +```typescript
    +// 环境类型
    +enum Environment {
    +  DEVELOPMENT = 'development',
    +  TESTING = 'testing',
    +  STAGING = 'staging',
    +  PRODUCTION = 'production'
    +}
    +
    +// 环境配置
    +interface EnvironmentConfig {
    +  name: Environment
    +  debug: boolean
    +  logging: LoggingConfig
    +  performance: PerformanceConfig
    +  security: SecurityConfig
    +}
    +```
    +
    +## 📝 日志类型
    +
    +### 日志级别
    +```typescript
    +enum LogLevel {
    +  DEBUG = 'debug',
    +  INFO = 'info',
    +  WARN = 'warn',
    +  ERROR = 'error',
    +  FATAL = 'fatal'
    +}
    +
    +// 日志条目
    +interface LogEntry {
    +  timestamp: Timestamp
    +  level: LogLevel
    +  message: string
    +  context?: Record<string, any>
    +  error?: Error
    +  source?: string
    +  requestId?: string
    +}
    +
    +// 日志配置
    +interface LoggingConfig {
    +  level: LogLevel
    +  file?: string
    +  maxSize?: string
    +  maxFiles?: number
    +  format?: 'json' | 'text'
    +  console?: boolean
    +}
    +```
    +
    +## 🚨 错误类型
    +
    +### 错误基类
    +```typescript
    +// 基础错误类
    +abstract class BaseError extends Error {
    +  abstract readonly code: string
    +  abstract readonly category: ErrorCategory
    +  readonly timestamp: Timestamp
    +  readonly context?: Record<string, any>
    +
    +  constructor(message: string, context?: Record<string, any>) {
    +    super(message)
    +    this.name = this.constructor.name
    +    this.timestamp = Date.now()
    +    this.context = context
    +  }
    +}
    +
    +// 错误类别
    +enum ErrorCategory {
    +  CONFIGURATION = 'configuration',
    +  PARSING = 'parsing',
    +  NETWORK = 'network',
    +  FILE = 'file',
    +  MODEL = 'model',
    +  TASK = 'task',
    +  PERMISSION = 'permission',
    +  SYSTEM = 'system'
    +}
    +```
    +
    +### 具体错误类型
    +```typescript
    +// 配置错误
    +class ConfigurationError extends BaseError {
    +  readonly code = 'TF-CF-001'
    +  readonly category = ErrorCategory.CONFIGURATION
    +}
    +
    +// 解析错误
    +class ParsingError extends BaseError {
    +  readonly code = 'TF-PR-001'
    +  readonly category = ErrorCategory.PARSING
    +}
    +
    +// 网络错误
    +class NetworkError extends BaseError {
    +  readonly code = 'TF-NW-001'
    +  readonly category = ErrorCategory.NETWORK
    +}
    +```
    +
    +## 📊 性能类型
    +
    +### 性能指标
    +```typescript
    +// 性能指标
    +interface PerformanceMetrics {
    +  responseTime: number
    +  throughput: number
    +  errorRate: number
    +  successRate: number
    +  cacheHitRate: number
    +  memoryUsage: number
    +  cpuUsage: number
    +}
    +
    +// 性能配置
    +interface PerformanceConfig {
    +  cacheSize: number
    +  timeout: number
    +  maxConcurrency: number
    +  retryAttempts: number
    +  enableMonitoring: boolean
    +}
    +```
    +
    +### 监控类型
    +```typescript
    +// 监控状态
    +enum MonitoringStatus {
    +  HEALTHY = 'healthy',
    +  WARNING = 'warning',
    +  CRITICAL = 'critical',
    +  UNKNOWN = 'unknown'
    +}
    +
    +// 健康检查结果
    +interface HealthStatus {
    +  status: MonitoringStatus
    +  timestamp: Timestamp
    +  checks: HealthCheck[]
    +  uptime: number
    +}
    +
    +// 健康检查项
    +interface HealthCheck {
    +  name: string
    +  status: MonitoringStatus
    +  message?: string
    +  duration: number
    +  metadata?: Record<string, any>
    +}
    +```
    +
    +## 🔒 安全类型
    +
    +### 权限类型
    +```typescript
    +// 权限枚举
    +enum Permission {
    +  READ = 'read',
    +  WRITE = 'write',
    +  DELETE = 'delete',
    +  ADMIN = 'admin'
    +}
    +
    +// 角色定义
    +interface Role {
    +  id: ID
    +  name: string
    +  permissions: Permission[]
    +  description?: string
    +}
    +
    +// 用户类型
    +interface User {
    +  id: ID
    +  name: string
    +  email: string
    +  roles: Role[]
    +  active: boolean
    +  lastLogin?: Timestamp
    +}
    +```
    +
    +### 安全配置
    +```typescript
    +// 安全配置
    +interface SecurityConfig {
    +  encryptApiKeys: boolean
    +  auditLog: boolean
    +  accessControl: boolean
    +  sessionTimeout: number
    +  maxLoginAttempts: number
    +}
    +
    +// 审计日志条目
    +interface AuditLogEntry {
    +  timestamp: Timestamp
    +  userId: ID
    +  action: string
    +  resource: string
    +  result: 'success' | 'failure'
    +  details?: Record<string, any>
    +  ipAddress?: string
    +  userAgent?: string
    +}
    +```
    +
    +## 🌐 网络类型
    +
    +### HTTP类型
    +```typescript
    +// HTTP方法
    +enum HttpMethod {
    +  GET = 'GET',
    +  POST = 'POST',
    +  PUT = 'PUT',
    +  DELETE = 'DELETE',
    +  PATCH = 'PATCH'
    +}
    +
    +// HTTP状态码
    +enum HttpStatusCode {
    +  OK = 200,
    +  CREATED = 201,
    +  BAD_REQUEST = 400,
    +  UNAUTHORIZED = 401,
    +  FORBIDDEN = 403,
    +  NOT_FOUND = 404,
    +  INTERNAL_SERVER_ERROR = 500
    +}
    +
    +// HTTP请求
    +interface HttpRequest {
    +  method: HttpMethod
    +  url: string
    +  headers?: Record<string, string>
    +  body?: any
    +  timeout?: number
    +}
    +
    +// HTTP响应
    +interface HttpResponse<T = any> {
    +  status: HttpStatusCode
    +  headers: Record<string, string>
    +  data: T
    +  duration: number
    +}
    +```
    +
    +### 网络配置
    +```typescript
    +// 网络配置
    +interface NetworkConfig {
    +  timeout: number
    +  retryAttempts: number
    +  proxy?: ProxyConfig
    +  ssl?: SSLConfig
    +  keepAlive: boolean
    +}
    +
    +// 代理配置
    +interface ProxyConfig {
    +  http?: string
    +  https?: string
    +  auth?: string
    +  noProxy?: string[]
    +}
    +
    +// SSL配置
    +interface SSLConfig {
    +  verify: boolean
    +  caPath?: string
    +  certPath?: string
    +  keyPath?: string
    +}
    +```
    +
    +## 📅 时间类型
    +
    +### 时间范围
    +```typescript
    +// 时间范围
    +interface TimeRange {
    +  start: Timestamp
    +  end: Timestamp
    +}
    +
    +// 时间段
    +enum TimePeriod {
    +  HOUR = 'hour',
    +  DAY = 'day',
    +  WEEK = 'week',
    +  MONTH = 'month',
    +  QUARTER = 'quarter',
    +  YEAR = 'year'
    +}
    +
    +// 调度配置
    +interface ScheduleConfig {
    +  enabled: boolean
    +  cron?: string
    +  interval?: number
    +  timezone?: string
    +}
    +```
    +
    +## 🔄 事件类型
    +
    +### 事件系统
    +```typescript
    +// 事件类型
    +enum EventType {
    +  TASK_CREATED = 'task:created',
    +  TASK_UPDATED = 'task:updated',
    +  TASK_COMPLETED = 'task:completed',
    +  PRD_PARSED = 'prd:parsed',
    +  MODEL_SELECTED = 'model:selected',
    +  ERROR_OCCURRED = 'error:occurred'
    +}
    +
    +// 事件数据
    +interface Event<T = any> {
    +  type: EventType
    +  timestamp: Timestamp
    +  source: string
    +  data: T
    +  metadata?: Record<string, any>
    +}
    +
    +// 事件处理器
    +type EventHandler<T = any> = (event: Event<T>) => void | Promise<void>
    +
    +// 事件发射器接口
    +interface EventEmitter {
    +  on<T>(eventType: EventType, handler: EventHandler<T>): void
    +  off<T>(eventType: EventType, handler: EventHandler<T>): void
    +  emit<T>(eventType: EventType, data: T): void
    +}
    +```
    +
    +## 🔌 插件类型
    +
    +### 插件系统
    +```typescript
    +// 插件接口
    +interface Plugin {
    +  name: string
    +  version: Version
    +  description?: string
    +  author?: string
    +  dependencies?: string[]
    +  
    +  initialize(context: PluginContext): Promise<void>
    +  execute(input: any): Promise<any>
    +  cleanup(): Promise<void>
    +}
    +
    +// 插件上下文
    +interface PluginContext {
    +  config: Record<string, any>
    +  logger: Logger
    +  events: EventEmitter
    +  storage: Storage
    +}
    +
    +// 插件状态
    +enum PluginStatus {
    +  INSTALLED = 'installed',
    +  ACTIVE = 'active',
    +  INACTIVE = 'inactive',
    +  ERROR = 'error'
    +}
    +```
    +
    +## 📦 存储类型
    +
    +### 存储接口
    +```typescript
    +// 存储接口
    +interface Storage {
    +  get<T>(key: string): Promise<T | null>
    +  set<T>(key: string, value: T): Promise<void>
    +  delete(key: string): Promise<void>
    +  exists(key: string): Promise<boolean>
    +  clear(): Promise<void>
    +  keys(): Promise<string[]>
    +}
    +
    +// 缓存接口
    +interface Cache extends Storage {
    +  ttl(key: string): Promise<number>
    +  expire(key: string, ttl: number): Promise<void>
    +  size(): Promise<number>
    +}
    +```
    +
    +## 🎯 工具类型
    +
    +### 实用类型
    +```typescript
    +// 深度部分类型
    +type DeepPartial<T> = {
    +  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]
    +}
    +
    +// 必需字段类型
    +type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>
    +
    +// 可选字段类型
    +type OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
    +
    +// 键值对类型
    +type KeyValuePair<T = any> = {
    +  key: string
    +  value: T
    +}
    +
    +// 字典类型
    +type Dictionary<T = any> = Record<string, T>
    +```
    +
    +## 📚 相关文档
    +
    +- [任务类型](./task.md) - 任务相关类型定义
    +- [配置类型](./config.md) - 配置相关类型定义
    +- [模型类型](./model.md) - AI模型相关类型定义
    +- [API文档](../) - 完整API接口文档
    
  • docs/api/types/model.md+606 0 added
    @@ -0,0 +1,606 @@
    +# 模型类型定义
    +
    +## 概述
    +
    +本文档定义了TaskFlow AI中AI模型相关的所有类型,包括模型定义、处理选项、结果类型等。
    +
    +## 🤖 AI模型核心类型
    +
    +### AIModel - AI模型定义
    +```typescript
    +interface AIModel extends BaseEntity {
    +  // 基本信息
    +  id: ID
    +  name: string
    +  provider: ModelProvider
    +  version?: string
    +  description?: string
    +  
    +  // 连接信息
    +  endpoint: string
    +  apiKey: string
    +  headers?: Record<string, string>
    +  
    +  // 能力描述
    +  capabilities: ModelCapability[]
    +  supportedTasks: string[]
    +  languages: string[]
    +  
    +  // 限制和配额
    +  limits: ModelLimits
    +  
    +  // 定价信息
    +  pricing?: ModelPricing
    +  
    +  // 状态信息
    +  status: ModelStatus
    +  currentLoad: number
    +  lastHealthCheck: Timestamp
    +  
    +  // 配置参数
    +  defaultParams: ModelParameters
    +  
    +  // 性能指标
    +  performance: ModelPerformance
    +}
    +
    +// 模型提供商
    +enum ModelProvider {
    +  DEEPSEEK = 'deepseek',
    +  ZHIPU = 'zhipu',
    +  QWEN = 'qwen',
    +  BAIDU = 'baidu',
    +  OPENAI = 'openai',
    +  ANTHROPIC = 'anthropic',
    +  CUSTOM = 'custom'
    +}
    +
    +// 模型能力
    +enum ModelCapability {
    +  TEXT_GENERATION = 'text-generation',
    +  CODE_ANALYSIS = 'code-analysis',
    +  REASONING = 'reasoning',
    +  CHINESE_UNDERSTANDING = 'chinese-understanding',
    +  ENGLISH_UNDERSTANDING = 'english-understanding',
    +  MULTIMODAL = 'multimodal',
    +  FUNCTION_CALLING = 'function-calling',
    +  JSON_MODE = 'json-mode'
    +}
    +
    +// 模型状态
    +enum ModelStatus {
    +  ACTIVE = 'active',
    +  INACTIVE = 'inactive',
    +  MAINTENANCE = 'maintenance',
    +  ERROR = 'error',
    +  DEPRECATED = 'deprecated'
    +}
    +```
    +
    +## 📊 模型性能类型
    +
    +### ModelPerformance - 模型性能
    +```typescript
    +interface ModelPerformance {
    +  // 响应时间指标
    +  responseTime: ResponseTimeMetrics
    +  
    +  // 质量指标
    +  quality: QualityMetrics
    +  
    +  // 可靠性指标
    +  reliability: ReliabilityMetrics
    +  
    +  // 成本指标
    +  cost: CostMetrics
    +  
    +  // 使用统计
    +  usage: UsageMetrics
    +}
    +
    +// 响应时间指标
    +interface ResponseTimeMetrics {
    +  average: number
    +  median: number
    +  p95: number
    +  p99: number
    +  min: number
    +  max: number
    +  lastUpdated: Timestamp
    +}
    +
    +// 质量指标
    +interface QualityMetrics {
    +  accuracy: number
    +  relevance: number
    +  completeness: number
    +  consistency: number
    +  confidence: number
    +  userRating: number
    +  lastEvaluated: Timestamp
    +}
    +
    +// 可靠性指标
    +interface ReliabilityMetrics {
    +  uptime: number
    +  successRate: number
    +  errorRate: number
    +  timeoutRate: number
    +  retryRate: number
    +  lastIncident?: Timestamp
    +}
    +
    +// 成本指标
    +interface CostMetrics {
    +  costPerRequest: number
    +  costPerToken: number
    +  totalCost: number
    +  costEfficiency: number
    +  budgetUtilization: number
    +  period: TimePeriod
    +}
    +
    +// 使用统计
    +interface UsageMetrics {
    +  totalRequests: number
    +  totalTokens: number
    +  activeUsers: number
    +  requestsPerDay: number
    +  tokensPerDay: number
    +  peakUsage: number
    +  period: TimePeriod
    +}
    +```
    +
    +## 🔧 处理选项类型
    +
    +### ProcessingOptions - 处理选项
    +```typescript
    +interface ProcessingOptions {
    +  // 任务类型
    +  task: ProcessingTask
    +  
    +  // 模型选择
    +  preferredModel?: string
    +  fallbackModels?: string[]
    +  multiModel?: boolean
    +  models?: string[]
    +  
    +  // 处理参数
    +  parameters?: ModelParameters
    +  
    +  // 质量控制
    +  qualityControl?: QualityControlOptions
    +  
    +  // 缓存控制
    +  cache?: CacheOptions
    +  
    +  // 回调函数
    +  callbacks?: ProcessingCallbacks
    +  
    +  // 元数据
    +  metadata?: Record<string, any>
    +}
    +
    +// 处理任务类型
    +enum ProcessingTask {
    +  PRD_ANALYSIS = 'prd-analysis',
    +  TASK_GENERATION = 'task-generation',
    +  CODE_ANALYSIS = 'code-analysis',
    +  BUSINESS_ANALYSIS = 'business-analysis',
    +  REQUIREMENT_EXTRACTION = 'requirement-extraction',
    +  DEPENDENCY_ANALYSIS = 'dependency-analysis',
    +  PRIORITY_ASSESSMENT = 'priority-assessment'
    +}
    +
    +// 质量控制选项
    +interface QualityControlOptions {
    +  compareResults?: boolean
    +  minConfidence?: number
    +  maxRetries?: number
    +  validationRules?: ValidationRule[]
    +  qualityThreshold?: number
    +}
    +
    +// 缓存选项
    +interface CacheOptions {
    +  useCache?: boolean
    +  cacheKey?: string
    +  cacheTTL?: number
    +  cacheStrategy?: 'aggressive' | 'conservative' | 'disabled'
    +}
    +
    +// 处理回调
    +interface ProcessingCallbacks {
    +  onProgress?: (progress: ProcessingProgress) => void
    +  onModelSelected?: (modelId: string) => void
    +  onError?: (error: ProcessingError) => void
    +  onComplete?: (result: ProcessingResult) => void
    +}
    +```
    +
    +## 📈 处理结果类型
    +
    +### ProcessingResult - 处理结果
    +```typescript
    +interface ProcessingResult {
    +  // 基本结果
    +  success: boolean
    +  content: string
    +  
    +  // 模型信息
    +  modelUsed: string
    +  modelsAttempted: string[]
    +  
    +  // 性能指标
    +  processingTime: number
    +  tokenUsage: TokenUsage
    +  
    +  // 质量指标
    +  confidence: number
    +  quality: QualityMetrics
    +  
    +  // 成本信息
    +  cost: CostBreakdown
    +  
    +  // 元数据
    +  metadata: ProcessingMetadata
    +  
    +  // 错误信息
    +  errors?: ProcessingError[]
    +  warnings?: ProcessingWarning[]
    +  
    +  // 对比结果(多模型时)
    +  comparisons?: ModelComparison[]
    +}
    +
    +// Token使用情况
    +interface TokenUsage {
    +  input: number
    +  output: number
    +  total: number
    +  cached?: number
    +}
    +
    +// 成本分解
    +interface CostBreakdown {
    +  amount: number
    +  currency: string
    +  inputCost: number
    +  outputCost: number
    +  fixedCost?: number
    +  breakdown: CostItem[]
    +}
    +
    +// 成本项目
    +interface CostItem {
    +  type: 'input_tokens' | 'output_tokens' | 'request' | 'cache'
    +  quantity: number
    +  unitPrice: number
    +  amount: number
    +}
    +
    +// 处理元数据
    +interface ProcessingMetadata {
    +  requestId: string
    +  timestamp: Timestamp
    +  version: string
    +  environment: Environment
    +  userAgent?: string
    +  sessionId?: string
    +}
    +
    +// 模型对比结果
    +interface ModelComparison {
    +  modelId: string
    +  confidence: number
    +  quality: number
    +  responseTime: number
    +  cost: number
    +  selected: boolean
    +  reason?: string
    +}
    +```
    +
    +## 🚨 错误和警告类型
    +
    +### ProcessingError - 处理错误
    +```typescript
    +interface ProcessingError extends BaseError {
    +  // 错误分类
    +  category: ProcessingErrorCategory
    +  
    +  // 模型相关
    +  modelId?: string
    +  
    +  // 重试信息
    +  retryable: boolean
    +  retryCount: number
    +  
    +  // 恢复建议
    +  recovery?: RecoveryAction[]
    +}
    +
    +// 处理错误类别
    +enum ProcessingErrorCategory {
    +  MODEL_ERROR = 'model_error',
    +  NETWORK_ERROR = 'network_error',
    +  TIMEOUT_ERROR = 'timeout_error',
    +  QUOTA_ERROR = 'quota_error',
    +  VALIDATION_ERROR = 'validation_error',
    +  PARSING_ERROR = 'parsing_error'
    +}
    +
    +// 恢复动作
    +interface RecoveryAction {
    +  type: 'retry' | 'fallback' | 'manual' | 'ignore'
    +  description: string
    +  parameters?: Record<string, any>
    +}
    +
    +// 处理警告
    +interface ProcessingWarning {
    +  type: 'quality' | 'performance' | 'cost' | 'compatibility'
    +  message: string
    +  severity: 'low' | 'medium' | 'high'
    +  suggestion?: string
    +}
    +```
    +
    +## 🔄 模型编排类型
    +
    +### ModelOrchestration - 模型编排
    +```typescript
    +interface ModelOrchestration {
    +  // 选择策略
    +  selectionStrategy: ModelSelectionStrategy
    +  
    +  // 负载均衡
    +  loadBalancing: LoadBalancingConfig
    +  
    +  // 故障转移
    +  failover: FailoverConfig
    +  
    +  // 性能优化
    +  optimization: OptimizationConfig
    +}
    +
    +// 负载均衡配置
    +interface LoadBalancingConfig {
    +  enabled: boolean
    +  algorithm: 'round_robin' | 'weighted' | 'least_connections' | 'response_time'
    +  weights?: Record<string, number>
    +  healthCheck: boolean
    +}
    +
    +// 故障转移配置
    +interface FailoverConfig {
    +  enabled: boolean
    +  maxRetries: number
    +  retryDelay: number
    +  fallbackModels: string[]
    +  circuitBreaker: CircuitBreakerConfig
    +}
    +
    +// 断路器配置
    +interface CircuitBreakerConfig {
    +  enabled: boolean
    +  failureThreshold: number
    +  recoveryTimeout: number
    +  halfOpenMaxCalls: number
    +}
    +
    +// 优化配置
    +interface OptimizationConfig {
    +  caching: boolean
    +  batching: boolean
    +  compression: boolean
    +  parallelization: boolean
    +  adaptiveTimeout: boolean
    +}
    +```
    +
    +## 📊 模型监控类型
    +
    +### ModelMonitoring - 模型监控
    +```typescript
    +interface ModelMonitoring {
    +  // 健康检查
    +  healthCheck: HealthCheckConfig
    +  
    +  // 性能监控
    +  performanceMonitoring: PerformanceMonitoringConfig
    +  
    +  // 使用监控
    +  usageMonitoring: UsageMonitoringConfig
    +  
    +  // 告警配置
    +  alerting: AlertingConfig
    +}
    +
    +// 健康检查配置
    +interface HealthCheckConfig {
    +  enabled: boolean
    +  interval: number
    +  timeout: number
    +  retries: number
    +  endpoints: HealthCheckEndpoint[]
    +}
    +
    +// 健康检查端点
    +interface HealthCheckEndpoint {
    +  name: string
    +  url: string
    +  method: HttpMethod
    +  expectedStatus: number
    +  timeout: number
    +}
    +
    +// 性能监控配置
    +interface PerformanceMonitoringConfig {
    +  enabled: boolean
    +  metrics: PerformanceMetric[]
    +  samplingRate: number
    +  aggregationWindow: number
    +  retention: number
    +}
    +
    +// 性能指标
    +enum PerformanceMetric {
    +  RESPONSE_TIME = 'response_time',
    +  THROUGHPUT = 'throughput',
    +  ERROR_RATE = 'error_rate',
    +  TOKEN_RATE = 'token_rate',
    +  COST_RATE = 'cost_rate',
    +  QUALITY_SCORE = 'quality_score'
    +}
    +
    +// 使用监控配置
    +interface UsageMonitoringConfig {
    +  enabled: boolean
    +  trackUsers: boolean
    +  trackSessions: boolean
    +  trackCosts: boolean
    +  aggregationLevel: 'request' | 'session' | 'user' | 'day'
    +}
    +
    +// 告警配置
    +interface AlertingConfig {
    +  enabled: boolean
    +  rules: AlertRule[]
    +  channels: AlertChannel[]
    +  escalation: EscalationPolicy[]
    +}
    +
    +// 告警规则
    +interface AlertRule {
    +  id: ID
    +  name: string
    +  metric: PerformanceMetric
    +  condition: AlertCondition
    +  threshold: number
    +  duration: number
    +  severity: 'low' | 'medium' | 'high' | 'critical'
    +}
    +
    +// 告警条件
    +enum AlertCondition {
    +  GREATER_THAN = 'greater_than',
    +  LESS_THAN = 'less_than',
    +  EQUALS = 'equals',
    +  NOT_EQUALS = 'not_equals',
    +  CHANGE_RATE = 'change_rate'
    +}
    +
    +// 告警渠道
    +interface AlertChannel {
    +  type: 'email' | 'slack' | 'webhook' | 'sms'
    +  config: Record<string, any>
    +  enabled: boolean
    +}
    +
    +// 升级策略
    +interface EscalationPolicy {
    +  level: number
    +  delay: number
    +  channels: string[]
    +  conditions: string[]
    +}
    +```
    +
    +## 🧪 模型测试类型
    +
    +### ModelTesting - 模型测试
    +```typescript
    +interface ModelTesting {
    +  // 基准测试
    +  benchmark: BenchmarkConfig
    +  
    +  // A/B测试
    +  abTesting: ABTestConfig
    +  
    +  // 回归测试
    +  regressionTesting: RegressionTestConfig
    +  
    +  // 性能测试
    +  performanceTesting: PerformanceTestConfig
    +}
    +
    +// 基准测试配置
    +interface BenchmarkConfig {
    +  enabled: boolean
    +  testSuites: TestSuite[]
    +  baseline: string
    +  metrics: BenchmarkMetric[]
    +  schedule: ScheduleConfig
    +}
    +
    +// 测试套件
    +interface TestSuite {
    +  name: string
    +  description: string
    +  testCases: TestCase[]
    +  expectedResults: ExpectedResult[]
    +}
    +
    +// 基准测试指标
    +enum BenchmarkMetric {
    +  ACCURACY = 'accuracy',
    +  RESPONSE_TIME = 'response_time',
    +  THROUGHPUT = 'throughput',
    +  COST_EFFICIENCY = 'cost_efficiency',
    +  QUALITY_SCORE = 'quality_score'
    +}
    +
    +// A/B测试配置
    +interface ABTestConfig {
    +  enabled: boolean
    +  experiments: ABExperiment[]
    +  trafficSplit: TrafficSplit
    +  duration: number
    +  successMetrics: string[]
    +}
    +
    +// A/B实验
    +interface ABExperiment {
    +  id: ID
    +  name: string
    +  description: string
    +  controlModel: string
    +  treatmentModel: string
    +  hypothesis: string
    +  status: ExperimentStatus
    +}
    +
    +// 实验状态
    +enum ExperimentStatus {
    +  DRAFT = 'draft',
    +  RUNNING = 'running',
    +  PAUSED = 'paused',
    +  COMPLETED = 'completed',
    +  CANCELLED = 'cancelled'
    +}
    +
    +// 流量分配
    +interface TrafficSplit {
    +  control: number
    +  treatment: number
    +  rampUp?: RampUpConfig
    +}
    +
    +// 渐进式发布配置
    +interface RampUpConfig {
    +  enabled: boolean
    +  initialPercentage: number
    +  incrementPercentage: number
    +  incrementInterval: number
    +  maxPercentage: number
    +}
    +```
    +
    +## 📚 相关文档
    +
    +- [核心类型](./core.md) - 基础类型定义
    +- [任务类型](./task.md) - 任务相关类型
    +- [配置类型](./config.md) - 配置相关类型
    +- [AI编排器 API](../ai-orchestrator.md) - AI模型管理接口
    
  • docs/api/types/task.md+597 0 added
    @@ -0,0 +1,597 @@
    +# 任务类型定义
    +
    +## 概述
    +
    +本文档定义了TaskFlow AI中任务管理相关的所有类型,包括任务实体、状态、优先级、依赖关系等。
    +
    +## 📋 任务核心类型
    +
    +### Task - 任务实体
    +```typescript
    +interface Task extends BaseEntity, NamedEntity, TaggableEntity {
    +  // 基本信息
    +  id: ID
    +  name: string
    +  description: string
    +  
    +  // 状态信息
    +  status: TaskStatus
    +  priority: TaskPriority
    +  
    +  // 分配信息
    +  assignee?: string
    +  team?: string
    +  reporter?: string
    +  
    +  // 时间信息
    +  estimatedHours: number
    +  actualHours?: number
    +  startDate?: Timestamp
    +  endDate?: Timestamp
    +  dueDate?: Timestamp
    +  
    +  // 依赖关系
    +  dependencies: ID[]
    +  dependents: ID[]
    +  blockers: ID[]
    +  
    +  // 分类和标签
    +  category?: string
    +  tags: string[]
    +  labels: TaskLabel[]
    +  
    +  // 验收标准
    +  acceptanceCriteria: AcceptanceCriterion[]
    +  
    +  // 备注和历史
    +  comments: TaskComment[]
    +  history: TaskHistoryEntry[]
    +  attachments: TaskAttachment[]
    +  
    +  // 进度信息
    +  progress: TaskProgress
    +  
    +  // 元数据
    +  metadata: TaskMetadata
    +}
    +```
    +
    +## 🏷️ 任务状态类型
    +
    +### TaskStatus - 任务状态
    +```typescript
    +enum TaskStatus {
    +  NOT_STARTED = 'not_started',
    +  IN_PROGRESS = 'in_progress',
    +  COMPLETED = 'completed',
    +  BLOCKED = 'blocked',
    +  CANCELLED = 'cancelled',
    +  ON_HOLD = 'on_hold',
    +  REVIEW = 'review',
    +  TESTING = 'testing'
    +}
    +
    +// 状态转换规则
    +interface TaskStatusTransition {
    +  from: TaskStatus
    +  to: TaskStatus
    +  allowed: boolean
    +  conditions?: TaskStatusCondition[]
    +  requiredPermissions?: Permission[]
    +}
    +
    +// 状态条件
    +interface TaskStatusCondition {
    +  type: 'dependency' | 'approval' | 'time' | 'custom'
    +  description: string
    +  validator: (task: Task) => boolean
    +}
    +```
    +
    +### TaskPriority - 任务优先级
    +```typescript
    +enum TaskPriority {
    +  LOW = 'low',
    +  MEDIUM = 'medium',
    +  HIGH = 'high',
    +  URGENT = 'urgent',
    +  CRITICAL = 'critical'
    +}
    +
    +// 优先级配置
    +interface TaskPriorityConfig {
    +  priority: TaskPriority
    +  color: string
    +  weight: number
    +  autoEscalation?: {
    +    enabled: boolean
    +    daysOverdue: number
    +    escalateTo: TaskPriority
    +  }
    +}
    +```
    +
    +## 🔗 依赖关系类型
    +
    +### TaskDependency - 任务依赖
    +```typescript
    +interface TaskDependency {
    +  id: ID
    +  sourceTaskId: ID
    +  targetTaskId: ID
    +  type: DependencyType
    +  description?: string
    +  createdAt: Timestamp
    +  createdBy: string
    +}
    +
    +// 依赖类型
    +enum DependencyType {
    +  FINISH_TO_START = 'finish_to_start',    // 前置任务完成后才能开始
    +  START_TO_START = 'start_to_start',      // 前置任务开始后才能开始
    +  FINISH_TO_FINISH = 'finish_to_finish',  // 前置任务完成后才能完成
    +  START_TO_FINISH = 'start_to_finish'     // 前置任务开始后才能完成
    +}
    +
    +// 依赖分析结果
    +interface DependencyAnalysis {
    +  hasCycles: boolean
    +  cycles: TaskDependencyCycle[]
    +  criticalPath: ID[]
    +  longestPath: ID[]
    +  parallelTasks: ID[][]
    +}
    +
    +// 依赖循环
    +interface TaskDependencyCycle {
    +  tasks: ID[]
    +  description: string
    +  severity: 'warning' | 'error'
    +}
    +```
    +
    +## 📊 任务进度类型
    +
    +### TaskProgress - 任务进度
    +```typescript
    +interface TaskProgress {
    +  percentage: number
    +  completedSubtasks: number
    +  totalSubtasks: number
    +  completedCriteria: number
    +  totalCriteria: number
    +  timeSpent: number
    +  timeRemaining: number
    +  velocity: number
    +  lastUpdated: Timestamp
    +}
    +
    +// 进度计算配置
    +interface ProgressCalculationConfig {
    +  method: 'manual' | 'subtasks' | 'criteria' | 'time' | 'weighted'
    +  weights?: {
    +    subtasks: number
    +    criteria: number
    +    time: number
    +  }
    +  autoUpdate: boolean
    +}
    +```
    +
    +## 💬 任务交互类型
    +
    +### TaskComment - 任务备注
    +```typescript
    +interface TaskComment extends BaseEntity {
    +  taskId: ID
    +  text: string
    +  author: string
    +  type: CommentType
    +  mentions: string[]
    +  attachments: CommentAttachment[]
    +  reactions: CommentReaction[]
    +  isEdited: boolean
    +  editedAt?: Timestamp
    +  parentCommentId?: ID
    +  replies: TaskComment[]
    +}
    +
    +// 备注类型
    +enum CommentType {
    +  GENERAL = 'general',
    +  STATUS_UPDATE = 'status_update',
    +  BLOCKER = 'blocker',
    +  QUESTION = 'question',
    +  SOLUTION = 'solution',
    +  REVIEW = 'review'
    +}
    +
    +// 备注反应
    +interface CommentReaction {
    +  emoji: string
    +  users: string[]
    +  count: number
    +}
    +```
    +
    +### TaskHistoryEntry - 任务历史
    +```typescript
    +interface TaskHistoryEntry extends BaseEntity {
    +  taskId: ID
    +  action: TaskAction
    +  field?: string
    +  oldValue?: any
    +  newValue?: any
    +  author: string
    +  description: string
    +  metadata?: Record<string, any>
    +}
    +
    +// 任务操作
    +enum TaskAction {
    +  CREATED = 'created',
    +  UPDATED = 'updated',
    +  STATUS_CHANGED = 'status_changed',
    +  ASSIGNED = 'assigned',
    +  UNASSIGNED = 'unassigned',
    +  COMMENTED = 'commented',
    +  DEPENDENCY_ADDED = 'dependency_added',
    +  DEPENDENCY_REMOVED = 'dependency_removed',
    +  ATTACHMENT_ADDED = 'attachment_added',
    +  ATTACHMENT_REMOVED = 'attachment_removed'
    +}
    +```
    +
    +## 📎 任务附件类型
    +
    +### TaskAttachment - 任务附件
    +```typescript
    +interface TaskAttachment extends BaseEntity {
    +  taskId: ID
    +  filename: string
    +  originalName: string
    +  mimeType: string
    +  size: number
    +  url: string
    +  uploadedBy: string
    +  description?: string
    +  isPublic: boolean
    +}
    +
    +// 附件类型
    +enum AttachmentType {
    +  IMAGE = 'image',
    +  DOCUMENT = 'document',
    +  SPREADSHEET = 'spreadsheet',
    +  PRESENTATION = 'presentation',
    +  ARCHIVE = 'archive',
    +  CODE = 'code',
    +  OTHER = 'other'
    +}
    +```
    +
    +## ✅ 验收标准类型
    +
    +### AcceptanceCriterion - 验收标准
    +```typescript
    +interface AcceptanceCriterion extends BaseEntity {
    +  taskId: ID
    +  title: string
    +  description: string
    +  type: CriterionType
    +  status: CriterionStatus
    +  priority: number
    +  testCases: TestCase[]
    +  verifiedBy?: string
    +  verifiedAt?: Timestamp
    +  notes?: string
    +}
    +
    +// 标准类型
    +enum CriterionType {
    +  FUNCTIONAL = 'functional',
    +  PERFORMANCE = 'performance',
    +  SECURITY = 'security',
    +  USABILITY = 'usability',
    +  COMPATIBILITY = 'compatibility',
    +  BUSINESS = 'business'
    +}
    +
    +// 标准状态
    +enum CriterionStatus {
    +  PENDING = 'pending',
    +  IN_PROGRESS = 'in_progress',
    +  PASSED = 'passed',
    +  FAILED = 'failed',
    +  SKIPPED = 'skipped'
    +}
    +
    +// 测试用例
    +interface TestCase {
    +  id: ID
    +  title: string
    +  steps: string[]
    +  expectedResult: string
    +  actualResult?: string
    +  status: CriterionStatus
    +  executedBy?: string
    +  executedAt?: Timestamp
    +}
    +```
    +
    +## 🏷️ 任务标签类型
    +
    +### TaskLabel - 任务标签
    +```typescript
    +interface TaskLabel {
    +  id: ID
    +  name: string
    +  color: string
    +  description?: string
    +  category?: string
    +  isSystem: boolean
    +}
    +
    +// 系统标签
    +enum SystemLabel {
    +  BUG = 'bug',
    +  FEATURE = 'feature',
    +  ENHANCEMENT = 'enhancement',
    +  DOCUMENTATION = 'documentation',
    +  TESTING = 'testing',
    +  REFACTORING = 'refactoring',
    +  HOTFIX = 'hotfix'
    +}
    +```
    +
    +## 📊 任务查询类型
    +
    +### TaskFilter - 任务过滤器
    +```typescript
    +interface TaskFilter {
    +  // 状态过滤
    +  status?: TaskStatus | TaskStatus[]
    +  priority?: TaskPriority | TaskPriority[]
    +  
    +  // 分配过滤
    +  assignee?: string | string[]
    +  team?: string | string[]
    +  reporter?: string | string[]
    +  
    +  // 时间过滤
    +  createdAfter?: Timestamp
    +  createdBefore?: Timestamp
    +  dueAfter?: Timestamp
    +  dueBefore?: Timestamp
    +  
    +  // 工时过滤
    +  estimatedHours?: NumberRange
    +  actualHours?: NumberRange
    +  
    +  // 标签过滤
    +  tags?: string | string[]
    +  labels?: string | string[]
    +  category?: string | string[]
    +  
    +  // 依赖过滤
    +  hasDependencies?: boolean
    +  hasBlockers?: boolean
    +  isDependentOn?: ID | ID[]
    +  
    +  // 文本搜索
    +  search?: string
    +  searchFields?: TaskSearchField[]
    +  
    +  // 排序
    +  sortBy?: TaskSortField
    +  sortOrder?: 'asc' | 'desc'
    +  
    +  // 分页
    +  limit?: number
    +  offset?: number
    +}
    +
    +// 数值范围
    +interface NumberRange {
    +  min?: number
    +  max?: number
    +}
    +
    +// 搜索字段
    +enum TaskSearchField {
    +  NAME = 'name',
    +  DESCRIPTION = 'description',
    +  COMMENTS = 'comments',
    +  TAGS = 'tags',
    +  ASSIGNEE = 'assignee'
    +}
    +
    +// 排序字段
    +enum TaskSortField {
    +  CREATED_AT = 'createdAt',
    +  UPDATED_AT = 'updatedAt',
    +  DUE_DATE = 'dueDate',
    +  PRIORITY = 'priority',
    +  STATUS = 'status',
    +  ESTIMATED_HOURS = 'estimatedHours',
    +  PROGRESS = 'progress'
    +}
    +```
    +
    +## 📈 任务统计类型
    +
    +### TaskStatistics - 任务统计
    +```typescript
    +interface TaskStatistics {
    +  // 基本统计
    +  total: number
    +  completed: number
    +  inProgress: number
    +  notStarted: number
    +  blocked: number
    +  cancelled: number
    +  
    +  // 完成率
    +  completionRate: number
    +  
    +  // 工时统计
    +  totalEstimatedHours: number
    +  totalActualHours: number
    +  remainingHours: number
    +  
    +  // 优先级分布
    +  priorityDistribution: Record<TaskPriority, number>
    +  
    +  // 状态分布
    +  statusDistribution: Record<TaskStatus, number>
    +  
    +  // 分配统计
    +  assigneeDistribution: Record<string, number>
    +  teamDistribution: Record<string, number>
    +  
    +  // 时间统计
    +  averageCompletionTime: number
    +  overdueTasks: number
    +  upcomingDeadlines: number
    +  
    +  // 趋势数据
    +  trends: TaskTrend[]
    +}
    +
    +// 任务趋势
    +interface TaskTrend {
    +  date: Timestamp
    +  created: number
    +  completed: number
    +  inProgress: number
    +  velocity: number
    +}
    +```
    +
    +## 🔄 任务操作类型
    +
    +### TaskOperation - 任务操作
    +```typescript
    +// 批量任务更新
    +interface BatchTaskUpdate {
    +  taskIds: ID[]
    +  updates: Partial<Task>
    +  conditions?: TaskUpdateCondition[]
    +}
    +
    +// 更新条件
    +interface TaskUpdateCondition {
    +  field: keyof Task
    +  operator: 'equals' | 'not_equals' | 'in' | 'not_in'
    +  value: any
    +}
    +
    +// 任务创建选项
    +interface TaskCreateOptions {
    +  generateId?: boolean
    +  validateDependencies?: boolean
    +  notifyAssignee?: boolean
    +  autoAssign?: boolean
    +  template?: string
    +}
    +
    +// 任务模板
    +interface TaskTemplate {
    +  id: ID
    +  name: string
    +  description: string
    +  defaultValues: Partial<Task>
    +  requiredFields: (keyof Task)[]
    +  customFields: CustomField[]
    +}
    +
    +// 自定义字段
    +interface CustomField {
    +  name: string
    +  type: 'string' | 'number' | 'boolean' | 'date' | 'select' | 'multiselect'
    +  required: boolean
    +  defaultValue?: any
    +  options?: string[]
    +  validation?: ValidationRule[]
    +}
    +```
    +
    +## 📊 任务分析类型
    +
    +### TaskAnalysis - 任务分析
    +```typescript
    +interface TaskAnalysis {
    +  // 复杂度分析
    +  complexity: TaskComplexity
    +  
    +  // 风险评估
    +  risks: TaskRisk[]
    +  
    +  // 依赖分析
    +  dependencyAnalysis: DependencyAnalysis
    +  
    +  // 工时预测
    +  effortEstimation: EffortEstimation
    +  
    +  // 建议
    +  recommendations: TaskRecommendation[]
    +}
    +
    +// 任务复杂度
    +interface TaskComplexity {
    +  level: 'simple' | 'medium' | 'complex' | 'very_complex'
    +  score: number
    +  factors: ComplexityFactor[]
    +}
    +
    +// 复杂度因素
    +interface ComplexityFactor {
    +  name: string
    +  weight: number
    +  score: number
    +  description: string
    +}
    +
    +// 任务风险
    +interface TaskRisk {
    +  type: 'schedule' | 'resource' | 'technical' | 'business'
    +  level: 'low' | 'medium' | 'high' | 'critical'
    +  description: string
    +  impact: string
    +  mitigation: string
    +  probability: number
    +}
    +
    +// 工时预测
    +interface EffortEstimation {
    +  optimistic: number
    +  realistic: number
    +  pessimistic: number
    +  confidence: number
    +  factors: EstimationFactor[]
    +}
    +
    +// 预测因素
    +interface EstimationFactor {
    +  name: string
    +  impact: number
    +  description: string
    +}
    +
    +// 任务建议
    +interface TaskRecommendation {
    +  type: 'optimization' | 'risk_mitigation' | 'resource_allocation' | 'scheduling'
    +  priority: 'low' | 'medium' | 'high'
    +  title: string
    +  description: string
    +  action: string
    +  expectedBenefit: string
    +}
    +```
    +
    +## 📚 相关文档
    +
    +- [核心类型](./core.md) - 基础类型定义
    +- [配置类型](./config.md) - 配置相关类型
    +- [模型类型](./model.md) - AI模型相关类型
    +- [任务管理器 API](../task-manager.md) - 任务管理接口
    
  • docs/assets/logo.svg+109 0 added
    @@ -0,0 +1,109 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<svg width="400" height="160" viewBox="0 0 400 160" xmlns="http://www.w3.org/2000/svg">
    +  <defs>
    +    <linearGradient id="primaryGradient" x1="0%" y1="0%" x2="100%" y2="100%">
    +      <stop offset="0%" style="stop-color:#00D2FF;stop-opacity:1" />
    +      <stop offset="100%" style="stop-color:#3A7BD5;stop-opacity:1" />
    +    </linearGradient>
    +    
    +    <linearGradient id="accentGradient" x1="0%" y1="0%" x2="100%" y2="0%">
    +      <stop offset="0%" style="stop-color:#FF6B6B;stop-opacity:1" />
    +      <stop offset="100%" style="stop-color:#4ECDC4;stop-opacity:1" />
    +    </linearGradient>
    +    
    +    <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
    +      <feDropShadow dx="2" dy="2" stdDeviation="3" flood-color="#000000" flood-opacity="0.2"/>
    +    </filter>
    +  </defs>
    +  
    +  <!-- 背景 -->
    +  <rect width="400" height="160" rx="12" ry="12" fill="#FFFFFF" stroke="#E5E7EB" stroke-width="1"/>
    +  
    +  <!-- 主图标区域 -->
    +  <g transform="translate(20, 30)">
    +    <!-- 流程图标 -->
    +    <g filter="url(#shadow)">
    +      <!-- 主要流程节点 -->
    +      <rect x="10" y="20" width="35" height="20" rx="4" fill="url(#primaryGradient)"/>
    +      <rect x="65" y="20" width="35" height="20" rx="4" fill="url(#primaryGradient)"/>
    +      <rect x="120" y="20" width="35" height="20" rx="4" fill="url(#primaryGradient)"/>
    +      
    +      <!-- 连接线和箭头 -->
    +      <line x1="45" y1="30" x2="65" y2="30" stroke="url(#accentGradient)" stroke-width="3" stroke-linecap="round"/>
    +      <line x1="100" y1="30" x2="120" y2="30" stroke="url(#accentGradient)" stroke-width="3" stroke-linecap="round"/>
    +      
    +      <polygon points="60,27 65,30 60,33" fill="url(#accentGradient)"/>
    +      <polygon points="115,27 120,30 115,33" fill="url(#accentGradient)"/>
    +      
    +      <!-- 节点标签 -->
    +      <text x="27.5" y="34" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="#FFFFFF" font-weight="600">PRD</text>
    +      <text x="82.5" y="34" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="#FFFFFF" font-weight="600">AI</text>
    +      <text x="137.5" y="34" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="#FFFFFF" font-weight="600">任务</text>
    +      
    +      <!-- 底部图标 -->
    +      <!-- 文档图标 -->
    +      <rect x="15" y="60" width="25" height="30" rx="3" fill="#F8FAFC" stroke="url(#primaryGradient)" stroke-width="2"/>
    +      <line x1="20" y1="70" x2="35" y2="70" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="20" y1="75" x2="35" y2="75" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="20" y1="80" x2="30" y2="80" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      
    +      <!-- AI 大脑图标 -->
    +      <circle cx="82.5" cy="75" r="18" fill="url(#primaryGradient)" opacity="0.1"/>
    +      <circle cx="82.5" cy="75" r="15" fill="none" stroke="url(#primaryGradient)" stroke-width="2"/>
    +      <circle cx="78" cy="70" r="2" fill="url(#primaryGradient)"/>
    +      <circle cx="87" cy="70" r="2" fill="url(#primaryGradient)"/>
    +      <path d="M 75 82 Q 82.5 87 90 82" stroke="url(#primaryGradient)" stroke-width="2" fill="none" stroke-linecap="round"/>
    +      
    +      <!-- 任务列表图标 -->
    +      <rect x="125" y="60" width="25" height="30" rx="3" fill="#F8FAFC" stroke="url(#primaryGradient)" stroke-width="2"/>
    +      <circle cx="130" cy="68" r="2" fill="url(#accentGradient)"/>
    +      <circle cx="130" cy="75" r="2" fill="url(#accentGradient)"/>
    +      <circle cx="130" cy="82" r="2" fill="url(#accentGradient)"/>
    +      <line x1="135" y1="68" x2="145" y2="68" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="135" y1="75" x2="145" y2="75" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +      <line x1="135" y1="82" x2="145" y2="82" stroke="url(#primaryGradient)" stroke-width="1.5"/>
    +    </g>
    +  </g>
    +  
    +  <!-- 文字区域 -->
    +  <g transform="translate(190, 40)">
    +    <!-- TaskFlow 文字 -->
    +    <text x="0" y="25" font-family="Arial, sans-serif" font-size="32" font-weight="bold" fill="url(#primaryGradient)">
    +      TaskFlow
    +    </text>
    +    
    +    <!-- AI 文字 -->
    +    <text x="150" y="25" font-family="Arial, sans-serif" font-size="32" font-weight="bold" fill="url(#accentGradient)">
    +      AI
    +    </text>
    +    
    +    <!-- 副标题 -->
    +    <text x="0" y="45" font-family="Arial, sans-serif" font-size="12" fill="#6B7280">
    +      智能PRD文档解析与任务管理助手
    +    </text>
    +    
    +    <!-- 特性标签 -->
    +    <g transform="translate(0, 65)">
    +      <rect x="0" y="0" width="40" height="16" rx="8" fill="url(#primaryGradient)" opacity="0.15"/>
    +      <text x="20" y="11" font-family="Arial, sans-serif" font-size="9" text-anchor="middle" fill="url(#primaryGradient)" font-weight="600">
    +        MCP
    +      </text>
    +      
    +      <rect x="45" y="0" width="30" height="16" rx="8" fill="url(#accentGradient)" opacity="0.15"/>
    +      <text x="60" y="11" font-family="Arial, sans-serif" font-size="9" text-anchor="middle" fill="url(#accentGradient)" font-weight="600">
    +        AI
    +      </text>
    +      
    +      <rect x="80" y="0" width="50" height="16" rx="8" fill="#10B981" opacity="0.15"/>
    +      <text x="105" y="11" font-family="Arial, sans-serif" font-size="9" text-anchor="middle" fill="#10B981" font-weight="600">
    +        多模型
    +      </text>
    +    </g>
    +  </g>
    +  
    +  <!-- 装饰性元素 -->
    +  <g opacity="0.08">
    +    <circle cx="360" cy="30" r="15" fill="url(#primaryGradient)"/>
    +    <circle cx="375" cy="130" r="10" fill="url(#accentGradient)"/>
    +  </g>
    +</svg>
    \ No newline at end of file
    
  • docs/changelog.md+278 0 added
    @@ -0,0 +1,278 @@
    +# 更新日志
    +
    +本文档记录了TaskFlow AI的所有重要更改。
    +
    +格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
    +并且本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
    +
    +## [未发布]
    +
    +### 计划中
    +
    +- 支持更多AI模型(文心一言、讯飞星火)
    +- 智能模板推荐系统
    +- 团队协作功能增强
    +- 性能监控和分析
    +
    +## [1.3.0] - 2025-07-05
    +
    +### 🔧 代码质量优化
    +
    +- **零容忍标准达成**: 完全消除所有TypeScript编译错误和ESLint警告
    +- **类型安全增强**: 全面替换`any`类型为严格类型定义
    +- **错误处理标准化**: 统一错误处理模式和类型断言
    +- **构建系统优化**: 确保所有构建流程零错误执行
    +
    +### 📚 文档和部署
    +
    +- **API密钥审计**: 完整的API密钥配置验证和文档同步
    +- **版本管理**: 统一所有配置文件中的版本号
    +- **部署流程**: 专业级CI/CD部署工作流实现
    +
    +### 🚀 质量保证
    +
    +- **测试覆盖**: 86.6%测试通过率,核心功能完全验证
    +- **生产就绪**: 所有关键质量指标达到生产标准
    +- **零错误构建**: 确保发布版本完全无编译和代码质量问题
    +
    +## [1.2.0] - 2025-07-04
    +
    +### 🔧 代码质量优化
    +
    +- **TypeScript编译错误修复**: 修复所有TypeScript编译错误,实现零编译错误
    +- **ESLint问题修复**: 修复所有ESLint错误,从324个问题减少到145个警告
    +- **类型安全改进**: 大幅减少any类型使用,提升类型安全性
    +- **代码清理**: 删除未使用的导入、变量和参数,提高代码质量
    +- **语法问题修复**: 修复case声明、常量条件等语法问题
    +- **文档完善**: 新增部署指南和测试指南,完善项目文档体系
    +
    +### 🌐 文档站点部署
    +
    +- **VitePress文档站点**: 配置完整的VitePress文档构建和部署系统
    +- **GitHub Actions自动部署**: 自动化文档构建和GitHub Pages部署流程
    +- **本地开发工具**: 提供便捷的文档开发、构建和预览脚本
    +- **文档站点优化**: SEO优化、响应式设计、搜索功能集成
    +
    +### 🛠️ 部署工具
    +
    +- **部署脚本**: 新增 `scripts/deploy-docs.sh` 自动化部署脚本
    +- **GitHub Actions工作流**: `.github/workflows/deploy-docs.yml` 自动部署配置
    +- **文档开发指南**: 完整的文档编写、构建和部署说明
    +
    +### 📚 文档完善
    +
    +- **文档结构优化**: 21个专业文档文件,覆盖所有功能模块
    +- **API类型定义**: 完整的TypeScript类型定义文档
    +- **故障排除指南**: 系统性的问题诊断和解决方案
    +- **最佳实践**: 企业级使用最佳实践和工作流程
    +
    +### 🔗 站点信息
    +
    +- **文档地址**: https://agions.github.io/taskflow-ai/
    +- **GitHub仓库**: https://github.com/agions/taskflow-ai
    +- **自动部署**: 推送到main分支自动更新文档站点
    +
    +### ✨ 新增功能
    +
    +- **多AI模型支持**: 新增对百度文心一言、阿里通义千问、科大讯飞星火的支持
    +- **智能模型编排**: 实现自动模型选择、负载均衡和故障转移机制
    +- **项目初始化增强**: 自动生成AI编辑器配置文件(.cursor-rules, .vscode/settings.json等)
    +- **多编辑器支持**: 支持Windsurf、Trae、Cursor、VSCode四种主流AI编辑器
    +- **双语文档系统**: 完整的中英文文档支持,包含API参考和交互示例
    +
    +### 🔧 改进优化
    +
    +- **CLI命令简化**: init命令移除目录参数,专注于现有项目集成
    +- **代码质量提升**: 严格的TypeScript/ESLint标准,零错误容忍
    +- **性能优化**: 智能缓存机制和并发处理优化
    +- **用户体验**: 更直观的命令行界面和错误提示
    +
    +### 🐛 问题修复
    +
    +- 修复PRD解析中的中文编码问题
    +- 解决任务依赖关系的循环检测bug
    +- 修复配置文件权限问题
    +- 优化内存使用和性能瓶颈
    +
    +### ⚠️ 破坏性变更
    +
    +- `taskflow init` 命令不再接受项目名称参数
    +- 移除项目模板功能,专注于现有项目集成
    +- 配置文件结构调整,需要重新初始化
    +
    +## [1.1.0] - 2025-07-01
    +
    +### 重大更新 🚀
    +
    +- 🎯 **专注CLI体验** - 移除Web组件,专注命令行工具优化
    +- 📦 **包大小优化** - 移除Web相关依赖,减少40%包大小
    +- 🏗️ **架构重构** - 简化项目结构,提升可维护性
    +- 📚 **升级方案** - 提供完整的项目升级改造方案
    +
    +### 移除功能
    +
    +- ❌ Web界面相关组件和依赖
    +- ❌ Express服务器和API路由
    +- ❌ Web相关中间件和认证
    +
    +### 新增文档
    +
    +- 📋 升级改造方案 (docs/upgrade-plan.md)
    +- 🎨 CLI用户体验设计 (docs/cli-ux-design.md)
    +- ⚡ 性能优化方案 (docs/performance-optimization.md)
    +
    +### 改进
    +
    +- 🔧 清理不必要的依赖包
    +- 📝 更新项目描述,明确CLI定位
    +- 🎯 专注核心功能,提升用户体验
    +
    +## [1.0.2] - 2025-07-01
    +
    +### 新增
    +
    +- 🎨 **项目Logo** - 添加了专业的TaskFlow AI logo设计
    +- 🔗 **GitHub集成** - 关联GitHub仓库,完善项目信息
    +
    +### 改进
    +
    +- 📦 **包信息完善** - 更新npm包的仓库、问题追踪和主页链接
    +- 🚀 **发布流程** - 优化发布前检查和自动化流程
    +
    +## [1.0.1] - 2025-07-01
    +
    +### 修复
    +
    +- 🔧 **TypeScript类型安全** - 修复所有TypeScript类型声明问题
    +- 🏗️ **类继承优化** - 解决ChineseLLMProvider基类的访问修饰符冲突
    +- 📦 **构建优化** - 启用tree shaking,减少包大小,提升加载性能
    +- 🔍 **代码质量** - 修复隐式any类型,提高类型安全性
    +- ⚡ **性能优化** - 优化Rollup配置,添加包大小分析工具
    +
    +### 改进
    +
    +- 📊 **构建分析** - 添加包大小分析和性能监控
    +- 🛠️ **开发体验** - 改进TypeScript配置,提升开发效率
    +- 📝 **文档完善** - 更新API文档和使用指南
    +
    +### 技术债务清理
    +
    +- 移除过时的依赖和配置
    +- 统一代码风格和类型定义
    +- 优化构建流程和发布准备
    +
    +## [1.0.0]
    +
    +### 新增
    +
    +- 🎉 **首次正式发布**
    +- 📄 **智能PRD解析** - 支持Markdown、JSON、纯文本格式
    +- 🤖 **AI任务编排** - 基于AI算法的智能任务规划
    +- 🔄 **任务管理系统** - 完整的任务生命周期管理
    +- 🎯 **项目初始化** - 一键生成AI编辑器配置和开发环境
    +- 🤖 **国产大模型支持** - 集成DeepSeek、智谱GLM、通义千问
    +- 🔧 **MCP协议支持** - 在AI编辑器中无缝运行
    +- 📊 **可视化展示** - 甘特图、依赖关系图等
    +- 🌐 **本土化体验** - 完全中文界面和文档
    +
    +### 核心功能
    +
    +- **PRD解析引擎** - 智能提取需求点和依赖关系
    +- **任务生成器** - 自动生成结构化任务计划
    +- **AI编排模块** - 优化任务顺序和资源分配
    +- **配置管理** - 灵活的配置系统
    +- **命令行工具** - 完整的CLI命令支持
    +
    +### AI编辑器集成
    +
    +- **Cursor AI配置** - 专为Cursor优化的配置生成
    +- **VSCode配置** - 完整的VSCode开发环境配置
    +- **代码质量工具** - ESLint、Prettier、TypeScript集成
    +- **开发规范** - 自动生成编程规范和最佳实践
    +
    +### 技术特性
    +
    +- **TypeScript支持** - 完整的类型定义
    +- **模块化架构** - 可扩展的插件系统
    +- **性能优化** - 高效的解析和处理算法
    +- **错误处理** - 完善的错误处理和日志系统
    +
    +## 版本说明
    +
    +### 版本号规则
    +
    +- **主版本号** (Major): 不兼容的API修改
    +- **次版本号** (Minor): 向下兼容的功能性新增
    +- **修订号** (Patch): 向下兼容的问题修正
    +
    +### 发布周期
    +
    +- **主版本**: 每6-12个月发布一次
    +- **次版本**: 每1-2个月发布一次
    +- **修订版**: 根据需要随时发布
    +
    +### 支持政策
    +
    +- **当前版本**: 完全支持,持续更新
    +- **前一个主版本**: 安全更新和重要bug修复
    +- **更早版本**: 仅提供安全更新
    +
    +## 迁移指南
    +
    +### 从0.x升级到1.0
    +
    +#### 重大变更
    +
    +1. **API重构**: 部分API接口有变更
    +2. **配置格式**: 配置文件格式有更新
    +3. **命令行**: 部分命令参数有调整
    +
    +#### 升级步骤
    +
    +```bash
    +# 1. 备份现有配置
    +cp ~/.taskflow-ai/config.json ~/.taskflow-ai/config.json.backup
    +
    +# 2. 更新到最新版本
    +npm update -g taskflow-ai
    +
    +# 3. 迁移配置
    +taskflow-ai migrate-config
    +
    +# 4. 验证功能
    +taskflow-ai --version
    +taskflow-ai config list
    +```
    +
    +#### API变更
    +
    +```javascript
    +// 旧版本 (0.x)
    +const taskflow = new TaskFlow();
    +taskflow.parse(content);
    +
    +// 新版本 (1.0)
    +const { TaskFlowService } = require('taskflow-ai');
    +const service = new TaskFlowService();
    +service.parsePRD(content, 'markdown');
    +```
    +
    +## 贡献者
    +
    +感谢所有为TaskFlow AI做出贡献的开发者:
    +
    +- [@agions](https://github.com/agions) - 项目创始人和主要维护者
    +
    +## 反馈和建议
    +
    +如果您在使用过程中遇到问题或有改进建议,请通过以下方式联系我们:
    +
    +- 🐛 [提交Bug报告](https://github.com/agions/taskflow-ai/issues/new?template=bug_report.md)
    +- 💡 [功能建议](https://github.com/agions/taskflow-ai/issues/new?template=feature_request.md)
    +- 💬 [社区讨论](https://github.com/agions/taskflow-ai/discussions)
    +- 📧 [邮件联系](mailto:1051736049@qq.com)
    +
    +
    +---
    +
    +**注意**: 本更新日志遵循 [Keep a Changelog](https://keepachangelog.com/) 格式,所有重要更改都会在此记录。
    
  • docs/cli/commands.md+353 0 added
    @@ -0,0 +1,353 @@
    +# TaskFlow AI CLI 命令参考
    +
    +## 概述
    +
    +TaskFlow AI 提供了强大的命令行界面,专注于PRD解析、任务管理和AI编辑器集成。本文档详细介绍所有可用命令及其使用方法。
    +
    +## 🚀 快速开始
    +
    +```bash
    +# 在现有项目中初始化
    +taskflow init
    +
    +# 解析PRD文档
    +taskflow parse docs/requirements.md
    +
    +# 查看任务状态
    +taskflow status list
    +
    +# 获取下一个任务
    +taskflow status next
    +```
    +
    +## 📋 命令列表
    +
    +### 核心命令
    +
    +| 命令 | 描述 | 示例 |
    +|------|------|------|
    +| [`init`](#init) | 在现有项目中初始化TaskFlow AI | `taskflow init` |
    +| [`parse`](#parse) | 解析PRD文档并生成任务计划 | `taskflow parse prd.md` |
    +| [`status`](#status) | 任务状态管理 | `taskflow status list` |
    +
    +### 配置命令
    +
    +| 命令 | 描述 | 示例 |
    +|------|------|------|
    +| [`config`](#config) | 配置管理 | `taskflow config set key value` |
    +| [`models`](#models) | AI模型管理 | `taskflow models test` |
    +| [`mcp`](#mcp) | MCP配置管理 | `taskflow mcp info` |
    +
    +### 工具命令
    +
    +| 命令 | 描述 | 示例 |
    +|------|------|------|
    +| [`visualize`](#visualize) | 生成可视化图表 | `taskflow visualize gantt` |
    +| [`interactive`](#interactive) | 交互式模式 | `taskflow interactive` |
    +
    +## 📖 详细命令说明
    +
    +### init
    +
    +在现有项目中初始化TaskFlow AI配置和MCP集成。
    +
    +**语法**:
    +```bash
    +taskflow init [选项]
    +```
    +
    +**选项**:
    +- `--force, -f` - 强制覆盖现有配置
    +- `--verbose, -v` - 显示详细输出
    +- `--editor <editor>` - 指定编辑器类型 (windsurf, trae, cursor, vscode)
    +
    +**示例**:
    +```bash
    +# 基本初始化
    +taskflow init
    +
    +# 强制重新初始化
    +taskflow init --force
    +
    +# 为特定编辑器初始化
    +taskflow init --editor cursor
    +```
    +
    +**生成的文件**:
    +- `.taskflow/config.json` - 主配置文件
    +- `.cursor/mcp.json` - Cursor MCP配置
    +- `.cursor-rules` - Cursor AI规则
    +- `.env.example` - 环境变量模板
    +
    +### parse
    +
    +解析PRD文档并生成结构化的任务计划。
    +
    +**语法**:
    +```bash
    +taskflow parse <文件路径> [选项]
    +```
    +
    +**选项**:
    +- `--model, -m <model>` - 指定AI模型 (deepseek, zhipu, qwen, baidu, moonshot, spark)
    +- `--output, -o <path>` - 输出文件路径
    +- `--format <format>` - 输出格式 (json, yaml, markdown)
    +- `--verbose, -v` - 显示详细解析过程
    +
    +**支持的文件格式**:
    +- Markdown (`.md`, `.markdown`)
    +- 纯文本 (`.txt`)
    +- Word文档 (`.docx`)
    +
    +**示例**:
    +```bash
    +# 基本解析
    +taskflow parse docs/requirements.md
    +
    +# 指定模型和输出
    +taskflow parse prd.md --model deepseek --output tasks.json
    +
    +# 详细模式
    +taskflow parse prd.md --verbose
    +```
    +
    +### status
    +
    +任务状态管理和项目进度跟踪。
    +
    +**子命令**:
    +
    +#### status list
    +查看任务列表。
    +
    +```bash
    +taskflow status list [选项]
    +```
    +
    +**选项**:
    +- `--input, -i <path>` - 任务文件路径
    +- `--filter <filter>` - 过滤条件
    +- `--format <format>` - 输出格式
    +
    +#### status update
    +更新任务状态。
    +
    +```bash
    +taskflow status update <taskId> <status> [选项]
    +```
    +
    +**状态值**:
    +- `not_started` - 未开始
    +- `in_progress` - 进行中  
    +- `completed` - 已完成
    +- `blocked` - 阻塞
    +- `cancelled` - 已取消
    +
    +#### status progress
    +显示项目进度统计。
    +
    +```bash
    +taskflow status progress [选项]
    +```
    +
    +#### status next
    +获取推荐的下一个任务。
    +
    +```bash
    +taskflow status next [选项]
    +```
    +
    +**示例**:
    +```bash
    +# 查看所有任务
    +taskflow status list
    +
    +# 更新任务状态
    +taskflow status update task-001 in_progress
    +
    +# 查看进度
    +taskflow status progress
    +
    +# 获取下一个任务
    +taskflow status next
    +```
    +
    +### config
    +
    +配置管理命令。
    +
    +**子命令**:
    +- `list` - 查看所有配置
    +- `get <key>` - 获取配置值
    +- `set <key> <value>` - 设置配置值
    +- `reset` - 重置配置
    +
    +**示例**:
    +```bash
    +# 查看配置
    +taskflow config list
    +
    +# 设置API密钥
    +taskflow config set models.deepseek.apiKey "your-key"
    +
    +# 获取配置值
    +taskflow config get models.default
    +```
    +
    +### models
    +
    +AI模型管理和测试。
    +
    +**子命令**:
    +- `test [model]` - 测试模型连接
    +- `status` - 查看模型状态
    +- `benchmark` - 性能基准测试
    +
    +**示例**:
    +```bash
    +# 测试所有模型
    +taskflow models test
    +
    +# 测试特定模型
    +taskflow models test deepseek
    +
    +# 查看模型状态
    +taskflow models status
    +```
    +
    +### mcp
    +
    +MCP (Model Context Protocol) 配置管理。
    +
    +**子命令**:
    +- `info` - 显示MCP服务信息
    +- `validate` - 验证MCP配置
    +- `test` - 测试MCP配置
    +- `regenerate` - 重新生成MCP配置
    +
    +**示例**:
    +```bash
    +# 查看MCP信息
    +taskflow mcp info
    +
    +# 验证配置
    +taskflow mcp validate
    +
    +# 重新生成配置
    +taskflow mcp regenerate
    +```
    +
    +### visualize
    +
    +生成任务计划可视化图表。
    +
    +**子命令**:
    +- `gantt` - 甘特图
    +- `timeline` - 时间线图
    +- `dependency` - 依赖关系图
    +
    +**选项**:
    +- `--input, -i <path>` - 任务文件路径
    +- `--output, -o <path>` - 输出文件路径
    +- `--format <format>` - 输出格式 (svg, png, html)
    +
    +**示例**:
    +```bash
    +# 生成甘特图
    +taskflow visualize gantt -i tasks.json
    +
    +# 生成依赖关系图
    +taskflow visualize dependency -i tasks.json -o deps.svg
    +```
    +
    +### interactive
    +
    +启动交互式模式,提供友好的用户界面。
    +
    +```bash
    +taskflow interactive
    +```
    +
    +## 🔧 全局选项
    +
    +所有命令都支持以下全局选项:
    +
    +| 选项 | 简写 | 描述 |
    +|------|------|------|
    +| `--help` | `-h` | 显示帮助信息 |
    +| `--version` | `-V` | 显示版本信息 |
    +| `--verbose` | `-v` | 详细输出模式 |
    +| `--quiet` | `-q` | 静默模式 |
    +| `--no-color` | | 禁用彩色输出 |
    +
    +## 📊 输出格式
    +
    +### 表格格式 (默认)
    +```
    +┌─────────────┬──────────────────────────┬──────────┐
    +│ ID          │ 任务名称                 │ 状态     │
    +├─────────────┼──────────────────────────┼──────────┤
    +│ task-001    │ 实现用户登录功能         │ 进行中   │
    +└─────────────┴──────────────────────────┴──────────┘
    +```
    +
    +### JSON格式
    +```json
    +{
    +  "tasks": [
    +    {
    +      "id": "task-001",
    +      "name": "实现用户登录功能",
    +      "status": "in_progress"
    +    }
    +  ]
    +}
    +```
    +
    +## 🔄 典型工作流
    +
    +```bash
    +# 1. 项目初始化
    +cd your-existing-project
    +taskflow init
    +
    +# 2. 配置AI模型
    +taskflow config set models.deepseek.apiKey "your-key"
    +
    +# 3. 解析PRD文档
    +taskflow parse docs/requirements.md
    +
    +# 4. 查看生成的任务
    +taskflow status list
    +
    +# 5. 开始工作
    +taskflow status next
    +taskflow status update task-001 in_progress
    +
    +# 6. 查看进度
    +taskflow status progress
    +
    +# 7. 生成可视化报告
    +taskflow visualize gantt
    +```
    +
    +## 🆘 获取帮助
    +
    +```bash
    +# 查看总体帮助
    +taskflow --help
    +
    +# 查看特定命令帮助
    +taskflow parse --help
    +taskflow status --help
    +
    +# 查看子命令帮助
    +taskflow status update --help
    +```
    +
    +## 📚 相关文档
    +
    +- [快速开始](../getting-started.md)
    +- [配置参考](../reference/configuration.md)
    +- [API文档](../api/)
    +- [故障排除](../troubleshooting/)
    
  • docs/deployment/index.md+370 0 added
    @@ -0,0 +1,370 @@
    +# TaskFlow AI 部署指南
    +
    +## 📋 概述
    +
    +本文档详细介绍了TaskFlow AI的部署方法,包括本地部署、服务器部署和容器化部署等多种方式。
    +
    +## 🔧 系统要求
    +
    +### 最低要求
    +- **Node.js**: >= 18.0.0
    +- **npm**: >= 8.0.0
    +- **内存**: >= 2GB
    +- **磁盘空间**: >= 1GB
    +
    +### 推荐配置
    +- **Node.js**: >= 20.0.0
    +- **npm**: >= 10.0.0
    +- **内存**: >= 4GB
    +- **磁盘空间**: >= 5GB
    +
    +### 支持的操作系统
    +- Windows 10/11
    +- macOS 10.15+
    +- Linux (Ubuntu 18.04+, CentOS 7+)
    +
    +## 📦 安装方式
    +
    +### 方式1: npm全局安装(推荐)
    +
    +```bash
    +# 安装最新版本
    +npm install -g taskflow-ai
    +
    +# 验证安装
    +taskflow --version
    +taskflow --help
    +```
    +
    +### 方式2: 从源码构建
    +
    +```bash
    +# 克隆仓库
    +git clone https://github.com/Agions/taskflow-ai.git
    +cd taskflow-ai
    +
    +# 安装依赖
    +npm install
    +
    +# 构建项目
    +npm run build
    +
    +# 全局链接
    +npm link
    +
    +# 验证安装
    +taskflow --version
    +```
    +
    +
    +## ⚙️ 配置设置
    +
    +### 1. 初始化配置
    +
    +```bash
    +# 在项目目录中初始化
    +cd your-project
    +taskflow init
    +
    +# 强制重新初始化
    +taskflow init --force
    +```
    +
    +### 2. 环境变量配置
    +
    +创建 `.env` 文件:
    +
    +```bash
    +# AI模型配置
    +DEEPSEEK_API_KEY=your_deepseek_key
    +ZHIPU_API_KEY=your_zhipu_key
    +QWEN_API_KEY=your_qwen_key
    +BAIDU_API_KEY=your_baidu_key
    +MOONSHOT_API_KEY=your_moonshot_key
    +SPARK_API_KEY=your_spark_key
    +
    +# 日志配置
    +LOG_LEVEL=info
    +LOG_FILE=taskflow.log
    +
    +# 性能配置
    +MAX_CONCURRENT_REQUESTS=5
    +REQUEST_TIMEOUT=30000
    +```
    +
    +### 3. 配置验证
    +
    +```bash
    +# 验证配置
    +taskflow config validate
    +
    +# 查看当前配置
    +taskflow config list
    +
    +# 测试AI模型连接
    +taskflow models test
    +```
    +
    +## 🚀 部署场景
    +
    +### 场景1: 个人开发环境
    +
    +```bash
    +# 1. 全局安装
    +npm install -g taskflow-ai
    +
    +# 2. 项目初始化
    +cd your-project
    +taskflow init
    +
    +# 3. 配置API密钥
    +taskflow config set models.deepseek.apiKey "your-key"
    +
    +# 4. 开始使用
    +taskflow parse docs/requirements.md
    +```
    +
    +### 场景2: 团队协作环境
    +
    +```bash
    +# 1. 项目级安装
    +npm install --save-dev taskflow-ai
    +
    +# 2. 添加npm脚本到package.json
    +{
    +  "scripts": {
    +    "taskflow": "taskflow",
    +    "parse-prd": "taskflow parse docs/prd.md",
    +    "task-status": "taskflow status list"
    +  }
    +}
    +
    +# 3. 团队成员使用
    +npm run parse-prd
    +npm run task-status
    +```
    +
    +### 场景3: CI/CD集成
    +
    +```yaml
    +# .github/workflows/taskflow.yml
    +name: TaskFlow AI Integration
    +
    +on:
    +  push:
    +    paths:
    +      - 'docs/**/*.md'
    +  pull_request:
    +    paths:
    +      - 'docs/**/*.md'
    +
    +jobs:
    +  parse-requirements:
    +    runs-on: ubuntu-latest
    +    steps:
    +      - uses: actions/checkout@v4
    +      
    +      - name: Setup Node.js
    +        uses: actions/setup-node@v4
    +        with:
    +          node-version: '20'
    +          
    +      - name: Install TaskFlow AI
    +        run: npm install -g taskflow-ai
    +        
    +      - name: Parse PRD
    +        run: taskflow parse docs/requirements.md
    +        env:
    +          DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
    +          
    +      - name: Upload task plan
    +        uses: actions/upload-artifact@v3
    +        with:
    +          name: task-plan
    +          path: taskflow/tasks.json
    +```
    +
    +
    +
    +# 切换用户
    +USER taskflow
    +
    +# 设置入口点
    +ENTRYPOINT ["taskflow"]
    +CMD ["--help"]
    +```
    +
    +#### docker-compose.yml
    +
    +```yaml
    +version: '3.8'
    +
    +services:
    +  taskflow:
    +    build: .
    +    volumes:
    +      - ./docs:/workspace/docs
    +      - ./taskflow:/workspace/taskflow
    +    working_dir: /workspace
    +    environment:
    +      - DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
    +      - ZHIPU_API_KEY=${ZHIPU_API_KEY}
    +    command: ["parse", "docs/requirements.md"]
    +```
    +
    +## 🔒 安全配置
    +
    +### 1. API密钥管理
    +
    +```bash
    +# 使用环境变量(推荐)
    +export DEEPSEEK_API_KEY="your-key"
    +
    +# 或使用配置文件(加密存储)
    +taskflow config set models.deepseek.apiKey "your-key"
    +
    +# 验证密钥安全性
    +taskflow config validate --security-check
    +```
    +
    +### 2. 网络安全
    +
    +```bash
    +# 配置代理(如果需要)
    +taskflow config set network.proxy "http://proxy.company.com:8080"
    +
    +# 配置超时
    +taskflow config set network.timeout 30000
    +
    +# 启用SSL验证
    +taskflow config set network.ssl.verify true
    +```
    +
    +### 3. 数据安全
    +
    +```bash
    +# 启用数据加密
    +taskflow config set security.encryption.enabled true
    +
    +# 设置数据保留期
    +taskflow config set security.dataRetention 30
    +
    +# 配置日志级别
    +taskflow config set logging.level info
    +```
    +
    +## 📊 监控和维护
    +
    +### 1. 健康检查
    +
    +```bash
    +# 系统状态检查
    +taskflow status system
    +
    +# 模型连接检查
    +taskflow models status
    +
    +# 配置完整性检查
    +taskflow config validate
    +```
    +
    +### 2. 日志管理
    +
    +```bash
    +# 查看日志
    +tail -f ~/.taskflow/logs/taskflow.log
    +
    +# 日志轮转配置
    +taskflow config set logging.rotation.enabled true
    +taskflow config set logging.rotation.maxSize "10MB"
    +taskflow config set logging.rotation.maxFiles 5
    +```
    +
    +### 3. 性能优化
    +
    +```bash
    +# 性能监控
    +taskflow status performance
    +
    +# 缓存清理
    +taskflow cache clear
    +
    +# 配置优化
    +taskflow config optimize
    +```
    +
    +## 🔄 升级和迁移
    +
    +### 升级到新版本
    +
    +```bash
    +# 检查当前版本
    +taskflow --version
    +
    +# 升级到最新版本
    +npm update -g taskflow-ai
    +
    +# 验证升级
    +taskflow --version
    +taskflow config validate
    +```
    +
    +### 配置迁移
    +
    +```bash
    +# 备份当前配置
    +taskflow config export > taskflow-config-backup.json
    +
    +# 升级后恢复配置
    +taskflow config import taskflow-config-backup.json
    +
    +# 验证迁移
    +taskflow config validate
    +```
    +
    +## 🆘 故障排除
    +
    +### 常见问题
    +
    +1. **安装失败**
    +   ```bash
    +   # 清理npm缓存
    +   npm cache clean --force
    +   
    +   # 重新安装
    +   npm install -g taskflow-ai
    +   ```
    +
    +2. **权限问题**
    +   ```bash
    +   # 修复npm权限
    +   sudo chown -R $(whoami) ~/.npm
    +   
    +   # 或使用nvm
    +   curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
    +   nvm install 20
    +   nvm use 20
    +   ```
    +
    +3. **API连接失败**
    +   ```bash
    +   # 检查网络连接
    +   taskflow models test --verbose
    +   
    +   # 检查API密钥
    +   taskflow config get models.deepseek.apiKey
    +   ```
    +
    +### 获取支持
    +
    +- **文档**: https://agions.github.io/taskflow-ai/
    +- **GitHub Issues**: https://github.com/Agions/taskflow-ai/issues
    +- **讨论区**: https://github.com/Agions/taskflow-ai/discussions
    +
    +## 📚 相关文档
    +
    +- [快速开始](../getting-started.md)
    +- [配置参考](../reference/configuration.md)
    +- [API文档](../api/)
    +- [故障排除](../troubleshooting/common-issues.md)
    +- [测试指南](../testing/index.md)
    
  • docs/development/contributing.md+378 0 added
    @@ -0,0 +1,378 @@
    +# 贡献指南
    +
    +感谢您对TaskFlow AI项目的关注!我们欢迎所有形式的贡献,包括但不限于:
    +
    +- 🐛 Bug报告和修复
    +- 💡 新功能建议和实现
    +- 📖 文档改进
    +- 🧪 测试用例添加
    +- 🎨 UI/UX改进
    +- 🌐 国际化支持
    +
    +## 🚀 快速开始
    +
    +### 开发环境准备
    +
    +1. **系统要求**
    +   - Node.js 18.0.0 或更高版本
    +   - Git 2.0 或更高版本
    +   - 推荐使用 VSCode 或 Cursor 编辑器
    +
    +2. **克隆项目**
    +   ```bash
    +   git clone https://github.com/agions/taskflow-ai.git
    +   cd taskflow-ai
    +   ```
    +
    +3. **安装依赖**
    +   ```bash
    +   npm install
    +   ```
    +
    +4. **构建项目**
    +   ```bash
    +   npm run build
    +   ```
    +
    +5. **运行测试**
    +   ```bash
    +   npm test
    +   ```
    +
    +6. **启动开发模式**
    +   ```bash
    +   npm run dev
    +   ```
    +
    +### 项目结构
    +
    +```
    +taskflow-ai/
    +├── src/                    # 源代码
    +│   ├── core/              # 核心模块
    +│   ├── models/            # AI模型集成
    +│   ├── parsers/           # PRD解析器
    +│   ├── planners/          # 任务规划器
    +│   ├── utils/             # 工具函数
    +│   └── types/             # TypeScript类型定义
    +├── tests/                 # 测试文件
    +├── docs/                  # 文档
    +├── examples/              # 示例代码
    +├── templates/             # 项目模板
    +└── bin/                   # 命令行工具
    +```
    +
    +## 📋 贡献流程
    +
    +### 1. 创建Issue
    +
    +在开始开发之前,请先创建一个Issue来描述您要解决的问题或添加的功能:
    +
    +- 🐛 **Bug报告**: 使用 [Bug报告模板](https://github.com/agions/taskflow-ai/issues/new?template=bug_report.md)
    +- 💡 **功能请求**: 使用 [功能请求模板](https://github.com/agions/taskflow-ai/issues/new?template=feature_request.md)
    +- 📖 **文档改进**: 使用 [文档改进模板](https://github.com/agions/taskflow-ai/issues/new?template=documentation.md)
    +
    +### 2. Fork和分支
    +
    +```bash
    +# 1. Fork项目到您的GitHub账户
    +# 2. 克隆您的Fork
    +git clone https://github.com/YOUR_USERNAME/taskflow-ai.git
    +cd taskflow-ai
    +
    +# 3. 添加上游仓库
    +git remote add upstream https://github.com/agions/taskflow-ai.git
    +
    +# 4. 创建功能分支
    +git checkout -b feature/your-feature-name
    +# 或者修复分支
    +git checkout -b fix/your-bug-fix
    +```
    +
    +### 3. 开发和测试
    +
    +```bash
    +# 开发过程中保持代码同步
    +git fetch upstream
    +git rebase upstream/main
    +
    +# 运行测试确保代码质量
    +npm test
    +npm run lint
    +npm run type-check
    +
    +# 构建项目
    +npm run build
    +```
    +
    +### 4. 提交代码
    +
    +我们使用 [Conventional Commits](https://www.conventionalcommits.org/) 规范:
    +
    +```bash
    +# 提交格式
    +git commit -m "type(scope): description"
    +
    +# 示例
    +git commit -m "feat(parser): add JSON format support"
    +git commit -m "fix(cli): resolve config loading issue"
    +git commit -m "docs(readme): update installation guide"
    +```
    +
    +**提交类型**:
    +- `feat`: 新功能
    +- `fix`: Bug修复
    +- `docs`: 文档更新
    +- `style`: 代码格式化
    +- `refactor`: 代码重构
    +- `test`: 测试相关
    +- `chore`: 构建过程或辅助工具的变动
    +
    +### 5. 创建Pull Request
    +
    +```bash
    +# 推送到您的Fork
    +git push origin feature/your-feature-name
    +
    +# 在GitHub上创建Pull Request
    +```
    +
    +**PR要求**:
    +- 清晰的标题和描述
    +- 关联相关的Issue
    +- 包含测试用例
    +- 通过所有CI检查
    +- 代码审查通过
    +
    +## 🧪 测试指南
    +
    +### 运行测试
    +
    +```bash
    +# 运行所有测试
    +npm test
    +
    +# 运行特定测试文件
    +npm test -- --testPathPattern=parser
    +
    +# 运行测试并生成覆盖率报告
    +npm run test:coverage
    +
    +# 监听模式运行测试
    +npm run test:watch
    +```
    +
    +### 编写测试
    +
    +我们使用Jest作为测试框架:
    +
    +```javascript
    +// tests/parser.test.ts
    +import { PRDParser } from '../src/parsers/PRDParser';
    +
    +describe('PRDParser', () => {
    +  let parser: PRDParser;
    +
    +  beforeEach(() => {
    +    parser = new PRDParser();
    +  });
    +
    +  test('should parse markdown PRD correctly', async () => {
    +    const content = `
    +# 项目标题
    +## 功能需求
    +- 功能1
    +- 功能2
    +    `;
    +    
    +    const result = await parser.parse(content, 'markdown');
    +    
    +    expect(result.success).toBe(true);
    +    expect(result.data.title).toBe('项目标题');
    +    expect(result.data.features).toHaveLength(2);
    +  });
    +});
    +```
    +
    +## 📝 代码规范
    +
    +### TypeScript规范
    +
    +```typescript
    +// 使用明确的类型定义
    +interface TaskData {
    +  id: string;
    +  title: string;
    +  description: string;
    +  priority: TaskPriority;
    +  status: TaskStatus;
    +}
    +
    +// 使用枚举定义常量
    +enum TaskStatus {
    +  NOT_STARTED = 'not_started',
    +  IN_PROGRESS = 'in_progress',
    +  COMPLETED = 'completed'
    +}
    +
    +// 使用泛型提高代码复用性
    +class ServiceResponse<T> {
    +  constructor(
    +    public success: boolean,
    +    public data?: T,
    +    public error?: string
    +  ) {}
    +}
    +```
    +
    +### 代码风格
    +
    +我们使用ESLint和Prettier来保持代码风格一致:
    +
    +```bash
    +# 检查代码风格
    +npm run lint
    +
    +# 自动修复代码风格问题
    +npm run lint:fix
    +
    +# 格式化代码
    +npm run format
    +```
    +
    +### 命名规范
    +
    +- **文件名**: 使用PascalCase (如: `PRDParser.ts`)
    +- **类名**: 使用PascalCase (如: `TaskFlowService`)
    +- **方法名**: 使用camelCase (如: `parsePRD`)
    +- **常量**: 使用UPPER_SNAKE_CASE (如: `DEFAULT_CONFIG`)
    +- **接口**: 使用PascalCase,可选择I前缀 (如: `ITaskData` 或 `TaskData`)
    +
    +## 📖 文档贡献
    +
    +### 文档类型
    +
    +1. **API文档**: 在代码中使用JSDoc注释
    +2. **用户文档**: Markdown格式,位于`docs/`目录
    +3. **示例代码**: 位于`examples/`目录
    +4. **README**: 项目主要说明文档
    +
    +### 文档规范
    +
    +```typescript
    +/**
    + * 解析PRD文档内容
    + * @param content - PRD文档内容
    + * @param fileType - 文件类型 (markdown, json, text)
    + * @param options - 解析选项
    + * @returns 解析结果
    + * @example
    + * ```typescript
    + * const result = await service.parsePRD(content, 'markdown');
    + * if (result.success) {
    + *   console.log(result.data);
    + * }
    + * ```
    + */
    +async parsePRD(
    +  content: string,
    +  fileType: FileType = FileType.MARKDOWN,
    +  options?: ParseOptions
    +): Promise<ServiceResponse<PRDParseResult>>
    +```
    +
    +## 🐛 Bug报告
    +
    +### 报告Bug前的检查
    +
    +1. 搜索现有Issues,确认问题未被报告
    +2. 确保使用的是最新版本
    +3. 查看[故障排除文档](docs/troubleshooting.md)
    +
    +### Bug报告模板
    +
    +```markdown
    +**Bug描述**
    +简洁清晰地描述bug是什么。
    +
    +**重现步骤**
    +1. 执行 '...'
    +2. 点击 '....'
    +3. 滚动到 '....'
    +4. 看到错误
    +
    +**期望行为**
    +清晰简洁地描述您期望发生什么。
    +
    +**实际行为**
    +清晰简洁地描述实际发生了什么。
    +
    +**环境信息**
    +- OS: [例如 macOS 12.0]
    +- Node.js版本: [例如 18.0.0]
    +- TaskFlow AI版本: [例如 1.0.0]
    +
    +**附加信息**
    +添加任何其他有关问题的上下文信息。
    +```
    +
    +## 💡 功能建议
    +
    +### 建议新功能前的考虑
    +
    +1. 功能是否符合项目目标
    +2. 是否有足够的用户需求
    +3. 实现复杂度和维护成本
    +4. 是否与现有功能冲突
    +
    +### 功能请求模板
    +
    +```markdown
    +**功能描述**
    +清晰简洁地描述您想要的功能。
    +
    +**问题背景**
    +描述这个功能要解决什么问题。
    +
    +**解决方案**
    +描述您希望如何实现这个功能。
    +
    +**替代方案**
    +描述您考虑过的其他解决方案。
    +
    +**附加信息**
    +添加任何其他相关信息或截图。
    +```
    +
    +## 🏆 贡献者认可
    +
    +我们重视每一个贡献,所有贡献者都会被记录在:
    +
    +- [贡献者列表](https://github.com/agions/taskflow-ai/graphs/contributors)
    +- [CHANGELOG.md](CHANGELOG.md)
    +- 项目README.md
    +
    +### 贡献类型
    +
    +- 🐛 **Bug修复**: 修复项目中的bug
    +- ✨ **新功能**: 添加新的功能特性
    +- 📖 **文档**: 改进项目文档
    +- 🧪 **测试**: 添加或改进测试用例
    +- 🎨 **设计**: UI/UX改进
    +- 🌐 **国际化**: 多语言支持
    +- 🔧 **工具**: 改进开发工具和流程
    +
    +## 📞 获取帮助
    +
    +如果您在贡献过程中遇到问题,可以通过以下方式获取帮助:
    +
    +- 💬 [GitHub Discussions](https://github.com/agions/taskflow-ai/discussions)
    +- 🐛 [创建Issue](https://github.com/agions/taskflow-ai/issues/new)
    +
    +## 📄 许可证
    +
    +通过贡献代码,您同意您的贡献将在[MIT许可证](LICENSE)下授权。
    +
    +---
    +
    +再次感谢您的贡献!每一个贡献都让TaskFlow AI变得更好。🚀
    
  • docs/development/developer-guide.md+984 0 added
    @@ -0,0 +1,984 @@
    +# TaskFlow AI 开发者指南
    +
    +## 目录
    +
    +- [开发环境搭建](#开发环境搭建)
    +- [项目架构](#项目架构)
    +- [开发工作流](#开发工作流)
    +- [编码规范](#编码规范)
    +- [测试指南](#测试指南)
    +- [调试技巧](#调试技巧)
    +- [性能优化](#性能优化)
    +- [贡献指南](#贡献指南)
    +
    +## 开发环境搭建
    +
    +### 系统要求
    +
    +- **Node.js**: 18.0.0 或更高版本
    +- **npm**: 8.0.0 或更高版本
    +- **Git**: 2.25.0 或更高版本
    +- **操作系统**: macOS、Linux 或 Windows
    +
    +### 环境搭建步骤
    +
    +1. **克隆项目**
    +
    +   ```bash
    +   git clone https://github.com/Agions/taskflow-ai.git
    +   cd taskflow-ai
    +   ```
    +
    +2. **安装依赖**
    +
    +   ```bash
    +   npm install
    +   ```
    +
    +3. **构建项目**
    +
    +   ```bash
    +   npm run build
    +   ```
    +
    +4. **验证安装**
    +   ```bash
    +   ./dist/cli/index.js --version
    +   ```
    +
    +### 开发工具推荐
    +
    +#### 编辑器配置
    +
    +**VSCode** (推荐)
    +
    +```json
    +{
    +  "editor.formatOnSave": true,
    +  "editor.codeActionsOnSave": {
    +    "source.fixAll.eslint": true
    +  },
    +  "typescript.preferences.importModuleSpecifier": "relative",
    +  "files.associations": {
    +    "*.json": "jsonc"
    +  }
    +}
    +```
    +
    +**必备插件:**
    +
    +- TypeScript Hero
    +- ESLint
    +- Prettier
    +- Path Intellisense
    +- Auto Rename Tag
    +
    +#### 终端配置
    +
    +**推荐使用:**
    +
    +- iTerm2 (macOS)
    +- Windows Terminal (Windows)
    +- GNOME Terminal (Linux)
    +
    +**Zsh配置:**
    +
    +```bash
    +# 安装oh-my-zsh
    +sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    +
    +# 推荐插件
    +plugins=(git node npm typescript)
    +```
    +
    +## 项目架构
    +
    +### 目录结构详解
    +
    +```
    +src/
    +├── cli/                    # CLI入口和命令处理
    +│   ├── index.ts           # 主入口,程序启动点
    +│   ├── commands/          # 命令实现
    +│   │   ├── init.ts        # 项目初始化命令
    +│   │   ├── parse.ts       # PRD解析命令
    +│   │   ├── status.ts      # 状态查看命令
    +│   │   ├── visualize.ts   # 可视化生成命令
    +│   │   ├── mcp.ts         # MCP服务管理命令
    +│   │   └── config.ts      # 配置管理命令
    +│   └── ui/                # CLI界面组件
    +│       ├── prompts.ts     # 交互式提示
    +│       ├── progress.ts    # 进度条组件
    +│       └── tables.ts      # 表格显示组件
    +├── core/                  # 核心业务逻辑
    +│   ├── engine/            # 核心引擎
    +│   │   ├── index.ts       # 主引擎
    +│   │   └── processor.ts   # 数据处理器
    +│   ├── parser/            # PRD解析器
    +│   │   ├── index.ts       # 解析器入口
    +│   │   ├── markdown.ts    # Markdown解析
    +│   │   └── extractor.ts   # 内容提取器
    +│   ├── tasks/             # 任务管理
    +│   │   ├── index.ts       # 任务生成器
    +│   │   ├── manager.ts     # 任务管理器
    +│   │   └── analyzer.ts    # 依赖分析器
    +│   ├── ai/                # AI模型集成
    +│   │   ├── index.ts       # AI接口
    +│   │   ├── providers/     # AI提供商
    +│   │   └── models.ts      # 模型管理
    +│   └── config/            # 配置管理
    +│       ├── index.ts       # 配置管理器
    +│       └── validator.ts   # 配置验证
    +├── mcp/                   # MCP服务器
    +│   ├── server.ts          # MCP服务器核心
    +│   ├── tools/             # 工具注册系统
    +│   │   ├── index.ts       # 工具注册器
    +│   │   ├── file.ts        # 文件操作工具
    +│   │   ├── shell.ts       # Shell执行工具
    +│   │   └── project.ts     # 项目分析工具
    +│   ├── resources/         # 资源管理
    +│   │   ├── index.ts       # 资源管理器
    +│   │   └── handlers.ts    # 资源处理器
    +│   ├── prompts/           # 提示管理
    +│   │   ├── index.ts       # 提示管理器
    +│   │   └── templates.ts   # 提示模板
    +│   └── security/          # 安全管理
    +│       ├── auth.ts        # 认证模块
    +│       ├── rate-limit.ts  # 限流模块
    +│       └── validator.ts   # 验证模块
    +├── utils/                 # 通用工具
    +│   ├── logger.ts          # 日志工具
    +│   ├── file.ts            # 文件操作
    +│   ├── format.ts          # 格式化工具
    +│   ├── validation.ts      # 验证工具
    +│   └── helpers.ts         # 辅助函数
    +├── types/                 # 类型定义
    +│   ├── index.ts           # 导出所有类型
    +│   ├── config.ts          # 配置类型
    +│   ├── tasks.ts           # 任务类型
    +│   ├── prd.ts             # PRD类型
    +│   └── mcp.ts             # MCP类型
    +└── constants/             # 常量定义
    +    ├── index.ts           # 导出所有常量
    +    ├── commands.ts        # 命令常量
    +    ├── messages.ts        # 消息常量
    +    └── defaults.ts        # 默认值常量
    +```
    +
    +### 核心模块说明
    +
    +#### CLI模块 (`src/cli/`)
    +
    +负责命令行界面的实现,包括:
    +
    +- 命令解析和路由
    +- 用户交互界面
    +- 错误处理和用户反馈
    +
    +**关键文件:**
    +
    +- `index.ts`: CLI主入口,设置命令和全局配置
    +- `commands/*.ts`: 各个命令的具体实现
    +- `ui/*.ts`: 用户界面组件
    +
    +#### Core模块 (`src/core/`)
    +
    +核心业务逻辑实现,包括:
    +
    +- PRD文档解析
    +- 任务生成和管理
    +- AI模型集成
    +- 配置管理
    +
    +**关键文件:**
    +
    +- `parser/index.ts`: PRD解析的主要逻辑
    +- `tasks/index.ts`: 任务生成算法
    +- `ai/index.ts`: AI模型调用接口
    +
    +#### MCP模块 (`src/mcp/`)
    +
    +Model Context Protocol服务器实现,包括:
    +
    +- MCP协议处理
    +- 工具注册和调用
    +- 资源管理
    +- 安全控制
    +
    +**关键文件:**
    +
    +- `server.ts`: MCP服务器主体
    +- `tools/index.ts`: 工具注册系统
    +- `security/auth.ts`: 认证和安全
    +
    +### 数据流架构
    +
    +```mermaid
    +graph TB
    +    A[CLI Commands] --> B[Core Engine]
    +    B --> C[Parser Module]
    +    B --> D[Task Module]
    +    B --> E[AI Module]
    +    C --> F[PRD Document]
    +    D --> G[Task List]
    +    E --> H[AI Models]
    +    I[MCP Server] --> B
    +    J[Config Manager] --> B
    +    K[Logger] --> B
    +```
    +
    +## 开发工作流
    +
    +### 分支策略
    +
    +我们使用 **Git Flow** 分支模型:
    +
    +- `main`: 稳定发布分支
    +- `develop`: 开发主分支
    +- `feature/*`: 功能开发分支
    +- `release/*`: 发布准备分支
    +- `hotfix/*`: 紧急修复分支
    +
    +### 开发流程
    +
    +1. **创建功能分支**
    +
    +   ```bash
    +   git checkout develop
    +   git pull origin develop
    +   git checkout -b feature/your-feature-name
    +   ```
    +
    +2. **开发和测试**
    +
    +   ```bash
    +   # 实时编译
    +   npm run dev
    +
    +   # 运行测试
    +   npm test
    +
    +   # 检查代码质量
    +   npm run lint
    +   npm run type-check
    +   ```
    +
    +3. **提交代码**
    +
    +   ```bash
    +   # 格式化代码
    +   npm run format
    +
    +   # 提交变更
    +   git add .
    +   git commit -m "feat: add new feature"
    +   ```
    +
    +4. **推送和PR**
    +   ```bash
    +   git push origin feature/your-feature-name
    +   # 在GitHub上创建Pull Request
    +   ```
    +
    +### 提交消息规范
    +
    +使用 [Conventional Commits](https://www.conventionalcommits.org/) 规范:
    +
    +```
    +<type>[optional scope]: <description>
    +
    +[optional body]
    +
    +[optional footer(s)]
    +```
    +
    +**类型说明:**
    +
    +- `feat`: 新功能
    +- `fix`: 修复bug
    +- `docs`: 文档更新
    +- `style`: 代码格式调整
    +- `refactor`: 重构代码
    +- `test`: 测试相关
    +- `chore`: 构建或工具变更
    +
    +**示例:**
    +
    +```
    +feat(cli): add interactive mode for parse command
    +
    +Add interactive prompts for better user experience when parsing PRD documents.
    +
    +Closes #123
    +```
    +
    +## 编码规范
    +
    +### TypeScript规范
    +
    +#### 类型定义
    +
    +```typescript
    +// ✅ 好的实践
    +interface TaskConfig {
    +  readonly id: string;
    +  title: string;
    +  description?: string;
    +  priority: 'low' | 'medium' | 'high';
    +  estimatedHours: number;
    +}
    +
    +// ❌ 避免
    +const taskConfig: any = {
    +  id: 'task-1',
    +  title: 'Task 1',
    +};
    +```
    +
    +#### 函数定义
    +
    +```typescript
    +// ✅ 好的实践
    +async function parseDocument(filePath: string, options: ParseOptions = {}): Promise<PRDDocument> {
    +  // 实现
    +}
    +
    +// ❌ 避免
    +function parseDocument(filePath, options) {
    +  // 实现
    +}
    +```
    +
    +#### 类和接口
    +
    +```typescript
    +// ✅ 接口命名使用PascalCase
    +interface TaskManager {
    +  createTask(config: TaskConfig): Promise<Task>;
    +  updateTask(id: string, updates: Partial<TaskConfig>): Promise<Task>;
    +}
    +
    +// ✅ 类实现
    +class DefaultTaskManager implements TaskManager {
    +  private tasks: Map<string, Task> = new Map();
    +
    +  async createTask(config: TaskConfig): Promise<Task> {
    +    // 实现
    +  }
    +
    +  async updateTask(id: string, updates: Partial<TaskConfig>): Promise<Task> {
    +    // 实现
    +  }
    +}
    +```
    +
    +### 代码组织
    +
    +#### 导入顺序
    +
    +```typescript
    +// 1. Node.js内置模块
    +import { readFile } from 'fs/promises';
    +import path from 'path';
    +
    +// 2. 第三方库
    +import chalk from 'chalk';
    +import { Command } from 'commander';
    +
    +// 3. 内部模块(绝对路径)
    +import { Logger } from '@/utils/logger';
    +import { TaskConfig } from '@/types';
    +
    +// 4. 相对路径导入
    +import { validateConfig } from './validator';
    +import { DEFAULT_CONFIG } from '../constants';
    +```
    +
    +#### 导出规范
    +
    +```typescript
    +// ✅ 命名导出(推荐)
    +export class TaskGenerator {}
    +export interface TaskConfig {}
    +export const DEFAULT_TIMEOUT = 30000;
    +
    +// ✅ 默认导出(适用于主要功能)
    +export default class ConfigManager {}
    +
    +// ❌ 混合导出(避免)
    +export default TaskGenerator;
    +export { TaskConfig };
    +```
    +
    +### 错误处理
    +
    +#### 自定义错误类
    +
    +```typescript
    +export class TaskFlowError extends Error {
    +  constructor(
    +    message: string,
    +    public readonly code: string,
    +    public readonly details?: Record<string, unknown>
    +  ) {
    +    super(message);
    +    this.name = 'TaskFlowError';
    +  }
    +}
    +
    +export class ConfigValidationError extends TaskFlowError {
    +  constructor(message: string, field: string) {
    +    super(message, 'CONFIG_VALIDATION_ERROR', { field });
    +  }
    +}
    +```
    +
    +#### 错误处理模式
    +
    +```typescript
    +// ✅ 使用Result模式
    +type Result<T, E = Error> =
    +  | {
    +      success: true;
    +      data: T;
    +    }
    +  | {
    +      success: false;
    +      error: E;
    +    };
    +
    +async function parseDocument(path: string): Promise<Result<PRDDocument>> {
    +  try {
    +    const document = await parseFile(path);
    +    return { success: true, data: document };
    +  } catch (error) {
    +    return { success: false, error: error as Error };
    +  }
    +}
    +```
    +
    +### 注释规范
    +
    +#### JSDoc注释
    +
    +````typescript
    +/**
    + * 解析PRD文档并生成任务列表
    + *
    + * @param filePath - PRD文档文件路径
    + * @param options - 解析选项
    + * @returns Promise解析结果,包含文档信息和生成的任务
    + *
    + * @example
    + * ```typescript
    + * const result = await parseDocument('./prd.md', {
    + *   generateTasks: true,
    + *   aiModel: 'deepseek'
    + * });
    + * ```
    + */
    +async function parseDocument(filePath: string, options: ParseOptions = {}): Promise<ParseResult> {
    +  // 实现
    +}
    +````
    +
    +#### 代码注释
    +
    +```typescript
    +// 配置AI模型参数
    +const modelConfig = {
    +  // 使用更低的temperature确保输出稳定性
    +  temperature: 0.3,
    +  // 限制token数量避免超出限制
    +  maxTokens: 2000,
    +};
    +
    +// TODO: 添加缓存机制优化性能
    +// FIXME: 处理文件路径中的特殊字符
    +// NOTE: 这里使用同步读取是为了确保配置加载完成
    +```
    +
    +## 测试指南
    +
    +### 测试策略
    +
    +我们采用金字塔测试策略:
    +
    +```
    +     /\
    +    /  \  E2E Tests (10%)
    +   /____\
    +  /      \
    + / Integration \ (20%)
    +/____Tests_____\
    +\              /
    + \    Unit    / (70%)
    +  \__Tests__/
    +```
    +
    +### 单元测试
    +
    +#### 测试文件组织
    +
    +```
    +src/
    +├── core/
    +│   ├── parser/
    +│   │   ├── index.ts
    +│   │   └── __tests__/
    +│   │       ├── index.test.ts
    +│   │       └── markdown.test.ts
    +│   └── tasks/
    +│       ├── index.ts
    +│       └── __tests__/
    +│           └── index.test.ts
    +```
    +
    +#### 测试示例
    +
    +```typescript
    +// src/core/parser/__tests__/index.test.ts
    +import { PRDParser } from '../index';
    +import { Logger } from '@/utils/logger';
    +
    +// Mock dependencies
    +jest.mock('@/utils/logger');
    +
    +describe('PRDParser', () => {
    +  let parser: PRDParser;
    +
    +  beforeEach(() => {
    +    parser = new PRDParser({
    +      aiModel: 'mock-model',
    +    });
    +  });
    +
    +  afterEach(() => {
    +    jest.clearAllMocks();
    +  });
    +
    +  describe('parseMarkdown', () => {
    +    it('should parse basic markdown structure', async () => {
    +      const markdown = `
    +# Project Title
    +## Section 1
    +Content for section 1
    +## Section 2
    +Content for section 2
    +      `;
    +
    +      const result = await parser.parseMarkdown(markdown);
    +
    +      expect(result).toMatchObject({
    +        title: 'Project Title',
    +        sections: [
    +          { title: 'Section 1', level: 2 },
    +          { title: 'Section 2', level: 2 },
    +        ],
    +      });
    +    });
    +
    +    it('should handle empty markdown', async () => {
    +      const result = await parser.parseMarkdown('');
    +
    +      expect(result.sections).toHaveLength(0);
    +    });
    +
    +    it('should throw error for invalid input', async () => {
    +      await expect(parser.parseMarkdown(null as any)).rejects.toThrow('Invalid markdown content');
    +    });
    +  });
    +});
    +```
    +
    +#### 测试工具函数
    +
    +```typescript
    +// tests/utils/helpers.ts
    +export function createMockConfig(overrides: Partial<TaskFlowConfig> = {}): TaskFlowConfig {
    +  return {
    +    projectName: 'Test Project',
    +    version: '1.0.0',
    +    aiModels: [],
    +    mcpSettings: {
    +      enabled: false,
    +      port: 3000,
    +      host: 'localhost',
    +    },
    +    ...overrides,
    +  };
    +}
    +
    +export function createMockTask(overrides: Partial<Task> = {}): Task {
    +  return {
    +    id: 'test-task-1',
    +    title: 'Test Task',
    +    description: 'Test description',
    +    type: 'frontend',
    +    status: 'todo',
    +    priority: 'medium',
    +    complexity: 'medium',
    +    estimatedHours: 8,
    +    dependencies: [],
    +    tags: [],
    +    subtasks: [],
    +    progress: 0,
    +    createdAt: new Date(),
    +    updatedAt: new Date(),
    +    ...overrides,
    +  };
    +}
    +```
    +
    +### 集成测试
    +
    +```typescript
    +// tests/integration/cli.test.ts
    +import { execSync } from 'child_process';
    +import { readFileSync, writeFileSync } from 'fs';
    +import { tmpdir } from 'os';
    +import { join } from 'path';
    +
    +describe('CLI Integration Tests', () => {
    +  let testDir: string;
    +
    +  beforeEach(() => {
    +    testDir = join(tmpdir(), `taskflow-test-${Date.now()}`);
    +    execSync(`mkdir -p ${testDir}`);
    +    process.chdir(testDir);
    +  });
    +
    +  afterEach(() => {
    +    execSync(`rm -rf ${testDir}`);
    +  });
    +
    +  it('should initialize project successfully', () => {
    +    const output = execSync('taskflow init --skip-ai', { encoding: 'utf8' });
    +
    +    expect(output).toContain('项目初始化成功');
    +    expect(readFileSync('.taskflow/config.json', 'utf8')).toBeTruthy();
    +  });
    +
    +  it('should parse PRD document', () => {
    +    // 创建测试PRD文件
    +    const prdContent = `
    +# Test Project
    +## Feature 1
    +Description of feature 1
    +    `;
    +    writeFileSync('test-prd.md', prdContent);
    +
    +    // 初始化项目
    +    execSync('taskflow init --skip-ai');
    +
    +    // 解析PRD
    +    const output = execSync('taskflow parse test-prd.md', { encoding: 'utf8' });
    +
    +    expect(output).toContain('解析完成');
    +    expect(readFileSync('output/tasks.json', 'utf8')).toBeTruthy();
    +  });
    +});
    +```
    +
    +### 测试运行
    +
    +```bash
    +# 运行所有测试
    +npm test
    +
    +# 运行特定测试
    +npm test -- --testPathPattern=parser
    +
    +# 运行测试并生成覆盖率报告
    +npm run test:coverage
    +
    +# 监听模式
    +npm run test:watch
    +
    +# 性能测试
    +npm run test:performance
    +```
    +
    +## 调试技巧
    +
    +### VSCode调试配置
    +
    +`.vscode/launch.json`:
    +
    +```json
    +{
    +  "version": "0.2.0",
    +  "configurations": [
    +    {
    +      "name": "Debug CLI",
    +      "type": "node",
    +      "request": "launch",
    +      "program": "${workspaceFolder}/dist/cli/index.js",
    +      "args": ["parse", "example-prd.md"],
    +      "outFiles": ["${workspaceFolder}/dist/**/*.js"],
    +      "sourceMaps": true,
    +      "preLaunchTask": "npm: build"
    +    },
    +    {
    +      "name": "Debug MCP Server",
    +      "type": "node",
    +      "request": "launch",
    +      "program": "${workspaceFolder}/dist/mcp/server.js",
    +      "args": ["--verbose"],
    +      "outFiles": ["${workspaceFolder}/dist/**/*.js"],
    +      "sourceMaps": true,
    +      "preLaunchTask": "npm: build"
    +    },
    +    {
    +      "name": "Debug Tests",
    +      "type": "node",
    +      "request": "launch",
    +      "program": "${workspaceFolder}/node_modules/.bin/jest",
    +      "args": ["--runInBand", "--no-coverage"],
    +      "outFiles": ["${workspaceFolder}/dist/**/*.js"],
    +      "sourceMaps": true
    +    }
    +  ]
    +}
    +```
    +
    +### 日志调试
    +
    +```typescript
    +import { Logger } from '@/utils/logger';
    +
    +const logger = Logger.getInstance('Parser');
    +
    +export class PRDParser {
    +  async parseDocument(filePath: string): Promise<PRDDocument> {
    +    logger.info('开始解析文档', { filePath });
    +
    +    try {
    +      const content = await readFile(filePath, 'utf8');
    +      logger.debug('文件内容读取成功', { contentLength: content.length });
    +
    +      const result = await this.processContent(content);
    +      logger.info('文档解析完成', {
    +        sectionsCount: result.sections.length,
    +        estimatedTime: result.estimatedHours,
    +      });
    +
    +      return result;
    +    } catch (error) {
    +      logger.error('文档解析失败', error);
    +      throw error;
    +    }
    +  }
    +}
    +```
    +
    +### 性能分析
    +
    +```typescript
    +// utils/performance.ts
    +export class PerformanceMonitor {
    +  private static timers: Map<string, number> = new Map();
    +
    +  static start(label: string): void {
    +    this.timers.set(label, performance.now());
    +  }
    +
    +  static end(label: string): number {
    +    const startTime = this.timers.get(label);
    +    if (!startTime) {
    +      throw new Error(`Timer ${label} not found`);
    +    }
    +
    +    const duration = performance.now() - startTime;
    +    this.timers.delete(label);
    +
    +    Logger.getInstance('Performance').info(`${label} took ${duration.toFixed(2)}ms`);
    +    return duration;
    +  }
    +}
    +
    +// 使用示例
    +PerformanceMonitor.start('parse-document');
    +const result = await parseDocument(filePath);
    +PerformanceMonitor.end('parse-document');
    +```
    +
    +## 性能优化
    +
    +### 内存优化
    +
    +```typescript
    +// ✅ 使用流处理大文件
    +import { createReadStream } from 'fs';
    +import { createInterface } from 'readline';
    +
    +async function processLargeFile(filePath: string): Promise<void> {
    +  const fileStream = createReadStream(filePath);
    +  const rl = createInterface({
    +    input: fileStream,
    +    crlfDelay: Infinity,
    +  });
    +
    +  for await (const line of rl) {
    +    // 逐行处理,避免将整个文件加载到内存
    +    await processLine(line);
    +  }
    +}
    +
    +// ✅ 及时清理资源
    +class ResourceManager {
    +  private resources: Set<Disposable> = new Set();
    +
    +  register(resource: Disposable): void {
    +    this.resources.add(resource);
    +  }
    +
    +  dispose(): void {
    +    for (const resource of this.resources) {
    +      resource.dispose();
    +    }
    +    this.resources.clear();
    +  }
    +}
    +```
    +
    +### 并发优化
    +
    +```typescript
    +// ✅ 使用Promise.all并行处理
    +async function processTasks(tasks: Task[]): Promise<TaskResult[]> {
    +  const BATCH_SIZE = 5; // 限制并发数量
    +  const results: TaskResult[] = [];
    +
    +  for (let i = 0; i < tasks.length; i += BATCH_SIZE) {
    +    const batch = tasks.slice(i, i + BATCH_SIZE);
    +    const batchResults = await Promise.all(batch.map(task => processTask(task)));
    +    results.push(...batchResults);
    +  }
    +
    +  return results;
    +}
    +```
    +
    +### 缓存策略
    +
    +```typescript
    +// 实现简单的LRU缓存
    +class LRUCache<T> {
    +  private cache = new Map<string, T>();
    +
    +  constructor(private maxSize: number) {}
    +
    +  get(key: string): T | undefined {
    +    const value = this.cache.get(key);
    +    if (value) {
    +      // 移到最前面
    +      this.cache.delete(key);
    +      this.cache.set(key, value);
    +    }
    +    return value;
    +  }
    +
    +  set(key: string, value: T): void {
    +    if (this.cache.has(key)) {
    +      this.cache.delete(key);
    +    } else if (this.cache.size >= this.maxSize) {
    +      // 删除最久未使用的项
    +      const firstKey = this.cache.keys().next().value;
    +      this.cache.delete(firstKey);
    +    }
    +    this.cache.set(key, value);
    +  }
    +}
    +```
    +
    +## 贡献指南
    +
    +### 如何贡献
    +
    +1. **Fork项目** - 点击GitHub上的Fork按钮
    +2. **创建分支** - `git checkout -b feature/your-feature`
    +3. **开发功能** - 编写代码和测试
    +4. **提交变更** - `git commit -am 'Add some feature'`
    +5. **推送分支** - `git push origin feature/your-feature`
    +6. **创建PR** - 在GitHub上创建Pull Request
    +
    +### PR检查清单
    +
    +- [ ] 代码遵循项目编码规范
    +- [ ] 添加了必要的测试
    +- [ ] 测试通过(`npm test`)
    +- [ ] 代码质量检查通过(`npm run lint`)
    +- [ ] 类型检查通过(`npm run type-check`)
    +- [ ] 更新了相关文档
    +- [ ] 提交消息遵循规范
    +
    +### 代码审查标准
    +
    +#### 功能性
    +
    +- 功能是否按预期工作
    +- 边界条件是否处理正确
    +- 错误处理是否完善
    +
    +#### 代码质量
    +
    +- 代码是否易读易维护
    +- 是否遵循SOLID原则
    +- 是否有重复代码
    +
    +#### 性能
    +
    +- 是否有性能问题
    +- 内存使用是否合理
    +- 是否需要优化
    +
    +#### 安全性
    +
    +- 是否有安全漏洞
    +- 输入验证是否充分
    +- 敏感信息是否安全处理
    +
    +### 发布流程
    +
    +1. **版本规划** - 确定版本号和功能范围
    +2. **功能开发** - 在develop分支上开发
    +3. **集成测试** - 确保所有功能正常工作
    +4. **创建Release分支** - `git checkout -b release/v2.1.0`
    +5. **版本号更新** - 更新package.json和文档
    +6. **最终测试** - 完整的回归测试
    +7. **合并到main** - 合并Release分支
    +8. **打标签** - `git tag v2.1.0`
    +9. **发布** - 发布到npm和GitHub
    +
    +---
    +
    +## 常见问题
    +
    +### Q: 如何添加新的AI模型支持?
    +
    +A: 在 `src/core/ai/providers/` 下创建新的提供商实现,并在 `src/core/ai/index.ts` 中注册。
    +
    +### Q: 如何添加新的CLI命令?
    +
    +A: 在 `src/cli/commands/` 下创建新的命令文件,并在 `src/cli/index.ts` 中注册。
    +
    +### Q: 如何调试MCP服务器?
    +
    +A: 使用 `taskflow mcp start --verbose` 启动详细日志模式,或使用VSCode调试配置。
    +
    +### Q: 如何处理大型PRD文档?
    +
    +A: 使用流式处理和分块解析,避免将整个文档加载到内存中。
    +
    +---
    +
    +## 获取帮助
    +
    +- **GitHub Issues**: [https://github.com/Agions/taskflow-ai/issues](https://github.com/Agions/taskflow-ai/issues)
    +- **GitHub Discussions**: [https://github.com/Agions/taskflow-ai/discussions](https://github.com/Agions/taskflow-ai/discussions)
    +- **Email**: agions@example.com
    +
    +---
    +
    +感谢您对TaskFlow AI的贡献!🎉
    
  • docs/editor-config/cursor.md+164 0 added
    @@ -0,0 +1,164 @@
    +# Cursor AI 编辑器配置
    +
    +## 📖 概述
    +
    +Cursor是一款基于AI的智能代码编辑器,TaskFlow AI为其提供了专门的配置文件生成功能。
    +
    +## 🚀 快速开始
    +
    +### 生成Cursor配置
    +
    +```bash
    +# 使用TaskFlow AI CLI生成Cursor配置
    +taskflow init --editor cursor
    +
    +# 或者在交互模式中选择Cursor
    +taskflow interactive
    +```
    +
    +### 配置文件位置
    +
    +生成的配置文件将保存在:
    +- `.cursor-rules` - Cursor AI行为规则
    +- `.cursor/mcp.json` - MCP服务配置
    +
    +## ⚙️ 配置选项
    +
    +### 基本配置
    +
    +TaskFlow AI会根据您的项目类型自动生成适合的Cursor配置:
    +
    +- **项目类型检测**: 自动识别React、Vue、Node.js等项目类型
    +- **语言支持**: TypeScript、JavaScript、Python等
    +- **框架集成**: 针对不同框架优化的规则
    +
    +### AI行为规则
    +
    +生成的`.cursor-rules`文件包含:
    +
    +1. **代码风格规范**
    +   - 命名约定
    +   - 格式化规则
    +   - 最佳实践
    +
    +2. **框架特定规则**
    +   - React组件规范
    +   - TypeScript类型定义
    +   - 测试编写指南
    +
    +3. **项目约定**
    +   - 文件组织结构
    +   - 导入导出规范
    +   - 错误处理模式
    +
    +## 🔧 高级配置
    +
    +### 自定义规则
    +
    +您可以在生成的配置基础上进行自定义:
    +
    +```markdown
    +# 在.cursor-rules文件中添加自定义规则
    +
    +## 自定义代码风格
    +- 使用4个空格缩进
    +- 行长度限制为100字符
    +- 优先使用const和let,避免var
    +
    +## 项目特定规则
    +- 组件文件使用PascalCase命名
    +- 工具函数文件使用camelCase命名
    +- 常量文件使用UPPER_SNAKE_CASE命名
    +```
    +
    +### MCP服务集成
    +
    +TaskFlow AI通过MCP协议与Cursor集成:
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["taskflow-ai", "mcp"],
    +      "env": {
    +        "NODE_ENV": "production"
    +      }
    +    }
    +  }
    +}
    +```
    +
    +## 📋 功能特性
    +
    +### 智能代码生成
    +
    +- **上下文感知**: 基于项目结构和现有代码
    +- **最佳实践**: 遵循行业标准和团队约定
    +- **类型安全**: TypeScript项目的完整类型支持
    +
    +### 实时协助
    +
    +- **代码补全**: 智能的代码建议
    +- **错误检测**: 实时发现潜在问题
    +- **重构建议**: 代码优化建议
    +
    +### 项目管理
    +
    +- **任务分解**: 将需求转换为具体任务
    +- **进度跟踪**: 开发进度可视化
    +- **文档生成**: 自动生成项目文档
    +
    +## 🛠️ 故障排除
    +
    +### 常见问题
    +
    +1. **配置文件未生效**
    +   - 检查文件路径是否正确
    +   - 重启Cursor编辑器
    +   - 验证JSON格式是否正确
    +
    +2. **MCP服务连接失败**
    +   - 确认TaskFlow AI已正确安装
    +   - 检查网络连接
    +   - 查看Cursor控制台错误信息
    +
    +3. **AI建议不准确**
    +   - 更新项目配置信息
    +   - 检查代码上下文
    +   - 调整AI规则设置
    +
    +### 调试模式
    +
    +启用调试模式获取更多信息:
    +
    +```bash
    +# 启用详细日志
    +DEBUG=taskflow:* taskflow init --editor cursor
    +
    +# 验证配置
    +taskflow validate --editor cursor
    +```
    +
    +## 📚 相关资源
    +
    +- [Cursor官方文档](https://cursor.sh/docs)
    +- [MCP协议规范](https://modelcontextprotocol.io/)
    +- [TaskFlow AI用户指南](/guide/getting-started)
    +- [配置参考](/reference/configuration)
    +
    +## 🔄 更新配置
    +
    +当项目结构或需求发生变化时,可以重新生成配置:
    +
    +```bash
    +# 更新现有配置
    +taskflow update --editor cursor
    +
    +# 强制重新生成
    +taskflow init --editor cursor --force
    +```
    +
    +---
    +
    +> **提示**: 建议定期更新Cursor配置以获得最新的AI功能和最佳实践。
    
  • docs/editor-config/overview.md+232 0 added
    @@ -0,0 +1,232 @@
    +# AI编辑器配置系统
    +
    +TaskFlow AI v1.2.0 引入了革命性的AI编辑器配置生成功能,能够为主流代码编辑器自动生成专业级配置文件,大幅提升开发效率。
    +
    +## 🎯 功能概述
    +
    +### 支持的编辑器
    +- **[Cursor](cursor.md)** - AI原生代码编辑器,智能代码补全
    +- **[VSCode](vscode.md)** - 微软Visual Studio Code,最受欢迎的代码编辑器
    +
    +### 核心特性
    +- **🤖 智能配置生成**: 根据项目类型自动生成最优配置
    +- **🎨 个性化定制**: 支持TypeScript、React、Vue等技术栈定制
    +- **🔧 专业规则集**: 内置最佳实践和代码规范
    +- **⚡ 一键部署**: 自动创建配置文件和目录结构
    +
    +## 🚀 快速开始
    +
    +### 基本用法
    +
    +```bash
    +# 为单个编辑器生成配置
    +taskflow init my-project --editor cursor
    +
    +# 为多个编辑器生成配置
    +taskflow init my-project --editor cursor,vscode,vim
    +
    +# 指定项目类型和技术栈
    +taskflow init my-react-app \
    +  --template web-app \
    +  --editor cursor,vscode \
    +  --typescript \
    +  --testing \
    +  --linting
    +```
    +
    +### 配置选项
    +
    +| 选项 | 描述 | 默认值 |
    +|------|------|--------|
    +| `--editor` | 目标编辑器列表 | `cursor,vscode` |
    +| `--typescript` | 启用TypeScript支持 | `false` |
    +| `--testing` | 启用测试框架配置 | `false` |
    +| `--linting` | 启用代码检查工具 | `false` |
    +| `--formatting` | 启用代码格式化 | `true` |
    +
    +## 📁 生成的文件结构
    +
    +```
    +my-project/
    +├── .cursor-rules              # Cursor AI规则配置
    +├── .vscode/                   # VSCode配置目录
    +│   ├── settings.json          # 编辑器设置
    +│   ├── launch.json            # 调试配置
    +│   ├── tasks.json             # 任务配置
    +│   └── extensions.json        # 推荐扩展
    +├── .vim/                      # Vim配置目录
    +│   └── coc-settings.json      # CoC插件配置
    +├── .zed/                      # Zed配置目录
    +│   └── settings.json          # 编辑器设置
    +└── .editorconfig              # 通用编辑器配置
    +```
    +
    +## 🎨 配置模板系统
    +
    +### 模板变量
    +配置生成器支持丰富的模板变量,确保生成的配置符合项目特性:
    +
    +```typescript
    +interface EditorVariables {
    +  PROJECT_NAME: string;          // 项目名称
    +  PROJECT_TYPE: string;          // 项目类型
    +  PROJECT_DESCRIPTION: string;   // 项目描述
    +  DATE: string;                  // 创建日期
    +  VERSION: string;               // 版本号
    +  TYPESCRIPT: boolean;           // TypeScript支持
    +  REACT: boolean;                // React框架
    +  VUE: boolean;                  // Vue框架
    +  JEST: boolean;                 // Jest测试框架
    +  ESLINT: boolean;               // ESLint代码检查
    +  PRETTIER: boolean;             // Prettier代码格式化
    +  PORT: number;                  // 开发服务器端口
    +}
    +```
    +
    +### 条件渲染
    +配置模板支持条件渲染,根据项目特性动态生成内容:
    +
    +```handlebars
    +{{#if TYPESCRIPT}}
    +### TypeScript配置
    +- 启用严格模式
    +- 配置路径映射
    +- 类型检查优化
    +{{/if}}
    +
    +{{#if REACT}}
    +### React开发配置
    +- JSX语法支持
    +- React Hooks规则
    +- 组件快速创建
    +{{/if}}
    +```
    +
    +## 🔧 高级配置
    +
    +### 自定义模板
    +可以创建自定义编辑器配置模板:
    +
    +```bash
    +# 创建自定义模板目录
    +mkdir -p templates/editors/my-editor
    +
    +# 创建配置模板文件
    +echo "# {{PROJECT_NAME}} 自定义配置" > templates/editors/my-editor/config.template
    +```
    +
    +### 配置覆盖
    +支持通过配置文件覆盖默认设置:
    +
    +```json
    +{
    +  "editorConfig": {
    +    "cursor": {
    +      "rules": {
    +        "codeStyle": "professional",
    +        "aiAssistance": "enhanced",
    +        "debugging": true
    +      }
    +    },
    +    "vscode": {
    +      "settings": {
    +        "editor.fontSize": 14,
    +        "editor.tabSize": 2,
    +        "workbench.colorTheme": "Dark+"
    +      }
    +    }
    +  }
    +}
    +```
    +
    +## 📊 配置效果对比
    +
    +### 使用前 vs 使用后
    +
    +| 方面 | 手动配置 | TaskFlow AI配置 |
    +|------|----------|-----------------|
    +| **配置时间** | 2-4小时 | 30秒 |
    +| **配置质量** | 因人而异 | 专业标准 |
    +| **一致性** | 难以保证 | 完全一致 |
    +| **维护成本** | 高 | 低 |
    +| **最佳实践** | 需要学习 | 自动应用 |
    +
    +### 开发效率提升
    +
    +- **代码补全准确率**: 提升40%
    +- **调试配置时间**: 减少80%
    +- **代码规范遵循**: 提升95%
    +- **团队协作效率**: 提升60%
    +
    +## 🌟 最佳实践
    +
    +### 1. 选择合适的编辑器组合
    +```bash
    +# 前端开发推荐
    +taskflow init --editor cursor,vscode
    +
    +# 后端开发推荐  
    +taskflow init --editor vscode,vim
    +
    +# 全栈开发推荐
    +taskflow init --editor cursor,vscode,zed
    +```
    +
    +### 2. 启用相关技术栈支持
    +```bash
    +# React + TypeScript项目
    +taskflow init my-react-app \
    +  --template web-app \
    +  --typescript \
    +  --testing \
    +  --linting
    +
    +# Node.js API项目
    +taskflow init my-api \
    +  --template api \
    +  --typescript \
    +  --testing
    +```
    +
    +### 3. 团队协作配置
    +```bash
    +# 生成团队统一配置
    +taskflow init team-project \
    +  --editor cursor,vscode \
    +  --config team-standards.json
    +```
    +
    +## 🔍 故障排除
    +
    +### 常见问题
    +
    +**Q: 配置文件没有生成?**
    +A: 检查目标目录权限,确保有写入权限。
    +
    +**Q: 编辑器不识别配置?**
    +A: 重启编辑器,某些配置需要重启后生效。
    +
    +**Q: 如何更新配置?**
    +A: 重新运行init命令,使用`--force`参数覆盖现有配置。
    +
    +### 调试模式
    +```bash
    +# 启用详细日志
    +taskflow init --editor cursor --verbose
    +
    +# 生成配置但不写入文件
    +taskflow init --editor cursor --dry-run
    +```
    +
    +## 📚 相关文档
    +
    +- [Cursor配置详解](cursor.md)
    +- [VSCode配置指南](vscode.md)
    +- [Vim配置说明](vim.md)
    +- [Zed配置指南](zed.md)
    +- [项目模板系统](../templates/overview.md)
    +- [CLI命令参考](../cli-reference.md)
    +
    +---
    +
    +**下一步**: 选择您使用的编辑器,查看详细的配置说明和使用技巧。
    
  • docs/editor-config/windsurf-trae-integration.md+538 0 added
    @@ -0,0 +1,538 @@
    +# Windsurf和Trae编辑器集成指南
    +
    +TaskFlow AI v1.2.0 新增了对 Windsurf 和 Trae 编辑器的完整支持,并集成了 MCP (Model Context Protocol) 服务,实现了智能的多模型任务编排和实时协作功能。
    +
    +## 🎯 新功能概览
    +
    +### 1. 编辑器支持扩展
    +- ✅ **Windsurf**: 完整的AI配置和MCP服务集成
    +- ✅ **Trae**: 智能工作流和任务管理集成
    +- ✅ **MCP服务**: 统一的模型上下文协议支持
    +- ✅ **多模型协作**: 智能任务分解和模型选择
    +
    +### 2. 核心特性
    +- 🤖 **智能任务分解**: 类似AugmentCode的复杂任务拆分
    +- 🔄 **多模型协作**: 自动选择最适合的AI模型
    +- 📊 **实时状态同步**: 任务进度和状态实时更新
    +- 🔗 **依赖关系管理**: 智能的任务依赖分析
    +- 🎯 **负载均衡**: 自动模型负载均衡和故障转移
    +
    +## 🚀 快速开始
    +
    +### 安装和初始化
    +
    +```bash
    +# 创建新项目(默认启用所有支持的编辑器)
    +taskflow init
    +
    +# 或者指定特定编辑器
    +taskflow init --editor windsurf,trae 
    +
    +# 为现有项目添加编辑器配置
    +taskflow init --force
    +```
    +
    +### 生成的文件结构
    +
    +```
    +my-project/
    +├── .windsurf/                 # Windsurf编辑器配置
    +│   ├── settings.json          # 主配置文件
    +│   ├── mcp.json              # MCP服务配置
    +│   └── ai-config.json        # AI助手配置
    +├── .trae/                    # Trae编辑器配置
    +│   ├── config.json           # 主配置文件
    +│   ├── mcp.json              # MCP服务配置
    +│   └── workflows.json        # 工作流配置
    +├── .taskflow/                # TaskFlow数据目录
    +│   ├── config.json           # 项目配置
    +│   └── tasks.json            # 任务数据
    +└── taskflow.config.json      # 全局配置
    +```
    +
    +## 🔧 Windsurf编辑器集成
    +
    +### 配置特性
    +
    +Windsurf配置包含以下核心功能:
    +
    +#### 1. AI助手配置
    +```json
    +{
    +  "ai": {
    +    "enabled": true,
    +    "provider": "taskflow-ai",
    +    "features": {
    +      "codeCompletion": true,
    +      "codeGeneration": true,
    +      "taskDecomposition": true,
    +      "projectAnalysis": true,
    +      "multiModelOrchestration": true
    +    }
    +  }
    +}
    +```
    +
    +#### 2. 多模型策略
    +```json
    +{
    +  "orchestration": {
    +    "strategy": "intelligent",
    +    "models": {
    +      "codeGeneration": {
    +        "primary": "deepseek",
    +        "fallback": ["qwen", "zhipu"]
    +      },
    +      "taskPlanning": {
    +        "primary": "qwen",
    +        "fallback": ["wenxin", "spark"]
    +      },
    +      "documentation": {
    +        "primary": "moonshot",
    +        "fallback": ["qwen", "zhipu"]
    +      }
    +    }
    +  }
    +}
    +```
    +
    +#### 3. 智能任务分解
    +```json
    +{
    +  "features": {
    +    "smartTaskBreakdown": {
    +      "enabled": true,
    +      "maxDepth": 3,
    +      "autoAssignment": true,
    +      "dependencyTracking": true
    +    }
    +  }
    +}
    +```
    +
    +### 使用方法
    +
    +1. **启动Windsurf编辑器**
    +2. **打开项目目录**
    +3. **TaskFlow AI会自动激活**,提供以下功能:
    +   - 智能代码补全和生成
    +   - 自动任务分解和规划
    +   - 实时项目状态同步
    +   - 多模型协作处理
    +
    +## 🎨 Trae编辑器集成
    +
    +### 工作流配置
    +
    +Trae编辑器专注于工作流自动化和任务管理:
    +
    +#### 1. 智能任务分解工作流
    +```json
    +{
    +  "name": "Smart Task Decomposition",
    +  "trigger": "on_prd_change",
    +  "actions": [
    +    {
    +      "type": "taskflow_parse_prd",
    +      "config": {
    +        "autoGenerate": true,
    +        "multiModel": true,
    +        "assignees": "auto"
    +      }
    +    },
    +    {
    +      "type": "taskflow_generate_tasks",
    +      "config": {
    +        "depth": 3,
    +        "dependencies": true,
    +        "estimates": true
    +      }
    +    }
    +  ]
    +}
    +```
    +
    +#### 2. 多模型代码生成工作流
    +```json
    +{
    +  "name": "Multi-Model Code Generation",
    +  "trigger": "on_task_start",
    +  "actions": [
    +    {
    +      "type": "taskflow_multi_model_orchestration",
    +      "config": {
    +        "strategy": "best_for_task",
    +        "fallback": true,
    +        "quality_check": true
    +      }
    +    }
    +  ]
    +}
    +```
    +
    +#### 3. 进度同步工作流
    +```json
    +{
    +  "name": "Progress Sync",
    +  "trigger": "on_file_save",
    +  "actions": [
    +    {
    +      "type": "taskflow_update_task_status",
    +      "config": {
    +        "auto_detect": true,
    +        "sync_team": true
    +      }
    +    }
    +  ]
    +}
    +```
    +
    +## 🔗 MCP服务集成
    +
    +### 可用工具
    +
    +TaskFlow AI MCP服务提供以下工具:
    +
    +#### 1. PRD解析工具
    +```typescript
    +taskflow_parse_prd({
    +  content: "# 产品需求文档\n...",
    +  format: "markdown",
    +  options: {
    +    extractSections: true,
    +    extractFeatures: true,
    +    prioritize: true
    +  }
    +})
    +```
    +
    +#### 2. 任务生成工具
    +```typescript
    +taskflow_generate_tasks({
    +  requirements: ["用户认证", "数据展示", "报表生成"],
    +  projectType: "Web Application",
    +  complexity: "medium",
    +  maxDepth: 3
    +})
    +```
    +
    +#### 3. 多模型协作工具
    +```typescript
    +taskflow_multi_model_orchestration({
    +  task: "实现用户管理系统",
    +  taskType: "code_generation",
    +  context: {
    +    projectType: "Web Application",
    +    technologies: ["React", "Node.js"],
    +    priority: "high"
    +  },
    +  options: {
    +    useMultipleModels: true,
    +    qualityCheck: true,
    +    fallbackEnabled: true
    +  }
    +})
    +```
    +
    +#### 4. 智能任务分解工具
    +```typescript
    +taskflow_smart_task_breakdown({
    +  complexTask: "开发完整的电商平台",
    +  targetGranularity: "medium",
    +  estimateEffort: true,
    +  generateDependencies: true
    +})
    +```
    +
    +#### 5. 任务状态管理工具
    +```typescript
    +taskflow_update_task_status({
    +  taskId: "task_123",
    +  status: "in_progress",
    +  progress: 75,
    +  notes: "功能开发进行中"
    +})
    +```
    +
    +#### 6. 项目状态查询工具
    +```typescript
    +taskflow_get_project_status({
    +  projectPath: ".",
    +  includeDetails: true,
    +  includeMetrics: true
    +})
    +```
    +
    +### MCP服务启动
    +
    +MCP服务会在编辑器启动时自动运行:
    +
    +```bash
    +# 手动启动MCP服务(调试用)
    +node dist/mcp/server.js
    +
    +# 或使用npm脚本
    +npm run mcp:start
    +```
    +
    +## 🤖 多模型协作功能
    +
    +### 智能模型选择
    +
    +TaskFlow AI会根据任务类型自动选择最适合的模型:
    +
    +| 任务类型 | 主要模型 | 备用模型 | 特点 |
    +|---------|---------|---------|------|
    +| 代码生成 | DeepSeek | Qwen, Zhipu | 专业代码能力 |
    +| 任务规划 | Qwen | Wenxin, Spark | 逻辑推理能力 |
    +| 文档编写 | Moonshot | Qwen, Zhipu | 长文本处理 |
    +| 测试设计 | Zhipu | DeepSeek, Qwen | 质量保证 |
    +| 代码审核 | DeepSeek | Zhipu, Qwen | 代码理解 |
    +
    +### 任务分解策略
    +
    +复杂任务会被智能分解为可执行的子任务:
    +
    +```typescript
    +// 示例:开发用户管理系统
    +const complexTask = {
    +  description: "开发完整的用户管理系统",
    +  type: "code_generation"
    +};
    +
    +// 自动分解为:
    +const subtasks = [
    +  {
    +    title: "需求分析",
    +    estimatedHours: 4,
    +    recommendedModel: "qwen"
    +  },
    +  {
    +    title: "核心代码实现", 
    +    estimatedHours: 12,
    +    recommendedModel: "deepseek",
    +    dependencies: ["需求分析"]
    +  },
    +  {
    +    title: "测试代码编写",
    +    estimatedHours: 6,
    +    recommendedModel: "zhipu",
    +    dependencies: ["核心代码实现"]
    +  },
    +  {
    +    title: "技术文档",
    +    estimatedHours: 4,
    +    recommendedModel: "moonshot",
    +    dependencies: ["核心代码实现"]
    +  }
    +];
    +```
    +
    +### 执行计划生成
    +
    +系统会自动生成最优的执行计划:
    +
    +```typescript
    +const executionPlan = [
    +  {
    +    step: 1,
    +    tasks: ["需求分析"],
    +    parallelExecution: false,
    +    estimatedDuration: 4
    +  },
    +  {
    +    step: 2,
    +    tasks: ["核心代码实现"],
    +    parallelExecution: false,
    +    estimatedDuration: 12
    +  },
    +  {
    +    step: 3,
    +    tasks: ["测试代码编写", "技术文档"],
    +    parallelExecution: true,
    +    estimatedDuration: 6
    +  }
    +];
    +```
    +
    +## 📊 任务状态管理
    +
    +### 状态跟踪
    +
    +TaskFlow AI提供完整的任务状态管理:
    +
    +```typescript
    +enum TaskStatus {
    +  PENDING = 'pending',        // 待处理
    +  IN_PROGRESS = 'in_progress', // 进行中
    +  COMPLETED = 'completed',     // 已完成
    +  BLOCKED = 'blocked',        // 阻塞中
    +  CANCELLED = 'cancelled'     // 已取消
    +}
    +```
    +
    +### 进度监控
    +
    +实时监控项目整体进度:
    +
    +```typescript
    +const stats = {
    +  total: 15,           // 总任务数
    +  completed: 8,        // 已完成
    +  in_progress: 4,      // 进行中
    +  pending: 2,          // 待处理
    +  blocked: 1,          // 阻塞中
    +  overallProgress: 53.3 // 整体进度%
    +};
    +```
    +
    +### 依赖关系管理
    +
    +自动检查和管理任务依赖:
    +
    +```typescript
    +const dependencies = taskManager.checkTaskDependencies('task_123');
    +// {
    +//   canStart: false,
    +//   blockedBy: ['task_456', 'task_789']
    +// }
    +```
    +
    +## 🔧 配置和自定义
    +
    +### 模型配置
    +
    +在 `taskflow.config.json` 中配置AI模型:
    +
    +```json
    +{
    +  "ai": {
    +    "models": {
    +      "default": "qwen",
    +      "multiModel": {
    +        "enabled": true,
    +        "primary": "qwen",
    +        "fallback": ["deepseek", "zhipu", "moonshot"]
    +      }
    +    },
    +    "orchestration": {
    +      "strategy": "intelligent",
    +      "loadBalancing": true,
    +      "healthCheck": true
    +    }
    +  }
    +}
    +```
    +
    +### 工作流自定义
    +
    +在 `.trae/workflows.json` 中自定义工作流:
    +
    +```json
    +{
    +  "workflows": [
    +    {
    +      "name": "Custom Code Review",
    +      "trigger": "on_pull_request",
    +      "actions": [
    +        {
    +          "type": "taskflow_multi_model_orchestration",
    +          "config": {
    +            "taskType": "review",
    +            "models": ["deepseek", "zhipu"],
    +            "criteria": ["security", "performance", "maintainability"]
    +          }
    +        }
    +      ]
    +    }
    +  ]
    +}
    +```
    +
    +## 🚀 最佳实践
    +
    +### 1. 项目初始化
    +```bash
    +# 使用默认配置(包含所有支持的编辑器)
    +taskflow init --template web-app --typescript --testing
    +
    +# 或者指定特定编辑器
    +taskflow init --editor windsurf,trae,cursor --template web-app --typescript --testing
    +```
    +
    +### 2. 任务规划
    +- 使用PRD解析工具自动生成初始任务
    +- 利用智能任务分解处理复杂需求
    +- 设置合理的任务依赖关系
    +
    +### 3. 多模型使用
    +- 让系统自动选择最适合的模型
    +- 启用质量检查和故障转移
    +- 监控模型性能指标
    +
    +### 4. 团队协作
    +- 启用实时状态同步
    +- 使用工作流自动化常见操作
    +- 定期查看项目状态报告
    +
    +## 🔍 故障排除
    +
    +### 常见问题
    +
    +1. **MCP服务无法启动**
    +   ```bash
    +   # 检查Node.js版本
    +   node --version  # 需要 >= 16.0.0
    +   
    +   # 重新安装依赖
    +   npm install
    +   
    +   # 手动启动MCP服务
    +   npm run mcp:start
    +   ```
    +
    +2. **编辑器配置未生效**
    +   ```bash
    +   # 重新生成配置
    +   taskflow init . --editor windsurf,trae --force
    +   
    +   # 检查配置文件
    +   cat .windsurf/settings.json
    +   cat .trae/config.json
    +   ```
    +
    +3. **任务状态同步问题**
    +   ```bash
    +   # 检查任务数据
    +   cat .taskflow/tasks.json
    +   
    +   # 重置任务状态
    +   taskflow tasks reset
    +   ```
    +
    +### 调试模式
    +
    +启用调试模式获取详细日志:
    +
    +```bash
    +# 设置调试环境变量
    +export DEBUG=taskflow:*
    +export LOG_LEVEL=debug
    +
    +# 启动服务
    +npm run dev
    +```
    +
    +## 📚 API参考
    +
    +详细的API文档请参考:
    +- [MCP服务API](./mcp-api-reference.md)
    +- [多模型协作API](./multi-model-api.md)
    +- [任务管理API](./task-management-api.md)
    +
    +## 🎯 下一步
    +
    +- 探索[高级配置选项](./advanced-configuration.md)
    +- 学习[自定义工作流](./custom-workflows.md)
    +- 查看[性能优化指南](./performance-optimization.md)
    +- 参与[社区讨论](https://github.com/agions/taskflow-ai/discussions)
    
  • docs/faq.md+349 0 added
    @@ -0,0 +1,349 @@
    +# 常见问题解答 (FAQ)
    +
    +## 🤔 一般问题
    +
    +### Q: TaskFlow AI 是什么?
    +A: TaskFlow AI 是一个智能的PRD文档解析与任务管理工具,专为开发团队设计。它能够自动解析产品需求文档(PRD),智能提取关键信息,生成结构化的开发任务,并提供完整的任务管理和进度跟踪功能。
    +
    +### Q: TaskFlow AI 支持哪些AI模型?
    +A: TaskFlow AI 支持多个国产大模型,包括:
    +- **DeepSeek**: 强大的代码理解和生成能力
    +- **智谱AI (GLM)**: 优秀的中文理解和推理能力
    +- **通义千问 (Qwen)**: 阿里云的大语言模型
    +- **文心一言 (ERNIE)**: 百度的AI大模型
    +- **月之暗面 (Moonshot)**: 长文本处理能力强
    +- **讯飞星火 (Spark)**: 科大讯飞的AI模型
    +
    +### Q: TaskFlow AI 是免费的吗?
    +A: TaskFlow AI 本身是开源免费的,采用 MIT 许可证。但是使用AI模型需要相应的API密钥,这些服务可能会产生费用。我们建议根据使用量选择合适的AI服务商套餐。
    +
    +### Q: TaskFlow AI 支持哪些编程语言?
    +A: TaskFlow AI 支持多种编程语言的项目模板,包括:
    +- **JavaScript/TypeScript**: React, Vue, Node.js, Express
    +- **Python**: Django, Flask, FastAPI
    +- **Java**: Spring Boot, Maven, Gradle
    +- **Go**: Gin, Echo, 标准库
    +- **Rust**: Actix, Rocket, Tokio
    +- **C#**: .NET Core, ASP.NET
    +- **PHP**: Laravel, Symfony
    +
    +## 🛠️ 安装和配置
    +
    +### Q: 如何安装 TaskFlow AI?
    +A: 你可以通过 npm 全局安装:
    +```bash
    +npm install -g taskflow-ai
    +```
    +
    +或者在项目中本地安装:
    +```bash
    +npm install taskflow-ai
    +```
    +
    +### Q: 安装时遇到权限错误怎么办?
    +A: 如果遇到权限错误,可以尝试以下解决方案:
    +
    +1. **使用 sudo(不推荐)**:
    +   ```bash
    +   sudo npm install -g taskflow-ai
    +   ```
    +
    +2. **配置 npm 全局目录(推荐)**:
    +   ```bash
    +   mkdir ~/.npm-global
    +   npm config set prefix '~/.npm-global'
    +   echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
    +   source ~/.bashrc
    +   npm install -g taskflow-ai
    +   ```
    +
    +3. **使用 nvm**:
    +   ```bash
    +   curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
    +   nvm install node
    +   npm install -g taskflow-ai
    +   ```
    +
    +### Q: 如何获取AI模型的API密钥?
    +A: 不同模型的API密钥获取方式:
    +
    +- **DeepSeek**: 访问 [DeepSeek 官网](https://www.deepseek.com/) 注册账号
    +- **智谱AI**: 访问 [智谱AI 开放平台](https://open.bigmodel.cn/) 注册
    +- **通义千问**: 访问 [阿里云模型服务灵积](https://dashscope.aliyun.com/) 注册
    +- **文心一言**: 访问 [百度智能云](https://cloud.baidu.com/) 注册
    +- **月之暗面**: 访问 [Moonshot AI](https://www.moonshot.cn/) 注册
    +
    +### Q: 配置文件在哪里?
    +A: 配置文件位置:
    +- **Windows**: `%USERPROFILE%\.taskflow\config.json`
    +- **macOS**: `~/.taskflow/config.json`
    +- **Linux**: `~/.taskflow/config.json`
    +
    +你可以使用 `taskflow config path` 命令查看配置文件路径。
    +
    +## 📄 PRD解析
    +
    +### Q: TaskFlow AI 支持哪些文档格式?
    +A: 目前支持以下格式:
    +- **Markdown (.md)**: 推荐格式,解析效果最佳
    +- **纯文本 (.txt)**: 基本支持
    +- **Word 文档 (.docx)**: 实验性支持
    +- **PDF 文件 (.pdf)**: 计划中
    +
    +### Q: 如何编写高质量的PRD文档?
    +A: 建议的PRD文档结构:
    +
    +```markdown
    +# 项目标题
    +
    +## 项目概述
    +简要描述项目的目标和背景
    +
    +## 功能需求
    +### 功能1: 功能名称
    +- 描述: 详细的功能描述
    +- 验收标准:
    +  - 标准1
    +  - 标准2
    +
    +## 技术要求
    +- 前端技术栈
    +- 后端技术栈
    +- 数据库选择
    +
    +## 优先级
    +1. 高优先级功能
    +2. 中优先级功能
    +3. 低优先级功能
    +```
    +
    +### Q: 解析结果不准确怎么办?
    +A: 可以尝试以下方法:
    +
    +1. **优化PRD文档结构**:确保文档结构清晰,包含明确的功能描述和验收标准
    +2. **尝试不同的AI模型**:
    +   ```bash
    +   taskflow parse requirements.md --model zhipu
    +   ```
    +3. **启用多模型协同**:
    +   ```bash
    +   taskflow parse requirements.md --multi-model
    +   ```
    +4. **调整解析参数**:
    +   ```bash
    +   taskflow parse requirements.md --extract-sections --extract-features
    +   ```
    +
    +## 📋 任务管理
    +
    +### Q: 如何查看任务列表?
    +A: 使用以下命令查看任务:
    +```bash
    +# 查看所有任务
    +taskflow status
    +
    +# 查看特定状态的任务
    +taskflow status --filter status=in_progress
    +
    +# 查看高优先级任务
    +taskflow status --filter priority=high
    +```
    +
    +### Q: 如何更新任务状态?
    +A: 使用 `taskflow status update` 命令:
    +```bash
    +# 更新单个任务状态
    +taskflow status update task-001 completed
    +
    +# 批量更新任务状态
    +taskflow status update --batch task-001,task-002 in_progress
    +
    +# 添加完成备注
    +taskflow status update task-001 completed --comment "功能已实现并测试通过"
    +```
    +
    +### Q: 如何查看项目进度?
    +A: 使用进度查看命令:
    +```bash
    +# 查看整体进度
    +taskflow status progress
    +
    +# 查看详细进度报告
    +taskflow status progress --detailed
    +
    +# 生成进度图表
    +taskflow status progress --chart
    +```
    +
    +## 🛠️ AI编辑器集成
    +
    +### Q: TaskFlow AI 支持哪些AI编辑器?
    +A: 目前支持以下AI编辑器:
    +- **Cursor**: 专业的AI代码编辑器
    +- **Windsurf**: 新兴的AI编程工具
    +- **Trae**: AI辅助开发环境
    +- **VSCode**: 配合AI扩展使用
    +
    +### Q: 如何在现有项目中集成TaskFlow AI?
    +A: 在现有项目目录中初始化TaskFlow AI:
    +```bash
    +# 进入现有项目目录
    +cd your-existing-project
    +
    +# 初始化TaskFlow AI配置
    +taskflow init
    +
    +# 配置AI模型
    +taskflow config set models.deepseek.apiKey "your-api-key"
    +```
    +
    +### Q: 生成的配置文件包含什么?
    +A: 生成的配置文件包括:
    +- **代码规范**: ESLint、Prettier配置
    +- **AI规则**: 编辑器特定的AI提示规则
    +- **项目设置**: 工作区配置和推荐扩展
    +- **调试配置**: 断点和调试设置
    +
    +## 🔧 高级功能
    +
    +### Q: 如何启用多模型协同?
    +A: 配置多模型支持:
    +```bash
    +# 启用多模型支持
    +taskflow config set multiModel.enabled true
    +
    +# 设置主要模型
    +taskflow config set multiModel.primary "deepseek"
    +
    +# 设置备用模型
    +taskflow config set multiModel.fallback '["zhipu", "qwen"]'
    +
    +# 启用负载均衡
    +taskflow config set multiModel.loadBalancing true
    +```
    +
    +### Q: 如何优化性能?
    +A: 性能优化建议:
    +
    +1. **调整缓存设置**:
    +   ```bash
    +   taskflow config set performance.cacheSize 200
    +   taskflow config set performance.cacheTTL 600000
    +   ```
    +
    +2. **增加并发数**:
    +   ```bash
    +   taskflow config set performance.concurrency 10
    +   ```
    +
    +3. **启用性能监控**:
    +   ```bash
    +   taskflow config set performance.enableMonitoring true
    +   ```
    +
    +### Q: 如何备份和恢复数据?
    +A: 数据备份和恢复:
    +```bash
    +# 创建备份
    +taskflow backup create
    +
    +# 查看备份列表
    +taskflow backup list
    +
    +# 恢复备份
    +taskflow backup restore latest
    +
    +# 导出配置
    +taskflow config export config-backup.json
    +
    +# 导入配置
    +taskflow config import config-backup.json
    +```
    +
    +## 🐛 故障排除
    +
    +### Q: 命令执行缓慢怎么办?
    +A: 性能优化方法:
    +1. 清理缓存:`taskflow cache clear`
    +2. 检查网络连接:`ping api.deepseek.com`
    +3. 调整超时设置:`taskflow config set performance.timeout 60000`
    +4. 使用本地代理:配置代理设置
    +
    +### Q: API请求失败怎么办?
    +A: 检查以下项目:
    +1. **API密钥是否正确**:`taskflow config validate`
    +2. **网络连接是否正常**:`taskflow models test`
    +3. **API配额是否充足**:查看服务商控制台
    +4. **是否需要代理**:配置网络代理
    +
    +### Q: 如何获取详细的错误信息?
    +A: 启用调试模式:
    +```bash
    +# 设置日志级别为调试
    +taskflow config set logging.level debug
    +
    +# 查看详细日志
    +taskflow logs --tail 50
    +
    +# 生成诊断报告
    +taskflow doctor
    +```
    +
    +## 💡 最佳实践
    +
    +### Q: 团队协作的最佳实践是什么?
    +A: 团队协作建议:
    +
    +1. **统一配置**:使用版本控制管理配置模板
    +2. **定期同步**:每日更新任务状态
    +3. **标准化流程**:制定统一的PRD编写规范
    +4. **权限管理**:合理分配任务和权限
    +5. **定期备份**:定期备份项目数据和配置
    +
    +### Q: 如何提高PRD解析质量?
    +A: PRD编写建议:
    +
    +1. **结构清晰**:使用标准的Markdown格式
    +2. **描述详细**:包含完整的功能描述和验收标准
    +3. **优先级明确**:明确标注功能优先级
    +4. **技术要求具体**:详细说明技术栈和架构要求
    +5. **示例丰富**:提供UI原型和交互示例
    +
    +### Q: 如何选择合适的AI模型?
    +A: 模型选择建议:
    +
    +- **DeepSeek**: 适合代码生成和技术文档解析
    +- **智谱AI**: 适合中文内容理解和业务逻辑分析
    +- **通义千问**: 适合综合性任务和多轮对话
    +- **文心一言**: 适合创意性内容和文案生成
    +
    +## 📞 获取帮助
    +
    +### Q: 如何获取更多帮助?
    +A: 获取帮助的途径:
    +
    +1. **查看文档**:[在线文档](https://agions.github.io/taskflow-ai)
    +2. **GitHub Issues**:[提交问题](https://github.com/agions/taskflow-ai/issues)
    +3. **讨论区**:[GitHub Discussions](https://github.com/agions/taskflow-ai/discussions)
    +4. **社区群组**:加入QQ群或微信群
    +5. **邮件支持**:发送邮件到 1051736049@qq.com
    +
    +### Q: 如何报告Bug?
    +A: 报告Bug时请提供:
    +1. **系统信息**:`taskflow info`
    +2. **错误日志**:`taskflow logs --level error`
    +3. **重现步骤**:详细的操作步骤
    +4. **预期行为**:期望的正确结果
    +5. **实际行为**:观察到的错误现象
    +
    +### Q: 如何提出功能建议?
    +A: 提出功能建议:
    +1. 访问 [GitHub Issues](https://github.com/agions/taskflow-ai/issues)
    +2. 选择 "Feature Request" 模板
    +3. 详细描述功能需求和使用场景
    +4. 说明功能的价值和重要性
    +5. 提供可能的实现方案
    +
    +---
    +
    +*如果你的问题没有在这里找到答案,请通过 [GitHub Issues](https://github.com/agions/taskflow-ai/issues) 联系我们。*
    
  • docs/guide/advanced-features.md+426 0 added
    @@ -0,0 +1,426 @@
    +# 高级功能指南
    +
    +## 概述
    +
    +本指南介绍TaskFlow AI的高级功能,包括多模型协同、性能优化、自定义配置、批量操作等企业级特性。这些功能可以帮助你更好地管理复杂项目和团队协作。
    +
    +## 🤖 多模型AI协同
    +
    +### 配置多模型支持
    +
    +TaskFlow AI支持同时使用多个AI模型,提供更好的解析效果和容错能力:
    +
    +```bash
    +# 启用多模型支持
    +taskflow config set multiModel.enabled true
    +
    +# 设置主要模型
    +taskflow config set multiModel.primary "deepseek"
    +
    +# 设置备用模型(按优先级排序)
    +taskflow config set multiModel.fallback '["zhipu", "qwen", "baidu"]'
    +
    +# 启用负载均衡
    +taskflow config set multiModel.loadBalancing true
    +
    +# 启用成本优化
    +taskflow config set multiModel.costOptimization true
    +```
    +
    +### 智能模型选择策略
    +
    +```bash
    +# 基于性能选择模型
    +taskflow config set multiModel.selectionStrategy "performance"
    +
    +# 基于成本选择模型
    +taskflow config set multiModel.selectionStrategy "cost"
    +
    +# 轮询选择模型
    +taskflow config set multiModel.selectionStrategy "round_robin"
    +
    +# 随机选择模型
    +taskflow config set multiModel.selectionStrategy "random"
    +```
    +
    +### 多模型解析对比
    +
    +```bash
    +# 使用多模型解析同一PRD,对比结果
    +taskflow parse requirements.md --multi-model --compare
    +
    +# 查看模型性能对比
    +taskflow models benchmark --task parsing
    +
    +# 分析模型准确性
    +taskflow models analyze --input requirements.md
    +```
    +
    +## 📊 高级任务管理
    +
    +### 批量任务操作
    +
    +```bash
    +# 批量创建任务
    +taskflow tasks create --batch tasks.json
    +
    +# 批量更新任务状态
    +taskflow status update --batch task-001,task-002,task-003 in_progress
    +
    +# 批量分配任务
    +taskflow tasks assign --batch task-001,task-002 --assignee "张三"
    +
    +# 批量设置优先级
    +taskflow tasks priority --batch task-001,task-002 --priority high
    +```
    +
    +### 任务依赖管理
    +
    +```bash
    +# 设置任务依赖关系
    +taskflow tasks dependency add task-002 --depends-on task-001
    +
    +# 查看依赖关系图
    +taskflow tasks dependency graph
    +
    +# 分析依赖路径
    +taskflow tasks dependency path task-001 task-005
    +
    +# 检测循环依赖
    +taskflow tasks dependency validate
    +```
    +
    +### 任务模板和自动化
    +
    +```bash
    +# 创建任务模板
    +taskflow templates create --name "frontend-component" --file component-template.json
    +
    +# 使用模板创建任务
    +taskflow tasks create --template "frontend-component" --vars '{"component": "UserProfile"}'
    +
    +# 自动化任务创建规则
    +taskflow automation create --trigger "prd-parsed" --action "create-tasks"
    +```
    +
    +## 🔧 高级配置管理
    +
    +### 环境配置
    +
    +```bash
    +# 设置开发环境配置
    +taskflow config env development
    +taskflow config set logging.level debug
    +taskflow config set performance.cacheSize 50
    +
    +# 设置生产环境配置
    +taskflow config env production
    +taskflow config set logging.level error
    +taskflow config set performance.cacheSize 200
    +
    +# 切换环境
    +taskflow config env use production
    +```
    +
    +### 配置文件管理
    +
    +```bash
    +# 导出配置模板
    +taskflow config export --template team-config.json
    +
    +# 导入团队配置
    +taskflow config import team-config.json --merge
    +
    +# 配置版本管理
    +taskflow config version save "v1.0-stable"
    +taskflow config version restore "v1.0-stable"
    +
    +# 配置差异对比
    +taskflow config diff local remote
    +```
    +
    +### 安全配置
    +
    +```bash
    +# 启用API密钥加密
    +taskflow config set security.encryptApiKeys true
    +
    +# 设置访问控制
    +taskflow config set security.accessControl.enabled true
    +taskflow config set security.accessControl.roles '["admin", "developer", "viewer"]'
    +
    +# 配置审计日志
    +taskflow config set security.auditLog.enabled true
    +taskflow config set security.auditLog.level "all"
    +```
    +
    +## 📈 性能优化
    +
    +### 缓存管理
    +
    +```bash
    +# 查看缓存状态
    +taskflow cache status
    +
    +# 优化缓存配置
    +taskflow config set performance.cacheSize 500
    +taskflow config set performance.cacheTTL 3600000
    +
    +# 预热缓存
    +taskflow cache warm --models all
    +
    +# 清理过期缓存
    +taskflow cache clean --expired
    +```
    +
    +### 并发控制
    +
    +```bash
    +# 设置并发请求数
    +taskflow config set performance.concurrency 10
    +
    +# 设置请求超时时间
    +taskflow config set performance.timeout 60000
    +
    +# 启用请求队列
    +taskflow config set performance.enableQueue true
    +taskflow config set performance.queueSize 100
    +```
    +
    +### 性能监控
    +
    +```bash
    +# 启用性能监控
    +taskflow config set performance.enableMonitoring true
    +
    +# 查看性能统计
    +taskflow performance stats
    +
    +# 生成性能报告
    +taskflow performance report --period "last-7-days"
    +
    +# 性能分析
    +taskflow performance analyze --operation "parse"
    +```
    +
    +## 🔄 工作流自动化
    +
    +### 自定义工作流
    +
    +```bash
    +# 创建自定义工作流
    +taskflow workflow create --name "feature-development" --file workflow.yaml
    +
    +# 执行工作流
    +taskflow workflow run "feature-development" --input requirements.md
    +
    +# 查看工作流状态
    +taskflow workflow status "feature-development"
    +
    +# 工作流模板
    +cat > workflow.yaml << 'EOF'
    +name: feature-development
    +steps:
    +  - name: parse-prd
    +    action: parse
    +    input: ${input}
    +  - name: create-tasks
    +    action: tasks.create
    +    depends: parse-prd
    +  - name: assign-tasks
    +    action: tasks.assign
    +    depends: create-tasks
    +    config:
    +      strategy: round-robin
    +EOF
    +```
    +
    +### 触发器和钩子
    +
    +```bash
    +# 设置文件监听触发器
    +taskflow triggers create --name "prd-watcher" \
    +  --watch "docs/*.md" \
    +  --action "parse-and-update"
    +
    +# 设置Git钩子
    +taskflow hooks install --type "pre-commit" \
    +  --action "validate-tasks"
    +
    +# 设置定时任务
    +taskflow schedule create --name "daily-report" \
    +  --cron "0 9 * * *" \
    +  --action "generate-report"
    +```
    +
    +## 📊 高级分析和报告
    +
    +### 项目分析
    +
    +```bash
    +# 生成项目分析报告
    +taskflow analyze project --output analysis-report.html
    +
    +# 任务完成趋势分析
    +taskflow analyze trends --metric "completion-rate" --period "30-days"
    +
    +# 团队效率分析
    +taskflow analyze team --members all --metric "velocity"
    +
    +# 瓶颈分析
    +taskflow analyze bottlenecks --threshold 0.8
    +```
    +
    +### 自定义报告
    +
    +```bash
    +# 创建自定义报告模板
    +taskflow reports template create --name "weekly-summary" --file template.json
    +
    +# 生成自定义报告
    +taskflow reports generate "weekly-summary" --output weekly-report.pdf
    +
    +# 报告自动化
    +taskflow reports schedule "weekly-summary" --cron "0 18 * * 5"
    +```
    +
    +## 🔌 集成和扩展
    +
    +### 第三方工具集成
    +
    +```bash
    +# 集成Jira
    +taskflow integrations enable jira --config jira-config.json
    +
    +# 集成Slack通知
    +taskflow integrations enable slack --webhook-url "https://hooks.slack.com/..."
    +
    +# 集成GitHub Issues
    +taskflow integrations enable github --token "ghp_..."
    +
    +# 查看可用集成
    +taskflow integrations list --available
    +```
    +
    +### 插件系统
    +
    +```bash
    +# 安装插件
    +taskflow plugins install taskflow-plugin-export
    +
    +# 查看已安装插件
    +taskflow plugins list
    +
    +# 配置插件
    +taskflow plugins config taskflow-plugin-export --format "excel"
    +
    +# 卸载插件
    +taskflow plugins uninstall taskflow-plugin-export
    +```
    +
    +### API和Webhook
    +
    +```bash
    +# 启用API服务器
    +taskflow api start --port 3000 --auth-token "your-token"
    +
    +# 配置Webhook
    +taskflow webhooks create --url "https://your-app.com/webhook" \
    +  --events "task.created,task.completed"
    +
    +# 测试Webhook
    +taskflow webhooks test --url "https://your-app.com/webhook"
    +```
    +
    +## 🛡️ 企业级功能
    +
    +### 用户和权限管理
    +
    +```bash
    +# 创建用户
    +taskflow users create --name "张三" --role "developer" --email "zhangsan@company.com"
    +
    +# 设置权限
    +taskflow permissions grant --user "张三" --permission "tasks.update"
    +
    +# 创建团队
    +taskflow teams create --name "前端团队" --members "张三,李四"
    +
    +# 项目访问控制
    +taskflow projects access --project "my-project" --team "前端团队" --level "read-write"
    +```
    +
    +### 审计和合规
    +
    +```bash
    +# 查看审计日志
    +taskflow audit logs --user "张三" --action "task.update" --date "2024-01-01"
    +
    +# 生成合规报告
    +taskflow compliance report --standard "ISO27001" --output compliance.pdf
    +
    +# 数据导出
    +taskflow export data --format "json" --include "tasks,users,logs"
    +
    +# 数据备份
    +taskflow backup create --include "all" --encrypt true
    +```
    +
    +### 高可用性配置
    +
    +```bash
    +# 配置数据同步
    +taskflow sync configure --remote "https://backup.company.com" --interval "1h"
    +
    +# 故障转移配置
    +taskflow failover configure --backup-models '["zhipu", "qwen"]'
    +
    +# 健康检查
    +taskflow health check --all
    +
    +# 灾难恢复
    +taskflow disaster-recovery test --scenario "model-failure"
    +```
    +
    +
    +
    +## 🔍 调试和诊断
    +
    +### 高级调试
    +
    +```bash
    +# 启用调试模式
    +taskflow debug enable --level "verbose"
    +
    +# 性能分析
    +taskflow debug profile --operation "parse" --duration "60s"
    +
    +# 内存分析
    +taskflow debug memory --threshold "100MB"
    +
    +# 网络诊断
    +taskflow debug network --test-endpoints all
    +```
    +
    +### 系统诊断
    +
    +```bash
    +# 完整系统诊断
    +taskflow doctor --comprehensive
    +
    +# 配置验证
    +taskflow doctor config --fix-issues
    +
    +# 依赖检查
    +taskflow doctor dependencies --update-if-needed
    +
    +# 性能基准测试
    +taskflow doctor benchmark --compare-baseline
    +```
    +
    +## 📚 下一步
    +
    +- [开发者指南](./developer-guide.md) - 了解开发和扩展
    +- [API文档](../api/) - 程序化接口使用
    +- [配置参考](../reference/configuration.md) - 完整配置选项
    +- [故障排除](../troubleshooting/common-issues.md) - 解决复杂问题
    
  • docs/guide/architecture.md+504 0 added
    @@ -0,0 +1,504 @@
    +# 架构设计
    +
    +## 概述
    +
    +TaskFlow AI 采用模块化、可扩展的架构设计,专注于PRD文档解析和任务管理功能。本文档详细介绍了系统的架构设计理念、核心组件、数据流和技术选型。
    +
    +## 🏗️ 整体架构
    +
    +### 架构图
    +
    +```
    +┌─────────────────────────────────────────────────────────────┐
    +│                    用户界面层 (UI Layer)                     │
    +│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
    +│  │ CLI Interface│  │ Web Interface│  │  Mobile App         │  │
    +│  │             │  │             │  │                     │  │
    +│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
    +└─────────────────────────────────────────────────────────────┘
    +┌─────────────────────────────────────────────────────────────┐
    +│                   应用服务层 (Service Layer)                 │
    +│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
    +│  │   Commands  │  │  Handlers   │  │    Controllers      │  │
    +│  │   Parser    │  │  Validator  │  │    Middleware       │  │
    +│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
    +└─────────────────────────────────────────────────────────────┘
    +┌─────────────────────────────────────────────────────────────┐
    +│                   业务逻辑层 (Business Layer)                │
    +│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
    +│  │ PRD Parser  │  │Task Manager │  │  AI Orchestrator    │  │
    +│  │             │  │             │  │                     │  │
    +│  │ Project     │  │ Performance │  │  Security Manager   │  │
    +│  │ Config Mgr  │  │ Monitor     │  │                     │  │
    +│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
    +└─────────────────────────────────────────────────────────────┘
    +┌─────────────────────────────────────────────────────────────┐
    +│                  基础设施层 (Infrastructure Layer)           │
    +│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
    +│  │   Storage   │  │   Network   │  │      Utilities      │  │
    +│  │   Manager   │  │   Client    │  │                     │  │
    +│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
    +└─────────────────────────────────────────────────────────────┘
    +```
    +
    +### 设计原则
    +
    +1. **单一职责**: 每个模块专注于特定功能
    +2. **松耦合**: 模块间通过接口通信,降低依赖
    +3. **高内聚**: 相关功能集中在同一模块内
    +4. **可扩展**: 支持插件和扩展机制
    +5. **可测试**: 每个组件都可以独立测试
    +
    +## 🧩 核心组件
    +
    +### 1. PRD解析器 (PRD Parser)
    +
    +**职责**: 智能解析PRD文档,提取结构化信息
    +
    +```typescript
    +interface PRDParser {
    +  parseFromFile(filePath: string, options?: ParseOptions): Promise<ParseResult>
    +  parseFromText(content: string, options?: ParseOptions): Promise<ParseResult>
    +  validatePRD(prd: ParsedPRD): ValidationResult
    +}
    +```
    +
    +**核心功能**:
    +- 多格式文档解析 (Markdown, Word, PDF)
    +- 语义理解和信息提取
    +- 任务自动生成
    +- 依赖关系分析
    +
    +**技术实现**:
    +- 文档解析: `markdown-it`, `mammoth`, `pdf-parse`
    +- AI集成: 多模型API调用
    +- 缓存机制: 解析结果缓存
    +
    +### 2. 任务管理器 (Task Manager)
    +
    +**职责**: 完整的任务生命周期管理
    +
    +```typescript
    +interface TaskManager {
    +  createTask(taskData: Partial<Task>): Promise<Task>
    +  updateTask(id: string, updates: Partial<Task>): Promise<Task>
    +  getTasks(filter?: TaskFilter): Promise<Task[]>
    +  getTaskDependencies(id: string): Promise<Task[]>
    +}
    +```
    +
    +**核心功能**:
    +- 任务CRUD操作
    +- 状态管理和跟踪
    +- 依赖关系管理
    +- 进度计算和报告
    +
    +**数据模型**:
    +```typescript
    +interface Task {
    +  id: string
    +  name: string
    +  description: string
    +  status: TaskStatus
    +  priority: TaskPriority
    +  dependencies: string[]
    +  assignee?: string
    +  estimatedHours?: number
    +  actualHours?: number
    +  createdAt: Date
    +  updatedAt: Date
    +}
    +```
    +
    +### 3. AI编排器 (AI Orchestrator)
    +
    +**职责**: 多AI模型的智能编排和管理
    +
    +```typescript
    +interface AIOrchestrator {
    +  processText(text: string, options: ProcessingOptions): Promise<ProcessingResult>
    +  selectOptimalModel(task: string, context: string): Promise<ModelType>
    +  balanceLoad(models: ModelType[]): Promise<ModelType>
    +}
    +```
    +
    +**核心功能**:
    +- 多模型协同工作
    +- 智能模型选择
    +- 负载均衡和故障转移
    +- 成本优化
    +
    +**支持的模型**:
    +- DeepSeek: 代码理解和生成
    +- 智谱AI: 中文语义理解
    +- 通义千问: 综合性任务处理
    +- 文心一言: 创意和文案生成
    +
    +### 4. 项目配置管理器 (Project Config Manager)
    +
    +**职责**: 项目集成和配置管理
    +
    +```typescript
    +interface ProjectConfigManager {
    +  initializeProject(options: ProjectInitOptions): Promise<ProjectConfig>
    +  getProjectInfo(): Promise<ProjectInfo>
    +  updateConfig(updates: Partial<ProjectConfig>): Promise<void>
    +}
    +```
    +
    +**核心功能**:
    +- 项目初始化和集成
    +- 配置文件管理
    +- 环境配置切换
    +- 团队配置同步
    +
    +## 📊 数据流架构
    +
    +### 1. PRD解析流程
    +
    +```
    +用户输入PRD文档
    +       ↓
    +文档格式检测和预处理
    +       ↓
    +AI模型选择和调用
    +       ↓
    +内容解析和结构化
    +       ↓
    +任务生成和依赖分析
    +       ↓
    +结果验证和存储
    +       ↓
    +用户反馈和展示
    +```
    +
    +### 2. 任务管理流程
    +
    +```
    +任务创建/更新请求
    +       ↓
    +输入验证和权限检查
    +       ↓
    +业务逻辑处理
    +       ↓
    +数据持久化
    +       ↓
    +事件通知
    +       ↓
    +缓存更新
    +       ↓
    +响应返回
    +```
    +
    +### 3. 多模型协同流程
    +
    +```
    +解析请求
    +    ↓
    +任务分析和模型选择
    +    ↓
    +并行调用多个模型
    +    ↓
    +结果聚合和对比
    +    ↓
    +最优结果选择
    +    ↓
    +结果缓存和返回
    +```
    +
    +## 🗄️ 数据存储架构
    +
    +### 存储结构
    +
    +```
    +.taskflow/
    +├── config.json          # 项目配置
    +├── tasks.json           # 任务数据
    +├── cache/               # 缓存目录
    +│   ├── models/          # 模型响应缓存
    +│   ├── parsing/         # 解析结果缓存
    +│   └── temp/            # 临时文件
    +├── logs/                # 日志文件
    +│   ├── app.log          # 应用日志
    +│   ├── error.log        # 错误日志
    +│   └── performance.log  # 性能日志
    +└── backups/             # 备份文件
    +    ├── tasks-backup.json
    +    └── config-backup.json
    +```
    +
    +### 数据模型设计
    +
    +```typescript
    +// 项目配置
    +interface ProjectConfig {
    +  name: string
    +  type: ProjectType
    +  workDir: string
    +  team: TeamMember[]
    +  createdAt: Date
    +  updatedAt: Date
    +}
    +
    +// 任务数据
    +interface TaskData {
    +  tasks: Task[]
    +  dependencies: TaskDependency[]
    +  metadata: {
    +    version: string
    +    lastUpdated: Date
    +    totalTasks: number
    +  }
    +}
    +
    +// 缓存数据
    +interface CacheEntry {
    +  key: string
    +  value: any
    +  expiry: number
    +  metadata: {
    +    size: number
    +    hits: number
    +    created: Date
    +  }
    +}
    +```
    +
    +## 🔧 技术栈
    +
    +### 核心技术
    +
    +| 层级 | 技术选型 | 用途 |
    +|------|----------|------|
    +| **语言** | TypeScript 5.0+ | 类型安全和现代语法 |
    +| **运行时** | Node.js 18+ | 高性能JavaScript运行时 |
    +| **CLI框架** | Commander.js | 命令行界面构建 |
    +| **文档解析** | markdown-it, mammoth | 多格式文档解析 |
    +| **HTTP客户端** | axios | AI模型API调用 |
    +| **日志系统** | winston | 结构化日志记录 |
    +| **测试框架** | Jest | 单元测试和集成测试 |
    +| **构建工具** | TypeScript Compiler | 代码编译和打包 |
    +
    +### 依赖管理
    +
    +```json
    +{
    +  "dependencies": {
    +    "commander": "^11.0.0",
    +    "axios": "^1.5.0",
    +    "winston": "^3.10.0",
    +    "markdown-it": "^13.0.0",
    +    "mammoth": "^1.6.0",
    +    "inquirer": "^9.2.0",
    +    "chalk": "^5.3.0",
    +    "ora": "^7.0.0"
    +  },
    +  "devDependencies": {
    +    "typescript": "^5.0.0",
    +    "@types/node": "^20.0.0",
    +    "jest": "^29.0.0",
    +    "@types/jest": "^29.0.0",
    +    "eslint": "^8.45.0",
    +    "prettier": "^3.0.0"
    +  }
    +}
    +```
    +
    +## 🔒 安全架构
    +
    +### 安全设计原则
    +
    +1. **最小权限**: 每个组件只获得必要的权限
    +2. **数据加密**: 敏感数据加密存储
    +3. **输入验证**: 严格的输入验证和清理
    +4. **审计日志**: 完整的操作审计记录
    +
    +### 安全实现
    +
    +```typescript
    +// API密钥加密存储
    +class SecureStorage {
    +  private encryptionKey: string
    +  
    +  encrypt(data: string): string {
    +    return crypto.encrypt(data, this.encryptionKey)
    +  }
    +  
    +  decrypt(encryptedData: string): string {
    +    return crypto.decrypt(encryptedData, this.encryptionKey)
    +  }
    +}
    +
    +// 输入验证
    +class InputValidator {
    +  validatePRDContent(content: string): ValidationResult {
    +    // 检查内容安全性
    +    // 过滤恶意代码
    +    // 验证格式正确性
    +  }
    +}
    +```
    +
    +## ⚡ 性能架构
    +
    +### 性能优化策略
    +
    +1. **智能缓存**: 多层缓存机制
    +2. **并发处理**: 异步和并行处理
    +3. **资源池**: 连接池和对象池
    +4. **懒加载**: 按需加载模块和数据
    +
    +### 缓存架构
    +
    +```typescript
    +interface CacheManager {
    +  // L1缓存: 内存缓存
    +  memoryCache: Map<string, CacheEntry>
    +  
    +  // L2缓存: 文件缓存
    +  fileCache: FileCache
    +  
    +  // 缓存策略
    +  strategy: CacheStrategy
    +}
    +
    +class PerformanceMonitor {
    +  trackOperation(operation: string, duration: number): void
    +  getMetrics(): PerformanceMetrics
    +  generateReport(): PerformanceReport
    +}
    +```
    +
    +## 🔌 扩展架构
    +
    +### 插件系统
    +
    +```typescript
    +interface Plugin {
    +  name: string
    +  version: string
    +  initialize(context: PluginContext): Promise<void>
    +  execute(input: any): Promise<any>
    +  cleanup(): Promise<void>
    +}
    +
    +class PluginManager {
    +  loadPlugin(pluginPath: string): Promise<Plugin>
    +  registerPlugin(plugin: Plugin): void
    +  executePlugin(name: string, input: any): Promise<any>
    +}
    +```
    +
    +### 事件系统
    +
    +```typescript
    +class EventEmitter {
    +  on(event: string, handler: EventHandler): void
    +  emit(event: string, data: any): void
    +  off(event: string, handler: EventHandler): void
    +}
    +
    +// 事件类型
    +enum EventType {
    +  TASK_CREATED = 'task:created',
    +  TASK_UPDATED = 'task:updated',
    +  PRD_PARSED = 'prd:parsed',
    +  PROJECT_INITIALIZED = 'project:initialized'
    +}
    +```
    +
    +## 📈 监控和诊断
    +
    +### 监控架构
    +
    +```typescript
    +interface MonitoringSystem {
    +  healthCheck(): HealthStatus
    +  collectMetrics(): Metrics
    +  generateAlerts(threshold: Threshold): Alert[]
    +}
    +
    +interface Metrics {
    +  performance: PerformanceMetrics
    +  usage: UsageMetrics
    +  errors: ErrorMetrics
    +  resources: ResourceMetrics
    +}
    +```
    +
    +### 诊断工具
    +
    +```typescript
    +class DiagnosticTool {
    +  systemCheck(): SystemStatus
    +  configValidation(): ValidationResult
    +  performanceBenchmark(): BenchmarkResult
    +  dependencyCheck(): DependencyStatus
    +}
    +```
    +
    +## 🚀 部署架构
    +
    +### 部署模式
    +
    +1. **本地部署**: 单机安装和使用
    +2. **团队部署**: 共享配置和数据同步
    +3. **企业部署**: 集中管理和权限控制
    +4. **云端部署**: SaaS模式服务
    +
    +### 配置管理
    +
    +```typescript
    +interface DeploymentConfig {
    +  environment: 'development' | 'staging' | 'production'
    +  features: FeatureFlags
    +  scaling: ScalingConfig
    +  monitoring: MonitoringConfig
    +}
    +```
    +
    +## 📚 架构演进
    +
    +### 版本规划
    +
    +- **v1.x**: 核心功能实现
    +- **v2.x**: 企业级功能增强
    +- **v3.x**: 云原生和微服务架构
    +- **v4.x**: AI能力深度集成
    +
    +### 技术债务管理
    +
    +1. **代码质量**: 持续重构和优化
    +2. **性能优化**: 定期性能分析和改进
    +3. **安全更新**: 及时修复安全漏洞
    +4. **依赖更新**: 保持依赖库的最新版本
    +
    +## 🔍 架构决策记录 (ADR)
    +
    +### ADR-001: 选择TypeScript作为主要开发语言
    +
    +**状态**: 已接受  
    +**日期**: 2024-01-01  
    +**决策**: 使用TypeScript替代JavaScript  
    +**理由**: 类型安全、更好的IDE支持、企业级开发标准  
    +
    +### ADR-002: 采用模块化架构设计
    +
    +**状态**: 已接受  
    +**日期**: 2024-01-01  
    +**决策**: 采用分层模块化架构  
    +**理由**: 可维护性、可测试性、可扩展性  
    +
    +### ADR-003: 选择JSON作为配置文件格式
    +
    +**状态**: 已接受  
    +**日期**: 2024-01-01  
    +**决策**: 使用JSON格式存储配置  
    +**理由**: 简单易读、广泛支持、易于解析  
    +
    +## 📖 相关文档
    +
    +- [开发者指南](./developer-guide.md) - 开发环境和贡献指南
    +- [API文档](../api/) - 详细的API接口文档
    +- [配置参考](../reference/configuration.md) - 完整的配置选项
    +- [性能优化](../troubleshooting/performance.md) - 性能调优指南
    
  • docs/guide/basic-usage.md+347 0 added
    @@ -0,0 +1,347 @@
    +# 基本使用指南
    +
    +## 概述
    +
    +本指南将详细介绍TaskFlow AI的基本使用方法,帮助你快速掌握PRD解析和任务管理的核心功能。TaskFlow AI是一个专为现有项目设计的智能任务管理工具,不是项目脚手架。
    +
    +## 🚀 基本工作流程
    +
    +### 1. 项目集成
    +
    +首先在你的现有项目中集成TaskFlow AI:
    +
    +```bash
    +# 进入现有项目目录
    +cd your-existing-project
    +
    +# 初始化TaskFlow AI配置
    +taskflow init
    +
    +# 验证初始化结果
    +ls -la .taskflow/
    +```
    +
    +初始化后,TaskFlow AI会创建以下结构:
    +```
    +your-project/
    +├── .taskflow/
    +│   ├── config.json      # TaskFlow AI配置
    +│   ├── tasks.json       # 任务数据存储
    +│   └── cache/           # 缓存目录
    +└── ... (你的原有文件)
    +```
    +
    +### 2. 配置AI模型
    +
    +配置至少一个AI模型来进行PRD解析:
    +
    +```bash
    +# 配置DeepSeek模型(推荐)
    +taskflow config set models.deepseek.apiKey "your-deepseek-api-key"
    +
    +# 或配置智谱AI
    +taskflow config set models.zhipu.apiKey "your-zhipu-api-key"
    +
    +# 验证配置
    +taskflow config validate
    +```
    +
    +### 3. 准备PRD文档
    +
    +确保你的项目中有PRD文档。支持的格式:
    +
    +- **Markdown** (推荐): `.md` 文件
    +- **纯文本**: `.txt` 文件
    +- **Word文档**: `.docx` 文件 (实验性支持)
    +
    +PRD文档建议结构:
    +```markdown
    +# 项目/功能名称
    +
    +## 项目概述
    +简要描述项目目标和背景
    +
    +## 功能需求
    +### 功能1: 功能名称
    +- 描述: 详细功能描述
    +- 验收标准:
    +  - 标准1
    +  - 标准2
    +
    +## 技术要求
    +- 技术栈要求
    +- 性能要求
    +- 兼容性要求
    +
    +## 优先级
    +1. 高优先级功能
    +2. 中优先级功能
    +3. 低优先级功能
    +```
    +
    +### 4. 解析PRD文档
    +
    +使用TaskFlow AI解析PRD文档:
    +
    +```bash
    +# 解析PRD文档
    +taskflow parse docs/requirements.md
    +
    +# 使用特定模型解析
    +taskflow parse docs/requirements.md --model deepseek
    +
    +# 启用多模型协同
    +taskflow parse docs/requirements.md --multi-model
    +
    +# 查看解析结果
    +taskflow status list
    +```
    +
    +## 📋 任务管理
    +
    +### 查看任务
    +
    +```bash
    +# 查看所有任务
    +taskflow status
    +
    +# 查看任务列表(表格格式)
    +taskflow status list
    +
    +# 查看特定状态的任务
    +taskflow status --filter status=not_started
    +taskflow status --filter status=in_progress
    +taskflow status --filter status=completed
    +
    +# 查看高优先级任务
    +taskflow status --filter priority=high
    +```
    +
    +### 更新任务状态
    +
    +```bash
    +# 开始一个任务
    +taskflow status update task-001 in_progress
    +
    +# 完成一个任务
    +taskflow status update task-001 completed
    +
    +# 添加完成备注
    +taskflow status update task-001 completed --comment "功能已实现并测试通过"
    +
    +# 批量更新任务状态
    +taskflow status update --batch task-001,task-002 in_progress
    +```
    +
    +### 查看项目进度
    +
    +```bash
    +# 查看整体进度
    +taskflow status progress
    +
    +# 查看详细进度报告
    +taskflow status progress --detailed
    +
    +# 生成进度图表
    +taskflow status progress --chart
    +
    +# 导出进度报告
    +taskflow status progress --export progress-report.pdf
    +```
    +
    +### 获取下一个任务
    +
    +```bash
    +# 获取下一个推荐任务
    +taskflow status next
    +
    +# 获取多个下一个任务
    +taskflow status next --count 3
    +
    +# 按优先级获取任务
    +taskflow status next --priority high
    +
    +# 按分配人员获取任务
    +taskflow status next --assignee current-user
    +```
    +
    +## 🔧 配置管理
    +
    +### 查看和修改配置
    +
    +```bash
    +# 查看所有配置
    +taskflow config list
    +
    +# 查看特定配置
    +taskflow config get models.deepseek.apiKey
    +
    +# 设置配置项
    +taskflow config set logging.level debug
    +
    +# 删除配置项
    +taskflow config unset models.zhipu.apiKey
    +```
    +
    +### 项目特定配置
    +
    +```bash
    +# 设置项目信息
    +taskflow config set project.name "我的项目"
    +taskflow config set project.type "web-app"
    +
    +# 配置团队信息
    +taskflow config set team.members '["张三", "李四", "王五"]'
    +
    +# 设置工作目录
    +taskflow config set project.workDir "./src"
    +```
    +
    +### 多模型配置
    +
    +```bash
    +# 启用多模型支持
    +taskflow config set multiModel.enabled true
    +
    +# 设置主要模型
    +taskflow config set multiModel.primary "deepseek"
    +
    +# 设置备用模型
    +taskflow config set multiModel.fallback '["zhipu", "qwen"]'
    +
    +# 启用负载均衡
    +taskflow config set multiModel.loadBalancing true
    +```
    +
    +## 🤖 AI模型管理
    +
    +### 测试模型连接
    +
    +```bash
    +# 测试所有配置的模型
    +taskflow models test
    +
    +# 测试特定模型
    +taskflow models test deepseek
    +
    +# 查看模型状态
    +taskflow models status
    +```
    +
    +### 模型性能优化
    +
    +```bash
    +# 查看模型使用统计
    +taskflow models stats
    +
    +# 对比模型性能
    +taskflow models benchmark
    +
    +# 优化模型选择
    +taskflow models optimize
    +```
    +
    +## 📊 实际使用示例
    +
    +### React项目示例
    +
    +```bash
    +# 在React项目中使用
    +cd my-react-app
    +
    +# 初始化TaskFlow AI
    +taskflow init
    +
    +# 解析React项目的PRD
    +taskflow parse docs/feature-requirements.md
    +
    +# 查看生成的任务
    +taskflow status list
    +# 输出示例:
    +# ┌─────────────┬──────────────────────────┬──────────┬──────────┐
    +# │ ID          │ 任务名称                 │ 状态     │ 优先级   │
    +# ├─────────────┼──────────────────────────┼──────────┼──────────┤
    +# │ task-001    │ 实现用户登录组件         │ 未开始   │ 高       │
    +# │ task-002    │ 创建数据可视化图表       │ 未开始   │ 中       │
    +# │ task-003    │ 添加响应式布局           │ 未开始   │ 低       │
    +# └─────────────┴──────────────────────────┴──────────┴──────────┘
    +
    +# 开始第一个任务
    +taskflow status update task-001 in_progress
    +```
    +
    +### Python API项目示例
    +
    +```bash
    +# 在Python API项目中使用
    +cd my-python-api
    +
    +# 初始化TaskFlow AI
    +taskflow init
    +
    +# 解析API需求文档
    +taskflow parse api-requirements.md
    +
    +# 查看项目进度
    +taskflow status progress
    +# 输出示例:
    +# 📊 项目进度概览
    +# ├── 总任务数: 8
    +# ├── 已完成: 3 (37.5%)
    +# ├── 进行中: 2 (25.0%)
    +# ├── 未开始: 3 (37.5%)
    +# └── 预计完成时间: 2024-02-15
    +```
    +
    +## 💡 最佳实践
    +
    +### PRD文档编写
    +
    +1. **结构清晰**: 使用标准的Markdown格式
    +2. **描述详细**: 包含完整的功能描述和验收标准
    +3. **优先级明确**: 明确标注功能优先级
    +4. **技术要求具体**: 详细说明技术栈和架构要求
    +
    +### 任务管理
    +
    +1. **及时更新**: 每日更新任务状态
    +2. **详细备注**: 为任务完成添加详细备注
    +3. **合理分配**: 根据团队成员技能分配任务
    +4. **定期回顾**: 定期查看项目进度和调整计划
    +
    +### 团队协作
    +
    +1. **统一配置**: 团队使用相同的配置模板
    +2. **标准流程**: 制定统一的PRD编写和任务管理流程
    +3. **定期同步**: 定期同步任务状态和项目进度
    +4. **知识共享**: 分享最佳实践和经验教训
    +
    +## 🔍 故障排除
    +
    +### 常见问题
    +
    +1. **解析失败**: 检查PRD文档格式和AI模型配置
    +2. **任务状态不同步**: 使用 `taskflow status refresh` 刷新状态
    +3. **配置错误**: 使用 `taskflow config validate` 验证配置
    +4. **性能问题**: 使用 `taskflow cache clear` 清理缓存
    +
    +### 获取帮助
    +
    +```bash
    +# 查看命令帮助
    +taskflow --help
    +taskflow parse --help
    +
    +# 生成诊断报告
    +taskflow doctor
    +
    +# 查看日志
    +taskflow logs --tail 20
    +```
    +
    +## 📚 下一步
    +
    +- [高级功能](./advanced-features.md) - 探索更多高级功能
    +- [开发者指南](./developer-guide.md) - 了解开发和扩展
    +- [API文档](../api/) - 程序化接口使用
    +- [故障排除](../troubleshooting/common-issues.md) - 解决常见问题
    
  • docs/guide/debugging.md+94 0 added
    @@ -0,0 +1,94 @@
    +# 调试工具
    +
    +TaskFlow AI 提供强大的调试工具,帮助开发者追踪和分析 AI 执行过程。
    +
    +## 思维链时间线
    +
    +可视化展示 AI 推理过程的每个步骤。
    +
    +```typescript
    +import { ThoughtChainTimeline, CostTracker, ErrorHandler } from '@taskflow-ai/core/debug';
    +
    +const timeline = new ThoughtChainTimeline();
    +timeline.fromChain(chain);
    +
    +// 输出文本格式
    +console.log(timeline.toText());
    +
    +// 输出 JSON 格式
    +console.log(timeline.toJSON());
    +
    +// 简洁进度条
    +console.log(timeline.toProgressBar());
    +
    +// 获取统计信息
    +const stats = timeline.getStats();
    +console.log(stats.totalSteps, stats.avgConfidence);
    +```
    +
    +## 成本跟踪
    +
    +实时监控 AI 调用的成本。
    +
    +```typescript
    +const costTracker = new CostTracker({
    +  budgetThreshold: 10,  // 预算警告阈值
    +  requestThreshold: 1, // 单次请求警告阈值
    +});
    +
    +// 记录 API 调用
    +costTracker.record('gpt-4o', 1000, 500, 1500);
    +
    +// 渲染成本面板
    +console.log(costTracker.renderPanel());
    +
    +// 导出 CSV
    +console.log(costTracker.toCSV());
    +```
    +
    +## 错误处理
    +
    +自动错误分类和重试机制。
    +
    +```typescript
    +const handler = new ErrorHandler();
    +
    +// 记录错误
    +const error = handler.record(new Error('Network failed'), 'network');
    +
    +// 带重试的操作
    +const { result, error } = await handler.retryWithRecovery(
    +  async () => {
    +    // your operation
    +  },
    +  {
    +    maxRetries: 3,
    +    initialDelay: 1000,
    +    backoffFactor: 2,
    +  }
    +);
    +
    +// 生成错误报告
    +console.log(handler.generateErrorReport(error));
    +```
    +
    +## 选项
    +
    +### TimelineViewOptions
    +
    +| 选项 | 类型 | 默认值 | 说明 |
    +|------|------|--------|------|
    +| showReasoning | boolean | true | 显示详细推理 |
    +| showTimestamp | boolean | true | 显示时间戳 |
    +| showModel | boolean | true | 显示模型信息 |
    +| maxDepth | number | 10 | 最大显示深度 |
    +| timeFormat | string | 'relative' | 时间格式 |
    +
    +### CostTrackerOptions
    +
    +| 选项 | 类型 | 默认值 | 说明 |
    +|------|------|--------|------|
    +| budgetThreshold | number | 10 | 预算警告阈值 (美元) |
    +| requestThreshold | number | 1 | 单次请求警告阈值 |
    +| autoPrint | boolean | false | 自动打印成本面板 |
    +| decimalPlaces | number | 4 | 保留小数位数 |
    
  • docs/guide/examples.md+475 0 added
    @@ -0,0 +1,475 @@
    +# TaskFlow AI 使用示例
    +
    +## 📋 目录
    +
    +1. [基础示例](#基础示例)
    +2. [Web应用开发](#web应用开发)
    +3. [移动应用开发](#移动应用开发)
    +4. [API服务开发](#api服务开发)
    +5. [数据分析项目](#数据分析项目)
    +6. [AI/ML项目](#aiml项目)
    +7. [企业级应用](#企业级应用)
    +
    +## 基础示例
    +
    +### 示例1:简单的博客系统
    +
    +**PRD文档** (`blog-system.md`):
    +
    +```markdown
    +# 个人博客系统
    +
    +## 功能需求
    +
    +### 文章管理
    +- 创建、编辑、删除文章
    +- 文章分类和标签
    +- 文章搜索功能
    +
    +### 用户系统
    +- 用户注册和登录
    +- 个人资料管理
    +- 评论功能
    +
    +### 后台管理
    +- 文章统计
    +- 用户管理
    +- 系统设置
    +
    +## 技术栈
    +- 前端:Vue.js 3
    +- 后端:Node.js + Express
    +- 数据库:MySQL
    +```
    +
    +**使用命令**:
    +```bash
    +# 解析PRD
    +taskflow-ai parse blog-system.md
    +
    +# 生成任务计划
    +taskflow-ai plan blog-system.md --team-size 2 --sprint-duration 7
    +
    +# 查看生成的任务
    +taskflow-ai tasks list --format json > blog-tasks.json
    +```
    +
    +**生成的任务示例**:
    +```json
    +{
    +  "tasks": [
    +    {
    +      "id": "task-001",
    +      "title": "数据库设计",
    +      "description": "设计博客系统的数据库表结构",
    +      "type": "design",
    +      "priority": "high",
    +      "estimatedHours": 8,
    +      "dependencies": []
    +    },
    +    {
    +      "id": "task-002", 
    +      "title": "用户认证模块",
    +      "description": "实现用户注册、登录、JWT认证",
    +      "type": "development",
    +      "priority": "high",
    +      "estimatedHours": 16,
    +      "dependencies": ["task-001"]
    +    }
    +  ]
    +}
    +```
    +
    +## Web应用开发
    +
    +### 示例2:电商平台
    +
    +**PRD文档** (`ecommerce-platform.md`):
    +
    +```markdown
    +# 电商平台系统
    +
    +## 核心功能
    +
    +### 商品管理
    +- 商品展示和详情页
    +- 商品分类和筛选
    +- 库存管理
    +- 价格管理
    +
    +### 购物流程
    +- 购物车功能
    +- 订单创建和支付
    +- 订单跟踪
    +- 退款处理
    +
    +### 用户中心
    +- 用户注册登录
    +- 个人信息管理
    +- 订单历史
    +- 收货地址管理
    +
    +### 商家后台
    +- 商品上架管理
    +- 订单处理
    +- 销售统计
    +- 客服系统
    +
    +## 技术要求
    +- 前端:React 18 + TypeScript
    +- 后端:Spring Boot + Java
    +- 数据库:PostgreSQL + Redis
    +- 支付:支付宝、微信支付
    +- 部署:云服务器 + CI/CD
    +
    +## 性能要求
    +- 支持10000+并发用户
    +- 页面加载时间 < 3秒
    +- API响应时间 < 500ms
    +```
    +
    +**使用命令**:
    +```bash
    +# 解析复杂PRD
    +taskflow-ai parse ecommerce-platform.md --model deepseek --verbose
    +
    +# 生成大型项目计划
    +taskflow-ai plan ecommerce-platform.md \
    +  --team-size 8 \
    +  --sprint-duration 14 \
    +  --include-tests \
    +  --include-docs \
    +  --complexity high
    +
    +# 按优先级查看任务
    +taskflow-ai tasks list --priority critical,high --format table
    +```
    +
    +
    +
    +## API服务开发
    +
    +### 示例4:微服务架构API
    +
    +**PRD文档** (`microservices-api.md`):
    +
    +```markdown
    +# 企业级微服务API平台
    +
    +## 系统架构
    +
    +### 用户服务 (User Service)
    +- 用户注册、登录、认证
    +- 用户信息管理
    +- 权限控制
    +
    +### 订单服务 (Order Service)  
    +- 订单创建和管理
    +- 订单状态跟踪
    +- 订单历史查询
    +
    +### 支付服务 (Payment Service)
    +- 多种支付方式集成
    +- 支付状态管理
    +- 退款处理
    +
    +### 通知服务 (Notification Service)
    +- 邮件通知
    +- 短信通知
    +- 推送通知
    +
    +## 技术要求
    +- 架构:微服务架构
    +- 后端:Spring Cloud + Java
    +- 数据库:MySQL + Redis
    +- 消息队列:RabbitMQ
    +- 服务发现:Eureka
    +- 网关:Spring Cloud Gateway
    +- 监控:Prometheus + Grafana
    +- 部署:云服务器 + Kubernetes
    +
    +## 非功能需求
    +- 高可用性:99.9%
    +- 水平扩展支持
    +- 服务熔断和降级
    +- 分布式事务处理
    +```
    +
    +**使用命令**:
    +```bash
    +# 微服务架构解析
    +taskflow-ai parse microservices-api.md --architecture microservices
    +
    +# 生成微服务开发计划
    +taskflow-ai plan microservices-api.md \
    +  --team-size 12 \
    +  --architecture microservices \
    +  --include-devops \
    +  --include-monitoring
    +```
    +
    +## 数据分析项目
    +
    +### 示例5:数据分析平台
    +
    +**PRD文档** (`data-analytics.md`):
    +
    +```markdown
    +# 企业数据分析平台
    +
    +## 功能模块
    +
    +### 数据接入
    +- 多数据源连接(MySQL、PostgreSQL、MongoDB)
    +- 文件上传(CSV、Excel、JSON)
    +- API数据接入
    +- 实时数据流处理
    +
    +### 数据处理
    +- 数据清洗和转换
    +- 数据质量检查
    +- 数据建模
    +- ETL流程管理
    +
    +### 数据可视化
    +- 图表组件库
    +- 仪表板设计器
    +- 报表生成
    +- 数据导出
    +
    +### 分析功能
    +- 统计分析
    +- 趋势分析
    +- 预测分析
    +- 异常检测
    +
    +## 技术栈
    +- 前端:Vue.js 3 + ECharts
    +- 后端:Python + FastAPI
    +- 数据处理:Pandas + NumPy
    +- 数据库:ClickHouse + Redis
    +- 任务调度:Celery
    +- 机器学习:Scikit-learn
    +```
    +
    +**使用命令**:
    +```bash
    +# 数据项目解析
    +taskflow-ai parse data-analytics.md --domain data-science
    +
    +# 生成数据分析项目计划
    +taskflow-ai plan data-analytics.md \
    +  --team-size 6 \
    +  --domain data-science \
    +  --include-ml-pipeline
    +```
    +
    +## AI/ML项目
    +
    +### 示例6:智能推荐系统
    +
    +**PRD文档** (`recommendation-system.md`):
    +
    +```markdown
    +# 智能推荐系统
    +
    +## 系统目标
    +构建一个高效的个性化推荐系统,提升用户体验和业务转化率。
    +
    +## 核心算法
    +
    +### 协同过滤
    +- 用户协同过滤
    +- 物品协同过滤
    +- 矩阵分解算法
    +
    +### 内容推荐
    +- 基于内容的推荐
    +- 特征工程
    +- 相似度计算
    +
    +### 深度学习
    +- 神经网络推荐
    +- 深度协同过滤
    +- 序列推荐模型
    +
    +### 混合推荐
    +- 多算法融合
    +- 权重优化
    +- A/B测试
    +
    +## 技术架构
    +- 机器学习:Python + TensorFlow
    +- 数据处理:Spark + Hadoop
    +- 实时计算:Flink
    +- 特征存储:Redis + HBase
    +- 模型服务:TensorFlow Serving
    +- 监控:MLflow + Prometheus
    +
    +## 性能指标
    +- 推荐准确率 > 85%
    +- 响应时间 < 100ms
    +- 覆盖率 > 90%
    +- 多样性指标优化
    +```
    +
    +**使用命令**:
    +```bash
    +# AI/ML项目解析
    +taskflow-ai parse recommendation-system.md --domain machine-learning
    +
    +# 生成ML项目计划
    +taskflow-ai plan recommendation-system.md \
    +  --team-size 8 \
    +  --domain machine-learning \
    +  --include-ml-ops \
    +  --include-experiments
    +```
    +
    +## 企业级应用
    +
    +### 示例7:企业ERP系统
    +
    +**PRD文档** (`enterprise-erp.md`):
    +
    +```markdown
    +# 企业资源规划(ERP)系统
    +
    +## 业务模块
    +
    +### 财务管理
    +- 会计核算
    +- 财务报表
    +- 预算管理
    +- 成本控制
    +
    +### 人力资源
    +- 员工信息管理
    +- 薪资管理
    +- 考勤管理
    +- 绩效评估
    +
    +### 供应链管理
    +- 采购管理
    +- 库存管理
    +- 供应商管理
    +- 物流跟踪
    +
    +### 销售管理
    +- 客户关系管理
    +- 销售订单
    +- 合同管理
    +- 销售分析
    +
    +## 技术架构
    +- 前端:Angular + TypeScript
    +- 后端:Java + Spring Boot
    +- 数据库:Oracle + Redis
    +- 消息队列:Apache Kafka
    +- 搜索引擎:Elasticsearch
    +- 报表:JasperReports
    +- 工作流:Activiti
    +- 部署:Docker + Kubernetes
    +
    +## 企业级要求
    +- 多租户支持
    +- 权限管理系统
    +- 审计日志
    +- 数据备份和恢复
    +- 高可用部署
    +- 性能监控
    +```
    +
    +**使用命令**:
    +```bash
    +# 企业级应用解析
    +taskflow-ai parse enterprise-erp.md --scale enterprise
    +
    +# 生成企业级项目计划
    +taskflow-ai plan enterprise-erp.md \
    +  --team-size 20 \
    +  --scale enterprise \
    +  --include-security \
    +  --include-compliance \
    +  --sprint-duration 21
    +```
    +
    +## 🔧 高级用法示例
    +
    +### 批量处理多个PRD
    +
    +```bash
    +# 批量解析多个PRD文件
    +for file in docs/*.md; do
    +  taskflow-ai parse "$file" --output "tasks/$(basename "$file" .md)-tasks.json"
    +done
    +
    +# 合并多个项目的任务
    +taskflow-ai merge-tasks tasks/*-tasks.json --output master-plan.json
    +```
    +
    +### 自定义输出格式
    +
    +```bash
    +# 生成Excel格式的任务计划
    +taskflow-ai plan prd.md --output tasks.xlsx --format excel
    +
    +# 生成甘特图
    +taskflow-ai plan prd.md --output gantt.html --format gantt
    +
    +# 生成Markdown报告
    +taskflow-ai plan prd.md --output report.md --format markdown
    +```
    +
    +### 集成CI/CD
    +
    +```yaml
    +# .github/workflows/taskflow.yml
    +name: TaskFlow Analysis
    +on: [push]
    +jobs:
    +  analyze:
    +    runs-on: ubuntu-latest
    +    steps:
    +      - uses: actions/checkout@v2
    +      - name: Install TaskFlow AI
    +        run: npm install -g taskflow-ai
    +      - name: Analyze PRD
    +        run: |
    +          taskflow-ai parse docs/prd.md --output analysis.json
    +          taskflow-ai plan docs/prd.md --output plan.json
    +      - name: Upload Results
    +        uses: actions/upload-artifact@v2
    +        with:
    +          name: taskflow-results
    +          path: "*.json"
    +```
    +
    +## 📊 结果分析示例
    +
    +### 任务统计分析
    +
    +```bash
    +# 查看任务统计
    +taskflow-ai stats --input tasks.json
    +
    +# 输出示例:
    +# 总任务数: 45
    +# 开发任务: 28 (62%)
    +# 测试任务: 12 (27%)
    +# 文档任务: 5 (11%)
    +# 预估总工时: 320小时
    +# 预估完成时间: 8周
    +```
    +
    +### 风险评估
    +
    +```bash
    +# 生成风险评估报告
    +taskflow-ai risk-analysis --input tasks.json --output risk-report.html
    +
    +# 关键路径分析
    +taskflow-ai critical-path --input tasks.json
    +```
    +
    +这些示例展示了TaskFlow AI在不同类型项目中的应用,从简单的个人项目到复杂的企业级系统,都能提供智能的任务规划和管理支持。
    
  • docs/guide/getting-started.md+414 0 added
    @@ -0,0 +1,414 @@
    +# 快速开始教程
    +
    +## 欢迎使用 TaskFlow AI
    +
    +这个5分钟的快速教程将帮助你在现有项目中集成 TaskFlow AI,体验智能PRD解析和任务管理的强大功能。
    +
    +## 🎯 学习目标
    +
    +完成本教程后,你将能够:
    +- ✅ 安装和配置 TaskFlow AI
    +- ✅ 在现有项目中集成 TaskFlow AI
    +- ✅ 解析PRD文档并生成任务
    +- ✅ 管理任务状态和进度
    +- ✅ 跟踪项目进展
    +
    +## 📋 前置要求
    +
    +- **Node.js**: >= 18.0.0
    +- **npm**: >= 9.0.0
    +- **现有项目**: 任何类型的开发项目(前端、后端、移动应用等)
    +- **PRD文档**: 产品需求文档(Markdown格式推荐)
    +- **AI模型API密钥**: 至少一个(DeepSeek、智谱AI、通义千问等)
    +
    +## 🚀 第一步:安装 TaskFlow AI
    +
    +### 全局安装
    +
    +```bash
    +# 安装 TaskFlow AI
    +npm install -g taskflow-ai
    +
    +# 验证安装
    +taskflow --version
    +```
    +
    +如果看到版本号输出,说明安装成功!
    +
    +### 可能遇到的问题
    +
    +如果遇到权限错误,请参考:
    +
    +```bash
    +# macOS/Linux 用户
    +sudo npm install -g taskflow-ai
    +
    +# 或配置 npm 全局目录(推荐)
    +mkdir ~/.npm-global
    +npm config set prefix '~/.npm-global'
    +echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
    +source ~/.bashrc
    +npm install -g taskflow-ai
    +```
    +
    +## ⚙️ 第二步:初始配置
    +
    +### 创建配置文件
    +
    +```bash
    +# 初始化配置
    +taskflow config init
    +```
    +
    +这将在你的用户目录下创建 `.taskflow/config.json` 配置文件。
    +
    +### 配置AI模型
    +
    +选择一个你有API密钥的模型进行配置:
    +
    +#### 配置 DeepSeek(推荐)
    +
    +```bash
    +# 设置 DeepSeek API 密钥
    +taskflow config set models.deepseek.apiKey "your-deepseek-api-key"
    +```
    +
    +#### 配置智谱AI
    +
    +```bash
    +# 设置智谱AI API 密钥
    +taskflow config set models.zhipu.apiKey "your-zhipu-api-key"
    +```
    +
    +#### 配置通义千问
    +
    +```bash
    +# 设置通义千问 API 密钥
    +taskflow config set models.qwen.apiKey "your-qwen-api-key"
    +```
    +
    +### 验证配置
    +
    +```bash
    +# 验证配置是否正确
    +taskflow config validate
    +
    +# 测试AI模型连接
    +taskflow models test
    +```
    +
    +如果看到 "✅ 配置验证通过" 和 "✅ 模型连接成功",说明配置完成!
    +
    +## 📁 第三步:在现有项目中集成TaskFlow AI
    +
    +### 进入现有项目
    +
    +```bash
    +# 进入你的现有项目目录(任何类型的项目都可以)
    +cd your-existing-project
    +
    +# 例如:React项目
    +cd my-react-app
    +
    +# 或者:Python项目
    +cd my-python-api
    +
    +# 或者:任何其他项目
    +cd my-mobile-app
    +```
    +
    +### 初始化TaskFlow AI配置
    +
    +```bash
    +# 在项目中初始化TaskFlow AI配置
    +taskflow init
    +
    +# 查看生成的配置文件
    +ls -la .taskflow/
    +```
    +
    +TaskFlow AI 会在你的项目中创建:
    +- `.taskflow/config.json` - TaskFlow AI 配置文件
    +- `.taskflow/tasks.json` - 任务数据存储
    +- `.taskflow/cache/` - 缓存目录
    +
    +### 项目集成后的结构
    +
    +```
    +your-existing-project/
    +├── src/                  # 你的原有源代码
    +├── docs/                 # 你的原有文档
    +├── package.json          # 你的原有配置
    +├── .taskflow/            # TaskFlow AI 配置目录
    +│   ├── config.json       # TaskFlow AI 配置
    +│   ├── tasks.json        # 任务数据
    +│   └── cache/            # 缓存目录
    +└── ...                   # 你的其他原有文件
    +```
    +
    +**重要**: TaskFlow AI 不会修改你的现有项目结构,只是添加自己的配置目录。
    +
    +## 📄 第四步:准备PRD文档
    +
    +### 使用现有PRD文档
    +
    +如果你的项目已经有PRD文档,可以直接使用:
    +
    +```bash
    +# 查看项目中的文档
    +ls docs/
    +ls requirements/
    +ls specifications/
    +
    +# 常见的PRD文档位置
    +docs/requirements.md
    +docs/product-requirements.md
    +requirements/user-stories.md
    +```
    +
    +### 创建示例PRD文档
    +
    +如果没有PRD文档,让我们创建一个简单的示例:
    +
    +```bash
    +# 在项目文档目录中创建PRD文档
    +mkdir -p docs
    +cat > docs/requirements.md << 'EOF'
    +# 用户管理功能 PRD
    +
    +## 项目概述
    +为现有系统添加用户管理功能,支持用户注册、登录、个人信息管理等基本功能。
    +
    +## 功能需求
    +
    +### 1. 用户注册
    +- 用户可以通过邮箱和密码注册账号
    +- 需要验证邮箱格式和密码强度
    +- 注册成功后发送确认邮件
    +
    +**验收标准:**
    +- 邮箱格式验证正确
    +- 密码长度至少8位,包含字母和数字
    +- 注册成功后跳转到登录页面
    +
    +### 2. 用户登录
    +- 用户可以通过邮箱和密码登录
    +- 支持"记住我"功能
    +- 登录失败时显示错误提示
    +
    +**验收标准:**
    +- 登录成功后跳转到用户仪表板
    +- 错误提示信息清晰明确
    +- "记住我"功能正常工作
    +
    +### 3. 个人信息管理
    +- 用户可以查看和编辑个人信息
    +- 支持头像上传
    +- 支持密码修改
    +
    +**验收标准:**
    +- 信息修改后立即生效
    +- 头像上传支持常见图片格式
    +- 密码修改需要验证原密码
    +
    +## 技术要求
    +- 集成到现有项目架构
    +- 保持与现有代码风格一致
    +- 确保数据安全和用户隐私
    +
    +## 优先级
    +1. 用户登录(高)
    +2. 用户注册(高)
    +3. 个人信息管理(中)
    +EOF
    +```
    +
    +## 🤖 第五步:解析PRD文档
    +
    +现在让我们使用 TaskFlow AI 解析PRD文档:
    +
    +```bash
    +# 解析项目中的PRD文档
    +taskflow parse docs/requirements.md
    +
    +# 或者解析其他位置的PRD文档
    +taskflow parse requirements/user-stories.md
    +```
    +
    +解析过程中你会看到:
    +1. 📄 正在读取文档...
    +2. 🤖 AI模型分析中...
    +3. 📋 生成任务列表...
    +4. ✅ 解析完成!
    +
    +### 查看解析结果
    +
    +```bash
    +# 查看生成的任务列表
    +taskflow status list
    +```
    +
    +你应该会看到类似这样的输出:
    +
    +```
    +📋 任务列表
    +
    +┌─────────────┬──────────────────────────┬──────────┬──────────┬──────────┐
    +│ ID          │ 任务名称                 │ 状态     │ 优先级   │ 预估工时 │
    +├─────────────┼──────────────────────────┼──────────┼──────────┼──────────┤
    +│ task-001    │ 实现用户注册功能         │ 未开始   │ 高       │ 8小时    │
    +│ task-002    │ 实现用户登录功能         │ 未开始   │ 高       │ 6小时    │
    +│ task-003    │ 实现个人信息管理         │ 未开始   │ 中       │ 10小时   │
    +│ task-004    │ 设计数据库表结构         │ 未开始   │ 高       │ 4小时    │
    +│ task-005    │ 实现JWT认证中间件        │ 未开始   │ 高       │ 6小时    │
    +└─────────────┴──────────────────────────┴──────────┴──────────┴──────────┘
    +
    +📊 项目统计
    +- 总任务数: 5
    +- 未开始: 5
    +- 进行中: 0
    +- 已完成: 0
    +- 总预估工时: 34小时
    +```
    +
    +## 📊 第六步:管理任务状态
    +
    +### 查看项目进度
    +
    +```bash
    +# 查看整体进度
    +taskflow status progress
    +```
    +
    +### 开始第一个任务
    +
    +```bash
    +# 获取下一个推荐任务
    +taskflow status next
    +
    +# 将任务标记为进行中
    +taskflow status update task-001 in_progress
    +```
    +
    +### 完成任务
    +
    +```bash
    +# 标记任务完成
    +taskflow status update task-001 completed --comment "用户注册功能已实现并测试通过"
    +
    +# 查看更新后的进度
    +taskflow status progress
    +```
    +
    +### 查看任务详情
    +
    +```bash
    +# 查看特定任务的详细信息
    +taskflow status show task-001
    +```
    +
    +## 🎮 第七步:体验交互式模式
    +
    +TaskFlow AI 提供了友好的交互式界面:
    +
    +```bash
    +# 启动交互式模式
    +taskflow interactive
    +```
    +
    +在交互式模式中,你可以:
    +- 📋 浏览任务列表
    +- ✏️ 更新任务状态
    +- 📊 查看项目进度
    +- ⚙️ 管理配置
    +- 🔍 搜索和过滤任务
    +
    +使用方向键导航,回车键选择,ESC键返回。
    +
    +## 🎯 第八步:高级功能体验
    +
    +### 多模型协同
    +
    +如果你配置了多个AI模型,可以启用多模型协同:
    +
    +```bash
    +# 启用多模型支持
    +taskflow config set multiModel.enabled true
    +taskflow config set multiModel.primary "deepseek"
    +taskflow config set multiModel.fallback '["zhipu", "qwen"]'
    +
    +# 使用多模型解析
    +taskflow parse requirements.md --multi-model
    +```
    +
    +### 任务依赖分析
    +
    +```bash
    +# 查看任务依赖关系
    +taskflow status dependencies
    +
    +# 生成依赖关系图
    +taskflow status dependencies --graph
    +```
    +
    +### 性能监控
    +
    +```bash
    +# 启用性能监控
    +taskflow config set performance.enableMonitoring true
    +
    +# 查看性能统计
    +taskflow performance stats
    +```
    +
    +## 🎉 恭喜!你已经完成了快速开始教程
    +
    +你现在已经学会了:
    +- ✅ 安装和配置 TaskFlow AI
    +- ✅ 创建项目和解析PRD文档
    +- ✅ 管理任务状态和进度
    +- ✅ 使用交互式模式
    +- ✅ 体验高级功能
    +
    +## 🚀 下一步
    +
    +现在你可以:
    +
    +1. **深入学习**:
    +   - [用户手册](../user-guide/user-manual.md) - 详细的功能说明
    +   - [高级功能指南](./advanced-features.md) - 探索更多功能
    +   - [CLI命令参考](../cli/commands.md) - 完整的命令列表
    +
    +2. **实际应用**:
    +   - 使用你的真实PRD文档
    +   - 配置团队协作流程
    +   - 集成到现有开发工作流
    +
    +3. **自定义配置**:
    +   - [配置参考](../reference/configuration.md) - 详细的配置选项
    +   - 优化性能设置
    +   - 配置多模型策略
    +
    +4. **获取帮助**:
    +   - [故障排除指南](../troubleshooting/common-issues.md) - 常见问题解决
    +   - [GitHub Issues](https://github.com/agions/taskflow-ai/issues) - 报告问题
    +   - [讨论区](https://github.com/agions/taskflow-ai/discussions) - 社区交流
    +
    +## 💡 小贴士
    +
    +- **定期备份**:使用 `taskflow backup create` 备份你的配置和数据
    +- **保持更新**:定期运行 `npm update -g taskflow-ai` 获取最新功能
    +- **监控使用**:使用 `taskflow models stats` 监控API使用情况
    +- **优化配置**:根据使用情况调整缓存和并发设置
    +
    +## 🤝 加入社区
    +
    +- **GitHub**: [Star 项目](https://github.com/agions/taskflow-ai) 支持我们
    +- **讨论**: 参与 [GitHub Discussions](https://github.com/agions/taskflow-ai/discussions)
    +- **贡献**: 查看 [贡献指南](../../CONTRIBUTING.md) 了解如何参与开发
    +
    +---
    +
    +**开始你的智能开发之旅吧!** 🚀
    +
    +如果在使用过程中遇到任何问题,请随时查看文档或联系我们。
    
  • docs/guide/installation.md+411 0 added
    @@ -0,0 +1,411 @@
    +# 安装和配置指南
    +
    +## 系统要求
    +
    +### 最低要求
    +- **Node.js**: >= 18.0.0
    +- **npm**: >= 9.0.0 或 **yarn**: >= 1.22.0
    +- **操作系统**: Windows 10+, macOS 10.15+, Linux (Ubuntu 18.04+)
    +- **内存**: 最少 2GB RAM
    +- **磁盘空间**: 最少 500MB 可用空间
    +
    +### 推荐配置
    +- **Node.js**: >= 20.0.0
    +- **npm**: >= 10.0.0
    +- **内存**: 4GB+ RAM
    +- **磁盘空间**: 2GB+ 可用空间
    +- **网络**: 稳定的互联网连接(用于AI模型API调用)
    +
    +## 安装方式
    +
    +### 1. 全局安装(推荐)
    +
    +全局安装可以在任何目录下使用 `taskflow` 命令:
    +
    +```bash
    +# 使用 npm
    +npm install -g taskflow-ai
    +
    +# 使用 yarn
    +yarn global add taskflow-ai
    +
    +# 使用 pnpm
    +pnpm add -g taskflow-ai
    +```
    +
    +安装完成后验证:
    +
    +```bash
    +taskflow --version
    +taskflow --help
    +```
    +
    +### 2. 项目本地安装
    +
    +如果你只想在特定项目中使用 TaskFlow AI:
    +
    +```bash
    +# 进入项目目录
    +cd your-project
    +
    +# 安装为开发依赖
    +npm install --save-dev taskflow-ai
    +
    +# 或安装为生产依赖
    +npm install --save taskflow-ai
    +```
    +
    +使用 npx 运行:
    +
    +```bash
    +npx taskflow --version
    +npx taskflow init
    +```
    +
    +### 3. 从源码安装
    +
    +适合开发者或需要最新功能的用户:
    +
    +```bash
    +# 克隆仓库
    +git clone https://github.com/agions/taskflow-ai.git
    +cd taskflow-ai
    +
    +# 安装依赖
    +npm install
    +
    +# 构建项目
    +npm run build
    +
    +# 链接到全局
    +npm link
    +
    +# 验证安装
    +taskflow --version
    +```
    +
    +### 4. 使用包管理器
    +
    +#### Homebrew (macOS)
    +
    +```bash
    +# 添加 tap(如果有的话)
    +brew tap agions/taskflow-ai
    +
    +# 安装
    +brew install taskflow-ai
    +```
    +
    +#### Chocolatey (Windows)
    +
    +```bash
    +# 安装
    +choco install taskflow-ai
    +```
    +
    +#### Snap (Linux)
    +
    +```bash
    +# 安装
    +sudo snap install taskflow-ai
    +```
    +
    +## 初始配置
    +
    +### 1. 创建配置文件
    +
    +首次运行时,TaskFlow AI 会自动创建配置文件:
    +
    +```bash
    +# 初始化配置
    +taskflow config init
    +
    +# 查看配置文件位置
    +taskflow config path
    +```
    +
    +配置文件位置:
    +- **Windows**: `%USERPROFILE%\.taskflow\config.json`
    +- **macOS**: `~/.taskflow/config.json`
    +- **Linux**: `~/.taskflow/config.json`
    +
    +### 2. 配置AI模型
    +
    +TaskFlow AI 支持多个国产大模型,你需要配置至少一个模型的API密钥:
    +
    +#### DeepSeek 配置
    +
    +```bash
    +# 设置 DeepSeek API 密钥
    +taskflow config set models.deepseek.apiKey "your-deepseek-api-key"
    +
    +# 设置自定义 API 端点(可选)
    +taskflow config set models.deepseek.baseUrl "https://api.deepseek.com"
    +```
    +
    +#### 智谱AI (GLM) 配置
    +
    +```bash
    +# 设置智谱AI API 密钥
    +taskflow config set models.zhipu.apiKey "your-zhipu-api-key"
    +```
    +
    +#### 通义千问 (Qwen) 配置
    +
    +```bash
    +# 设置通义千问 API 密钥
    +taskflow config set models.qwen.apiKey "your-qwen-api-key"
    +```
    +
    +#### 文心一言 (ERNIE) 配置
    +
    +```bash
    +# 设置文心一言 API 密钥和密钥
    +taskflow config set models.baidu.apiKey "your-api-key"
    +taskflow config set models.baidu.secretKey "your-secret-key"
    +```
    +
    +### 3. 验证配置
    +
    +```bash
    +# 验证所有配置
    +taskflow config validate
    +
    +# 测试AI模型连接
    +taskflow models test
    +
    +# 查看当前配置
    +taskflow config list
    +```
    +
    +### 4. 高级配置
    +
    +#### 多模型配置
    +
    +```bash
    +# 启用多模型支持
    +taskflow config set multiModel.enabled true
    +
    +# 设置主要模型
    +taskflow config set multiModel.primary "deepseek"
    +
    +# 设置备用模型
    +taskflow config set multiModel.fallback '["zhipu", "qwen"]'
    +
    +# 启用负载均衡
    +taskflow config set multiModel.loadBalancing true
    +
    +# 启用成本优化
    +taskflow config set multiModel.costOptimization true
    +```
    +
    +#### 日志配置
    +
    +```bash
    +# 设置日志级别
    +taskflow config set logging.level "info"
    +
    +# 设置日志输出方式
    +taskflow config set logging.output "both"
    +
    +# 设置日志文件路径
    +taskflow config set logging.file "./logs/taskflow.log"
    +```
    +
    +#### 性能配置
    +
    +```bash
    +# 启用性能监控
    +taskflow config set performance.enableMonitoring true
    +
    +# 设置缓存大小
    +taskflow config set performance.cacheSize 200
    +
    +# 设置请求超时时间
    +taskflow config set performance.timeout 30000
    +```
    +
    +## 环境变量配置
    +
    +你也可以使用环境变量来配置 TaskFlow AI:
    +
    +```bash
    +# AI模型配置
    +export TASKFLOW_DEEPSEEK_API_KEY="your-api-key"
    +export TASKFLOW_ZHIPU_API_KEY="your-api-key"
    +export TASKFLOW_QWEN_API_KEY="your-api-key"
    +
    +# 日志配置
    +export TASKFLOW_LOG_LEVEL="debug"
    +export TASKFLOW_LOG_OUTPUT="console"
    +
    +# 性能配置
    +export TASKFLOW_ENABLE_MONITORING="true"
    +export TASKFLOW_CACHE_SIZE="100"
    +```
    +
    +环境变量优先级高于配置文件。
    +
    +## 配置文件示例
    +
    +完整的配置文件示例:
    +
    +```json
    +{
    +  "version": "1.0.0",
    +  "models": {
    +    "deepseek": {
    +      "apiKey": "your-deepseek-api-key",
    +      "baseUrl": "https://api.deepseek.com"
    +    },
    +    "zhipu": {
    +      "apiKey": "your-zhipu-api-key"
    +    },
    +    "qwen": {
    +      "apiKey": "your-qwen-api-key"
    +    },
    +    "baidu": {
    +      "apiKey": "your-baidu-api-key",
    +      "secretKey": "your-baidu-secret-key"
    +    }
    +  },
    +  "multiModel": {
    +    "enabled": true,
    +    "primary": "deepseek",
    +    "fallback": ["zhipu", "qwen"],
    +    "loadBalancing": true,
    +    "costOptimization": true
    +  },
    +  "logging": {
    +    "level": "info",
    +    "output": "both",
    +    "file": "./logs/taskflow.log"
    +  },
    +  "performance": {
    +    "enableMonitoring": true,
    +    "cacheSize": 200,
    +    "timeout": 30000
    +  },
    +  "security": {
    +    "encryptApiKeys": true,
    +    "validateInputs": true
    +  },
    +  "ui": {
    +    "theme": "default",
    +    "language": "zh-CN",
    +    "showProgress": true
    +  }
    +}
    +```
    +
    +## 故障排除
    +
    +### 常见安装问题
    +
    +#### 1. 权限错误
    +
    +```bash
    +# macOS/Linux: 使用 sudo
    +sudo npm install -g taskflow-ai
    +
    +# 或配置 npm 全局目录
    +mkdir ~/.npm-global
    +npm config set prefix '~/.npm-global'
    +echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
    +source ~/.bashrc
    +```
    +
    +#### 2. 网络问题
    +
    +```bash
    +# 使用国内镜像
    +npm install -g taskflow-ai --registry https://registry.npmmirror.com
    +
    +# 或配置代理
    +npm config set proxy http://proxy.company.com:8080
    +npm config set https-proxy http://proxy.company.com:8080
    +```
    +
    +#### 3. Node.js 版本问题
    +
    +```bash
    +# 使用 nvm 管理 Node.js 版本
    +nvm install 18
    +nvm use 18
    +npm install -g taskflow-ai
    +```
    +
    +### 常见配置问题
    +
    +#### 1. API 密钥无效
    +
    +```bash
    +# 验证 API 密钥格式
    +taskflow config validate
    +
    +# 测试 API 连接
    +taskflow models test deepseek
    +```
    +
    +#### 2. 配置文件损坏
    +
    +```bash
    +# 重置配置文件
    +taskflow config reset
    +
    +# 重新初始化
    +taskflow config init
    +```
    +
    +#### 3. 权限问题
    +
    +```bash
    +# 检查配置文件权限
    +ls -la ~/.taskflow/
    +
    +# 修复权限
    +chmod 600 ~/.taskflow/config.json
    +```
    +
    +## 更新和卸载
    +
    +### 更新 TaskFlow AI
    +
    +```bash
    +# 检查当前版本
    +taskflow --version
    +
    +# 更新到最新版本
    +npm update -g taskflow-ai
    +
    +# 或重新安装
    +npm uninstall -g taskflow-ai
    +npm install -g taskflow-ai
    +```
    +
    +### 卸载 TaskFlow AI
    +
    +```bash
    +# 卸载全局安装
    +npm uninstall -g taskflow-ai
    +
    +# 清理配置文件(可选)
    +rm -rf ~/.taskflow
    +
    +# 清理缓存
    +npm cache clean --force
    +```
    +
    +## 下一步
    +
    +安装和配置完成后,你可以:
    +
    +1. [查看快速开始教程](./getting-started.md)
    +2. [学习基本使用方法](./basic-usage.md)
    +3. [探索高级功能](./advanced-features.md)
    +4. [查看CLI命令参考](../cli/commands.md)
    +
    +如果遇到问题,请查看:
    +- [常见问题解答](../faq.md)
    +- [故障排除指南](../troubleshooting/common-issues.md)
    +- [GitHub Issues](https://github.com/agions/taskflow-ai/issues)
    
  • docs/guide/mcp-integration.md+331 0 added
    @@ -0,0 +1,331 @@
    +# MCP (Model Context Protocol) 集成指南
    +
    +## 🎯 概述
    +
    +TaskFlow AI 遵循标准 MCP 协议,通过配置文件与 AI 编辑器实现无缝集成。编辑器会自动启动和管理 MCP 服务,无需手动操作。
    +
    +## 🤖 支持的 AI 编辑器
    +
    +| 编辑器 | MCP 支持 | 配置文件 | 自动启动 |
    +|--------|----------|----------|----------|
    +| **Windsurf** | ✅ 完整支持 | `.windsurf/mcp.json` | ✅ 是 |
    +| **Trae** | ✅ 完整支持 | `.trae/mcp-config.json` | ✅ 是 |
    +| **Cursor** | ✅ 完整支持 | `.cursor/mcp.json` | ✅ 是 |
    +| **VSCode** | ✅ 完整支持 | `.vscode/settings.json` | ✅ 是 |
    +
    +## 🚀 快速开始
    +
    +### 一键配置生成
    +
    +```bash
    +# 生成所有编辑器的 MCP 配置
    +taskflow init
    +
    +# 为特定编辑器生成配置
    +taskflow init --editor cursor
    +
    +# 验证配置有效性
    +taskflow mcp validate --all
    +```
    +
    +### 工作流程
    +
    +1. **生成配置文件** - `taskflow init`
    +2. **设置环境变量** - 配置 API 密钥
    +3. **打开编辑器** - 编辑器自动启动 MCP 服务
    +4. **开始使用** - 享受 AI 驱动的开发体验
    +
    +> **重要**: 无需手动启动服务,编辑器会根据配置文件自动管理 MCP 服务。
    +
    +## 🔧 配置文件详解
    +
    +### Cursor 配置
    +
    +**文件**: `.cursor/mcp.json`
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "--package=taskflow-ai", "taskflow-mcp"],
    +      "env": {
    +        "DEEPSEEK_API_KEY": "${DEEPSEEK_API_KEY}",
    +        "ZHIPU_API_KEY": "${ZHIPU_API_KEY}",
    +        "QWEN_API_KEY": "${QWEN_API_KEY}",
    +        "BAIDU_API_KEY": "${BAIDU_API_KEY}",
    +        "BAIDU_SECRET_KEY": "${BAIDU_SECRET_KEY}",
    +        "MOONSHOT_API_KEY": "${MOONSHOT_API_KEY}",
    +        "SPARK_APP_ID": "${SPARK_APP_ID}",
    +        "SPARK_API_KEY": "${SPARK_API_KEY}",
    +        "SPARK_API_SECRET": "${SPARK_API_SECRET}",
    +        "TASKFLOW_PROJECT_ROOT": "${workspaceFolder}",
    +        "TASKFLOW_CONFIG_PATH": ".taskflow/config.json"
    +      }
    +    }
    +  }
    +}
    +```
    +
    +**工作原理**:
    +1. Cursor 读取 `.cursor/mcp.json` 配置
    +2. 自动执行 `npx -y --package=taskflow-ai taskflow-mcp`
    +3. 启动 TaskFlow AI MCP 服务进程
    +4. 通过 stdio 进行通信
    +
    +### VSCode 配置
    +
    +**文件**: `.vscode/settings.json`
    +
    +```json
    +{
    +  "taskflow.mcp.enabled": true,
    +  "taskflow.mcp.server": {
    +    "command": "npx",
    +    "args": ["-y", "--package=taskflow-ai", "taskflow-mcp"],
    +    "env": {
    +      "DEEPSEEK_API_KEY": "${env:DEEPSEEK_API_KEY}",
    +      "ZHIPU_API_KEY": "${env:ZHIPU_API_KEY}",
    +      "QWEN_API_KEY": "${env:QWEN_API_KEY}",
    +      "BAIDU_API_KEY": "${env:BAIDU_API_KEY}",
    +      "BAIDU_SECRET_KEY": "${env:BAIDU_SECRET_KEY}",
    +      "MOONSHOT_API_KEY": "${env:MOONSHOT_API_KEY}",
    +      "SPARK_APP_ID": "${env:SPARK_APP_ID}",
    +      "SPARK_API_KEY": "${env:SPARK_API_KEY}",
    +      "SPARK_API_SECRET": "${env:SPARK_API_SECRET}",
    +      "TASKFLOW_PROJECT_ROOT": "${workspaceFolder}"
    +    }
    +  },
    +  "taskflow.ai.models": {
    +    "primary": "deepseek",
    +    "fallback": ["zhipu", "qwen", "baidu"],
    +    "specialized": {
    +      "code": "deepseek",
    +      "chinese": "zhipu",
    +      "general": "qwen",
    +      "creative": "baidu",
    +      "longText": "moonshot",
    +      "multimodal": "spark"
    +    }
    +  }
    +}
    +```
    +
    +### Windsurf 配置
    +
    +**文件**: `.windsurf/mcp.json`
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "--package=taskflow-ai", "taskflow-mcp"],
    +      "env": {
    +        "DEEPSEEK_API_KEY": "${DEEPSEEK_API_KEY}",
    +        "ZHIPU_API_KEY": "${ZHIPU_API_KEY}",
    +        "QWEN_API_KEY": "${QWEN_API_KEY}",
    +        "BAIDU_API_KEY": "${BAIDU_API_KEY}",
    +        "BAIDU_SECRET_KEY": "${BAIDU_SECRET_KEY}",
    +        "MOONSHOT_API_KEY": "${MOONSHOT_API_KEY}",
    +        "SPARK_APP_ID": "${SPARK_APP_ID}",
    +        "SPARK_API_KEY": "${SPARK_API_KEY}",
    +        "SPARK_API_SECRET": "${SPARK_API_SECRET}",
    +        "TASKFLOW_PROJECT_ROOT": "${workspaceFolder}",
    +        "TASKFLOW_CONFIG_PATH": ".taskflow/config.json"
    +      },
    +      "capabilities": {
    +        "resources": true,
    +        "tools": true,
    +        "prompts": true,
    +        "streaming": true
    +      }
    +    }
    +  }
    +}
    +```
    +
    +### Trae 配置
    +
    +**文件**: `.trae/mcp-config.json`
    +
    +```json
    +{
    +  "mcp": {
    +    "version": "1.0",
    +    "servers": {
    +      "taskflow": {
    +        "command": "npx",
    +        "args": ["-y", "--package=taskflow-ai", "taskflow-mcp"],
    +        "environment": {
    +          "TASKFLOW_WORKSPACE": "${workspaceFolder}",
    +          "DEEPSEEK_API_KEY": "${DEEPSEEK_API_KEY}",
    +          "ZHIPU_API_KEY": "${ZHIPU_API_KEY}",
    +          "QWEN_API_KEY": "${QWEN_API_KEY}",
    +          "BAIDU_API_KEY": "${BAIDU_API_KEY}",
    +          "BAIDU_SECRET_KEY": "${BAIDU_SECRET_KEY}",
    +          "MOONSHOT_API_KEY": "${MOONSHOT_API_KEY}",
    +          "SPARK_APP_ID": "${SPARK_APP_ID}",
    +          "SPARK_API_KEY": "${SPARK_API_KEY}",
    +          "SPARK_API_SECRET": "${SPARK_API_SECRET}"
    +        },
    +        "capabilities": [
    +          "code_analysis",
    +          "task_management",
    +          "prd_parsing",
    +          "ai_assistance"
    +        ]
    +      }
    +    }
    +  }
    +}
    +```
    +
    +## 🌐 多模型 AI 支持
    +
    +### 智能模型选择
    +
    +TaskFlow AI 根据任务类型自动选择最适合的 AI 模型:
    +
    +| 任务类型 | 推荐模型 | 能力特点 |
    +|----------|----------|----------|
    +| **代码生成** | DeepSeek | 强大的代码理解和生成能力 |
    +| **中文处理** | 智谱AI | 优秀的中文理解和推理能力 |
    +| **通用分析** | 通义千问 | 平衡的综合分析能力 |
    +| **创意任务** | 文心一言 | 出色的创意和内容生成 |
    +| **长文档** | 月之暗面 | 超长上下文处理能力 |
    +| **多模态** | 讯飞星火 | 文本、图像、音频综合处理 |
    +
    +### 模型配置
    +
    +```typescript
    +// 在 TaskFlow AI 中,模型选择是自动的
    +// 用户只需配置 API 密钥,系统会智能选择最优模型
    +
    +interface ModelConfig {
    +  deepseek: { apiKey: string }
    +  zhipu: { apiKey: string }
    +  qwen: { apiKey: string }
    +  baidu: { apiKey: string, secretKey: string }
    +  moonshot: { apiKey: string }
    +  spark: { appId: string, apiKey: string, apiSecret: string }
    +}
    +```
    +
    +## 🔐 环境变量配置
    +
    +### 创建 .env 文件
    +
    +```bash
    +# AI 模型 API 密钥
    +DEEPSEEK_API_KEY=sk-your-deepseek-key
    +ZHIPU_API_KEY=your-zhipu-key
    +QWEN_API_KEY=your-qwen-key
    +BAIDU_API_KEY=your-baidu-key
    +BAIDU_SECRET_KEY=your-baidu-secret
    +MOONSHOT_API_KEY=your-moonshot-key
    +SPARK_APP_ID=your-spark-appid
    +SPARK_API_KEY=your-spark-key
    +SPARK_API_SECRET=your-spark-secret
    +
    +# TaskFlow 配置
    +TASKFLOW_LOG_LEVEL=info
    +TASKFLOW_CACHE_ENABLED=true
    +```
    +
    +### 环境变量验证
    +
    +```bash
    +# 验证环境变量配置
    +taskflow config validate
    +
    +# 测试 API 密钥有效性
    +taskflow mcp test --all-models
    +```
    +
    +## 🎯 使用示例
    +
    +### Cursor 中的智能开发
    +
    +```typescript
    +// 在 Cursor 中输入注释,AI 会自动处理
    +/**
    + * @taskflow 创建用户认证系统
    + * 需求:支持邮箱登录、JWT认证、角色权限
    + */
    +
    +// TaskFlow AI 会:
    +// 1. 使用智谱AI解析中文需求
    +// 2. 使用DeepSeek生成技术方案
    +// 3. 自动创建开发任务
    +// 4. 生成完整代码结构
    +```
    +
    +### VSCode 中的项目管理
    +
    +```bash
    +# 通过命令面板使用
    +# Ctrl+Shift+P -> "TaskFlow: Parse PRD"
    +# Ctrl+Shift+P -> "TaskFlow: Create Task"
    +# Ctrl+Shift+P -> "TaskFlow: Analyze Code"
    +```
    +
    +## 🔧 配置验证
    +
    +### 验证命令
    +
    +```bash
    +# 验证所有 MCP 配置
    +taskflow mcp validate
    +
    +# 验证特定编辑器配置
    +taskflow mcp validate --editor cursor
    +
    +# 测试配置有效性
    +taskflow mcp test --editor cursor
    +
    +# 检查环境变量
    +taskflow config check-env
    +```
    +
    +### 故障排除
    +
    +| 问题 | 症状 | 解决方案 |
    +|------|------|----------|
    +| 配置文件无效 | 编辑器无法启动服务 | `taskflow mcp validate` |
    +| API 密钥错误 | 认证失败 | 检查 `.env` 文件 |
    +| 环境变量未设置 | 服务启动失败 | `taskflow config check-env` |
    +| 网络连接问题 | 模型调用失败 | 检查网络和防火墙 |
    +
    +## 📋 最佳实践
    +
    +### 1. 配置管理
    +
    +```bash
    +# 定期验证配置
    +taskflow mcp validate
    +
    +# 备份配置文件
    +cp .cursor/mcp.json .cursor/mcp.json.backup
    +
    +# 版本控制排除敏感信息
    +echo ".env" >> .gitignore
    +```
    +
    +### 2. 安全考虑
    +
    +- ✅ 使用环境变量存储 API 密钥
    +- ✅ 不要在配置文件中硬编码密钥
    +- ✅ 定期轮换 API 密钥
    +- ✅ 限制网络访问权限
    +
    +### 3. 性能优化
    +
    +- ✅ 启用缓存机制
    +- ✅ 合理设置超时时间
    +- ✅ 监控 API 使用量
    +- ✅ 使用负载均衡
    +
    +---
    +
    +**通过标准 MCP 协议,TaskFlow AI 与您的 AI 编辑器实现了真正的无缝集成!** 🚀
    
  • docs/guide/mcp-setup.md+225 0 added
    @@ -0,0 +1,225 @@
    +# TaskFlow AI MCP 配置指南
    +
    +## 概述
    +
    +TaskFlow AI 支持 **Model Context Protocol (MCP)**,可以与 Trae、Cursor、Claude Desktop、Windsurf 等 AI 编辑器集成。
    +
    +## 支持的编辑器
    +
    +- ✅ [Trae](https://trae.ai/)
    +- ✅ [Cursor](https://cursor.sh/)
    +- ✅ [Claude Desktop](https://claude.ai/download)
    +- ✅ [Windsurf](https://codeium.com/windsurf)
    +- ✅ [VS Code](https://code.visualstudio.com/) (with MCP extension)
    +
    +## 快速配置
    +
    +### 1. Trae 编辑器
    +
    +**方法:通过设置界面**
    +
    +1. 打开 Trae → Settings → MCP
    +2. 点击 "Add Server"
    +3. 填写配置:
    +   - **Name**: `taskflow-ai`
    +   - **Type**: `Command`
    +   - **Command**: `npx -y taskflow-ai@latest mcp start`
    +
    +**方法:配置文件**
    +
    +编辑 `~/.config/Trae/mcp.json` (Linux) 或 `~/Library/Application Support/Trae/mcp.json` (macOS):
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "taskflow-ai@latest", "mcp", "start"],
    +      "env": {
    +        "NODE_ENV": "production"
    +      }
    +    }
    +  }
    +}
    +```
    +
    +### 2. Cursor 编辑器
    +
    +1. 打开 Cursor → Settings → Features → MCP
    +2. 点击 "Add New MCP Server"
    +3. 填写配置:
    +   - **Name**: `taskflow-ai`
    +   - **Type**: `Command`
    +   - **Command**: `npx -y taskflow-ai@latest mcp start`
    +
    +### 3. Claude Desktop
    +
    +编辑配置文件:
    +
    +**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
    +
    +**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
    +
    +**Linux**: `~/.config/Claude/claude_desktop_config.json`
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "taskflow-ai@latest", "mcp", "start"]
    +    }
    +  }
    +}
    +```
    +
    +### 4. Windsurf
    +
    +1. 打开 Windsurf → Settings → Cascade → MCP
    +2. 添加配置:
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "taskflow-ai@latest", "mcp", "start"]
    +    }
    +  }
    +}
    +```
    +
    +## 本地开发配置
    +
    +如果你正在开发 TaskFlow AI,可以使用本地版本:
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "node",
    +      "args": ["/path/to/taskflow-ai/dist/mcp/stdio-server.js"]
    +    }
    +  }
    +}
    +```
    +
    +## 可用工具
    +
    +MCP 服务器提供以下工具:
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `file_read` | 读取文件内容 | `path`: 文件路径 |
    +| `file_write` | 写入文件内容 | `path`: 文件路径, `content`: 内容 |
    +| `shell_exec` | 执行 Shell 命令 | `command`: 命令, `cwd`: 工作目录, `timeout`: 超时时间 |
    +| `project_analyze` | 分析项目结构 | `path`: 项目路径, `depth`: 扫描深度 |
    +| `task_create` | 创建新任务 | `title`: 标题, `description`: 描述, `priority`: 优先级 |
    +
    +## 使用示例
    +
    +在编辑器中,你可以这样使用 TaskFlow AI:
    +
    +```
    +请帮我分析当前项目的结构
    +```
    +
    +```
    +读取 src/index.ts 文件的内容
    +```
    +
    +```
    +创建一个新任务:实现用户登录功能
    +```
    +
    +## 故障排除
    +
    +### 连接失败
    +
    +1. **检查 Node.js 版本**: 确保 Node.js >= 18.0.0
    +   ```bash
    +   node --version
    +   ```
    +
    +2. **检查包是否安装**:
    +   ```bash
    +   npm list -g taskflow-ai
    +   ```
    +
    +3. **查看日志**: 在编辑器中查看 MCP 服务器的输出日志
    +
    +### 权限问题
    +
    +如果提示权限错误,尝试:
    +
    +```bash
    +# 使用 sudo (macOS/Linux)
    +sudo npx taskflow-ai@latest mcp start
    +
    +# 或修改 npm 全局目录权限
    +mkdir ~/.npm-global
    +npm config set prefix '~/.npm-global'
    +export PATH=~/.npm-global/bin:$PATH
    +```
    +
    +### 命令未找到
    +
    +确保 `npx` 可用:
    +
    +```bash
    +which npx
    +# 或
    +where npx
    +```
    +
    +如果未找到,重新安装 Node.js 或更新 npm:
    +
    +```bash
    +npm install -g npm@latest
    +```
    +
    +## 高级配置
    +
    +### 自定义环境变量
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "taskflow-ai@latest", "mcp", "start"],
    +      "env": {
    +        "TASKFLOW_LOG_LEVEL": "debug",
    +        "TASKFLOW_WORKSPACE": "/path/to/workspace"
    +      }
    +    }
    +  }
    +}
    +```
    +
    +### 使用特定版本
    +
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "taskflow-ai@2.0.0", "mcp", "start"]
    +    }
    +  }
    +}
    +```
    +
    +## 更新日志
    +
    +### v2.0.0
    +- ✅ 修复 MCP 连接问题 (Issue #1)
    +- ✅ 支持 stdio 传输模式
    +- ✅ 兼容 Trae、Cursor、Claude Desktop、Windsurf
    +- ✅ 添加安全沙箱机制
    +- ✅ 优化工具执行性能
    +
    +## 获取帮助
    +
    +- GitHub Issues: https://github.com/Agions/taskflow-ai/issues
    +- 文档: https://agions.github.io/taskflow-ai/
    
  • docs/guide/project-requirements.md+319 0 added
    @@ -0,0 +1,319 @@
    +# TaskFlow AI 产品需求文档 (PRD)
    +
    +## 1. 产品概述
    +
    +### 1.1 产品定位
    +
    +TaskFlow AI 是一款基于AI的任务管理工具,专注于帮助开发者将PRD文档转换为结构化任务列表并进行智能管理,作为MCP服务在AI编辑器中无缝运行,实现AI自动编排开发计划,让AI编辑器更加智能高效。
    +
    +### 1.2 核心价值主张
    +
    +- **PRD文档结构化**:一键将文本/Markdown格式PRD转换为可执行任务列表
    +- **智能任务编排**:AI自动分析任务依赖关系,优化开发路径和顺序
    +- **国产模型深度集成**:专为国内开发者定制,解决境外API访问难题
    +- **MCP服务无缝对接**:作为编辑器AI助手的智能大脑,提升开发体验
    +
    +### 1.3 目标用户
    +
    +- **产品经理**:需要将PRD转换为开发任务的产品负责人
    +- **技术主管**:负责项目规划和任务分配的技术领导
    +- **开发团队**:使用AI编辑器进行开发的程序员团队
    +- **项目经理**:需要跟踪项目进度和管理任务的项目负责人
    +
    +## 2. 核心功能需求
    +
    +### 2.1 PRD解析引擎
    +
    +#### 2.1.1 多格式支持
    +- **Markdown文档解析**:支持标准Markdown格式PRD文档
    +- **纯文本解析**:智能识别文本中的需求结构
    +- **Word文档导入**:支持.docx格式文档解析
    +- **Excel表格解析**:支持需求表格的结构化导入
    +- **在线文档集成**:支持Notion、语雀等平台导出文档
    +
    +#### 2.1.2 智能解析能力
    +- **需求点提取**:自动识别和提取关键需求点
    +- **优先级识别**:自动检测需求优先级标识
    +- **依赖关系分析**:识别需求间的隐含依赖关系
    +- **时间约束提取**:检测关键截止日期和里程碑
    +- **技术约束识别**:提取技术限制和非功能需求
    +
    +### 2.2 AI任务编排引擎
    +
    +#### 2.2.1 智能任务分解
    +- **层次化分解**:将大需求分解为可执行的小任务
    +- **工作量估算**:基于历史数据和AI分析进行时间估算
    +- **技能匹配**:根据任务类型匹配所需技能
    +- **并行识别**:识别可以并行执行的任务组合
    +
    +#### 2.2.2 依赖关系管理
    +- **自动依赖检测**:智能分析任务间的依赖关系
    +- **关键路径计算**:识别项目关键路径和瓶颈
    +- **风险评估**:预测潜在风险点和阻塞因素
    +- **资源冲突检测**:识别资源分配冲突
    +
    +#### 2.2.3 优化算法
    +- **多目标优化**:平衡时间、资源、风险等多个目标
    +- **动态调整**:根据实际进度动态调整计划
    +- **最佳实践应用**:基于项目类型应用最佳实践模板
    +- **团队能力考虑**:结合团队规模和技能分布优化分配
    +
    +### 2.3 任务管理系统
    +
    +#### 2.3.1 任务生命周期管理
    +- **任务状态跟踪**:支持待处理/进行中/已完成/已取消等状态
    +- **状态自动更新**:基于代码提交等事件自动更新状态
    +- **进度监控**:实时跟踪任务和项目整体进度
    +- **里程碑管理**:设置和跟踪项目关键里程碑
    +
    +#### 2.3.2 协作功能
    +- **任务分配**:支持任务分配给团队成员
    +- **实时同步**:多人协作时实时同步任务状态
    +- **通知机制**:任务状态变更时自动通知相关人员
    +- **冲突解决**:提供任务冲突的解决建议
    +
    +#### 2.3.3 可视化展示
    +- **甘特图生成**:自动生成项目甘特图
    +- **依赖关系图**:可视化展示任务依赖关系
    +- **看板视图**:提供Kanban风格的任务看板
    +- **进度仪表板**:展示项目整体进度和关键指标
    +
    +### 2.4 MCP服务集成
    +
    +#### 2.4.1 编辑器深度集成
    +- **上下文感知**:基于当前编辑文件提供相关任务信息
    +- **智能推荐**:在编辑器中直接推荐下一步任务
    +- **代码关联**:建立代码文件与任务的双向关联
    +- **实时更新**:在编辑器中实时显示任务状态变化
    +
    +#### 2.4.2 MCP协议支持
    +- **标准命令实现**:实现完整的MCP协议命令集
    +- **自定义扩展**:支持自定义MCP命令扩展
    +- **事件通知**:支持任务状态变更的事件通知
    +- **双向通信**:支持编辑器与服务的双向数据交换
    +
    +### 2.5 国产大模型适配
    +
    +#### 2.5.1 多模型支持
    +- **DeepSeek集成**:深度集成DeepSeek API
    +- **文心一言支持**:完整支持百度文心一言
    +- **智谱AI适配**:集成智谱AI的GLM模型
    +- **可扩展架构**:支持快速接入新的国产大模型
    +
    +#### 2.5.2 模型协调机制
    +- **任务分发**:根据任务类型选择最适合的模型
    +- **负载均衡**:在多个模型间进行负载均衡
    +- **降级策略**:模型不可用时的降级处理机制
    +- **缓存优化**:智能缓存模型响应结果
    +
    +## 3. 技术架构
    +
    +### 3.1 系统架构设计
    +
    +```
    +┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
    +│   AI编辑器       │    │   MCP服务层      │    │   核心引擎       │
    +│  (Cursor/VSCode)│◄──►│  (TaskFlow AI)  │◄──►│  (解析/编排)     │
    +└─────────────────┘    └─────────────────┘    └─────────────────┘
    +                              │                        │
    +                              ▼                        ▼
    +                       ┌─────────────────┐    ┌─────────────────┐
    +                       │   数据存储        │   │   AI模型层       │
    +                       │  (本地/云端)      │   │ (国产大模型)      │
    +                       └─────────────────┘    └─────────────────┘
    +```
    +
    +### 3.2 核心模块
    +
    +#### 3.2.1 PRD解析模块
    +- **文档解析器**:支持多种格式的文档解析
    +- **内容提取器**:智能提取关键信息
    +- **结构化转换器**:将非结构化内容转换为结构化数据
    +- **语义分析器**:理解需求的语义和意图
    +
    +#### 3.2.2 任务编排模块
    +- **依赖分析器**:分析任务间的依赖关系
    +- **优化引擎**:基于多种算法优化任务安排
    +- **资源调度器**:合理分配人力和时间资源
    +- **风险评估器**:评估和预警项目风险
    +
    +#### 3.2.3 任务管理模块
    +- **状态管理器**:管理任务的各种状态
    +- **进度跟踪器**:跟踪任务和项目进度
    +- **通知系统**:处理各种通知和提醒
    +- **协作引擎**:支持团队协作功能
    +
    +### 3.3 数据模型
    +
    +#### 3.3.1 任务数据模型
    +```typescript
    +interface Task {
    +  id: string;
    +  title: string;
    +  description: string;
    +  priority: 'high' | 'medium' | 'low';
    +  status: 'pending' | 'in_progress' | 'completed' | 'cancelled';
    +  assignee?: string;
    +  estimatedHours: number;
    +  actualHours?: number;
    +  dependencies: string[];
    +  tags: string[];
    +  createdAt: Date;
    +  updatedAt: Date;
    +  dueDate?: Date;
    +}
    +```
    +
    +#### 3.3.2 项目数据模型
    +```typescript
    +interface Project {
    +  id: string;
    +  name: string;
    +  description: string;
    +  tasks: Task[];
    +  milestones: Milestone[];
    +  team: TeamMember[];
    +  startDate: Date;
    +  endDate?: Date;
    +  status: 'planning' | 'active' | 'completed' | 'cancelled';
    +}
    +```
    +
    +## 4. 用户体验设计
    +
    +### 4.1 核心用户流程
    +
    +#### 4.1.1 PRD导入流程
    +1. 用户在编辑器中打开PRD文档
    +2. 调用TaskFlow AI解析命令
    +3. 系统智能解析文档内容
    +4. 展示解析结果供用户确认
    +5. 生成初始任务列表
    +
    +#### 4.1.2 任务规划流程
    +1. 系统分析任务依赖关系
    +2. AI生成优化的执行计划
    +3. 用户调整和确认计划
    +4. 系统生成可视化展示
    +5. 开始任务执行跟踪
    +
    +#### 4.1.3 任务执行流程
    +1. 系统推荐下一个任务
    +2. 用户开始执行任务
    +3. 系统跟踪执行进度
    +4. 任务完成后更新状态
    +5. 自动推荐下一个任务
    +
    +### 4.2 界面设计原则
    +
    +- **简洁直观**:界面简洁,操作直观易懂
    +- **中文优先**:完全中文界面,符合国内用户习惯
    +- **响应迅速**:快速响应用户操作
    +- **信息丰富**:提供充分的上下文信息
    +- **可定制化**:支持用户自定义界面和工作流
    +
    +## 5. 非功能需求
    +
    +### 5.1 性能要求
    +- **响应时间**:本地命令响应时间不超过100ms
    +- **AI调用**:AI模型调用平均响应时间控制在3秒以内
    +- **并发支持**:支持10个并发用户同时使用
    +- **内存占用**:内存占用不超过512MB
    +
    +### 5.2 可靠性要求
    +- **容错机制**:AI模型调用失败时有完善的重试机制
    +- **数据安全**:任务数据定期自动备份
    +- **离线支持**:网络断开时可使用本地缓存继续部分功能
    +- **异常恢复**:异常情况下自动恢复到稳定状态
    +
    +### 5.3 安全要求
    +- **数据隐私**:用户数据本地存储,不上传到云端
    +- **API安全**:API密钥本地加密存储
    +- **访问控制**:支持团队权限管理
    +- **审计日志**:记录关键操作的审计日志
    +
    +### 5.4 兼容性要求
    +- **操作系统**:支持Windows、macOS、Linux
    +- **Node.js版本**:支持Node.js 14.x及以上版本
    +- **编辑器支持**:优先支持Cursor和VSCode
    +- **浏览器兼容**:Web界面支持主流现代浏览器
    +
    +## 6. 开发计划
    +
    +### 6.1 开发阶段
    +
    +#### 阶段1:基础架构 (2周)
    +- 项目框架搭建
    +- 核心模块设计
    +- MCP服务基础实现
    +- 基本CLI命令
    +
    +#### 阶段2:PRD解析引擎 (3周)
    +- 文档解析器开发
    +- 智能内容提取
    +- 结构化转换
    +- 测试用例编写
    +
    +#### 阶段3:任务编排引擎 (3周)
    +- 依赖分析算法
    +- 优化引擎实现
    +- 可视化组件
    +- 性能优化
    +
    +#### 阶段4:任务管理系统 (2周)
    +- 状态管理实现
    +- 协作功能开发
    +- 通知系统
    +- 数据持久化
    +
    +#### 阶段5:集成与优化 (2周)
    +- 编辑器集成测试
    +- 性能优化
    +- 用户体验优化
    +- 文档完善
    +
    +### 6.2 里程碑
    +
    +- **M1**:基础架构完成,可运行基本MCP服务
    +- **M2**:PRD解析功能完成,可解析简单文档
    +- **M3**:任务编排功能完成,可生成任务计划
    +- **M4**:任务管理功能完成,可跟踪任务状态
    +- **M5**:产品完整功能实现,可正式发布
    +
    +## 7. 风险评估
    +
    +### 7.1 技术风险
    +- **AI模型稳定性**:国产大模型API可能不稳定
    +- **解析准确性**:PRD文档格式多样,解析准确性难以保证
    +- **性能瓶颈**:大型项目的任务编排可能存在性能问题
    +
    +### 7.2 产品风险
    +- **用户接受度**:用户可能不习惯AI驱动的任务管理方式
    +- **竞争压力**:市场上可能出现类似产品
    +- **需求变化**:用户需求可能快速变化
    +
    +### 7.3 缓解策略
    +- **多模型支持**:支持多个AI模型,降低单一模型风险
    +- **渐进式发布**:采用MVP方式,快速验证核心功能
    +- **用户反馈**:建立快速的用户反馈机制
    +- **技术储备**:保持技术前瞻性,快速适应变化
    +
    +## 8. 成功指标
    +
    +### 8.1 功能指标
    +- PRD解析准确率达到85%以上
    +- 任务编排优化效果提升30%以上
    +- 支持至少3种主流国产大模型
    +- MCP服务稳定性达到99%以上
    +
    +### 8.2 用户指标
    +- 首月活跃用户达到500人
    +- 用户留存率达到60%以上
    +- 用户满意度评分达到4.0/5.0以上
    +- 社区贡献者达到10人以上
    +
    +### 8.3 技术指标
    +- 单元测试覆盖率达到80%以上
    +- 关键功能响应时间不超过3秒
    +- 系统可用性达到99.5%以上
    +- 代码质量评分达到A级以上
    
  • docs/index.md+222 0 added
    @@ -0,0 +1,222 @@
    +---
    +layout: home
    +
    +hero:
    +  name: "TaskFlow AI"
    +  text: "AI 思维流编排引擎"
    +  tagline: "从任务执行升级为思维编排 - 专为开发团队设计的下一代 AI 开发工具"
    +  image:
    +    src: /assets/logo.svg
    +    alt: TaskFlow AI Logo
    +  actions:
    +    - theme: brand
    +      text: 快速开始 →
    +      link: /guide/getting-started
    +    - theme: alt
    +      text: 安装指南
    +      link: /guide/installation
    +    - theme: alt
    +      text: GitHub
    +      link: https://github.com/agions/taskflow-ai
    +
    +features:
    +  - icon: 🧠
    +    title: 思维链可视化
    +    details: 展示 AI 推理的每一步,支持 Mermaid 流程图、思维导图等多种渲染格式,AI 自我审视优化结果
    +
    +  - icon: 🤖
    +    title: 多模型智能路由
    +    details: 统一管理 DeepSeek、OpenAI、Anthropic 等多模型,smart/cost/speed 路由策略,级联降级,成本估算
    +
    +  - icon: ⚡
    +    title: 工作流引擎
    +    details: YAML/JSON 声明式工作流,顺序/并行/条件分支/循环执行,SQLite 状态持久化,完整错误处理
    +
    +  - icon: 🧩
    +    title: 插件系统
    +    details: 动态加载/卸载插件,钩子系统 (onInit, onTaskCreate 等),内置 PRD/工作流/任务模板
    +
    +  - icon: 🤝
    +    title: 多 Agent 协作
    +    details: 自主目标执行,AI 反思机制,多 Agent 消息传递和任务分发,短期/长期记忆系统
    +
    +  - icon: 🔌
    +    title: MCP 集成
    +    details: 支持 Cursor、Windsurf、Trae、Claude Desktop,动态工具注册,企业级安全策略
    +---
    +
    +  - icon: ⚡
    +    title: 工作流引擎
    +    details: YAML/JSON 声明式工作流,顺序/并行/条件分支/循环执行,SQLite 状态持久化,完整错误处理
    +
    +  - icon: 🧩
    +    title: 插件系统
    +    details: 动态加载/卸载插件,钩子系统 (onInit, onTaskCreate 等),内置 PRD/工作流/任务模板
    +
    +  - icon: 🤝
    +    title: 多 Agent 协作
    +    details: 自主目标执行,AI 反思机制,多 Agent 消息传递和任务分发,短期/长期记忆系统
    +
    +  - icon: 🔌
    +    title: MCP 集成
    +    details: 支持 Cursor、Windsurf、Trae、Claude Desktop,动态工具注册,企业级安全策略
    +---
    +
    +## ⚡ 快速开始
    +
    +### 安装
    +
    +::: code-group
    +```bash [npm]
    +npm install -g taskflow-ai
    +```
    +
    +```bash [源码安装]
    +git clone https://github.com/Agions/taskflow-ai.git
    +cd taskflow-ai
    +npm install && npm run build
    +```
    +:::
    +
    +### 基础使用
    +
    +```bash
    +# 1. 初始化项目
    +taskflow init
    +
    +# 2. 配置 AI 模型
    +taskflow model add -i deepseek-chat -p deepseek -k YOUR_KEY
    +
    +# 3. 解析 PRD 文档
    +taskflow parse requirements.md
    +
    +# 4. 查看项目状态
    +taskflow status
    +```
    +
    +### 核心功能演示
    +
    +::: code-group
    +```bash [思维链分析]
    +taskflow think "帮我分析用户登录功能需求"
    +# 输出思维链分析,包含推理步骤、置信度
    +```
    +
    +```bash [模型路由]
    +taskflow model route "帮我写个排序算法"
    +# 智能选择最适合的模型
    +```
    +
    +```bash [工作流执行]
    +taskflow flow run prd-to-code
    +# 执行完整的 PRD → 代码工作流
    +```
    +
    +```bash [Agent 自主执行]
    +taskflow agent run executor "帮我创建一个 API"
    +# Agent 自主完成复杂任务
    +```
    +:::
    +
    +## 📚 文档导航
    +
    +<div class="doc-grid">
    +
    +### 🚀 入门指南
    +快速上手 TaskFlow AI
    +
    +- [安装指南](./guide/installation.md) - 安装和环境配置
    +- [快速开始](./guide/getting-started.md) - 5 分钟快速上手
    +- [基础使用](./guide/basic-usage.md) - 核心功能介绍
    +- [项目需求](./guide/project-requirements.md) - 系统要求
    +
    +### 📖 用户手册
    +深入了解功能特性
    +
    +- [高级特性](./guide/advanced-features.md) - 高级功能详解
    +- [工作流指南](./user-guide/workflows.md) - 工作流配置
    +- [最佳实践](./user-guide/best-practices.md) - 使用建议
    +- [使用示例](./guide/examples.md) - 实战案例
    +
    +### 🔌 编辑器集成
    +与 AI 编辑器无缝集成
    +
    +- [MCP 配置指南](./guide/mcp-setup.md) - MCP 服务器配置
    +- [Cursor 集成](./editor-config/cursor.md) - Cursor 编辑器
    +- [Windsurf/Trae](./editor-config/windsurf-trae-integration.md) - 其他编辑器
    +- [编辑器概览](./editor-config/overview.md) - 支持的编辑器
    +
    +### 🛠️ API 参考
    +完整的 API 文档
    +
    +- [API 概览](./api/index.md) - API 总览
    +- [CLI 命令](./reference/cli.md) - 命令行工具
    +- [配置选项](./reference/configuration.md) - 配置文件
    +- [完整 API](./api-reference.md) - 详细 API 文档
    +
    +### 💻 开发者
    +参与项目开发
    +
    +- [开发者指南](./development/developer-guide.md) - 开发环境搭建
    +- [贡献指南](./development/contributing.md) - 如何贡献代码
    +- [架构设计](./guide/architecture.md) - 系统架构
    +- [测试指南](./testing/index.md) - 测试规范
    +
    +### 🔧 故障排除
    +解决常见问题
    +
    +- [常见问题](./faq.md) - FAQ
    +- [安装问题](./troubleshooting/installation.md) - 安装故障
    +- [配置问题](./troubleshooting/configuration.md) - 配置故障
    +- [性能优化](./troubleshooting/performance.md) - 性能问题
    +
    +</div>
    +
    +## 相关链接
    +
    +<div class="link-grid">
    +
    +### 📦 资源
    +- [GitHub 仓库](https://github.com/Agions/taskflow-ai)
    +- [NPM 包](https://www.npmjs.com/package/taskflow-ai)
    +- [更新日志](./changelog.md)
    +- [安全策略](./security.md)
    +
    +### 💬 社区
    +- [问题反馈](https://github.com/Agions/taskflow-ai/issues)
    +- [讨论区](https://github.com/Agions/taskflow-ai/discussions)
    +- [贡献指南](./development/contributing.md)
    +
    +### 📚 学习资源
    +- [示例项目](./examples/example-prd.md)
    +- [视频教程](#) (即将推出)
    +- [博客文章](#) (即将推出)
    +
    +</div>
    +
    +<style>
    +.doc-grid {
    +  display: grid;
    +  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    +  gap: 1.5rem;
    +  margin: 2rem 0;
    +}
    +
    +.doc-grid h3 {
    +  margin-top: 0;
    +  padding-bottom: 0.5rem;
    +  border-bottom: 2px solid var(--vp-c-brand);
    +}
    +
    +.link-grid {
    +  display: grid;
    +  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    +  gap: 2rem;
    +  margin: 2rem 0;
    +}
    +
    +.link-grid h3 {
    +  margin-top: 0;
    +  color: var(--vp-c-brand);
    +}
    +</style>
    
  • docs/mcp/index.md+267 0 added
    @@ -0,0 +1,267 @@
    +# MCP 工具
    +
    +TaskFlow AI 内置强大的 MCP (Model Context Protocol) 工具集,支持主流代码编辑器的无缝集成。
    +
    +## 特性
    +
    +- 🚀 **40+ MCP 工具** - 覆盖文件、网络、数据库、代码执行等场景
    +- 🎯 **一键集成** - 支持 Cursor、VSCode、Windsurf、Trae、Claude Desktop、Zed
    +- 🔒 **安全沙箱** - 代码执行隔离,权限控制
    +- ⚡ **高性能** - 基于原生 Node.js 实现
    +
    +## 工具分类
    +
    +| 分类 | 工具数 | 描述 |
    +|------|--------|------|
    +| filesystem | 10+ | 文件系统操作 |
    +| http | 4 | HTTP 请求 |
    +| database | 4 | SQLite 数据库 |
    +| shell | 4 | Shell 命令执行 |
    +| git | 7 | Git 版本控制 |
    +| memory | 6 | 短期记忆 |
    +| code | 4 | 代码执行 |
    +| notification | 4 | 消息通知 |
    +
    +## 快速开始
    +
    +### 1. 安装
    +
    +```bash
    +npm install -g taskflow-ai
    +# 或
    +pnpm add -g taskflow-ai
    +```
    +
    +### 2. 生成编辑器配置
    +
    +```bash
    +# 生成所有编辑器配置
    +taskflow mcp init
    +
    +# 只生成 Cursor 配置
    +taskflow mcp init -e cursor
    +
    +# 指定输出目录
    +taskflow mcp init -e all -o ~/.cursor
    +```
    +
    +### 3. 查看可用工具
    +
    +```bash
    +# 列出所有工具
    +taskflow mcp tools
    +
    +# 按分类筛选
    +taskflow mcp tools -c filesystem
    +taskflow mcp tools -c http
    +taskflow mcp tools -c shell
    +```
    +
    +## 编辑器配置
    +
    +### Cursor
    +
    +```bash
    +taskflow mcp init -e cursor
    +```
    +
    +配置内容:
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "taskflow-ai@latest", "mcp", "start"],
    +      "env": {
    +        "TASKFLOW_API_KEY": "{{TASKFLOW_API_KEY}}"
    +      }
    +    }
    +  }
    +}
    +```
    +
    +### Claude Desktop
    +
    +```bash
    +taskflow mcp init -e claude-desktop
    +```
    +
    +配置文件位置:
    +- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
    +- Windows: `%APPDATA%/Claude/claude_desktop_config.json`
    +
    +### VSCode
    +
    +使用 VSCode MCP 扩展,然后添加配置:
    +```json
    +{
    +  "mcpServers": {
    +    "taskflow-ai": {
    +      "command": "npx",
    +      "args": ["-y", "taskflow-ai@latest", "mcp", "start"]
    +    }
    +  }
    +}
    +```
    +
    +### Windsurf
    +
    +```bash
    +taskflow mcp init -e windsurf
    +```
    +
    +### Trae
    +
    +```bash
    +taskflow mcp init -e trae
    +```
    +
    +## 工具详情
    +
    +### 文件系统工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `fs_readDir` | 读取目录内容 | path, options |
    +| `fs_mkdir` | 创建目录 | path, options |
    +| `fs_remove` | 删除文件/目录 | path, options |
    +| `fs_copy` | 复制文件/目录 | src, dest |
    +| `fs_move` | 移动/重命名 | src, dest |
    +| `fs_stat` | 获取文件状态 | path |
    +| `fs_exists` | 检查是否存在 | path |
    +| `fs_readJson` | 读取 JSON 文件 | path |
    +| `fs_writeJson` | 写入 JSON 文件 | path, data |
    +| `fs_glob` | Glob 模式匹配 | pattern, options |
    +
    +### HTTP 工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `http_request` | 通用 HTTP 请求 | url, method, headers, body |
    +| `http_get` | GET 请求 | url, query, headers |
    +| `http_post` | POST 请求 | url, body, query |
    +| `http_download` | 下载文件 | url, path |
    +
    +### 数据库工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `db_query` | 执行 SQL 查询 | dbPath, sql, params |
    +| `db_init` | 初始化数据库 | dbPath, tables |
    +| `db_list` | 列出所有表 | dbPath |
    +| `db_schema` | 获取表结构 | dbPath, table |
    +
    +### Shell 工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `shell_exec` | 执行命令 | command, cwd, timeout |
    +| `shell_exec_async` | 异步执行 | command, cwd |
    +| `shell_test` | 测试命令可用性 | command |
    +| `shell_kill` | 终止进程 | pid, signal |
    +
    +### Git 工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `git_status` | 获取状态 | cwd |
    +| `git_log` | 提交历史 | cwd, maxCount |
    +| `git_branch` | 分支列表 | cwd, all |
    +| `git_commit` | 创建提交 | cwd, message |
    +| `git_push` | 推送 | cwd, remote, branch |
    +| `git_pull` | 拉取 | cwd, remote, branch |
    +| `git_diff` | 查看差异 | cwd, file, staged |
    +
    +### Memory 工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `memory_set` | 存储数据 | key, value, ttl |
    +| `memory_get` | 获取数据 | key |
    +| `memory_delete` | 删除数据 | key |
    +| `memory_list` | 列出所有键 | - |
    +| `memory_clear` | 清空内存 | - |
    +| `memory_stats` | 内存统计 | - |
    +
    +### 代码执行工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `code_execute` | 执行代码 | code, language, timeout |
    +| `code_eval_js` | 执行 JS (沙箱) | code, timeout |
    +| `code_eval_python` | 执行 Python | code, timeout |
    +| `code_test` | 测试语言可用性 | code, language |
    +
    +### 通知工具
    +
    +| 工具名 | 描述 | 参数 |
    +|--------|------|------|
    +| `notify_slack` | 发送 Slack | webhookUrl, message |
    +| `notify_discord` | 发送 Discord | webhookUrl, message |
    +| `notify_email` | 发送邮件 | from, to, subject, body |
    +| `notify_webhook` | 通用 Webhook | url, method, body |
    +
    +## 本地开发测试
    +
    +```bash
    +# 构建项目
    +npm run build
    +
    +# 启动 MCP 服务器 (stdio 模式)
    +npm run mcp:start
    +
    +# 或使用 CLI
    +taskflow mcp start
    +```
    +
    +## 环境变量
    +
    +| 变量名 | 描述 |
    +|--------|------|
    +| `TASKFLOW_API_KEY` | API 密钥 |
    +| `TASKFLOW_CONFIG_PATH` | 配置文件路径 |
    +| `TASKFLOW_LOG_LEVEL` | 日志级别 |
    +
    +## 安全说明
    +
    +- Shell 执行需要明确授权
    +- 代码执行在沙箱环境中运行
    +- 所有操作都有审计日志
    +- 敏感操作需要 API 密钥
    +
    +## 常见问题
    +
    +### Q: MCP 服务器启动失败?
    +
    +```bash
    +# 检查 Node.js 版本
    +node --version  # 需要 >= 18
    +
    +# 重新安装
    +npm install -g taskflow-ai
    +```
    +
    +### Q: 工具调用超时?
    +
    +增加超时时间:
    +```json
    +{
    +  "shell_exec": {
    +    "timeout": 60
    +  }
    +}
    +```
    +
    +### Q: 如何添加更多工具?
    +
    +使用 `ToolRegistry` 注册自定义工具:
    +```typescript
    +import { toolRegistry } from 'taskflow-ai';
    +
    +toolRegistry.register({
    +  name: 'custom_tool',
    +  description: '自定义工具',
    +  inputSchema: { ... },
    +  handler: async (input) => { ... }
    +});
    +```
    
  • docs/.nojekyll+0 0 added
  • docs/package.json+38 0 added
    @@ -0,0 +1,38 @@
    +{
    +  "name": "taskflow-ai-docs",
    +  "version": "1.0.0",
    +  "description": "TaskFlow AI Documentation Site",
    +  "type": "module",
    +  "scripts": {
    +    "dev": "vitepress dev",
    +    "build": "vitepress build",
    +    "preview": "vitepress preview",
    +    "serve": "vitepress serve",
    +    "clean": "rm -rf .vitepress/dist .vitepress/cache"
    +  },
    +  "devDependencies": {
    +    "vitepress": "^1.6.4",
    +    "vue": "^3.5.28"
    +  },
    +  "engines": {
    +    "node": ">=18.0.0"
    +  },
    +  "repository": {
    +    "type": "git",
    +    "url": "https://github.com/agions/taskflow-ai.git",
    +    "directory": "docs"
    +  },
    +  "homepage": "https://agions.github.io/taskflow-ai/",
    +  "bugs": {
    +    "url": "https://github.com/agions/taskflow-ai/issues"
    +  },
    +  "license": "MIT",
    +  "keywords": [
    +    "taskflow",
    +    "ai",
    +    "documentation",
    +    "vitepress",
    +    "project-management",
    +    "prd-parser"
    +  ]
    +}
    \ No newline at end of file
    
  • docs/package-lock.json+2518 0 added
    @@ -0,0 +1,2518 @@
    +{
    +  "name": "taskflow-ai-docs",
    +  "version": "1.0.0",
    +  "lockfileVersion": 3,
    +  "requires": true,
    +  "packages": {
    +    "": {
    +      "name": "taskflow-ai-docs",
    +      "version": "1.0.0",
    +      "license": "MIT",
    +      "devDependencies": {
    +        "vitepress": "^1.6.4",
    +        "vue": "^3.5.28"
    +      },
    +      "engines": {
    +        "node": ">=18.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/abtesting": {
    +      "version": "1.15.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/abtesting/-/abtesting-1.15.2.tgz",
    +      "integrity": "sha512-rF7vRVE61E0QORw8e2NNdnttcl3jmFMWS9B4hhdga12COe+lMa26bQLfcBn/Nbp9/AF/8gXdaRCPsVns3CnjsA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/autocomplete-core": {
    +      "version": "1.17.7",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/autocomplete-core/-/autocomplete-core-1.17.7.tgz",
    +      "integrity": "sha512-BjiPOW6ks90UKl7TwMv7oNQMnzU+t/wk9mgIDi6b1tXpUek7MW0lbNOUHpvam9pe3lVCf4xPFT+lK7s+e+fs7Q==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/autocomplete-plugin-algolia-insights": "1.17.7",
    +        "@algolia/autocomplete-shared": "1.17.7"
    +      }
    +    },
    +    "node_modules/@algolia/autocomplete-plugin-algolia-insights": {
    +      "version": "1.17.7",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.7.tgz",
    +      "integrity": "sha512-Jca5Ude6yUOuyzjnz57og7Et3aXjbwCSDf/8onLHSQgw1qW3ALl9mrMWaXb5FmPVkV3EtkD2F/+NkT6VHyPu9A==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/autocomplete-shared": "1.17.7"
    +      },
    +      "peerDependencies": {
    +        "search-insights": ">= 1 < 3"
    +      }
    +    },
    +    "node_modules/@algolia/autocomplete-preset-algolia": {
    +      "version": "1.17.7",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.7.tgz",
    +      "integrity": "sha512-ggOQ950+nwbWROq2MOCIL71RE0DdQZsceqrg32UqnhDz8FlO9rL8ONHNsI2R1MH0tkgVIDKI/D0sMiUchsFdWA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/autocomplete-shared": "1.17.7"
    +      },
    +      "peerDependencies": {
    +        "@algolia/client-search": ">= 4.9.1 < 6",
    +        "algoliasearch": ">= 4.9.1 < 6"
    +      }
    +    },
    +    "node_modules/@algolia/autocomplete-shared": {
    +      "version": "1.17.7",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.7.tgz",
    +      "integrity": "sha512-o/1Vurr42U/qskRSuhBH+VKxMvkkUVTLU6WZQr+L5lGZZLYWyhdzWjW0iGXY7EkwRTjBqvN2EsR81yCTGV/kmg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "peerDependencies": {
    +        "@algolia/client-search": ">= 4.9.1 < 6",
    +        "algoliasearch": ">= 4.9.1 < 6"
    +      }
    +    },
    +    "node_modules/@algolia/client-abtesting": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/client-abtesting/-/client-abtesting-5.49.2.tgz",
    +      "integrity": "sha512-XyvKCm0RRmovMI/ChaAVjTwpZhXdbgt3iZofK914HeEHLqD1MUFFVLz7M0+Ou7F56UkHXwRbpHwb9xBDNopprQ==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/client-analytics": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/client-analytics/-/client-analytics-5.49.2.tgz",
    +      "integrity": "sha512-jq/3qvtmj3NijZlhq7A1B0Cl41GfaBpjJxcwukGsYds6aMSCWrEAJ9pUqw/C9B3hAmILYKl7Ljz3N9SFvekD3Q==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/client-common": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/client-common/-/client-common-5.49.2.tgz",
    +      "integrity": "sha512-bn0biLequn3epobCfjUqCxlIlurLr4RHu7RaE4trgN+RDcUq6HCVC3/yqq1hwbNYpVtulnTOJzcaxYlSr1fnuw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/client-insights": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/client-insights/-/client-insights-5.49.2.tgz",
    +      "integrity": "sha512-z14wfFs1T3eeYbCArC8pvntAWsPo9f6hnUGoj8IoRUJTwgJiiySECkm8bmmV47/x0oGHfsVn3kBdjMX0yq0sNA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/client-personalization": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/client-personalization/-/client-personalization-5.49.2.tgz",
    +      "integrity": "sha512-GpRf7yuuAX93+Qt0JGEJZwgtL0MFdjFO9n7dn8s2pA9mTjzl0Sc5+uTk1VPbIAuf7xhCP9Mve+URGb6J+EYxgA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/client-query-suggestions": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/client-query-suggestions/-/client-query-suggestions-5.49.2.tgz",
    +      "integrity": "sha512-HZwApmNkp0DiAjZcLYdQLddcG4Agb88OkojiAHGgcm5DVXobT5uSZ9lmyrbw/tmQBJwgu2CNw4zTyXoIB7YbPA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/client-search": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/client-search/-/client-search-5.49.2.tgz",
    +      "integrity": "sha512-y1IOpG6OSmTpGg/CT0YBb/EAhR2nsC18QWp9Jy8HO9iGySpcwaTvs5kHa17daP3BMTwWyaX9/1tDTDQshZzXdg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/ingestion": {
    +      "version": "1.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/ingestion/-/ingestion-1.49.2.tgz",
    +      "integrity": "sha512-YYJRjaZ2bqk923HxE4um7j/Cm3/xoSkF2HC2ZweOF8cXL3sqnlndSUYmCaxHFjNPWLaSHk2IfssX6J/tdKTULw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/monitoring": {
    +      "version": "1.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/monitoring/-/monitoring-1.49.2.tgz",
    +      "integrity": "sha512-9WgH+Dha39EQQyGKCHlGYnxW/7W19DIrEbCEbnzwAMpGAv1yTWCHMPXHxYa+LcL3eCp2V/5idD1zHNlIKmHRHg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/recommend": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/recommend/-/recommend-5.49.2.tgz",
    +      "integrity": "sha512-K7Gp5u+JtVYgaVpBxF5rGiM+Ia8SsMdcAJMTDV93rwh00DKNllC19o1g+PwrDjDvyXNrnTEbofzbTs2GLfFyKA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/requester-browser-xhr": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.49.2.tgz",
    +      "integrity": "sha512-3UhYCcWX6fbtN8ABcxZlhaQEwXFh3CsFtARyyadQShHMPe3mJV9Wel4FpJTa+seugRkbezFz0tt6aPTZSYTBuA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/requester-fetch": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/requester-fetch/-/requester-fetch-5.49.2.tgz",
    +      "integrity": "sha512-G94VKSGbsr+WjsDDOBe5QDQ82QYgxvpxRGJfCHZBnYKYsy/jv9qGIDb93biza+LJWizQBUtDj7bZzp3QZyzhPQ==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@algolia/requester-node-http": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@algolia/requester-node-http/-/requester-node-http-5.49.2.tgz",
    +      "integrity": "sha512-UuihBGHafG/ENsrcTGAn5rsOffrCIRuHMOsD85fZGLEY92ate+BMTUqxz60dv5zerh8ZumN4bRm8eW2z9L11jA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/client-common": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/@babel/helper-string-parser": {
    +      "version": "7.27.1",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
    +      "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "engines": {
    +        "node": ">=6.9.0"
    +      }
    +    },
    +    "node_modules/@babel/helper-validator-identifier": {
    +      "version": "7.28.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
    +      "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
    +      "dev": true,
    +      "license": "MIT",
    +      "engines": {
    +        "node": ">=6.9.0"
    +      }
    +    },
    +    "node_modules/@babel/parser": {
    +      "version": "7.29.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@babel/parser/-/parser-7.29.2.tgz",
    +      "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@babel/types": "^7.29.0"
    +      },
    +      "bin": {
    +        "parser": "bin/babel-parser.js"
    +      },
    +      "engines": {
    +        "node": ">=6.0.0"
    +      }
    +    },
    +    "node_modules/@babel/types": {
    +      "version": "7.29.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@babel/types/-/types-7.29.0.tgz",
    +      "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@babel/helper-string-parser": "^7.27.1",
    +        "@babel/helper-validator-identifier": "^7.28.5"
    +      },
    +      "engines": {
    +        "node": ">=6.9.0"
    +      }
    +    },
    +    "node_modules/@docsearch/css": {
    +      "version": "3.8.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@docsearch/css/-/css-3.8.2.tgz",
    +      "integrity": "sha512-y05ayQFyUmCXze79+56v/4HpycYF3uFqB78pLPrSV5ZKAlDuIAAJNhaRi8tTdRNXh05yxX/TyNnzD6LwSM89vQ==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@docsearch/js": {
    +      "version": "3.8.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@docsearch/js/-/js-3.8.2.tgz",
    +      "integrity": "sha512-Q5wY66qHn0SwA7Taa0aDbHiJvaFJLOJyHmooQ7y8hlwwQLQ/5WwCcoX0g7ii04Qi2DJlHsd0XXzJ8Ypw9+9YmQ==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@docsearch/react": "3.8.2",
    +        "preact": "^10.0.0"
    +      }
    +    },
    +    "node_modules/@docsearch/react": {
    +      "version": "3.8.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@docsearch/react/-/react-3.8.2.tgz",
    +      "integrity": "sha512-xCRrJQlTt8N9GU0DG4ptwHRkfnSnD/YpdeaXe02iKfqs97TkZJv60yE+1eq/tjPcVnTW8dP5qLP7itifFVV5eg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/autocomplete-core": "1.17.7",
    +        "@algolia/autocomplete-preset-algolia": "1.17.7",
    +        "@docsearch/css": "3.8.2",
    +        "algoliasearch": "^5.14.2"
    +      },
    +      "peerDependencies": {
    +        "@types/react": ">= 16.8.0 < 19.0.0",
    +        "react": ">= 16.8.0 < 19.0.0",
    +        "react-dom": ">= 16.8.0 < 19.0.0",
    +        "search-insights": ">= 1 < 3"
    +      },
    +      "peerDependenciesMeta": {
    +        "@types/react": {
    +          "optional": true
    +        },
    +        "react": {
    +          "optional": true
    +        },
    +        "react-dom": {
    +          "optional": true
    +        },
    +        "search-insights": {
    +          "optional": true
    +        }
    +      }
    +    },
    +    "node_modules/@esbuild/aix-ppc64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
    +      "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
    +      "cpu": [
    +        "ppc64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "aix"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/android-arm": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
    +      "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
    +      "cpu": [
    +        "arm"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "android"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/android-arm64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
    +      "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "android"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/android-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
    +      "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "android"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/darwin-arm64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
    +      "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "darwin"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/darwin-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
    +      "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "darwin"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/freebsd-arm64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
    +      "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "freebsd"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/freebsd-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
    +      "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "freebsd"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-arm": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
    +      "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
    +      "cpu": [
    +        "arm"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-arm64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
    +      "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-ia32": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
    +      "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
    +      "cpu": [
    +        "ia32"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-loong64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
    +      "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
    +      "cpu": [
    +        "loong64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-mips64el": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
    +      "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
    +      "cpu": [
    +        "mips64el"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-ppc64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
    +      "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
    +      "cpu": [
    +        "ppc64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-riscv64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
    +      "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
    +      "cpu": [
    +        "riscv64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-s390x": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
    +      "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
    +      "cpu": [
    +        "s390x"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/linux-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
    +      "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/netbsd-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
    +      "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "netbsd"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/openbsd-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
    +      "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "openbsd"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/sunos-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
    +      "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "sunos"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/win32-arm64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
    +      "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "win32"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/win32-ia32": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
    +      "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
    +      "cpu": [
    +        "ia32"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "win32"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@esbuild/win32-x64": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
    +      "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "win32"
    +      ],
    +      "engines": {
    +        "node": ">=12"
    +      }
    +    },
    +    "node_modules/@iconify-json/simple-icons": {
    +      "version": "1.2.74",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@iconify-json/simple-icons/-/simple-icons-1.2.74.tgz",
    +      "integrity": "sha512-yqaohfY6jnYjTVpuTkaBQHrWbdUrQyWXhau0r/0EZiNWYXPX/P8WWwl1DoLH5CbvDjjcWQw5J0zADhgCUklOqA==",
    +      "dev": true,
    +      "license": "CC0-1.0",
    +      "dependencies": {
    +        "@iconify/types": "*"
    +      }
    +    },
    +    "node_modules/@iconify/types": {
    +      "version": "2.0.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@iconify/types/-/types-2.0.0.tgz",
    +      "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@jridgewell/sourcemap-codec": {
    +      "version": "1.5.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
    +      "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@rollup/rollup-android-arm-eabi": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz",
    +      "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==",
    +      "cpu": [
    +        "arm"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "android"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-android-arm64": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz",
    +      "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "android"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-darwin-arm64": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz",
    +      "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "darwin"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-darwin-x64": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz",
    +      "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "darwin"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-freebsd-arm64": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz",
    +      "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "freebsd"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-freebsd-x64": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz",
    +      "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "freebsd"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz",
    +      "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==",
    +      "cpu": [
    +        "arm"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-arm-musleabihf": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz",
    +      "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==",
    +      "cpu": [
    +        "arm"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-arm64-gnu": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz",
    +      "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-arm64-musl": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz",
    +      "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-loong64-gnu": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz",
    +      "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==",
    +      "cpu": [
    +        "loong64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-loong64-musl": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz",
    +      "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==",
    +      "cpu": [
    +        "loong64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-ppc64-gnu": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz",
    +      "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==",
    +      "cpu": [
    +        "ppc64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-ppc64-musl": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz",
    +      "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==",
    +      "cpu": [
    +        "ppc64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-riscv64-gnu": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz",
    +      "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==",
    +      "cpu": [
    +        "riscv64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-riscv64-musl": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz",
    +      "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==",
    +      "cpu": [
    +        "riscv64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-s390x-gnu": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz",
    +      "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==",
    +      "cpu": [
    +        "s390x"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-x64-gnu": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz",
    +      "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-linux-x64-musl": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz",
    +      "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "linux"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-openbsd-x64": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz",
    +      "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "openbsd"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-openharmony-arm64": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz",
    +      "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "openharmony"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-win32-arm64-msvc": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz",
    +      "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==",
    +      "cpu": [
    +        "arm64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "win32"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-win32-ia32-msvc": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz",
    +      "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==",
    +      "cpu": [
    +        "ia32"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "win32"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-win32-x64-gnu": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz",
    +      "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "win32"
    +      ]
    +    },
    +    "node_modules/@rollup/rollup-win32-x64-msvc": {
    +      "version": "4.59.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz",
    +      "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==",
    +      "cpu": [
    +        "x64"
    +      ],
    +      "dev": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "win32"
    +      ]
    +    },
    +    "node_modules/@shikijs/core": {
    +      "version": "2.5.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/core/-/core-2.5.0.tgz",
    +      "integrity": "sha512-uu/8RExTKtavlpH7XqnVYBrfBkUc20ngXiX9NSrBhOVZYv/7XQRKUyhtkeflY5QsxC0GbJThCerruZfsUaSldg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@shikijs/engine-javascript": "2.5.0",
    +        "@shikijs/engine-oniguruma": "2.5.0",
    +        "@shikijs/types": "2.5.0",
    +        "@shikijs/vscode-textmate": "^10.0.2",
    +        "@types/hast": "^3.0.4",
    +        "hast-util-to-html": "^9.0.4"
    +      }
    +    },
    +    "node_modules/@shikijs/engine-javascript": {
    +      "version": "2.5.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/engine-javascript/-/engine-javascript-2.5.0.tgz",
    +      "integrity": "sha512-VjnOpnQf8WuCEZtNUdjjwGUbtAVKuZkVQ/5cHy/tojVVRIRtlWMYVjyWhxOmIq05AlSOv72z7hRNRGVBgQOl0w==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@shikijs/types": "2.5.0",
    +        "@shikijs/vscode-textmate": "^10.0.2",
    +        "oniguruma-to-es": "^3.1.0"
    +      }
    +    },
    +    "node_modules/@shikijs/engine-oniguruma": {
    +      "version": "2.5.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/engine-oniguruma/-/engine-oniguruma-2.5.0.tgz",
    +      "integrity": "sha512-pGd1wRATzbo/uatrCIILlAdFVKdxImWJGQ5rFiB5VZi2ve5xj3Ax9jny8QvkaV93btQEwR/rSz5ERFpC5mKNIw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@shikijs/types": "2.5.0",
    +        "@shikijs/vscode-textmate": "^10.0.2"
    +      }
    +    },
    +    "node_modules/@shikijs/langs": {
    +      "version": "2.5.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/langs/-/langs-2.5.0.tgz",
    +      "integrity": "sha512-Qfrrt5OsNH5R+5tJ/3uYBBZv3SuGmnRPejV9IlIbFH3HTGLDlkqgHymAlzklVmKBjAaVmkPkyikAV/sQ1wSL+w==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@shikijs/types": "2.5.0"
    +      }
    +    },
    +    "node_modules/@shikijs/themes": {
    +      "version": "2.5.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/themes/-/themes-2.5.0.tgz",
    +      "integrity": "sha512-wGrk+R8tJnO0VMzmUExHR+QdSaPUl/NKs+a4cQQRWyoc3YFbUzuLEi/KWK1hj+8BfHRKm2jNhhJck1dfstJpiw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@shikijs/types": "2.5.0"
    +      }
    +    },
    +    "node_modules/@shikijs/transformers": {
    +      "version": "2.5.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/transformers/-/transformers-2.5.0.tgz",
    +      "integrity": "sha512-SI494W5X60CaUwgi8u4q4m4s3YAFSxln3tzNjOSYqq54wlVgz0/NbbXEb3mdLbqMBztcmS7bVTaEd2w0qMmfeg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@shikijs/core": "2.5.0",
    +        "@shikijs/types": "2.5.0"
    +      }
    +    },
    +    "node_modules/@shikijs/types": {
    +      "version": "2.5.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/types/-/types-2.5.0.tgz",
    +      "integrity": "sha512-ygl5yhxki9ZLNuNpPitBWvcy9fsSKKaRuO4BAlMyagszQidxcpLAr0qiW/q43DtSIDxO6hEbtYLiFZNXO/hdGw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@shikijs/vscode-textmate": "^10.0.2",
    +        "@types/hast": "^3.0.4"
    +      }
    +    },
    +    "node_modules/@shikijs/vscode-textmate": {
    +      "version": "10.0.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz",
    +      "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@types/estree": {
    +      "version": "1.0.8",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/estree/-/estree-1.0.8.tgz",
    +      "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@types/hast": {
    +      "version": "3.0.4",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/hast/-/hast-3.0.4.tgz",
    +      "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@types/unist": "*"
    +      }
    +    },
    +    "node_modules/@types/linkify-it": {
    +      "version": "5.0.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/linkify-it/-/linkify-it-5.0.0.tgz",
    +      "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@types/markdown-it": {
    +      "version": "14.1.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/markdown-it/-/markdown-it-14.1.2.tgz",
    +      "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@types/linkify-it": "^5",
    +        "@types/mdurl": "^2"
    +      }
    +    },
    +    "node_modules/@types/mdast": {
    +      "version": "4.0.4",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/mdast/-/mdast-4.0.4.tgz",
    +      "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@types/unist": "*"
    +      }
    +    },
    +    "node_modules/@types/mdurl": {
    +      "version": "2.0.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/mdurl/-/mdurl-2.0.0.tgz",
    +      "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@types/unist": {
    +      "version": "3.0.3",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/unist/-/unist-3.0.3.tgz",
    +      "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@types/web-bluetooth": {
    +      "version": "0.0.21",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz",
    +      "integrity": "sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@ungap/structured-clone": {
    +      "version": "1.3.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",
    +      "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",
    +      "dev": true,
    +      "license": "ISC"
    +    },
    +    "node_modules/@vitejs/plugin-vue": {
    +      "version": "5.2.4",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz",
    +      "integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "engines": {
    +        "node": "^18.0.0 || >=20.0.0"
    +      },
    +      "peerDependencies": {
    +        "vite": "^5.0.0 || ^6.0.0",
    +        "vue": "^3.2.25"
    +      }
    +    },
    +    "node_modules/@vue/compiler-core": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/compiler-core/-/compiler-core-3.5.30.tgz",
    +      "integrity": "sha512-s3DfdZkcu/qExZ+td75015ljzHc6vE+30cFMGRPROYjqkroYI5NV2X1yAMX9UeyBNWB9MxCfPcsjpLS11nzkkw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@babel/parser": "^7.29.0",
    +        "@vue/shared": "3.5.30",
    +        "entities": "^7.0.1",
    +        "estree-walker": "^2.0.2",
    +        "source-map-js": "^1.2.1"
    +      }
    +    },
    +    "node_modules/@vue/compiler-dom": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/compiler-dom/-/compiler-dom-3.5.30.tgz",
    +      "integrity": "sha512-eCFYESUEVYHhiMuK4SQTldO3RYxyMR/UQL4KdGD1Yrkfdx4m/HYuZ9jSfPdA+nWJY34VWndiYdW/wZXyiPEB9g==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/compiler-core": "3.5.30",
    +        "@vue/shared": "3.5.30"
    +      }
    +    },
    +    "node_modules/@vue/compiler-sfc": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/compiler-sfc/-/compiler-sfc-3.5.30.tgz",
    +      "integrity": "sha512-LqmFPDn89dtU9vI3wHJnwaV6GfTRD87AjWpTWpyrdVOObVtjIuSeZr181z5C4PmVx/V3j2p+0f7edFKGRMpQ5A==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@babel/parser": "^7.29.0",
    +        "@vue/compiler-core": "3.5.30",
    +        "@vue/compiler-dom": "3.5.30",
    +        "@vue/compiler-ssr": "3.5.30",
    +        "@vue/shared": "3.5.30",
    +        "estree-walker": "^2.0.2",
    +        "magic-string": "^0.30.21",
    +        "postcss": "^8.5.8",
    +        "source-map-js": "^1.2.1"
    +      }
    +    },
    +    "node_modules/@vue/compiler-ssr": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/compiler-ssr/-/compiler-ssr-3.5.30.tgz",
    +      "integrity": "sha512-NsYK6OMTnx109PSL2IAyf62JP6EUdk4Dmj6AkWcJGBvN0dQoMYtVekAmdqgTtWQgEJo+Okstbf/1p7qZr5H+bA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/compiler-dom": "3.5.30",
    +        "@vue/shared": "3.5.30"
    +      }
    +    },
    +    "node_modules/@vue/devtools-api": {
    +      "version": "7.7.9",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/devtools-api/-/devtools-api-7.7.9.tgz",
    +      "integrity": "sha512-kIE8wvwlcZ6TJTbNeU2HQNtaxLx3a84aotTITUuL/4bzfPxzajGBOoqjMhwZJ8L9qFYDU/lAYMEEm11dnZOD6g==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/devtools-kit": "^7.7.9"
    +      }
    +    },
    +    "node_modules/@vue/devtools-kit": {
    +      "version": "7.7.9",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/devtools-kit/-/devtools-kit-7.7.9.tgz",
    +      "integrity": "sha512-PyQ6odHSgiDVd4hnTP+aDk2X4gl2HmLDfiyEnn3/oV+ckFDuswRs4IbBT7vacMuGdwY/XemxBoh302ctbsptuA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/devtools-shared": "^7.7.9",
    +        "birpc": "^2.3.0",
    +        "hookable": "^5.5.3",
    +        "mitt": "^3.0.1",
    +        "perfect-debounce": "^1.0.0",
    +        "speakingurl": "^14.0.1",
    +        "superjson": "^2.2.2"
    +      }
    +    },
    +    "node_modules/@vue/devtools-shared": {
    +      "version": "7.7.9",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/devtools-shared/-/devtools-shared-7.7.9.tgz",
    +      "integrity": "sha512-iWAb0v2WYf0QWmxCGy0seZNDPdO3Sp5+u78ORnyeonS6MT4PC7VPrryX2BpMJrwlDeaZ6BD4vP4XKjK0SZqaeA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "rfdc": "^1.4.1"
    +      }
    +    },
    +    "node_modules/@vue/reactivity": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/reactivity/-/reactivity-3.5.30.tgz",
    +      "integrity": "sha512-179YNgKATuwj9gB+66snskRDOitDiuOZqkYia7mHKJaidOMo/WJxHKF8DuGc4V4XbYTJANlfEKb0yxTQotnx4Q==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/shared": "3.5.30"
    +      }
    +    },
    +    "node_modules/@vue/runtime-core": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/runtime-core/-/runtime-core-3.5.30.tgz",
    +      "integrity": "sha512-e0Z+8PQsUTdwV8TtEsLzUM7SzC7lQwYKePydb7K2ZnmS6jjND+WJXkmmfh/swYzRyfP1EY3fpdesyYoymCzYfg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/reactivity": "3.5.30",
    +        "@vue/shared": "3.5.30"
    +      }
    +    },
    +    "node_modules/@vue/runtime-dom": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/runtime-dom/-/runtime-dom-3.5.30.tgz",
    +      "integrity": "sha512-2UIGakjU4WSQ0T4iwDEW0W7vQj6n7AFn7taqZ9Cvm0Q/RA2FFOziLESrDL4GmtI1wV3jXg5nMoJSYO66egDUBw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/reactivity": "3.5.30",
    +        "@vue/runtime-core": "3.5.30",
    +        "@vue/shared": "3.5.30",
    +        "csstype": "^3.2.3"
    +      }
    +    },
    +    "node_modules/@vue/server-renderer": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/server-renderer/-/server-renderer-3.5.30.tgz",
    +      "integrity": "sha512-v+R34icapydRwbZRD0sXwtHqrQJv38JuMB4JxbOxd8NEpGLny7cncMp53W9UH/zo4j8eDHjQ1dEJXwzFQknjtQ==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vue/compiler-ssr": "3.5.30",
    +        "@vue/shared": "3.5.30"
    +      },
    +      "peerDependencies": {
    +        "vue": "3.5.30"
    +      }
    +    },
    +    "node_modules/@vue/shared": {
    +      "version": "3.5.30",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vue/shared/-/shared-3.5.30.tgz",
    +      "integrity": "sha512-YXgQ7JjaO18NeK2K9VTbDHaFy62WrObMa6XERNfNOkAhD1F1oDSf3ZJ7K6GqabZ0BvSDHajp8qfS5Sa2I9n8uQ==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/@vueuse/core": {
    +      "version": "12.8.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vueuse/core/-/core-12.8.2.tgz",
    +      "integrity": "sha512-HbvCmZdzAu3VGi/pWYm5Ut+Kd9mn1ZHnn4L5G8kOQTPs/IwIAmJoBrmYk2ckLArgMXZj0AW3n5CAejLUO+PhdQ==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@types/web-bluetooth": "^0.0.21",
    +        "@vueuse/metadata": "12.8.2",
    +        "@vueuse/shared": "12.8.2",
    +        "vue": "^3.5.13"
    +      },
    +      "funding": {
    +        "url": "https://github.com/sponsors/antfu"
    +      }
    +    },
    +    "node_modules/@vueuse/integrations": {
    +      "version": "12.8.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vueuse/integrations/-/integrations-12.8.2.tgz",
    +      "integrity": "sha512-fbGYivgK5uBTRt7p5F3zy6VrETlV9RtZjBqd1/HxGdjdckBgBM4ugP8LHpjolqTj14TXTxSK1ZfgPbHYyGuH7g==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@vueuse/core": "12.8.2",
    +        "@vueuse/shared": "12.8.2",
    +        "vue": "^3.5.13"
    +      },
    +      "funding": {
    +        "url": "https://github.com/sponsors/antfu"
    +      },
    +      "peerDependencies": {
    +        "async-validator": "^4",
    +        "axios": "^1",
    +        "change-case": "^5",
    +        "drauu": "^0.4",
    +        "focus-trap": "^7",
    +        "fuse.js": "^7",
    +        "idb-keyval": "^6",
    +        "jwt-decode": "^4",
    +        "nprogress": "^0.2",
    +        "qrcode": "^1.5",
    +        "sortablejs": "^1",
    +        "universal-cookie": "^7"
    +      },
    +      "peerDependenciesMeta": {
    +        "async-validator": {
    +          "optional": true
    +        },
    +        "axios": {
    +          "optional": true
    +        },
    +        "change-case": {
    +          "optional": true
    +        },
    +        "drauu": {
    +          "optional": true
    +        },
    +        "focus-trap": {
    +          "optional": true
    +        },
    +        "fuse.js": {
    +          "optional": true
    +        },
    +        "idb-keyval": {
    +          "optional": true
    +        },
    +        "jwt-decode": {
    +          "optional": true
    +        },
    +        "nprogress": {
    +          "optional": true
    +        },
    +        "qrcode": {
    +          "optional": true
    +        },
    +        "sortablejs": {
    +          "optional": true
    +        },
    +        "universal-cookie": {
    +          "optional": true
    +        }
    +      }
    +    },
    +    "node_modules/@vueuse/metadata": {
    +      "version": "12.8.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vueuse/metadata/-/metadata-12.8.2.tgz",
    +      "integrity": "sha512-rAyLGEuoBJ/Il5AmFHiziCPdQzRt88VxR+Y/A/QhJ1EWtWqPBBAxTAFaSkviwEuOEZNtW8pvkPgoCZQ+HxqW1A==",
    +      "dev": true,
    +      "license": "MIT",
    +      "funding": {
    +        "url": "https://github.com/sponsors/antfu"
    +      }
    +    },
    +    "node_modules/@vueuse/shared": {
    +      "version": "12.8.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/@vueuse/shared/-/shared-12.8.2.tgz",
    +      "integrity": "sha512-dznP38YzxZoNloI0qpEfpkms8knDtaoQ6Y/sfS0L7Yki4zh40LFHEhur0odJC6xTHG5dxWVPiUWBXn+wCG2s5w==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "vue": "^3.5.13"
    +      },
    +      "funding": {
    +        "url": "https://github.com/sponsors/antfu"
    +      }
    +    },
    +    "node_modules/algoliasearch": {
    +      "version": "5.49.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/algoliasearch/-/algoliasearch-5.49.2.tgz",
    +      "integrity": "sha512-1K0wtDaRONwfhL4h8bbJ9qTjmY6rhGgRvvagXkMBsAOMNr+3Q2SffHECh9DIuNVrMA1JwA0zCwhyepgBZVakng==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@algolia/abtesting": "1.15.2",
    +        "@algolia/client-abtesting": "5.49.2",
    +        "@algolia/client-analytics": "5.49.2",
    +        "@algolia/client-common": "5.49.2",
    +        "@algolia/client-insights": "5.49.2",
    +        "@algolia/client-personalization": "5.49.2",
    +        "@algolia/client-query-suggestions": "5.49.2",
    +        "@algolia/client-search": "5.49.2",
    +        "@algolia/ingestion": "1.49.2",
    +        "@algolia/monitoring": "1.49.2",
    +        "@algolia/recommend": "5.49.2",
    +        "@algolia/requester-browser-xhr": "5.49.2",
    +        "@algolia/requester-fetch": "5.49.2",
    +        "@algolia/requester-node-http": "5.49.2"
    +      },
    +      "engines": {
    +        "node": ">= 14.0.0"
    +      }
    +    },
    +    "node_modules/birpc": {
    +      "version": "2.9.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/birpc/-/birpc-2.9.0.tgz",
    +      "integrity": "sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "funding": {
    +        "url": "https://github.com/sponsors/antfu"
    +      }
    +    },
    +    "node_modules/ccount": {
    +      "version": "2.0.1",
    +      "resolved": "http://mirrors.tencentyun.com/npm/ccount/-/ccount-2.0.1.tgz",
    +      "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "funding": {
    +        "type": "github",
    +        "url": "https://github.com/sponsors/wooorm"
    +      }
    +    },
    +    "node_modules/character-entities-html4": {
    +      "version": "2.1.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/character-entities-html4/-/character-entities-html4-2.1.0.tgz",
    +      "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "funding": {
    +        "type": "github",
    +        "url": "https://github.com/sponsors/wooorm"
    +      }
    +    },
    +    "node_modules/character-entities-legacy": {
    +      "version": "3.0.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz",
    +      "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==",
    +      "dev": true,
    +      "license": "MIT",
    +      "funding": {
    +        "type": "github",
    +        "url": "https://github.com/sponsors/wooorm"
    +      }
    +    },
    +    "node_modules/comma-separated-tokens": {
    +      "version": "2.0.3",
    +      "resolved": "http://mirrors.tencentyun.com/npm/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz",
    +      "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==",
    +      "dev": true,
    +      "license": "MIT",
    +      "funding": {
    +        "type": "github",
    +        "url": "https://github.com/sponsors/wooorm"
    +      }
    +    },
    +    "node_modules/copy-anything": {
    +      "version": "4.0.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/copy-anything/-/copy-anything-4.0.5.tgz",
    +      "integrity": "sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "is-what": "^5.2.0"
    +      },
    +      "engines": {
    +        "node": ">=18"
    +      },
    +      "funding": {
    +        "url": "https://github.com/sponsors/mesqueeb"
    +      }
    +    },
    +    "node_modules/csstype": {
    +      "version": "3.2.3",
    +      "resolved": "http://mirrors.tencentyun.com/npm/csstype/-/csstype-3.2.3.tgz",
    +      "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/dequal": {
    +      "version": "2.0.3",
    +      "resolved": "http://mirrors.tencentyun.com/npm/dequal/-/dequal-2.0.3.tgz",
    +      "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "engines": {
    +        "node": ">=6"
    +      }
    +    },
    +    "node_modules/devlop": {
    +      "version": "1.1.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/devlop/-/devlop-1.1.0.tgz",
    +      "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "dequal": "^2.0.0"
    +      },
    +      "funding": {
    +        "type": "github",
    +        "url": "https://github.com/sponsors/wooorm"
    +      }
    +    },
    +    "node_modules/emoji-regex-xs": {
    +      "version": "1.0.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/emoji-regex-xs/-/emoji-regex-xs-1.0.0.tgz",
    +      "integrity": "sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/entities": {
    +      "version": "7.0.1",
    +      "resolved": "http://mirrors.tencentyun.com/npm/entities/-/entities-7.0.1.tgz",
    +      "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==",
    +      "dev": true,
    +      "license": "BSD-2-Clause",
    +      "engines": {
    +        "node": ">=0.12"
    +      },
    +      "funding": {
    +        "url": "https://github.com/fb55/entities?sponsor=1"
    +      }
    +    },
    +    "node_modules/esbuild": {
    +      "version": "0.21.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/esbuild/-/esbuild-0.21.5.tgz",
    +      "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
    +      "dev": true,
    +      "hasInstallScript": true,
    +      "license": "MIT",
    +      "bin": {
    +        "esbuild": "bin/esbuild"
    +      },
    +      "engines": {
    +        "node": ">=12"
    +      },
    +      "optionalDependencies": {
    +        "@esbuild/aix-ppc64": "0.21.5",
    +        "@esbuild/android-arm": "0.21.5",
    +        "@esbuild/android-arm64": "0.21.5",
    +        "@esbuild/android-x64": "0.21.5",
    +        "@esbuild/darwin-arm64": "0.21.5",
    +        "@esbuild/darwin-x64": "0.21.5",
    +        "@esbuild/freebsd-arm64": "0.21.5",
    +        "@esbuild/freebsd-x64": "0.21.5",
    +        "@esbuild/linux-arm": "0.21.5",
    +        "@esbuild/linux-arm64": "0.21.5",
    +        "@esbuild/linux-ia32": "0.21.5",
    +        "@esbuild/linux-loong64": "0.21.5",
    +        "@esbuild/linux-mips64el": "0.21.5",
    +        "@esbuild/linux-ppc64": "0.21.5",
    +        "@esbuild/linux-riscv64": "0.21.5",
    +        "@esbuild/linux-s390x": "0.21.5",
    +        "@esbuild/linux-x64": "0.21.5",
    +        "@esbuild/netbsd-x64": "0.21.5",
    +        "@esbuild/openbsd-x64": "0.21.5",
    +        "@esbuild/sunos-x64": "0.21.5",
    +        "@esbuild/win32-arm64": "0.21.5",
    +        "@esbuild/win32-ia32": "0.21.5",
    +        "@esbuild/win32-x64": "0.21.5"
    +      }
    +    },
    +    "node_modules/estree-walker": {
    +      "version": "2.0.2",
    +      "resolved": "http://mirrors.tencentyun.com/npm/estree-walker/-/estree-walker-2.0.2.tgz",
    +      "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
    +      "dev": true,
    +      "license": "MIT"
    +    },
    +    "node_modules/focus-trap": {
    +      "version": "7.8.0",
    +      "resolved": "http://mirrors.tencentyun.com/npm/focus-trap/-/focus-trap-7.8.0.tgz",
    +      "integrity": "sha512-/yNdlIkpWbM0ptxno3ONTuf+2g318kh2ez3KSeZN5dZ8YC6AAmgeWz+GasYYiBJPFaYcSAPeu4GfhUaChzIJXA==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "tabbable": "^6.4.0"
    +      }
    +    },
    +    "node_modules/fsevents": {
    +      "version": "2.3.3",
    +      "resolved": "http://mirrors.tencentyun.com/npm/fsevents/-/fsevents-2.3.3.tgz",
    +      "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
    +      "dev": true,
    +      "hasInstallScript": true,
    +      "license": "MIT",
    +      "optional": true,
    +      "os": [
    +        "darwin"
    +      ],
    +      "engines": {
    +        "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
    +      }
    +    },
    +    "node_modules/hast-util-to-html": {
    +      "version": "9.0.5",
    +      "resolved": "http://mirrors.tencentyun.com/npm/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz",
    +      "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==",
    +      "dev": true,
    +      "license": "MIT",
    +      "dependencies": {
    +        "@types/hast": "^3.0.0",
    +        "@types/unist": "^3.0.0",
    +        "ccount": "^2.0.0",
    +        "comma-separated-tokens": "^2.0.0",
    +        "hast-util-whitespace": "^3.0.0",
    +        "html-void-elements": "^3.0.0",
    +        "mdast-util-to-hast": "^13.0.0",
    +        "property-information": "^7.0.0",
    +        "space-separated-tokens": "^2.0.0",
    +        "stringify-entities": "^4.0.0",
    +        "zwitch": "^2.0.4"
    +      },
    +      "funding": {
    +        "type": "opencollective",
    +        "url": "https://opencollective.com/unified"
    +      }
    +    },
    +    "node_modules/hast-util-whitespace": {
    +      "version": 
    ... [truncated]
    
  • docs/pnpm-lock.yaml+0 0 added
  • docs/public/assets/logo.svg+109 0 added
  • docs/public/CNAME+3 0 added
  • docs/public/favicon.ico+1 0 added
  • docs/public/favicon.svg+1 0 added
  • docs/public/.nojekyll+1 0 added
  • docs/public/robots.txt+10 0 added
  • docs/README.md+271 0 added
    @@ -0,0 +1,271 @@
    +# 📚 TaskFlow AI 文档中心
    +
    +> 专业的 AI 思维流编排引擎文档
    +
    +## 🎯 文档导航
    +
    +### 🚀 快速入门
    +从零开始,快速掌握 TaskFlow AI
    +
    +| 文档 | 描述 | 难度 |
    +|------|------|------|
    +| [安装指南](guide/installation.md) | 系统要求、安装步骤、环境配置 | ⭐ |
    +| [快速开始](guide/getting-started.md) | 5 快速上手教程 | ⭐ |
    +| [基础使用](guide/basic-usage.md) | 核心功能和基本操作 | ⭐⭐ |
    +| [项目需求](guide/project-requirements.md) | 系统要求和依赖说明 | ⭐ |
    +
    +### 📖 用户指南
    +深入了解功能特性
    +
    +| 文档 | 描述 | 难度 |
    +|------|------|------|
    +| [高级特性](guide/advanced-features.md) | 高级功能详解 | ⭐⭐⭐ |
    +| [工作流指南](user-guide/workflows.md) | 工作流配置和使用 | ⭐⭐⭐ |
    +| [最佳实践](user-guide/best-practices.md) | 使用建议和技巧 | ⭐⭐ |
    +| [使用示例](guide/examples.md) | 实战案例和场景 | ⭐⭐ |
    +| [用户手册](user-guide/user-manual.md) | 完整用户手册 | ⭐⭐ |
    +
    +### 🔌 编辑器集成
    +与 AI 编辑器无缝集成
    +
    +| 文档 | 描述 | 支持状态 |
    +|------|------|----------|
    +| [MCP 配置指南](guide/mcp-setup.md) | MCP 服务器配置详解 | ✅ 完整支持 |
    +| [MCP 集成说明](guide/mcp-integration.md) 议集成 | ✅ 完整支持 |
    +| [Cursor 集成](editor-config/cursor.md) | Cursor 编辑器配置 | ✅ 完整支持 |
    +| [Windsurf/Trae](editor-config/windsurf-trae-integration.md) | 其他编辑器集成 | ✅ 完整支持 |
    +| [编辑器概览](editor-conf持的编辑器列表 | ✅ 完整支持 |
    +
    +### 🛠️ API 参考
    +完整的 API 文档
    +
    +| 文档 | 描述 | 类型 |
    +|------|------|------|
    +| [API 概览](api/index.md) | API 总览和快速索引 | 📘 概览 |
    +| [完整 API](api-reference.md) | 详细 API 文档 | 📗 详细 |
    +| [CLI 命令](reference/cli.md) | 命令行工具参考 | 📙 参考 |
    +| [配置选项](reference/configuration.md) | 配置文件详解 | 📙 参考 |
    +| [环境变量](reference/environment.md) | 环境变量说明 | 📙 参考 |
    +| [错误代码](reference/error-codes.md) | 错误代码对照表 | 📙 参考 |
    +
    +#### API 模块文档
    +
    +| 模块 | 描述 |
    +|------|------|
    +| [AI 编排器](api/ai-orchestrator.md) | AI 模型编排和路由 |
    +| [配置管理](api/config-manager.md) | 配置管理器 API |
    +|PRD 解析器](api/prd-parser.md) | PRD 文档解析 |
    +| [项目配置](api/project-config.md) | 项目配置 API |
    +| [任务管理](api/task-manager.md) | 任务管理器 API |
    +| [任务编排](api/task-orchestration.md) | 任务编排引擎 |
    +
    +#### 类型定义
    +
    +| 类型 | 描述 |
    +|------|------|
    +| [配置类型](api/types/config.md) | 配置相关类型 |
    +| [核心类型](api/types/core.md) | 核心数据类型 |
    +| [模型类型](api/types/model.md) | AI 模型类型 |
    +| [任务类型](api/types/task.md) | 任务相关类型 |
    +
    +### 💻 开发者文档
    +参与项目开发
    +
    +| 文档 | 描述 | 适合人群 |
    +|------|------|----------|
    +| [开发者指南](development/developer-guide.md) | 开发环境搭建和规范 | 👨‍💻 开发者 |
    +| [贡献指南](development/contributing.md) | 如何贡献代码 | 👥 贡献者 |
    +| [架构设计](guide/architecture.md) | 系统架构和设计 | 🏗️ 架构师 |
    +| [测试指南](testing/index.md) | 测试规范和方法 | 🧪 测试工程师 |
    +| [部署指南](deployment/index.md) | 部署和运维 | 🚀 运维工程师 |
    +
    +### 🔧 故障排除
    +解决常见问题
    +
    +| 文档 | 描述 | 优先级 |
    +|------|------|--------|
    +| [常见问题](faq.md) | FAQ 和快速解答 | 🔴 高 |
    +hooting/installation.md) | 安装故障排查 | 🔴 高 |
    +| [配置问题](troubleshooting/configuration.md) | 配置故障排查 | 🟡 中 |
    +| [性能优化](troubleshooting/performance.md) | 性能问题诊断 | 🟡 中 |
    +| [通用问题](troubleshooting/common-issues.md) | 其他常见问题 | 🟢 低 |
    +
    +### 📦 其他资源
    +
    +| 资源 | 描述 |
    +|------|------|
    +| [更新日志](changelog.md) | 版本更新记录 |
    +| [安全策略](security.md) | 安全相关信息 |
    +| [示例项目](examples/example-prd.md) | PRD 文档示例 |
    +
    +---
    +
    +## 📁 文档结构
    +
    +```
    +docs/
    +├── 📄 index.md                    # 文档首页
    +├── 📄 README.md                   # 本文件
    +├── 📄 api-reference.md            # 完整 API 参考
    +├── 📄 changelog.md                # 更新日志
    +├── 📄 faq.md                      # 常见问题
    +├── 📄 security.md                 # 安全策略
    +│
    +├── 📁 guide/                      # 用户指南
    +│   ├── getting-started.md         # 快速开始
    +│   ├── installation.md       # 安装指南
    +│   ├── basic-usage.md             # 基础使用
    +│   ├── advanced-features.md       # 高级特性
    +│   ├── architecture.md            # 架构设计
    +│   ├── mcp-setup.md               # MCP 配置
    +│   ├── mcp-integration.md         # MCP 集成
    +started.md) · [查看示例](examples/example-prd.md) · [加入社区](https://github.com/Agions/taskflow-ai/discussions)
    +
    +</div>
    +推出)
    +- 📝 [博客文章](#) (即将推出)
    +- 🎓 [在线课程](#) (即将推出)
    +
    +---
    +
    +## 📝 贡献文档
    +
    +发现文档问题或想要改进文档?
    +
    +### 快速贡献
    +
    +1. **报告问题**: 在 [GitHub Issues](https://github.com/Agions/taskflow-ai/issues) 提交
    +2. **修改文档**: Fork 仓库,修改后提交 PR
    +3. **参与讨论**: 在 [Discussions](https://github.com/Agions/taskflow-ai/discussions) 参与
    +
    +### 文档改进建议
    +
    +- 📖 修正错别字和语法错误
    +- 💡 添加更多示例和用例
    +- 🎨 改进文档结构和排版
    +- 🌐 翻译文档到其他语言
    +- 📹 创建视频教程
    +
    +---
    +
    +## 📄 许可证
    +
    +文档采用 [MIT License](../LICENSE) 许可。
    +
    +---
    +
    +<div align="center">
    +
    +**TaskFlow AI** - 让 AI 开发工作流从"被动执行"变为"主动思考"
    +
    +[开始使用](guide/getting-taskflow-ai/issues)
    +- 📧 [邮件列表](#) (即将推出)
    +
    +### 学习资源
    +- 📺 [视频教程](#) (即将odelName: 'deepseek-chat',
    +      apiKey: process.env.DEEPSEEK_API_KEY
    +    }
    +  ]
    +});
    +
    +await taskflow.init();
    +```
    +
    +```typescript
    +// ❌ 避免:不完整、缺少上下文
    +const taskflow = new TaskFlow();
    +taskflow.init();
    +```
    +
    +---
    +
    +## 🔗 外部资源
    +
    +### 官方资源
    +- 🏠 [官方网站](https://agions.github.io/taskflow-ai/)
    +- 📦 [GitHub 仓库](https://github.com/Agions/taskflow-ai)
    +- 📦 [NPM 包](https://www.npmjs.com/package/taskflow-ai)
    +
    +### 社区资源
    +- 💬 [GitHub Discussions](https://github.com/Agions/taskflow-ai/discussions)
    +- 🐛 [问题反馈](https://github.com/Agions/askflow-ai';
    +
    +const taskflow = new TaskFlow({
    +  projectName: 'My Project',
    +  aiModels: [
    +    {
    +      provider: 'deepseek',
    +      mtesting/                    # 测试文档
    +│   └── index.md                   # 测试指南
    +│
    +├── 📁 deployment/                 # 部署文档
    +│   └── index.md                   # 部署指南
    +│
    +└── 📁 .vitepress/                 # VitePress 配置
    +    └── config.ts                  # 站点配置
    +```
    +
    +---
    +
    +## 🎨 文档规范
    +
    +### 文档编写规范
    +
    +1. **标题层级**: 使用 `#` 到 `####`,不超过 4 级
    +2. **代码块**: 使用 ` ```语言 ` 标记代码块
    +3. **链接**: 使用相对路径链接其他文档
    +4. **图片**: 放在 `assets/` 目录下
    +5. **表格**: 使用 Markdown 表格语法
    +
    +### 代码示例规范
    +
    +```typescript
    +// ✅ 好的示例:清晰、完整、可运行
    +import { TaskFlow } from 't├── 📁 examples/                   # 示例文档
    +│   └── example-prd.md             # PRD 示例
    +│
    +├── 📁 
    +│   ├── developer-guide.md         # 开发者指南
    +│   └── contributing.md            # 贡献指南
    +│
    +├── 📁 user-guide/                 # 用户手册
    +│   ├── best-practices.md          # 最佳实践
    +│   ├── cli-commands.md            # CLI 命令
    +│   ├── user-manual.md             # 用户手册
    +│   └── workflows.md               # 工作流
    +│
    +├── 📁 troubleshooting/            # 故障排除
    +│   ├── common-issues.md           # 常见问题
    +│   ├── configuration.md           # 配置问题
    +│   ├── installation.md            # 安装问题
    +│   └── performance.md             # 性能问题
    +│
    +       # Cursor
    +│   └── windsurf-trae-integration.md
    +│
    +├── 📁 development/                # 开发文档           # 任务管理
    +│   ├── task-orchestration.md      # 任务编排
    +│   └── types/                     # 类型定义
    +│       ├── config.md
    +│       ├── core.md
    +│       ├── model.md
    +│       └── task.md
    +│
    +├── 📁 reference/                  # 参考文档
    +│   ├── cli.md                     # CLI 参考
    +│   ├── configuration.md           # 配置参考
    +│   ├── environment.md             # 环境变量
    +│   └── error-codes.md             # 错误代码
    +│
    +├── 📁 editor-config/              # 编辑器配置
    +│   ├── overview.md                # 概览
    +│   ├── cursor.md               # PRD 解析器
    +│   ├── project-config.md          # 项目配置
    +│   ├── task-manager.md │   ├── project-requirements.md    # 项目需求
    +│   └── examples.md                # 使用示例
    +│
    +├── 📁 api/                        # API 文档
    +│   ├── index.md                   # API 概览
    +│   ├── ai-orchestrator.md         # AI 编排器
    +│   ├── config-manager.md          # 配置管理
    +│   ├── prd-parser.md          
    \ No newline at end of file
    
  • docs/reference/cli.md+689 0 added
  • docs/reference/configuration.md+464 0 added
  • docs/reference/environment.md+336 0 added
  • docs/reference/error-codes.md+448 0 added
  • docs/security.md+21 0 added
  • docs/testing/index.md+471 0 added
  • docs/troubleshooting/common-issues.md+589 0 added
  • docs/troubleshooting/configuration.md+443 0 added
  • docs/troubleshooting/installation.md+325 0 added
  • docs/troubleshooting/performance.md+464 0 added
  • docs/user-guide/best-practices.md+551 0 added
  • docs/user-guide/cli-commands.md+503 0 added
  • docs/user-guide/user-manual.md+535 0 added
  • docs/user-guide/workflows.md+478 0 added
  • docs/.vitepress/config-internal/head.ts+19 0 added
    @@ -0,0 +1,19 @@
    +/**
    + * 头部配置
    + */
    +
    +export const head = [
    +  ['link', { rel: 'icon', href: '/taskflow-ai/favicon.ico' }],
    +  ['link', { rel: 'icon', type: 'image/svg+xml', href: '/taskflow-ai/favicon.svg' }],
    +  ['meta', { name: 'theme-color', content: '#3c82f6' }],
    +  ['meta', { name: 'og:type', content: 'website' }],
    +  ['meta', { name: 'og:locale', content: 'zh-CN' }],
    +  ['meta', { name: 'og:site_name', content: 'TaskFlow AI' }],
    +  ['meta', { name: 'og:image', content: 'https://agions.github.io/taskflow-ai/og-image.png' }],
    +  ['meta', { name: 'twitter:card', content: 'summary_large_image' }],
    +  // 强制刷新缓存 - 企业级重构版本
    +  ['meta', { name: 'cache-control', content: 'no-cache, no-store, must-revalidate' }],
    +  ['meta', { name: 'pragma', content: 'no-cache' }],
    +  ['meta', { name: 'expires', content: '0' }],
    +  ['meta', { name: 'version', content: 'enterprise-refactor-2024' }]
    +];
    
  • docs/.vitepress/config-internal/index.ts+10 0 added
    @@ -0,0 +1,10 @@
    +/**
    + * VitePress 配置导出
    + */
    +
    +export * from './nav';
    +export * from './sidebar';
    +export * from './theme';
    +export * from './head';
    +export * from './vite';
    +export * from './markdown';
    
  • docs/.vitepress/config-internal/markdown.ts+11 0 added
    @@ -0,0 +1,11 @@
    +/**
    + * Markdown 配置
    + */
    +
    +export const markdown = {
    +  lineNumbers: true,
    +  theme: {
    +    light: 'github-light',
    +    dark: 'github-dark'
    +  }
    +};
    
  • docs/.vitepress/config-internal/nav.ts+54 0 added
    @@ -0,0 +1,54 @@
    +/**
    + * 导航栏配置
    + */
    +
    +export const nav = [
    +  { text: '首页', link: '/' },
    +  {
    +    text: '指南',
    +    items: [
    +      { text: '快速开始', link: '/guide/getting-started' },
    +      { text: '安装指南', link: '/guide/installation' },
    +      { text: '基本使用', link: '/guide/basic-usage' },
    +      { text: '高级功能', link: '/guide/advanced-features' }
    +    ]
    +  },
    +  {
    +    text: 'API参考',
    +    items: [
    +      { text: 'API概览', link: '/api/' },
    +      { text: '配置管理', link: '/api/config-manager' },
    +      { text: 'PRD解析器', link: '/api/prd-parser' },
    +      { text: '任务管理器', link: '/api/task-manager' },
    +      { text: 'AI编排器', link: '/api/ai-orchestrator' }
    +    ]
    +  },
    +  {
    +    text: '用户手册',
    +    items: [
    +      { text: '用户指南', link: '/user-guide/user-manual' },
    +      { text: 'CLI命令', link: '/user-guide/cli-commands' },
    +      { text: '最佳实践', link: '/user-guide/best-practices' },
    +      { text: '工作流程', link: '/user-guide/workflows' }
    +    ]
    +  },
    +  {
    +    text: '技术参考',
    +    items: [
    +      { text: '配置选项', link: '/reference/configuration' },
    +      { text: 'CLI参考', link: '/reference/cli' },
    +      { text: '环境变量', link: '/reference/environment' },
    +      { text: '错误代码', link: '/reference/error-codes' }
    +    ]
    +  },
    +  {
    +    text: '更多',
    +    items: [
    +      { text: '常见问题', link: '/faq' },
    +      { text: '故障排除', link: '/troubleshooting/common-issues' },
    +      { text: '更新日志', link: '/changelog' },
    +      { text: '贡献指南', link: '/guide/contributing' },
    +      { text: 'GitHub', link: 'https://github.com/agions/taskflow-ai' }
    +    ]
    +  }
    +];
    
  • docs/.vitepress/config-internal/sidebar.ts+148 0 added
    @@ -0,0 +1,148 @@
    +/**
    + * 侧边栏配置
    + */
    +
    +export const sidebar = {
    +  '/guide/': [
    +    {
    +      text: '🚀 快速入门',
    +      collapsed: false,
    +      items: [
    +        { text: '安装指南', link: '/guide/installation' },
    +        { text: '快速开始', link: '/guide/getting-started' },
    +        { text: '基础使用', link: '/guide/basic-usage' },
    +        { text: '项目需求', link: '/guide/project-requirements' }
    +      ]
    +    },
    +    {
    +      text: '📖 核心功能',
    +      collapsed: false,
    +      items: [
    +        { text: '高级特性', link: '/guide/advanced-features' },
    +        { text: '使用示例', link: '/guide/examples' },
    +        { text: '系统架构', link: '/guide/architecture' }
    +      ]
    +    },
    +    {
    +      text: '🔌 编辑器集成',
    +      collapsed: false,
    +      items: [
    +        { text: 'MCP 配置指南', link: '/guide/mcp-setup' },
    +        { text: 'MCP 集成说明', link: '/guide/mcp-integration' }
    +      ]
    +    }
    +  ],
    +
    +  '/api/': [
    +    {
    +      text: '📚 API 概览',
    +      collapsed: false,
    +      items: [
    +        { text: 'API 总览', link: '/api/' },
    +        { text: '完整 API 参考', link: '/api-reference' }
    +      ]
    +    },
    +    {
    +      text: '🔧 核心模块',
    +      collapsed: false,
    +      items: [
    +        { text: 'AI 编排器', link: '/api/ai-orchestrator' },
    +        { text: '配置管理器', link: '/api/config-manager' },
    +        { text: 'PRD 解析器', link: '/api/prd-parser' },
    +        { text: '任务管理器', link: '/api/task-manager' },
    +        { text: '任务编排', link: '/api/task-orchestration' },
    +        { text: '项目配置', link: '/api/project-config' }
    +      ]
    +    },
    +    {
    +      text: '📝 类型定义',
    +      collapsed: true,
    +      items: [
    +        { text: '配置类型', link: '/api/types/config' },
    +        { text: '核心类型', link: '/api/types/core' },
    +        { text: '模型类型', link: '/api/types/model' },
    +        { text: '任务类型', link: '/api/types/task' }
    +      ]
    +    }
    +  ],
    +
    +  '/editor-config/': [
    +    {
    +      text: '🔌 编辑器集成',
    +      collapsed: false,
    +      items: [
    +        { text: '编辑器概览', link: '/editor-config/overview' },
    +        { text: 'Cursor 配置', link: '/editor-config/cursor' },
    +        { text: 'Windsurf/Trae', link: '/editor-config/windsurf-trae-integration' }
    +      ]
    +    }
    +  ],
    +
    +  '/user-guide/': [
    +    {
    +      text: '📖 用户手册',
    +      collapsed: false,
    +      items: [
    +        { text: '用户指南', link: '/user-guide/user-manual' },
    +        { text: 'CLI 命令', link: '/user-guide/cli-commands' },
    +        { text: '工作流程', link: '/user-guide/workflows' },
    +        { text: '最佳实践', link: '/user-guide/best-practices' }
    +      ]
    +    }
    +  ],
    +
    +  '/reference/': [
    +    {
    +      text: '📙 技术参考',
    +      collapsed: false,
    +      items: [
    +        { text: 'CLI 参考', link: '/reference/cli' },
    +        { text: '配置选项', link: '/reference/configuration' },
    +        { text: '环境变量', link: '/reference/environment' },
    +        { text: '错误代码', link: '/reference/error-codes' }
    +      ]
    +    }
    +  ],
    +
    +  '/development/': [
    +    {
    +      text: '💻 开发文档',
    +      collapsed: false,
    +      items: [
    +        { text: '开发者指南', link: '/development/developer-guide' },
    +        { text: '贡献指南', link: '/development/contributing' }
    +      ]
    +    },
    +    {
    +      text: '🧪 测试与部署',
    +      collapsed: false,
    +      items: [
    +        { text: '测试指南', link: '/testing/' },
    +        { text: '部署指南', link: '/deployment/' }
    +      ]
    +    }
    +  ],
    +
    +  '/troubleshooting/': [
    +    {
    +      text: '🔧 故障排除',
    +      collapsed: false,
    +      items: [
    +        { text: '常见问题', link: '/troubleshooting/common-issues' },
    +        { text: '安装问题', link: '/troubleshooting/installation' },
    +        { text: '配置问题', link: '/troubleshooting/configuration' },
    +        { text: '性能问题', link: '/troubleshooting/performance' }
    +      ]
    +    }
    +  ],
    +
    +  '/examples/': [
    +    {
    +      text: '📦 示例文档',
    +      collapsed: false,
    +      items: [
    +        { text: 'PRD 示例', link: '/examples/example-prd' }
    +      ]
    +    }
    +  ]
    +};
    
  • docs/.vitepress/config-internal/theme.ts+72 0 added
    @@ -0,0 +1,72 @@
    +/**
    + * 主题配置
    + */
    +
    +export const themeConfig = {
    +  // 网站标题和Logo
    +  logo: '/assets/logo.svg',
    +  siteTitle: 'TaskFlow AI',
    +
    +  // 社交链接
    +  socialLinks: [
    +    { icon: 'github', link: 'https://github.com/agions/taskflow-ai' }
    +  ],
    +
    +  // 页脚
    +  footer: {
    +    message: 'Released under the MIT License.',
    +    copyright: 'Copyright © 2025 Agions'
    +  },
    +
    +  // 搜索
    +  search: {
    +    provider: 'local',
    +    options: {
    +      translations: {
    +        button: {
    +          buttonText: '搜索文档',
    +          buttonAriaLabel: '搜索文档'
    +        },
    +        modal: {
    +          noResultsText: '无法找到相关结果',
    +          resetButtonTitle: '清除查询条件',
    +          footer: {
    +            selectText: '选择',
    +            navigateText: '切换',
    +            closeText: '关闭'
    +          }
    +        }
    +      }
    +    }
    +  },
    +
    +  // 编辑链接
    +  editLink: {
    +    pattern: 'https://github.com/agions/taskflow-ai/edit/main/docs/:path',
    +    text: '在 GitHub 上编辑此页'
    +  },
    +
    +  // 最后更新时间
    +  lastUpdated: {
    +    text: '最后更新于',
    +    formatOptions: {
    +      dateStyle: 'short',
    +      timeStyle: 'medium'
    +    }
    +  },
    +
    +  // 文档页脚导航
    +  docFooter: {
    +    prev: '上一页',
    +    next: '下一页'
    +  },
    +
    +  // 大纲配置
    +  outline: {
    +    level: [2, 3],
    +    label: '页面导航'
    +  },
    +
    +  // 返回顶部
    +  returnToTopLabel: '返回顶部'
    +};
    
  • docs/.vitepress/config-internal/vite.ts+24 0 added
    @@ -0,0 +1,24 @@
    +/**
    + * Vite 配置
    + */
    +
    +export const vite = {
    +  // 自定义 Vite 配置
    +  define: {
    +    __VUE_OPTIONS_API__: false,
    +    __VUE_PROD_DEVTOOLS__: false
    +  },
    +
    +  // 服务器配置
    +  server: {
    +    host: true,
    +    port: 5173
    +  },
    +
    +  // 构建优化 - 简化配置避免冲突
    +  build: {
    +    minify: 'esbuild',
    +    chunkSizeWarningLimit: 1000,
    +    target: 'es2015'
    +  }
    +};
    
  • docs/.vitepress/config.ts+39 0 added
    @@ -0,0 +1,39 @@
    +import { defineConfig } from 'vitepress'
    +import { nav, sidebar, themeConfig, head, vite, markdown } from './config-internal'
    +
    +export default defineConfig({
    +  title: 'TaskFlow AI',
    +  description: 'TaskFlow AI - 智能PRD文档解析与任务管理助手,专为开发团队设计的AI驱动任务编排工具',
    +
    +  // GitHub Pages 优化配置
    +  base: '/taskflow-ai/',
    +  lang: 'zh-CN',
    +  cleanUrls: false,
    +  ignoreDeadLinks: true,
    +  lastUpdated: true,
    +
    +  // 确保资源正确加载
    +  assetsDir: 'assets',
    +  cacheDir: '.vitepress/cache',
    +
    +  // 主题配置
    +  themeConfig: {
    +    ...themeConfig,
    +    nav,
    +    sidebar
    +  },
    +
    +  // Vite 配置
    +  vite,
    +
    +  // 头部配置
    +  head,
    +
    +  // Markdown配置
    +  markdown,
    +
    +  // 站点地图
    +  sitemap: {
    +    hostname: 'https://agions.github.io/taskflow-ai/'
    +  }
    +})
    
  • .editorconfig+35 0 added
    @@ -0,0 +1,35 @@
    +# EditorConfig is awesome: https://EditorConfig.org
    +
    +# Top-most EditorConfig file
    +root = true
    +
    +# Unix-style newlines with a newline ending every file
    +[*]
    +end_of_line = lf
    +insert_final_newline = true
    +charset = utf-8
    +trim_trailing_whitespace = true
    +
    +# TypeScript, JavaScript, JSON
    +[*.{ts,tsx,js,jsx,json}]
    +indent_style = space
    +indent_size = 2
    +
    +# Markdown
    +[*.md]
    +trim_trailing_whitespace = false
    +
    +# YAML
    +[*.{yml,yaml}]
    +indent_style = space
    +indent_size = 2
    +
    +# Shell scripts
    +[*.sh]
    +indent_style = space
    +indent_size = 2
    +
    +# Package files
    +[{package.json,*.yml}]
    +indent_style = space
    +indent_size = 2
    
  • .env.example+108 0 added
    @@ -0,0 +1,108 @@
    +# TaskFlow AI 环境变量配置示例
    +# 复制此文件为 .env 并填入您的真实API密钥
    +
    +# ===========================================
    +# AI模型配置 (必填至少一个)
    +# ===========================================
    +
    +# DeepSeek AI 配置
    +DEEPSEEK_API_KEY=sk-your_deepseek_api_key_here
    +
    +# 百度文心一言配置
    +BAIDU_API_KEY=your_baidu_api_key_here
    +BAIDU_SECRET_KEY=your_baidu_secret_key_here
    +
    +# 智谱AI配置
    +ZHIPU_API_KEY=your_zhipu_api_key_here
    +
    +# OpenRouter配置
    +OPENROUTER_API_KEY=your_openrouter_api_key_here
    +
    +# 讯飞星火配置
    +XUNFEI_APP_ID=your_xunfei_app_id_here
    +XUNFEI_API_KEY=your_xunfei_api_key_here
    +XUNFEI_API_SECRET=your_xunfei_api_secret_here
    +
    +# 阿里通义千问配置
    +QWEN_API_KEY=your_qwen_api_key_here
    +
    +# 月之暗面Kimi配置
    +MOONSHOT_API_KEY=your_moonshot_api_key_here
    +
    +# ===========================================
    +# 应用配置
    +# ===========================================
    +
    +# 环境配置
    +NODE_ENV=development
    +LOG_LEVEL=info
    +
    +
    +
    +# 数据存储配置
    +DATA_DIR=./data
    +BACKUP_DIR=./backups
    +
    +# ===========================================
    +# 性能与监控配置
    +# ===========================================
    +
    +# 性能监控配置
    +ENABLE_PERFORMANCE_MONITORING=true
    +PERFORMANCE_LOG_INTERVAL=60000
    +
    +# 安全配置
    +ENABLE_RATE_LIMITING=true
    +MAX_REQUESTS_PER_MINUTE=100
    +
    +# ===========================================
    +# 开发配置 (可选)
    +# ===========================================
    +
    +# 调试模式
    +DEBUG=taskflow:*
    +
    +# 测试配置
    +TEST_TIMEOUT=30000
    +TEST_PARALLEL=true
    +
    +# 构建配置
    +BUILD_ANALYZE=false
    +BUILD_SOURCEMAP=true
    +
    +
    +VERSION=
    +
    +# ===========================================
    +# MCP 服务器配置
    +# ===========================================
    +
    +# MCP传输协议 (stdio, http)
    +MCP_TRANSPORT=stdio
    +
    +# MCP HTTP端口 (仅在http模式下使用)
    +MCP_PORT=3001
    +
    +# MCP服务器环境
    +TASKFLOW_ENV=production
    +
    +# ===========================================
    +# 容器化部署配置
    +# ===========================================
    +
    +# 应用环境
    +NODE_ENV=production
    +
    +# 日志级别
    +LOG_LEVEL=info
    +
    +# 数据目录
    +TASKFLOW_DATA_DIR=/app/data
    +TASKFLOW_LOG_DIR=/app/logs
    +TASKFLOW_CONFIG_DIR=/app/config
    +
    +# 并发限制
    +TASKFLOW_MAX_CONCURRENT_TASKS=10
    +
    +# 内存限制 (MB)
    +TASKFLOW_MEMORY_LIMIT=1024
    \ No newline at end of file
    
  • .eslintrc.cjs+38 0 added
    @@ -0,0 +1,38 @@
    +module.exports = {
    +  parser: '@typescript-eslint/parser',
    +  extends: [
    +    'eslint:recommended',
    +    'plugin:@typescript-eslint/recommended',
    +  ],
    +  plugins: ['@typescript-eslint'],
    +  parserOptions: {
    +    ecmaVersion: 2021,
    +    sourceType: 'module',
    +  },
    +  env: {
    +    node: true,
    +    jest: true,
    +    es6: true,
    +  },
    +  rules: {
    +    '@typescript-eslint/explicit-function-return-type': 'off',
    +    '@typescript-eslint/explicit-module-boundary-types': 'off',
    +    '@typescript-eslint/no-explicit-any': 'off',
    +    '@typescript-eslint/no-unused-vars': 'off',
    +    '@typescript-eslint/no-empty-function': 'off',
    +    '@typescript-eslint/no-require-imports': 'off',
    +    '@typescript-eslint/no-unsafe-function-type': 'off',
    +    '@typescript-eslint/no-unsafe-call': 'off',
    +    '@typescript-eslint/no-unsafe-member-access': 'off',
    +    '@typescript-eslint/no-unsafe-return': 'off',
    +    '@typescript-eslint/no-unsafe-assignment': 'off',
    +    '@typescript-eslint/no-unused-expressions': 'off',
    +    'no-console': 'off',
    +    'no-unused-vars': 'off',
    +    'prefer-const': 'off',
    +    'no-var': 'off',
    +    'eqeqeq': 'off',
    +    'no-empty': 'off',
    +  },
    +  ignorePatterns: ['dist', 'node_modules', 'coverage', '*.js', '*.d.ts'],
    +};
    
  • .gitattributes+38 0 added
    @@ -0,0 +1,38 @@
    +# Binary files
    +*.7z binary
    +*.bmp binary
    +*.deb binary
    +*.dmg binary
    +*.ear binary
    +*.gif binary
    +*.gz binary
    +*.jar binary
    +*.jpeg binary
    +*.jpg binary
    +*.png binary
    +*.rar binary
    +*.rpm binary
    +*.svg text
    +*.tar binary
    +*.tgz binary
    +*.war binary
    +*.webp binary
    +*.woff binary
    +*.woff2 binary
    +*.zip binary
    +
    +# Images
    +assets/** binary
    +
    +# Docs
    +docs/.vitepress/cache/** binary
    +docs/.vitepress/dist/** binary
    +
    +# Build outputs
    +dist/** binary
    +
    +# Dependencies
    +node_modules/** binary
    +
    +# Test coverage
    +coverage/** binary
    
  • .github/workflows/deploy-docs.yml+88 0 added
    @@ -0,0 +1,88 @@
    +name: Deploy Documentation
    +
    +on:
    +  push:
    +    branches:
    +      - main
    +    paths:
    +      - 'docs/**'
    +      - '.github/workflows/deploy-docs.yml'
    +  workflow_dispatch:
    +
    +permissions:
    +  contents: read
    +  pages: write
    +  id-token: write
    +
    +concurrency:
    +  group: pages
    +  cancel-in-progress: false
    +
    +jobs:
    +  build:
    +    name: Build Documentation
    +    runs-on: ubuntu-latest
    +    
    +    steps:
    +      - name: Checkout
    +        uses: actions/checkout@v4
    +        with:
    +          fetch-depth: 0
    +      
    +      - name: Setup Node.js
    +        uses: actions/setup-node@v4
    +        with:
    +          node-version: '20'
    +      
    +      - name: Setup pnpm
    +        uses: pnpm/action-setup@v4
    +        with:
    +          version: 10
    +      
    +      - name: Get pnpm store directory
    +        shell: bash
    +        run: |
    +          echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
    +      
    +      - name: Setup pnpm cache
    +        uses: actions/cache@v4
    +        with:
    +          path: ${{ env.STORE_PATH }}
    +          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
    +          restore-keys: |
    +            ${{ runner.os }}-pnpm-store-
    +      
    +      - name: Install dependencies
    +        run: |
    +          cd docs
    +          pnpm install --no-frozen-lockfile
    +      
    +      - name: Build documentation
    +        run: |
    +          cd docs
    +          pnpm run build
    +        env:
    +          NODE_ENV: production
    +      
    +      - name: Upload artifact
    +        uses: actions/upload-pages-artifact@v3
    +        with:
    +          path: docs/.vitepress/dist
    +
    +  deploy:
    +    name: Deploy to GitHub Pages
    +    needs: build
    +    runs-on: ubuntu-latest
    +    permissions:
    +      pages: write
    +      id-token: write
    +      contents: read
    +    
    +    environment:
    +      name: github-pages
    +      url: ${{ steps.deployment.outputs.page_url }}
    +    
    +    steps:
    +      - name: Deploy to GitHub Pages
    +        id: deployment
    +        uses: actions/deploy-pages@v4
    
  • .github/workflows/npm-publish.yml+80 0 added
    @@ -0,0 +1,80 @@
    +name: Publish to NPM
    +
    +on:
    +  release:
    +    types: [published]
    +  workflow_dispatch:
    +    inputs:
    +      version:
    +        description: 'Version to publish (e.g., 2.1.7)'
    +        required: false
    +        type: string
    +
    +jobs:
    +  publish:
    +    name: Publish to npm
    +    runs-on: ubuntu-latest
    +    permissions:
    +      contents: read
    +      packages: write
    +      id-token: write
    +    steps:
    +      - name: Checkout
    +        uses: actions/checkout@v4
    +
    +      - name: Setup Node.js
    +        uses: actions/setup-node@v4
    +        with:
    +          node-version: '22'
    +          registry-url: 'https://registry.npmjs.org'
    +
    +      - name: Install pnpm
    +        uses: pnpm/action-setup@v4
    +        with:
    +          version: 9
    +
    +      - name: Get pnpm store directory
    +        shell: bash
    +        run: |
    +          echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
    +
    +      - name: Setup pnpm cache
    +        uses: actions/cache@v4
    +        with:
    +          path: ${{ env.STORE_PATH }}
    +          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
    +          restore-keys: |
    +            ${{ runner.os }}-pnpm-store-
    +
    +      - name: Install dependencies
    +        run: pnpm install --frozen-lockfile
    +
    +      - name: Type check
    +        run: pnpm run type-check
    +
    +      - name: Lint
    +        run: pnpm run lint
    +
    +      - name: Format check
    +        run: pnpm run format:check
    +
    +      - name: Test
    +        run: pnpm run test
    +
    +      - name: Build
    +        run: pnpm run build
    +
    +      - name: Update version
    +        if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != ''
    +        run: |
    +          CURRENT_VERSION=$(node -p "require('./package.json').version")
    +          if [ "$CURRENT_VERSION" != "${{ github.event.inputs.version }}" ]; then
    +            pnpm version ${{ github.event.inputs.version }} --no-git-tag-version
    +          else
    +            echo "Version $CURRENT_VERSION already matches target, skipping update"
    +          fi
    +
    +      - name: Publish to npm
    +        run: npm publish --access public
    +        env:
    +          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
    
  • .gitignore+79 0 added
    @@ -0,0 +1,79 @@
    +# 依赖目录
    +node_modules/
    +
    +# 构建输出
    +dist/
    +build/
    +lib/
    +examples/
    +
    +# 保留 bin 目录中的可执行文件
    +# bin/ 目录包含重要的可执行文件,不应被忽略
    +# 编译缓存
    +*.tsbuildinfo
    +# 日志文件
    +logs/
    +*.log
    +npm-debug.log*
    +yarn-debug.log*
    +yarn-error.log*
    +
    +# 运行时数据
    +.pnp.*
    +.npm
    +.yarn/cache
    +.yarn/unplugged
    +.yarn/build-state.yml
    +.yarn/install-state.gz
    +# 环境变量文件 (包含敏感信息)
    +.env
    +.env.local
    +.env.development.local
    +.env.test.local
    +.env.production.local
    +
    +# 保留环境变量示例文件
    +!.env.example
    +
    +# 编辑器目录和文件
    +.idea/
    +.vscode/
    +*.swp
    +*.swo
    +.DS_Store
    +Thumbs.db
    +*.package-lock.json
    +
    +# 测试覆盖率
    +coverage/
    +
    +# 临时文件
    +tmp/
    +temp/
    +
    +# 项目特定文件
    +mcp.config.json
    +.mcp/ 
    +
    +# Logs
    +logs
    +dev-debug.log
    +# Dependency directories
    +# Environment variables
    +# Editor directories and files
    +.idea
    +.vscode
    +*.suo
    +*.ntvs*
    +*.njsproj
    +*.sln
    +*.sw?
    +# OS specific
    +# Docs build
    +docs/.vitepress/dist/
    +docs/.vitepress/cache/
    +
    +# node_modules is already covered above
    +# Task files
    +# tasks.json
    +# tasks/
    \ No newline at end of file
    
  • jest.setup.js+23 0 added
  • LICENSE+21 0 added
    @@ -0,0 +1,21 @@
    +MIT License
    +
    +Copyright (c) 2025 Agions
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in all
    +copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +SOFTWARE. 
    \ No newline at end of file
    
  • .npmignore+62 0 added
    @@ -0,0 +1,62 @@
    +# Dependencies (already in node_modules)
    +node_modules/
    +
    +# Build outputs
    +dist/
    +lib/
    +
    +# Development files
    +.git/
    +.github/
    +.vscode/
    +.idea/
    +*.tsbuildinfo
    +
    +# Test & coverage
    +coverage/
    +tests/
    +__tests__/
    +*.test.ts
    +*.spec.ts
    +jest.config.*
    +vitest.config.*
    +
    +# Docs
    +docs/.vitepress/cache/
    +docs/node_modules/
    +
    +# Logs
    +logs/
    +*.log
    +npm-debug.log*
    +
    +# Environment
    +.env
    +.env.*
    +
    +# Editor
    +*.swp
    +*.swo
    +.DS_Store
    +
    +# Temporary
    +tmp/
    +temp/
    +.cache/
    +
    +# Source (only publish compiled JS)
    +src/
    +*.ts
    +*.tsx
    +!*.d.ts
    +
    +# Configs (not needed in package)
    +tsconfig*.json
    +jest.setup.js
    +build.js
    +RELEASE.md
    +
    +# Misc
    +reports/
    +output/
    +.taskflow/
    
  • .npmrc+5 0 added
    @@ -0,0 +1,5 @@
    +# npm configuration
    +engine-strict=true
    +save-exact=true
    +fund=false
    +audit=true
    
  • .nvmrc+1 0 added
    @@ -0,0 +1 @@
    +20
    
  • output/智能任务管理系统PRD-2025-08-26T09-20-58-099Z.json+755 0 added
  • package.json+242 0 added
  • package-lock.json+13160 0 added
  • packages/console/index.html+13 0 added
  • packages/console/package.json+27 0 added
  • packages/console/README.md+50 0 added
  • packages/console/src/App.tsx+211 0 added
  • packages/console/src/index.css+354 0 added
  • packages/console/src/main.tsx+10 0 added
  • packages/console/tsconfig.json+21 0 added
  • packages/console/tsconfig.node.json+10 0 added
  • packages/console/vite.config.ts+19 0 added
  • packages/shared/src/workflow-schema.ts+365 0 added
  • pnpm-lock.yaml+8568 0 added
  • .prettierrc+11 0 added
    @@ -0,0 +1,11 @@
    +{
    +  "printWidth": 100,
    +  "tabWidth": 2,
    +  "useTabs": false,
    +  "semi": true,
    +  "singleQuote": true,
    +  "trailingComma": "es5",
    +  "bracketSpacing": true,
    +  "arrowParens": "avoid",
    +  "endOfLine": "lf"
    +} 
    \ No newline at end of file
    
  • README.md+535 0 added
    @@ -0,0 +1,535 @@
    +<div align="center">
    +
    +<img src="assets/logo.svg" alt="TaskFlow AI Logo" width="120" />
    +
    +# TaskFlow AI
    +
    +**AI 思维流编排引擎**
    +
    +[![Version](https://img.shields.io/badge/version-2.1.0-blue.svg)](https://github.com/Agions/taskflow-ai)
    +[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
    +[![Node.js](https://img.shields.io/badge/Node.js-20+-339933?logo=node.js)](https://nodejs.org/)
    +[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178C6?logo=typescript)](https://www.typescriptlang.org/)
    +[![MCP](https://img.shields.io/badge/MCP-Enabled-purple)](https://modelcontextprotocol.io/)
    +
    +<p align="center">
    +  <a href="#核心特性">核心特性</a> •
    +  <a href="#快速开始">快速开始</a> •
    +  <a href="#使用指南">使用指南</a> •
    +  <a href="#架构设计">架构设计</a> •
    +  <a href="#开发文档">开发文档</a>
    +</p>
    +
    +</div>
    +
    +---
    +
    +## ✨ 核心特性
    +
    +### 🧠 思维链可视化
    +
    +将 AI 推理过程可视化,让思考过程一目了然:
    +
    +- **多格式渲染**: Text、Markdown、Mermaid 流程图、思维导图
    +- **反思机制**: AI 自我审视,迭代优化结果
    +- **置信度评估**: 每步推理的可靠性评分
    +- **历史追溯**: 完整的思考链路记录
    +
    +### 🤖 多模型智能路由
    +
    +统一接口管理多厂商 LLM,智能选择最优模型:
    +
    +| 特性 | 说明 |
    +|------|------|
    +| **统一网关** | 一个接口调用所有模型 |
    +| **智能路由** | smart / cost / speed / priority 策略 |
    +| **级联降级** | 主模型失败自动切换备选 |
    +| **成本估算** | 实时计算 API 费用 |
    +
    +**支持模型**: DeepSeek, OpenAI, Anthropic, 智谱 GLM, 通义千问
    +
    +### 📝 智能 PRD 解析
    +
    +自动解析产品需求文档,生成开发任务:
    +
    +- **多格式支持**: Markdown, Word, PDF
    +- **任务拆分**: AI 驱动的智能任务分解
    +- **工时估算**: 基于历史数据的预测模型
    +- **风险识别**: 自动识别潜在项目风险
    +
    +### ⚡ 工作流引擎
    +
    +声明式工作流编排,支持复杂业务逻辑:
    +
    +```yaml
    +# 示例工作流
    +name: 代码审查流程
    +steps:
    +  - name: 语法检查
    +    type: command
    +    command: npm run lint
    +  
    +  - name: 类型检查
    +    type: command
    +    command: npm run type-check
    +  
    +  - name: AI 代码审查
    +    type: ai
    +    prompt: "审查以下代码: {{code}}"
    +    condition: "{{files.length}} > 0"
    +```
    +
    +**特性**:
    +- 顺序、并行、条件分支、循环控制
    +- 变量替换系统 `{{variable}}`
    +- SQLite 状态持久化
    +- 错误重试与降级
    +
    +### 🔌 MCP 集成
    +
    +Model Context Protocol 集成,连接主流编辑器:
    +
    +| 编辑器 | 状态 |
    +|--------|------|
    +| Cursor | ✅ 完整支持 |
    +| VSCode | ✅ 完整支持 |
    +| Windsurf | ✅ 完整支持 |
    +| Trae | ✅ 完整支持 |
    +| Claude Desktop | ✅ 完整支持 |
    +
    +**功能**:
    +- 动态工具注册
    +- 权限控制
    +- 速率限制
    +- 工具市场
    +
    +### 🧩 插件系统
    +
    +可扩展的插件架构:
    +
    +- **热插拔**: 运行时加载/卸载
    +- **钩子系统**: onInit, onTaskCreate, onWorkflowExecute
    +- **生命周期**: 完整的加载/卸载流程
    +- **API 暴露**: 插件间通信机制
    +
    +### 🤖 Agent 系统
    +
    +自主任务执行 Agent:
    +
    +- **目标驱动**: 给定目标自动规划执行
    +- **反思改进**: 自我审视优化策略
    +- **多 Agent 协作**: 消息传递、任务分发
    +- **记忆系统**: 短期/长期记忆管理
    +
    +---
    +
    +## 🚀 快速开始
    +
    +### 环境要求
    +
    +- Node.js ≥ 20
    +- npm ≥ 10
    +
    +### 安装
    +
    +```bash
    +# 全局安装
    +npm install -g taskflow-ai
    +
    +# 或使用 npx
    +npx taskflow-ai --help
    +```
    +
    +### 初始化配置
    +
    +```bash
    +# 初始化项目
    +taskflow init
    +
    +# 配置 AI 模型
    +taskflow model add \
    +  --id deepseek-chat \
    +  --provider deepseek \
    +  --model deepseek-chat \
    +  --key YOUR_API_KEY
    +```
    +
    +### 第一个工作流
    +
    +```bash
    +# 创建思维链
    +taskflow think "如何设计一个用户认证系统"
    +
    +# 解析 PRD
    +taskflow parse requirements.md
    +
    +# 运行工作流
    +taskflow flow run ci-pipeline
    +```
    +
    +---
    +
    +## 📖 使用指南
    +
    +### 模型管理
    +
    +```bash
    +# 列出所有模型
    +taskflow model list
    +
    +# 添加模型
    +taskflow model add -i <id> -p <provider> -m <model> -k <key>
    +
    +# 测试连接
    +taskflow model test
    +
    +# 测试路由策略
    +taskflow model route "帮我写个函数"
    +
    +# 性能基准测试
    +taskflow model benchmark
    +```
    +
    +### 思维分析
    +
    +```bash
    +# 基础思维分析
    +taskflow think "分析这个技术方案"
    +
    +# 可视化输出
    +taskflow think "设计数据库架构" --visualize
    +
    +# 查看历史
    +taskflow think history
    +
    +# 导出为 Mermaid
    +taskflow think "优化算法" --format mermaid
    +```
    +
    +### 工作流管理
    +
    +```bash
    +# 列出工作流
    +taskflow flow list
    +
    +# 运行工作流
    +taskflow flow run <name>
    +
    +# 创建新工作流
    +taskflow flow create <name>
    +
    +# 查看执行历史
    +taskflow flow history
    +
    +# 暂停/恢复
    +taskflow flow pause <id>
    +taskflow flow resume <id>
    +```
    +
    +### PRD 解析
    +
    +```bash
    +# 解析 Markdown
    +taskflow parse prd.md
    +
    +# 解析 Word
    +taskflow parse prd.docx
    +
    +# 解析 PDF
    +taskflow parse prd.pdf
    +
    +# 导出任务
    +taskflow parse prd.md --output tasks.json
    +```
    +
    +### 插件管理
    +
    +```bash
    +# 列出插件
    +taskflow plugin list
    +
    +# 加载插件
    +taskflow plugin load <id>
    +
    +# 卸载插件
    +taskflow plugin unload <id>
    +
    +# 安装插件
    +taskflow plugin install <package>
    +```
    +
    +### 模板使用
    +
    +```bash
    +# 列出模板
    +taskflow template list
    +
    +# 使用模板
    +taskflow template use <id> -o output.md
    +
    +# 搜索模板
    +taskflow template search <query>
    +
    +# 创建模板
    +taskflow template create <name>
    +```
    +
    +### Agent 控制
    +
    +```bash
    +# 启动 Agent
    +taskflow agent start
    +
    +# 发送任务
    +taskflow agent task "优化代码性能"
    +
    +# 查看状态
    +taskflow agent status
    +
    +# 停止 Agent
    +taskflow agent stop
    +```
    +
    +### MCP 操作
    +
    +```bash
    +# 启动 MCP 服务器
    +taskflow mcp start
    +
    +# 列出工具
    +taskflow mcp tools
    +
    +# 测试工具
    +taskflow mcp test <tool-name>
    +
    +# 查看资源
    +taskflow mcp resources
    +```
    +
    +---
    +
    +## 🏗️ 架构设计
    +
    +### 系统架构
    +
    +```
    +┌─────────────────────────────────────────────────────────────┐
    +│                        CLI 层                                │
    +│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐           │
    +│  │  model  │ │  think  │ │  flow   │ │  agent  │           │
    +│  └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘           │
    +└───────┼───────────┼───────────┼───────────┼─────────────────┘
    +        │           │           │           │
    +        └───────────┴─────┬─────┴───────────┘
    +                          │
    +┌─────────────────────────▼───────────────────────────────────┐
    +│                      核心服务层                              │
    +│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐       │
    +│  │  AI 网关  │ │ 思维链   │ │ 工作流   │ │  Agent   │       │
    +│  │  Gateway │ │  Thought │ │ Workflow │ │  System  │       │
    +│  └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘       │
    +│       │            │            │            │              │
    +│  ┌────▼─────┐ ┌────▼─────┐ ┌────▼─────┐ ┌────▼─────┐       │
    +│  │  Parser  │ │  Plugin  │ │  Template│ │   MCP    │       │
    +│  └──────────┘ └──────────┘ └──────────┘ └──────────┘       │
    +└─────────────────────────────────────────────────────────────┘
    +                          │
    +┌─────────────────────────▼───────────────────────────────────┐
    +│                      适配器层                                │
    +│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐          │
    +│  │DeepSeek │ │ OpenAI  │ │Anthropic│ │  智谱   │          │
    +│  └─────────┘ └─────────┘ └─────────┘ └─────────┘          │
    +└─────────────────────────────────────────────────────────────┘
    +```
    +
    +### 模块说明
    +
    +| 模块 | 职责 | 核心文件 |
    +|------|------|----------|
    +| **AI Gateway** | 多模型统一管理 | `core/ai/gateway.ts` |
    +| **Thought Chain** | 思维链管理 | `core/thought/chain.ts` |
    +| **Workflow Engine** | 工作流执行 | `core/workflow/engine.ts` |
    +| **Agent System** | 自主 Agent | `core/agent/core.ts` |
    +| **PRD Parser** | 文档解析 | `core/parser/enhanced.ts` |
    +| **Plugin Manager** | 插件管理 | `core/plugin/manager.ts` |
    +| **MCP Server** | MCP 服务 | `mcp/server.ts` |
    +
    +---
    +
    +## 🛠️ 开发文档
    +
    +### 项目结构
    +
    +```
    +taskflow-ai/
    +├── src/
    +│   ├── cli/                    # CLI 入口
    +│   │   ├── commands/          # 命令实现
    +│   │   │   ├── model.ts      # 模型管理
    +│   │   │   ├── think.ts      # 思维分析
    +│   │   │   ├── flow.ts       # 工作流
    +│   │   │   ├── parse.ts      # PRD 解析
    +│   │   │   ├── agent.ts      # Agent
    +│   │   │   ├── plugin.ts     # 插件
    +│   │   │   ├── template.ts   # 模板
    +│   │   │   ├── mcp.ts        # MCP
    +│   │   │   └── ...
    +│   │   └── index.ts
    +│   │
    +│   ├── core/                   # 核心模块
    +│   │   ├── ai/                # AI 网关
    +│   │   ├── thought/           # 思维链
    +│   │   ├── workflow/          # 工作流引擎
    +│   │   ├── agent/             # Agent 系统
    +│   │   ├── plugin/            # 插件系统
    +│   │   └── parser/            # PRD 解析器
    +│   │
    +│   ├── mcp/                    # MCP 实现
    +│   │   ├── server.ts
    +│   │   ├── tools/
    +│   │   └── resources/
    +│   │
    +│   ├── types/                  # 类型定义
    +│   └── constants/              # 常量配置
    +│
    +├── tests/                      # 测试
    +├── docs/                       # 文档
    +├── templates/                  # 模板
    +└── assets/                     # 资源
    +```
    +
    +### 开发环境
    +
    +```bash
    +# 克隆项目
    +git clone https://github.com/Agions/taskflow-ai.git
    +cd taskflow-ai
    +
    +# 安装依赖
    +npm install
    +
    +# 开发模式
    +npm run dev
    +
    +# 运行测试
    +npm test
    +
    +# 代码检查
    +npm run lint
    +
    +# 格式化
    +npm run format
    +```
    +
    +### 发布流程
    +
    +```bash
    +# 1. 确保所有测试通过
    +npm run quality
    +
    +# 2. 更新版本号并发布
    +npm run publish:patch   # 补丁版本 (1.0.0 -> 1.0.1)
    +npm run publish:minor   # 次要版本 (1.0.0 -> 1.1.0)
    +npm run publish:major   # 主要版本 (1.0.0 -> 2.0.0)
    +
    +# 3. 预发布版本
    +npm run publish:beta    # Beta 版本
    +npm run publish:alpha   # Alpha 版本
    +```
    +
    +### CI/CD 工作流
    +
    +| 工作流 | 触发条件 | 说明 |
    +|--------|----------|------|
    +| `CI` | Push/PR | 代码质量检查、测试、构建 |
    +| `Release` | Tag push | 创建 GitHub Release |
    +| `NPM Publish` | Release/手动 | 发布到 NPM |
    +| `Deploy Docs` | Release | 部署文档网站 |
    +
    +### 添加新模型
    +
    +```typescript
    +// src/core/ai/providers/custom.ts
    +import { AIProvider, AIRequest, AIResponse } from '../types';
    +
    +export class CustomProvider implements AIProvider {
    +  readonly name = 'custom';
    +  
    +  async chat(request: AIRequest): Promise<AIResponse> {
    +    // 实现模型调用
    +  }
    +}
    +```
    +
    +### 创建插件
    +
    +```typescript
    +// my-plugin.ts
    +import { Plugin, PluginContext } from 'taskflow-ai';
    +
    +export default class MyPlugin implements Plugin {
    +  name = 'my-plugin';
    +  version = '1.0.0';
    +  
    +  async onInit(ctx: PluginContext) {
    +    console.log('Plugin initialized');
    +  }
    +  
    +  async onTaskCreate(task: Task) {
    +    // 任务创建钩子
    +  }
    +}
    +```
    +
    +---
    +
    +## 📝 更新日志
    +
    +### v2.1.1 (2026-02-27)
    +
    +- ✨ 新增专业级 CLI UI 组件库
    +- 📦 优化 NPM 发布配置
    +- 🔧 增强 CI/CD 工作流
    +- 📝 完善项目文档
    +
    +### v2.1.0 (2026-02-22)
    +
    +- ✨ 新增 Agent 系统
    +- 🔌 MCP 集成增强
    +- 🧠 思维链可视化优化
    +- ⚡ 工作流性能提升
    +
    +### v2.0.0 (2026-01-15)
    +
    +- 🎉 全新架构设计
    +- 🤖 多模型智能路由
    +- 📝 智能 PRD 解析
    +- 🧩 插件系统
    +
    +[查看完整更新日志](CHANGELOG.md)
    +
    +---
    +
    +## 🤝 贡献指南
    +
    +欢迎提交 Issue 和 PR!
    +
    +1. Fork 本仓库
    +2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
    +3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
    +4. 推送分支 (`git push origin feature/AmazingFeature`)
    +5. 创建 Pull Request
    +
    +---
    +
    +## 📄 许可证
    +
    +[MIT](LICENSE) © 2026 agions
    +
    +---
    +
    +<div align="center">
    +
    +**Made with ❤️ by agions**
    +
    +</div>
    
  • RELEASE.md+65 0 added
    @@ -0,0 +1,65 @@
    +# 发布流程
    +
    +## 快速发布
    +
    +```bash
    +# 1. 确保代码质量
    +npm run verify
    +
    +# 2. 选择版本类型发布
    +npm run publish:patch   # 修复版本 2.1.0 -> 2.1.1
    +npm run publish:minor   # 小版本 2.1.0 -> 2.2.0
    +npm run publish:major   # 大版本 2.1.0 -> 3.0.0
    +npm run publish:beta    # 测试版本 2.1.0 -> 2.1.1-beta.0
    +npm run publish:alpha   # 内测版本 2.1.0 -> 2.1.1-alpha.0
    +```
    +
    +## 手动发布流程
    +
    +```bash
    +# 1. 更新版本
    +npm version patch|minor|major
    +
    +# 2. 推送到 GitHub
    +git push origin main --tags
    +
    +# 3. 创建 Release
    +# 在 GitHub 上创建 Release,会自动触发发布工作流
    +```
    +
    +## CI/CD 流程
    +
    +```
    +代码推送
    +    ↓
    +并行检查(类型/格式/Lint/测试)
    +    ↓
    +构建
    +    ↓
    +安全扫描
    +    ↓
    +发布到 NPM(Release 触发)
    +    ↓
    +更新文档
    +```
    +
    +## 工作流说明
    +
    +| 工作流 | 触发条件 | 说明 |
    +|--------|----------|------|
    +| `ci-optimized.yml` | PR / Push | 并行质量检查 |
    +| `npm-publish.yml` | Release / 手动 | 发布到 NPM |
    +| `deploy-docs.yml` | docs/** 变更 | 部署文档 |
    +
    +## 本地检查
    +
    +```bash
    +# 完整检查
    +npm run verify
    +
    +# 快速检查(跳过格式)
    +npm run check
    +
    +# 自动修复
    +npm run check:fix
    +```
    
  • reports/taskflow-report-2025-08-26T09-24-03-277Z.html+108 0 added
  • scripts/release.sh+239 0 added
  • src/agent/execution/index.ts+97 0 added
  • src/agent/execution/sorter.ts+41 0 added
  • src/agent/execution/summary.ts+23 0 added
  • src/agent/execution/task-executor.ts+184 0 added
  • src/agent/planning/analyzer.ts+72 0 added
  • src/agent/planning/dependency-analyzer.ts+92 0 added
  • src/agent/planning/index.ts+67 0 added
  • src/agent/planning/task-generator.ts+101 0 added
  • src/agent/state-machine/index.ts+73 0 added
  • src/agent/state-machine/machine.ts+88 0 added
  • src/agent/state-machine/types.ts+39 0 added
  • src/agent/types/agent.ts+76 0 added
  • src/agent/types/execution.ts+52 0 added
  • src/agent/types/history.ts+34 0 added
  • src/agent/types/index.ts+28 0 added
  • src/agent/types/prd.ts+69 0 added
  • src/agent/types/task.ts+70 0 added
  • src/agent/types/template.ts+93 0 added
  • src/agent/types/tool.ts+27 0 added
  • src/agent/types/verification.ts+80 0 added
  • src/agent/verification/checks/generated-files.ts+63 0 added
  • src/agent/verification/checks/index.ts+6 0 added
  • src/agent/verification/checks/task-completion.ts+25 0 added
  • src/agent/verification/checks.ts+58 0 added
  • src/agent/verification/code-quality.ts+113 0 added
  • src/agent/verification/coverage.ts+74 0 added
  • src/agent/verification/dependencies.ts+41 0 added
  • src/agent/verification/engine.ts+68 0 added
  • src/agent/verification/fix-tasks.ts+43 0 added
  • src/agent/verification/type-safety.ts+31 0 added
  • src/cicd/github/api-client.ts+188 0 added
  • src/cicd/github/file-manager.ts+54 0 added
  • src/cicd/github/index.ts+93 0 added
  • src/cicd/github/validator.ts+65 0 added
  • src/cicd/github/workflow-generator.ts+166 0 added
  • src/cicd/types.ts+240 0 added
  • src/cli/commands/agent/index.ts+62 0 added
  • src/cli/commands/agent/mock-ai.ts+59 0 added
  • src/cli/commands/agent/prd-parser.ts+37 0 added
  • src/cli/commands/agent/runner.ts+137 0 added
  • src/cli/commands/cicd/deploy.ts+56 0 added
  • src/cli/commands/cicd/engine.ts+83 0 added
  • src/cli/commands/cicd/index.ts+62 0 added
  • src/cli/commands/cicd/init.ts+87 0 added
  • src/cli/commands/cicd/report.ts+52 0 added
  • src/cli/commands/cicd/status.ts+69 0 added
  • src/cli/commands/cicd/template.ts+36 0 added
  • src/cli/commands/cicd/trigger.ts+40 0 added
  • src/cli/commands/cicd/validate.ts+54 0 added
  • src/cli/commands/config.ts+28 0 added
  • src/cli/commands/doctor.ts+100 0 added
  • src/cli/commands/flow/control.ts+34 0 added
  • src/cli/commands/flow/create.ts+32 0 added
  • src/cli/commands/flow/engine.ts+36 0 added
  • src/cli/commands/flow/history.ts+44 0 added
  • src/cli/commands/flow/index.ts+57 0 added
  • src/cli/commands/flow/list.ts+50 0 added
  • src/cli/commands/flow/run.ts+60 0 added
  • src/cli/commands/flow/templates.ts+85 0 added
  • src/cli/commands/init/ai-models.ts+120 0 added
  • src/cli/commands/init/index.ts+30 0 added
  • src/cli/commands/init/output.ts+31 0 added
  • src/cli/commands/init/project.ts+54 0 added
  • src/cli/commands/init/runner.ts+79 0 added
  • src/cli/commands/init/structure.ts+105 0 added
  • src/cli/commands/knowledge/ask.ts+58 0 added
  • src/cli/commands/knowledge/clear.ts+43 0 added
  • src/cli/commands/knowledge/engine.ts+88 0 added
  • src/cli/commands/knowledge/index-cmd.ts+63 0 added
  • src/cli/commands/knowledge/index.ts+61 0 added
  • src/cli/commands/knowledge/init.ts+63 0 added
  • src/cli/commands/knowledge/query.ts+64 0 added
  • src/cli/commands/knowledge/stats.ts+56 0 added
  • src/cli/commands/marketplace/index.ts+74 0 added
  • src/cli/commands/marketplace/info.ts+67 0 added
  • src/cli/commands/marketplace/install.ts+57 0 added
  • src/cli/commands/marketplace/list.ts+52 0 added
  • src/cli/commands/marketplace/search.ts+66 0 added
  • src/cli/commands/marketplace/sync.ts+33 0 added
  • src/cli/commands/marketplace/uninstall.ts+40 0 added
  • src/cli/commands/marketplace/update.ts+68 0 added
  • src/cli/commands/mcp.ts+256 0 added
  • src/cli/commands/model.ts+260 0 added
  • src/cli/commands/parse.ts+154 0 added
  • src/cli/commands/plugin.ts+92 0 added
  • src/cli/commands/stats.ts+127 0 added
  • src/cli/commands/status.ts+173 0 added
  • src/cli/commands/template.ts+131 0 added
  • src/cli/commands/think.ts+165 0 added
  • src/cli/commands/upgrade.ts+79 0 added
  • src/cli/commands/visualize/charts.ts+146 0 added
  • src/cli/commands/visualize/data.ts+57 0 added
  • src/cli/commands/visualize/index.ts+74 0 added
  • src/cli/commands/visualize/prompts.ts+42 0 added
  • src/cli/commands/visualize/report.ts+75 0 added
  • src/cli/index.ts+158 0 added
  • src/cli/ui/animations.ts+963 0 added
  • src/cli/ui/autocomplete.ts+403 0 added
  • src/cli/ui/dashboard.ts+251 0 added
  • src/cli/ui/demo-enhanced.ts+237 0 added
  • src/cli/ui/demo.ts+163 0 added
  • src/cli/ui/help.ts+347 0 added
  • src/cli/ui/index.ts+373 0 added
  • src/cli/ui/prompts.ts+202 0 added
  • src/cli/ui/README.md+250 0 added
  • src/cli/ui/theme.ts+21 0 added
  • src/cli/utils.ts+75 0 added
  • src/codegen/engines/file-generator.ts+61 0 added
  • src/codegen/engines/index.ts+134 0 added
  • src/codegen/engines/sync.ts+68 0 added
  • src/codegen/engines/validator.ts+93 0 added
  • src/codegen/templates/built-in/index.ts+14 0 added
  • src/codegen/templates/built-in/react.ts+180 0 added
  • src/codegen/templates/index.ts+136 0 added
  • src/codegen/types.ts+165 0 added
  • src/constants/index.ts+273 0 added
  • src/core/agent/coordinator.ts+294 0 added
  • src/core/agent/core.ts+309 0 added
  • src/core/agent/index.ts+13 0 added
  • src/core/agent/types.ts+110 0 added
  • src/core/ai/adapter.ts+180 0 added
  • src/core/ai/gateway.ts+283 0 added
  • src/core/ai/index.ts+50 0 added
  • src/core/ai/providers/anthropic.ts+215 0 added
  • src/core/ai/providers/deepseek.ts+117 0 added
  • src/core/ai/providers/openai.ts+125 0 added
  • src/core/ai/router-factory.ts+44 0 added
  • src/core/ai/router-rules.ts+49 0 added
  • src/core/ai/routers.ts+142 0 added
  • src/core/ai/router.ts+9 0 added
  • src/core/ai/router-types.ts+78 0 added
  • src/core/ai/types.ts+177 0 added
  • src/core/config/ai-models.ts+96 0 added
  • src/core/config/backup.ts+108 0 added
  • src/core/config/import-export.ts+68 0 added
  • src/core/config/index.ts+136 0 added
  • src/core/config/mcp-settings.ts+73 0 added
  • src/core/config/operations.ts+149 0 added
  • src/core/config/stats.ts+41 0 added
  • src/core/config/types.ts+48 0 added
  • src/core/debug/cost-tracker.ts+331 0 added
  • src/core/debug/error-handler.ts+373 0 added
  • src/core/debug/index.ts+21 0 added
  • src/core/debug/__tests__/cost-tracker.test.ts+151 0 added
  • src/core/debug/__tests__/error-handler.test.ts+223 0 added
  • src/core/debug/__tests__/timeline.test.ts+208 0 added
  • src/core/debug/timeline.ts+248 0 added
  • src/core/parser/enhanced.ts+298 0 added
  • src/core/parser/index.ts+216 0 added
  • src/core/parser/pdf.ts+46 0 added
  • src/core/parser/word.ts+47 0 added
  • src/core/plugin/index.ts+13 0 added
  • src/core/plugin/manager.ts+267 0 added
  • src/core/plugin/template.ts+271 0 added
  • src/core/plugin/types.ts+89 0 added
  • src/core/tasks/index.ts+287 0 added
  • src/core/thought/chain-core.ts+165 0 added
  • src/core/thought/chain-operations.ts+72 0 added
  • src/core/thought/chain-serializer.ts+97 0 added
  • src/core/thought/chain.ts+130 0 added
  • src/core/thought/index.ts+14 0 added
  • src/core/thought/renderer.ts+281 0 added
  • src/core/thought/types.ts+107 0 added
  • src/core/workflow/engine.ts+283 0 added
  • src/core/workflow/executor.ts+231 0 added
  • src/core/workflow/exporter.ts+65 0 added
  • src/core/workflow/flow-control.ts+263 0 added
  • src/core/workflow/index.ts+12 0 added
  • src/core/workflow/memory-storage.ts+73 0 added
  • src/core/workflow/parser.ts+89 0 added
  • src/core/workflow/sqlite-storage.ts+179 0 added
  • src/core/workflow/step-converter.ts+129 0 added
  • src/core/workflow/storage.ts+78 0 added
  • src/core/workflow/storage-types.ts+29 0 added
  • src/core/workflow/types.ts+173 0 added
  • src/core/workflow/validator.ts+83 0 added
  • src/core/workflow/yaml-parser.ts+68 0 added
  • src/knowledge/embedding/index.ts+241 0 added
  • src/knowledge/retrieval/chunker.ts+65 0 added
  • src/knowledge/retrieval/index.ts+200 0 added
  • src/knowledge/retrieval/qa.ts+58 0 added
  • src/knowledge/retrieval/scanner.ts+57 0 added
  • src/knowledge/storage/index.ts+135 0 added
  • src/knowledge/storage/persistence.ts+75 0 added
  • src/knowledge/storage/search.ts+189 0 added
  • src/knowledge/storage/types.ts+39 0 added
  • src/knowledge/types.ts+165 0 added
  • src/marketplace/installer/config.ts+54 0 added
  • src/marketplace/installer/dependencies.ts+67 0 added
  • src/marketplace/installer/downloader.ts+66 0 added
  • src/marketplace/installer/index.ts+159 0 added
  • src/marketplace/registry/cache.ts+59 0 added
  • .taskflow/config.json+36 0 added
    @@ -0,0 +1,36 @@
    +{
    +  "projectName": "demo",
    +  "version": "1.0.0",
    +  "aiModels": [],
    +  "mcpSettings": {
    +    "enabled": true,
    +    "port": 3000,
    +    "host": "localhost",
    +    "serverName": "taskflow-ai",
    +    "version": "2024-11-05",
    +    "capabilities": [],
    +    "security": {
    +      "authRequired": false,
    +      "allowedOrigins": [
    +        "*"
    +      ],
    +      "rateLimit": {
    +        "enabled": true,
    +        "maxRequests": 100,
    +        "windowMs": 60000
    +      },
    +      "sandbox": {
    +        "enabled": true,
    +        "timeout": 30000,
    +        "memoryLimit": 536870912
    +      }
    +    },
    +    "tools": [],
    +    "resources": []
    +  },
    +  "outputFormats": [
    +    "json",
    +    "markdown"
    +  ],
    +  "plugins": []
    +}
    
  • .taskflow/tasks.json+1 0 added
    @@ -0,0 +1 @@
    +{"tasks":[]}
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

8

News mentions

0

No linked articles in our index yet.