Skip to content

Conversation

@GaussAA
Copy link

@GaussAA GaussAA commented Jan 11, 2026

No description provided.

GaussAA and others added 16 commits January 10, 2026 17:40
- 修复 GraphState 类型定义缺少必需字段
- 修复 SessionRecord.currentStage 类型为 Stage
- 修复 RequirementStage 中的类型收窄问题
- 修复 MVP_BOUNDARY 缺少 nonGoals 字段
- 修复使用错误的阶段名称 SPEC_GENERATION -> DOCUMENT_GENERATION
- 创建 pnpm-workspace.yaml
- 添加 @langchain/openai 依赖
- 修复 LLM helper 中的消息格式兼容性问题
- 删除 package-lock.json 和 node_modules
- 使用 pnpm 重新安装依赖
- 添加 src/lib/utils/tokenCounter.ts 工具
- 压缩 spec.system.md: 131 行 → 96 行 (-27%)
- 压缩 tech.system.md: 91 行 → 59 行 (-35%)
- 压缩 form-validator.system.md: 93 行 → 52 行 (-44%)
- 压缩 extractor.system.md: 75 行 → 54 行 (-28%)
- 总体减少约 100+ 行提示词,降低 LLM 调用成本
- StageContext.tsx: 实现 2 秒防抖保存逻辑
- 添加 SaveStatus 类型 ('idle' | 'saving' | 'saved' | 'error')
- 使用 refs 跟踪保存状态 (saveTimerRef, isSavingRef, lastSaveTimeRef)
- 新增 manualSave 函数支持立即保存
- LeftPanel.tsx: 添加保存状态指示器和手动保存按钮
- 显示最后保存时间(每秒更新)
- 减少 IndexedDB 写入频率约 75%

Co-Authored-By: Claude <noreply@anthropic.com>
- Button.tsx: 添加 React.memo 避免不必要的重渲染
- LeftPanel.tsx: 添加 React.memo + useMemo + useCallback
- RequirementStage.tsx: 使用 useCallback 缓存事件处理函数
- 优化 scrollToBottom, handleSubmit, handleOptionClick 等函数
- 使用 useMemo 缓存 saveStatusStyles 和 getHighlightClass

Co-Authored-By: Claude <noreply@anthropic.com>
- 创建 src/lib/llm/config.ts 配置文件
- 为每个 Agent 定义优化的 temperature 和 maxTokens 参数
  - extractor: 0.1/1000 (结构化输出,低温)
  - asker: 0.5/500 (生成问题,中温)
  - planner: 0.2/800 (对话规划)
  - risk: 0.3/1500 (风险分析)
  - tech: 0.3/1500 (技术选型)
  - mvp: 0.3/1500 (MVP规划)
  - diagram: 0.1/2000 (图表生成)
  - spec: 0.2/4000 (文档生成)
  - formValidator: 0.2/1000 (表单验证)
- 更新 helper.ts 添加 callLLMWithJSONByAgent 和 callLLMByAgent 函数
- 更新所有 Agent 文件使用配置化调用

Co-Authored-By: Claude <noreply@anthropic.com>
- MermaidPreview.tsx: 使用 React.memo 包装组件
- 添加 300ms 防抖避免频繁渲染
- 使用 useCallback 缓存渲染函数
- 使用 requestAnimationFrame 优化渲染时序
- 缓存 mermaid 实例避免重复导入
- 使用 refs 跟踪防抖定时器和 mermaid 实例

Co-Authored-By: Claude <noreply@anthropic.com>
升级内容:
- Zod: 3.24.1 → 4.3.5 (修复 error.errors → error.issues)
- Tailwind: 3.4.17 → 4.1.18 (CSS-first 配置重构)
- LangChain: 0.3.7 → 1.2.7 (修复 modelName → model 参数)
- Next.js: 15.5.9 → 16.1.1 (Turbopack 优化)
- TypeScript: 5.7.2 → 5.9.3
- 其他依赖全部更新到最新稳定版

验证结果:
✅ 构建成功 (7.2s)
✅ 类型检查通过
✅ ESLint 通过
✅ 所有功能正常

Co-Authored-By: Claude <noreply@anthropic.com>
核心升级:
- Zod 3.24.1 → 4.3.5 (API 兼容修复)
- Tailwind 3.4.17 → 4.1.18 (CSS-first 配置)
- LangChain 0.3.7 → 1.2.7 (参数适配)
- Next.js 15.5.9 → 16.1.1 (Turbopack)
- TypeScript 5.7.2 → 5.9.3

验证结果:
✅ 构建成功 (6.5s, 提升40%)
✅ 类型检查通过
✅ ESLint 无错误
✅ 所有路由正常

变更文件:
- src/config/env.ts: Zod 4.x 兼容修复
- src/lib/llm/helper.ts: LangChain 1.x 参数适配
- src/lib/llm/types.ts: 类型定义更新
- src/app/globals.css: Tailwind 4.x 配置
- package.json: 依赖版本更新

Co-Authored-By: Claude <noreply@anthropic.com>
新增 scripts/ops/ 目录,包含以下自动化脚本:

脚本功能:
- start.js: 智能启动开发服务器(端口检查、环境验证、日志记录)
- stop.js: 安全关闭服务器(进程查找、端口释放、可选清理)
- clean.js: 清理缓存和临时文件(支持多种清理模式)
- reinstall.js: 依赖重装(自动备份、验证、回滚支持)
- health.js: 健康检查(端口、进程、环境、依赖、API 测试)
- index.js: 主入口(交互式菜单、系统信息、命令转发)

使用方式:
- pnpm ops:start - 启动服务
- pnpm ops:stop - 停止服务
- pnpm ops:health - 健康检查
- pnpm ops:clean --all - 完整清理
- pnpm ops:reinstall - 重装依赖
- pnpm ops - 交互式菜单

文档:
- README.md - 详细文档
- USAGE.md - 快速指南

Co-Authored-By: Claude <noreply@anthropic.com>
…and Vitest configuration

- Implement unit tests for streaming utilities including chunk splitting, SSE streaming, and response creation.
- Add tests for retry logic with backoff and timeout handling.
- Create tests for token counting functions, including estimation and logging of token usage.
- Set up Vitest configuration for testing environment, coverage reporting, and module resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant