24 Commits

Author SHA1 Message Date
linshen
bb7af28d3d fix(repo): harden english-first checks and MCP packaging
- strengthen locale parity checks and related regression coverage
- stabilize repo-level english-first test expectations
- harden MCP packaging, install entrypoints, and supporting script validation
- tighten related config and model checks used by the rollout
2026-04-09 20:31:52 +08:00
linshen
520ae2be99 build(deps): align toolchain peers and replace npm-run-all
- align TypeScript with the current eslint peer range across packages
- replace npm-run-all with a local run-many script and test coverage
- tighten remaining mcp-server typing so the package lint stays clean
- update the lockfile after removing redundant root-level tooling deps
2026-03-27 22:18:57 +08:00
linshen
37d6fa564c build(deps): prune redundant deps and fix ui type outputs
- remove redundant direct dependencies that are no longer used
- restore UI library type build outputs after the dependency cleanup
- keep Tailwind/PostCSS-related package config aligned with actual usage
2026-03-27 21:26:43 +08:00
linshen
e69086f075 build(deps): refresh workspace dependency baselines
- refresh direct dependency baselines across workspace packages
- require Node 22 consistently in docs, Docker, and package engines
- update lint/build tooling configs to match the new workspace baseline
- keep package manifests and lockfile aligned after the dependency refresh
2026-03-27 20:41:18 +08:00
linshen
63ab9e66cd feat(test): 建立完整的测试基础设施和集成测试
- 建立 VCR 测试基础设施,支持 LLM API 回放
- 添加错误门禁和冒烟测试
- 添加 LLM 服务集成测试(P0)
- 记录测试进展并更新任务计划
2026-01-03 21:08:00 +08:00
linshen
b7cab01197 fix(evaluation): 修复代码审查报告中的多项问题
修复项:
- §4.1: 使用 jsonrepair 库优化 JSON 解析鲁棒性
- §4.2: 规范化 isOptimizedBetter 字段为 boolean 类型
- §4.4: 支持中文变量名回退扫描(正则改为 [^{}]+)
- §4.5: 为单例模式添加架构约束注释说明
- §4.6: 移除 useEvaluation 和 useFunctionModelManager 中的 as any
- §4.8: 复用 createApplyImprovementHandler 工厂方法
- §4.9: 确认 UI 包导出变更无外部依赖影响

延后处理:
- §4.7: Extension App.vue 拆分(大工程)

不修复:
- §4.3: 默认打开面板策略(计划移除详情面板)
2025-12-19 11:29:35 +08:00
linshen
c3c46b6e83 fix(deps): 升级 vitest 和 tsup 修复 vite 漏洞
- vitest: 3.2.4 → 4.0.15 (vite-node 不再依赖旧版 vite)
- tsup: 8.5.0 → 8.5.1

修复 Dependabot 警报:
- #21 vite server.fs.deny bypass
- #18 vite public directory 文件泄露
- #17 vite HTML 文件未应用 server.fs 设置
2025-12-07 16:30:05 +08:00
linshen
fe961eb4f5 fix(deps): 修复多个安全漏洞
升级直接依赖:
- @google/genai: 1.19.0 → 1.32.0 (修复 jws HMAC 签名验证漏洞)
- vite: 6.x → 7.2.7 (修复 3 个安全漏洞)
- electron: 37.1.0 → 39.2.6 (修复 ASAR 完整性绕过)
- electron-builder: 24.13.3 → 26.0.12
- electron-builder-squirrel-windows: 新增 26.0.12
- electron-updater: 6.3.9 → 6.6.2
- vue-i18n: 10.0.6 → 11.2.2 (修复 XSS 漏洞)
- @modelcontextprotocol/sdk: 1.16.0 → 1.24.3 (修复 DNS 重绑定)
- element-plus: 2.10.2 → 2.12.0 (修复 el-link href 验证)
- @typescript-eslint/*: 6.21.0 → 8.49.0 (支持 TypeScript 5.8.3)

自动修复的传递依赖:
- jws: 4.0.1, form-data: 4.0.5, tmp: 0.2.5
- body-parser: 2.2.1, @eslint/plugin-kit: 0.3.5

其他:
- 修复 lint 错误 (未使用的 catch 变量添加 _ 前缀)
2025-12-07 15:59:24 +08:00
linshen
4967164ded feat(core): 升级Anthropic适配器使用官方SDK
主要变更:
- 添加@anthropic-ai/sdk依赖
- 重构AnthropicAdapter使用官方SDK替代自定义HTTP实现
- 支持真正的SSE流式响应(不再是模拟)
- 支持Extended Thinking功能
- 支持工具调用的流式响应
- 优化错误处理和连接配置
- 移除不再需要的timeout参数(SDK内部处理)
- 删除service.ts.backup.txt备份文件
2025-10-09 00:22:37 +08:00
linshen
31cd6d0ac4 feat(core): 升级 Gemini SDK 到 @google/genai 并支持新特性
- 迁移到统一的 @google/genai SDK
- 支持动态模型列表获取
- 新增思考功能参数(thinkingBudget、includeThoughts)
- 实现工具调用支持
- 简化消息处理逻辑
- 添加完整的集成测试套件
2025-10-08 16:56:31 +08:00
linshen
2ffb7556ee feat: 实现图像模式与多模态功能架构
- 新增图像模式支持文生图(T2I)和图生图(I2I)功能
- 实现图像服务层,支持Gemini/Seedream/OpenAI等多适配器
- 升级功能模式架构:basic/pro/image三重模式系统
- 新增图像模型管理器与专用UI组件
- 优化存储键管理,统一图像模式相关配置
- 完善国际化支持,新增图像模式相关翻译
- 增强模型管理器,支持文本/图像双模型管理
2025-09-20 21:55:26 +08:00
linshen
68b9473964 refactor(core): 统一模板引擎从Handlebars迁移至Mustache
- 迁移原因:统一CSP安全支持,简化架构设计
- 核心变更:
  * 移除handlebars依赖,添加mustache依赖
  * 删除CSPSafeTemplateProcessor及相关测试
  * 统一使用Mustache.render()处理所有模板
  * 移除环境检测逻辑,所有平台使用相同处理流程
- 文档更新:
  * 更新语法指南中的模板技术描述
  * 归档文档补充迁移说明和架构演进经验
- 测试调整:更新相关单元测试以匹配新的模板引擎
- 兼容性:保持所有现有模板变量替换功能不变

技术优势:原生CSP支持,统一处理逻辑,简化维护复杂度
2025-08-24 09:31:12 +08:00
szy
17a29f6aba feat: 增加与上版提示词对比功能。 2025-06-24 16:27:29 +08:00
linshen
316893023b feat(template): 实现高级模板支持并优化提示词服务
- 新增 TemplateProcessor 类实现模板处理功能
- 更新 PromptService 以支持高级模板
- 修改 Template 类增加 MessageTemplate 类型
- 优化迭代模板以支持变量替换
- 增加模板验证和错误处理
2025-06-08 14:49:18 +08:00
linshen
a2173548d7 feat(core): 重构数据管理器并添加 UI 配置导入导出功能
- 重构了 DataManager 类,增加了 UI 配置导入导出功能
- 优化了数据导入流程,能够处理部分数据导入失败的情况
- 添加了对 UI 配置数据的导入导出支持
- 重构了部分错误处理逻辑,提高了代码的健壮性
2025-05-26 22:48:01 +08:00
linshen
8afce63de3 chore: 更新 npm 和包管理器配置
- 在 .npmrc 中启用预/后置脚本和公共依赖提升
- 扩展 package.json 的包管理器支持,增加 pnpm 版本约束
- 调整 core 和 ui 包的导出配置,优化模块引入方式
- 更新 Node.js 版本支持范围,兼容 18、20 和 22 版本
2025-02-28 00:14:29 +08:00
linshen
8cf9c7407f chore: Update project configuration and dependencies
- Add Node.js and package manager engine restrictions in package.json
- Update OpenAI SDK to latest version (4.83.0)
- Remove package-lock.json and unnecessary environment files
- Modify UI package imports and styles
- Update README with pnpm usage guidance
- Remove unused logo and style files
- Simplify main application entry points
2025-02-23 09:58:39 +08:00
linshen
22638cbde0 refactor: Migrate from LangChain to native SDKs for LLM services
- Replace LangChain dependencies with native OpenAI and Google Generative AI SDKs
- Rewrite LLMService to use direct API calls for OpenAI and Gemini
- Update core package dependencies to remove LangChain-related packages
- Modify message handling and streaming logic to work with new SDK implementations
- Simplify model configuration and instance management
- Update integration and unit tests to support new SDK approach
- Remove LangChain-specific message conversion and streaming methods
2025-02-23 09:12:00 +08:00
linshen
4e2410a7ff chore: Update LangChain dependencies and package scripts
- Upgrade @langchain/core to version 0.3.40
- Update @langchain/google-genai and @langchain/openai to latest versions
- Remove npm-run-all and replace with direct pnpm commands
- Simplify clean and dev scripts in root package.json
- Add pnpm override for @langchain/core version
- Remove redundant dependencies in web and core packages
- Update Vite config and import paths in web package
2025-02-22 21:51:09 +08:00
linshen
4d88c3093d refactor: Consolidate and clean up test files across core and web packages
- Remove redundant integration and unit test files from web package
- Update import paths in remaining test files to use local source
- Remove console logs and unnecessary comments in test files
- Simplify test structure and remove duplicate test scenarios
- Add dotenv dependency to core package for environment variable support
2025-02-22 16:02:52 +08:00
linshen
779f23ce9e refactor: Optimize core package exports and module structure
This commit focuses on improving the core package's module organization and export strategy:

- Reorganized `index.ts` exports with grouped and more explicit module exports
- Removed redundant `services/index.ts` and `types/index.ts` files
- Simplified LLM service creation with optional default model manager
- Updated model defaults to handle environment variable retrieval more robustly
- Added `@types/node` dependency to support TypeScript development
2025-02-22 14:02:54 +08:00
linshen
6c5de4703a chore: Add Zod for type validation and improve error handling
- Add Zod dependency to core package
- Update BaseError to safely check Error.captureStackTrace
- Modify template validation to handle Zod error typing
2025-02-16 15:37:14 +08:00
linshen
cb720ea073 refactor: Migrate services to core package and update project dependencies
- Move services from web package to core package
- Update import statements across web package to use @prompt-optimizer/core
- Add LangChain and related dependencies to package.json
- Refactor and standardize service interfaces and implementations
- Update test suites to work with new package structure
- Improve module exports and type consistency
2025-02-14 22:24:51 +08:00
linshen
9be9f6b3ae refactor: Migrate project to monorepo structure with pnpm workspaces
- Convert project to monorepo with separate web and extension packages
- Update package.json scripts to support pnpm workspace commands
- Remove individual configuration files from root directory
- Adjust Vercel configuration for monorepo deployment
- Prepare for Chrome extension development
- Remove existing web application source files in preparation for restructuring
2025-02-13 22:51:28 +08:00