13 Commits
Author SHA1 Message Date
hughhuangandClaude Sonnet 4.5 d0cece053d 修复 CORS 配置以支持 PUT/DELETE 请求
## 问题
前端调用 PUT/DELETE 接口时出现 CORS 预检失败,导致网络错误:
- PUT /api/v1/llm-configs/{id} - 更新配置失败
- DELETE /api/v1/llm-configs/{id} - 删除配置失败

## 修复
在 backend/src/app.ts 中明确添加允许的 HTTP 方法列表:
- 添加 methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
- 确保 CORS 预检请求(OPTIONS)正确处理

## 测试
使用 Playwright 测试 LLM 配置功能,所有功能正常:
✅ 切换启用/禁用状态
✅ 编辑配置
✅ 新增配置
✅ 删除配置

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-07 00:36:33 +08:00
hughhuangandClaude Sonnet 4.5 311f09fb0c 重构前端 UI 并修复关键问题
## 主要变更

### UI 重构(基于 Gemini)
- 引入 Tailwind CSS 设计系统,替换原有样式
- 重构所有主要页面组件(Dashboard、AgentChat、Sources 等)
- 新增 CommandPalette 和 ToolCallDisplay 组件
- 优化布局和交互体验

### 关键问题修复
1. 修复 AI 对话页面 TypeError 错误
   - 问题:后端 conversations API 返回格式不标准,导致前端访问 res.data 为 undefined
   - 修复:agent.ts 中使用 `res.data ?? res as any ?? []` 兼容两种响应格式

2. 修复 Tailwind CSS 样式未加载
   - 问题:main.ts 中缺少 style.css 导入
   - 修复:添加 `import './style.css'`

3. 安装缺失依赖
   - 新增 @vueuse/core(MessageItem.vue 使用 useClipboard)
   - 新增 Tailwind CSS 相关依赖

### 新增配置
- postcss.config.js - PostCSS 配置
- tailwind.config.js - Tailwind 主题配置
- user.ts store - 用户状态管理

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 15:57:21 +08:00
hughhuang(黄健铭)andClaude Sonnet 4.5 e6a434e516 实现 AI Agent 对话功能(Task 15)
后端实现:
- 集成 Vercel AI SDK 实现流式对话
- 实现工具系统(文章搜索、报告分析、网络搜索)
- 实现上下文加载和提示词构建
- 实现对话管理和消息存储
- 添加 Agent API 路由(流式对话、历史记录)

前端实现:
- 实现聊天界面(配置选择、消息展示、历史记录)
- 支持 Markdown 渲染和代码高亮
- 实现流式响应解析和展示
- 优化布局(单侧边栏 + 可折叠历史面板)
- 修复 API 路径和 CORS 问题

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-06 09:58:47 +08:00
hughhuangandClaude Sonnet 4.5 697430feed 添加后端集成测试套件
- 实现 82 个集成测试用例覆盖所有 API 端点
- 使用真实数据库连接,无 mock 逻辑
- 修复 PUT 请求只更新提供字段的逻辑
- 配置 Vitest 串行执行避免测试竞态

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-05 15:23:37 +08:00
hughhuangandClaude Opus 4.5 51eb7d4292 实现 Web API 路由
- 添加 LLM 配置 API (llm-configs.ts)
- 添加数据源管理 API (sources.ts)
- 添加推送渠道管理 API (channels.ts)
- 添加主题管理 API (topics.ts)
- 添加报告查询 API (reports.ts)
- 添加资讯浏览 API (articles.ts)
- 添加采集日志 API (collection-logs.ts)
- 更新 app.ts 注册所有路由和调度器

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:42:25 +08:00
hughhuangandClaude Opus 4.5 881bbb64a3 实现定时任务调度服务
- 创建 SchedulerService 调度服务
- 支持采集任务定时调度
- 支持报告生成任务定时调度
- 支持手动触发任务
- 支持动态加载和重载任务

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:34:34 +08:00
hughhuangandClaude Opus 4.5 5746676819 实现分发器模块
- 添加分发器类型定义 (distributor.ts)
- 实现分发器基类 (base.distributor.ts)
- 实现邮件分发器 (email.distributor.ts)
- 实现钉钉分发器 (dingtalk.distributor.ts)
- 实现企业微信分发器 (wechat.distributor.ts)
- 实现 Slack 分发器 (slack.distributor.ts)
- 创建分发器工厂 (distributor.factory.ts)
- 实现分发服务 (distributor.service.ts)
- 安装 nodemailer 依赖

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:32:54 +08:00
hughhuangandClaude Opus 4.5 75c765af93 实现报告生成服务
- 创建 ReportService 报告生成服务
- 支持按时间范围查询资讯
- 集成内容处理服务生成报告
- 支持为单个主题或所有主题生成报告
- 实现报告查询和列表功能

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:25:38 +08:00
hughhuangandClaude Opus 4.5 bb9d691f7a 修复代码质量问题并更新任务进度
修复内容:
- API 采集器添加 30 秒超时控制 (AbortController)
- 采集服务优化批量插入,修复 URL 为空时的去重逻辑
- 整理类型定义,将 ProcessedContent 移至 types/index.ts
- 添加 ReportStatus 和 ReportGenerationOptions 类型

更新任务进度:
- 任务 01-05 标记为已完成
- 任务 06-09 待开发

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:23:53 +08:00
hughhuangandClaude Opus 4.5 d8553c06fa 实现内容处理模块
- 添加 LLM 类型定义 (llm.ts)
- 实现 LLM 客户端封装 (llm-client.ts)
- 实现内容处理服务 (processor.service.ts)
  - 简单聚合模式 (aggregate)
  - AI 摘要模式 (summary)
  - AI 深度分析模式 (deep_analysis)
  - 去重和排序功能

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 21:17:54 +08:00
hughhuangandClaude Opus 4.5 fe7714a3a6 实现采集器模块
- 添加采集器类型定义 (collector.ts)
- 实现采集器基类 (base.collector.ts)
- 实现 API 采集器 (api.collector.ts)
- 实现 Playwright 网页采集器 (playwright.collector.ts)
- 实现 RSS 采集器 (rss.collector.ts)
- 创建采集器工厂 (collector.factory.ts)
- 实现采集服务 (collector.service.ts)
- 安装 rss-parser 依赖

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 23:50:31 +08:00
hughhuangandClaude Opus 4.5 b8791ee556 完善后端核心框架
- 添加错误处理中间件 (error-handler.ts)
- 添加请求日志中间件 (request-logger.ts)
- 添加健康检查路由 (health.ts)
- 更新 app.ts 集成中间件和数据库连接
- 添加优雅关闭时断开数据库连接

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 23:46:59 +08:00
hughhuangandClaude Sonnet 4.5 830a17bf46 初始化项目结构和基础模块
完成内容:
- 创建前后端项目目录结构
- 初始化 Node.js + TypeScript 后端项目 (Fastify)
- 初始化 Vue 3 + TypeScript 前端项目 (Vite)
- 配置 Prisma ORM 和 MySQL 数据库
- 创建数据库 Schema 和种子数据
- 实现后端基础模块 (配置、日志、错误处理、验证)
- 创建基础服务类 (BaseService)
- 配置 Git 仓库和忽略文件

技术栈:
- 后端:Fastify + Prisma + MySQL + Winston
- 前端:Vue 3 + TypeScript + Element Plus + Pinia

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 12:11:57 +08:00