45 Commits

Author SHA1 Message Date
linshen
23848a840d feat(favorites): refine prompt asset workspace flows
- Bind favorites to source assets and save targets throughout workspace actions
- Share the favorite editor/detail surfaces across dialogs and workspace panels
- Add provenance badges, utility-menu apply actions, and themed favorite panels
- Expand unit and integration coverage for favorite source and editor flows
2026-05-01 14:36:12 +08:00
linshen
93377e1b70 feat(favorites): standardize prompt asset sessions
- Add prompt-model services for content, examples, modes, sessions, and history
- Persist richer favorite prompt-asset metadata and session projections
- Wire favorite save/apply paths across supported workspaces
- Cover the new prompt-asset contract with core and UI regressions
2026-05-01 10:24:18 +08:00
linshen
f034bde2d4 feat(ui): enhance favorites with example editing, media management, and workspace apply
- Add reproducibility example editing with media support in favorite editor
- Add example apply to workspace sessions (pro-variable, image modes)
- Harden favorites page routing, guards, and garden deduplication
- Consolidate FavoriteCard into editor form with full test coverage
2026-04-27 21:28:00 +08:00
linshen
2dc0b99e78 test(e2e): refresh image generation replay fixture 2026-04-26 23:53:11 +08:00
linshen
33849fe34f test(e2e): refresh DeepSeek VCR fixtures 2026-04-25 12:25:51 +08:00
linshen
89a84075a9 feat(ui): add workspace clear content tool 2026-04-24 22:24:42 +08:00
linshen
136a09ffe8 fix image2image upload session persistence 2026-04-18 17:34:16 +08:00
linshen
d60b11a6c2 fix(e2e): move replay image placeholders into VCR 2026-04-07 22:32:23 +08:00
linshen
ccc75ee6f9 test(e2e): refresh siliconflow text2image fixture 2026-04-06 14:13:29 +08:00
linshen
8cf43a3e3d test(e2e): streamline gated suites and replay stability 2026-04-06 14:13:29 +08:00
linshen
90b957c983 feat(image): deliver multi-image generation workflow
- add multi-image request types, routing, favorites integration, and desktop bridges
- support multimodal streaming prompt optimization with ordered image inputs
- enable Seedream multi-image generation and redesign the multi-image workspace
- add coverage for routing, persistence, workspace guards, and end-to-end flows
2026-04-06 14:13:28 +08:00
linshen
9908dbcd09 test(e2e): cover structured compare replay flows 2026-03-21 22:17:36 +08:00
linshen
da0a4b8cf5 fix(ui): reset basic v0 analysis state 2026-03-21 10:18:24 +08:00
linshen
aa8fe80953 test(e2e): refresh evaluation fixtures and stabilize image flows 2026-03-15 16:30:00 +08:00
linshen
8e11ee784f test(evaluation): refresh unit, e2e, and VCR coverage
- expand core and ui regression coverage for analysis, result, and compare evaluation flows
- refresh text analysis and evaluation VCR fixtures after the workspace/result semantics change
- cover stale-state and analyze-created workspace behaviors in integration and e2e tests
2026-03-18 09:35:43 +08:00
linshen
7a9fd7c01d fix(e2e): stabilize storage init and cap workers 2026-02-09 23:48:55 +08:00
linshen
117de3b2ea fix(ui): store pro-multi messages in session 2026-01-31 17:25:57 +08:00
linshen
1b0fb64939 fix(e2e): stabilize VCR replay for multi-column tests 2026-01-28 21:00:00 +08:00
linshen
40e1005d81 test(e2e): stabilize route bootstrap and output polling
- Reduce output polling flakes\n- Stabilize route bootstrap and smoke flows\n- Improve i18n label compatibility (incl. zh-TW)
2026-01-18 22:56:00 +08:00
linshen
90f23b6e0a test(e2e): 补全文生图/图生图对比生成并稳定回放
- 增加 SiliconFlow 文生图与图生图用例并启用对比生成\n- 完善 VCR 回放(含非 SSE 响应)并修复输出选择器\n- 图生图跳过易抖动模板下拉、等待上传弹窗关闭;e2e 脚本改用 cross-env 兼容 Windows
2026-01-15 22:43:00 +08:00
linshen
840d4087a7 test(e2e): 补充 basic-system/basic-user 用例并增强回放
- 新增 system 对比用例并支持 VCR 多请求回放\n- 补齐 basic-user 用例并录制 fixtures
2026-01-15 21:08:00 +08:00
linshen
204c5d9816 feat(ui): 提升可访问性并稳定 Pro Multi 流程
- 提升 UI 组件可访问性与导航交互一致性\n- 稳定 Pro Multi 消息优化流程,降低 E2E flake
2026-01-13 21:17:00 +08:00
linshen
062c2eb9d5 feat(router): 优化路由初始化和工作区布局
- 重构工作区布局并改进端到端测试
- 重构根路径路由引导和模型选择逻辑
- 解决路由初始化时机问题避免误重定向
2026-01-12 22:36:00 +08:00
linshen
7163464097 fix(ui): 实现 UI 持久化和模板选择统一
- 实现 session selections 跨刷新持久化
- 统一 template default 选择逻辑
- 对齐 image template 和 model 布局
- 验证 template defaults 和 mode-switch persistence
2026-01-11 19:34:00 +08:00
linshen
afb0f92d19 refactor(e2e): 全面重构端到端测试基础设施
- 实现 VCR 在启用真实 LLM 时默认使用 off 模式
- 实现动态数据库隔离以支持并行测试
- 修复 Pro 模式 session 持久化测试
- 移除 VCR fixtures 中的时间戳字段
- 改进测试隔离以防止路由状态泄漏
- 修正 smart-e2e 只检查实际调用 LLM API 的测试 fixture
- 简化 smart-e2e 使用 auto 模式
- 重命名 analyze-prompt.spec.ts 为 route-initialization.spec.ts
- 添加 session 持久化测试,验证下拉框选择刷新后丢失问题
2026-01-10 15:47:00 +08:00
linshen
8467b96263 feat(test): 实现智能测试系统并改进测试策略
- 实现智能测试系统,统一测试入口
- 完成 Pro 路由重构和 Image 模式评估测试
- 为 Image 模式添加 data-testid 支持
- 完善 E2E 测试并修复选择器策略
- 优化 Seedream、OpenAI 和 SiliconFlow 适配器
- 移除调试日志,保留错误和警告日志
- 重命名 Pro 模式子模式(system/user → multi/variable)
- 清理测试代码并改进稳定性
2026-01-10 11:23:00 +08:00
linshen
63ab9e66cd feat(test): 建立完整的测试基础设施和集成测试
- 建立 VCR 测试基础设施,支持 LLM API 回放
- 添加错误门禁和冒烟测试
- 添加 LLM 服务集成测试(P0)
- 记录测试进展并更新任务计划
2026-01-03 21:08:00 +08:00
linshen
a3dc3285d0 feat: 完成收藏管理重构
- 🏗️ 实现三层分类体系:functionMode、optimizationMode、category
- 🏷️ 构建独立标签库系统,支持标签全生命周期管理
- 📁 增强分类管理,支持排序、使用统计、删除保护
- 🎨 重构UI组件:SaveFavoriteDialog、TagManager、CategoryManager
- 🔄 实现向后兼容的数据迁移机制
- 🧪 添加全面测试覆盖:754+测试,100%通过
- 📝 完善文档:CHANGELOG + 用户指南

Breaking Changes:
- 移除 isPublic 字段
- FavoritePrompt 接口变更(functionMode必填,metadata重组)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 14:50:56 +08:00
linshen
c54cfad272 feat: Add SiliconFlow as a new LLM provider
- Introduce SiliconFlow API key environment variable
- Add SiliconFlow configuration to default models
- Separate DeepSeek and SiliconFlow provider configurations
- Remove App and LLM service test files
2025-02-23 22:51:00 +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
linshen
2e72d2613e feat: Enhance history management with versioning and chain tracking
- Implement comprehensive history management with record chains
- Add support for tracking prompt optimization and iteration versions
- Introduce new history types and interfaces for better record management
- Update HistoryDrawer to display versioned records with detailed information
- Integrate UUID for generating unique record and chain identifiers
- Improve history persistence and retrieval mechanisms
- Refactor history-related services and components to support new versioning system
2025-02-11 23:25:17 +08:00
linshen
8959812149 feat: 重命名和优化提示词相关术语
本次提交主要对项目中的术语进行了全面优化和统一:

- 将"模板"统一替换为"提示词"
- 更新所有相关文件中的术语,包括注释、变量名和用户界面
- 调整 UI 文案,使用更加直观的提示词描述
- 优化提示词管理器和相关组件的命名
- 增强用户界面的一致性和可读性

关键改进:
- 全局搜索并替换术语
- 保持代码逻辑和功能不变
- 提高用户理解和交互体验
2025-02-10 23:07:36 +08:00
linshen
688d19113f feat: 优化模板加载和选择逻辑,增加默认模板处理
本次提交主要改进了模板加载和选择的健壮性:

- 重构模板初始化流程,支持从本地存储和内置模板中选择
- 新增 `getTemplatesByType` 方法,按类型获取模板列表
- 优化 App 中模板加载逻辑,增加容错处理
- 更新默认模板配置,增加简单优化模板
- 调整内置模板 ID 和元数据,提高可读性

关键改进:
- 支持动态选择同类型的第一个模板
- 增强模板加载失败时的错误处理
- 完善模板类型和内置标识
2025-02-10 20:04:29 +08:00
linshen
97716f94ef feat: 重构模板管理器,实现本地存储和用户模板支持
本次提交对模板管理器进行了全面重构,主要改进包括:

- 实现内置模板和用户模板的分离管理
- 添加 LocalStorage 持久化用户模板
- 支持模板的保存、删除、导入和导出
- 增加模板验证和错误处理机制
- 优化模板列表排序逻辑
- 重构模板管理器初始化流程
- 完善单元测试覆盖率

关键技术点:
- 使用 zod 进行模板数据验证
- 实现内置模板和用户模板的区分
- 提供灵活的模板管理接口
2025-02-06 20:41:27 +08:00
linshen
0599354288 feat: 增加自定义API集成和流式输出支持
本次提交主要实现了以下功能:

- 添加自定义API集成支持,通过环境变量配置
- 实现流式输出功能,支持优化、迭代和测试场景
- 重构 OutputPanel 组件,支持流式渲染
- 更新 LLM 服务,增加流式消息发送方法
- 优化错误处理和状态管理
- 调整 Vite 配置,支持路径别名和公共目录
- 添加 Element Plus 和 Pinia 测试依赖

主要技术改进:
- 使用 LangChain 流式 API
- 实现跨组件的流式数据传输
- 增强用户交互体验
2025-02-04 02:19:17 +08:00
linshen
859e81c22c refactor: Enhance template manager with cross-environment file loading support
- Add Node.js and browser environment detection in TemplateManager
- Implement file loading using `fs` for Node.js environments
- Maintain existing fetch-based loading for browser environments
- Update template index and individual template loading methods
- Remove unnecessary test files related to template management
- Increase timeout for DeepSeek API integration tests
2025-02-03 10:52:46 +08:00
linshen
c76c0f3aa0 feat: 重构服务层初始化和错误处理,统一错误消息
本次提交主要对服务层进行了以下重要改进:

- 为历史记录管理器 `HistoryManager` 添加初始化方法,确保存储可用性
- 在 `LLM` 服务中引入统一的错误消息常量 `ERROR_MESSAGES`
- 优化提示词服务的错误处理,使用统一的错误消息
- 更新模型配置类型,增加可选的 API Key 和更多提供商支持
- 重构服务初始化流程,确保依赖服务正确初始化
- 调整单元测试以适应新的初始化和错误处理机制

目标是提高代码的健壮性、一致性和可维护性,同时改进错误处理和服务初始化流程
2025-01-30 23:52:38 +08:00
linshen
eb2172eb50 feat: 重构LLM服务,引入LangChain并优化错误处理
本次提交对LLM服务进行了全面重构,主要变更包括:

- 引入LangChain库,支持多模型提供商(OpenAI、Gemini)
- 重构错误处理机制,增加更精细的错误类型
- 优化模型实例缓存和配置验证
- 更新服务层接口,提高代码可读性和可维护性
- 调整模型配置类型,增加provider字段
- 更新单元测试和集成测试,适配新的服务架构
- 添加LangChain相关依赖

重构目标:
- 提高代码的可扩展性
- 统一模型调用接口
- 改进错误处理和类型安全
- 支持更多模型提供商
2025-01-30 23:14:24 +08:00
linshen
5468f272da feat: 重构项目,调整服务层架构 (master)
本次提交对项目进行了大规模重构,主要调整了服务层架构,以实现更清晰的职责划分和更好的可维护性。
具体变更包括:

- 移除 `src/api/llm.js` 文件,相关 API 密钥管理逻辑已迁移到 `src/services/model/manager.js` 中。
- 移除 `src/config/llm.js` 文件,LLM 配置逻辑已迁移到 `src/services/model/manager.js` 和 `src/services/llm/service.js` 中。
- 移除 `src/services/llm.js` 文件,LLM 服务逻辑已迁移到 `src/services/llm/service.js` 中。
- 移除 `src/services/promptManager.js` 文件,提示词模板管理逻辑已迁移到 `src/services/prompt/service.js` 中,历史记录管理已迁移到 `src/services/history/manager.js` 中。
- 重构 `src/components/ModelManager.vue` 组件,使用新的模型管理服务。
- 重构 `src/App.vue` 组件,使用新的服务层架构。
- 修改 `tests/unit/services/llm.test.js` 文件,适应新的服务层架构。
- 修改 `tests/integration/services/llm/common.test.js`, `tests/integration/services/llm/custom.test.js`, `tests/integration/services/llm/deepseek.test.js`, `tests/integration/services/llm/gemini.test.js` 文件,适应新的服务层架构。
- 修改 `tests/unit/App.test.js` 文件,适应新的服务层架构。
- 修改 `src/components/OutputPanel.vue` 组件,添加复制选中内容功能。
- 更新 `experience.md`,记录重构经验。
- 更新 `scratchpad.md`,添加重构计划和日志。

本次重构的主要目标是:

- 更清晰的职责划分:将模型管理、LLM 服务、提示词模板管理和历史记录管理分离到独立的模块中。
- 更好的可维护性:通过模块化设计,降低代码耦合度,提高代码可读性和可维护性。
- 更高的可扩展性:新的架构更易于添加新的模型和功能。

本次重构对现有功能没有影响,所有测试均已通过。
2025-01-21 23:25:18 +08:00
linshen
07a8d7e262 feat(优化): 去除currentProvider,独立优化、测试模型 (master)
去除全局 currentProvider 依赖,模型选择和 API 调用时直接传递模型参数。
优化模型选择状态同步逻辑,确保 UI 和服务层状态一致。
改进测试架构,支持多模型并行测试,并优化环境变量处理。

- 移除全局 currentProvider 状态
- API 调用时显式指定模型
- 模型选择时同步更新服务状态
- 优化测试用例,避免依赖全局状态
- 改进环境变量处理
- 添加测试模型配置
- 优化模型管理和状态同步
- 优化组件状态独立性,避免共享状态
- 统一使用 import.meta.env 读取环境变量
- 修复模型选择下拉框状态不同步问题
2025-01-21 21:55:57 +08:00
linshen
c923348c4b fix: 修复历史记录相关功能 (master)
修复了历史记录无法实时更新和重用功能失效的问题。

此提交包含以下更改:

- 修复了历史记录在添加新记录后没有实时更新的问题,现在会在添加记录后立即更新 `history.value`。
- 修复了历史记录重用功能无法使用的问题,将 `HistoryDrawer` 组件的 `@select` 事件统一修改为 `@reuse`。
- 修改了 `HistoryDrawer.vue` 组件,将 `item.original` 修改为 `item.prompt`,将 `item.optimized` 修改为 `item.result`,以符合最新的数据结构。
- 更新了 `App.vue` 中的 `handleSelectHistory` 方法,使其使用 `item.result` 而不是 `item.optimized`。
- 在 `experience.md` 中增加了关于数据结构一致性、Vue响应式数据更新和Vue测试经验的总结。
- 在 `scratchpad.md` 中添加了本次修复的详细分析和总结。
- 在 `tests/unit/App.test.js` 中添加了对历史记录功能更新的测试。

这些更改确保了历史记录的实时更新,以及重用功能正常工作。
2025-01-21 20:27:36 +08:00
linshen
0e6dc465ee feat(prompt-optimizer): 增加提示词迭代功能 (master)
本次提交增加了提示词迭代优化功能,并对相关模块进行了调整和优化,具体包括:

- **新增:**
  - 新增 `iterate.yaml` 迭代优化提示词模板。
  - `PromptPanel` 组件新增迭代优化功能,允许用户在已优化的提示词基础上进行进一步优化。
  - `llmService` 服务新增 `iteratePrompt` 方法,支持提示词迭代优化。
  - `promptManager` 服务新增 `getIterationChain` 方法,支持迭代链查询,并修改 `addToHistory` 方法以支持记录迭代优化历史。
- **修改:**
  - `experience.md` 文档更新,记录了提示词迭代功能开发经验。
  - `src/prompts/templates/_index.json` 文件更新,添加 `iterate.yaml`。
  - `src/App.vue` 组件添加 `handleIteratePrompt` 方法,处理迭代优化逻辑。
  - `src/components/PromptPanel.vue` 组件添加迭代优化按钮和输入框。
  - `src/services/llm.js` 添加 `iteratePrompt` 方法。
  - `src/services/promptManager.js` 修改了 `addToHistory` 和 添加了 `getIterationChain` 方法
  - `tests/unit/App.test.js` 添加了对迭代优化功能的测试
- **优化:**
  - 优化了 UI/UX 设计,确保用户体验。
  - 优化了数据存储结构,支持记录迭代优化历史。
  - 优化了代码组织和可维护性。

此次更新旨在提高用户优化提示词的效率和灵活性,并提供更完善的迭代优化功能。
2025-01-20 22:34:17 +08:00
linshen
a9d9756910 feat(experience): 调整布局并增加历史记录功能 (master)
此次提交主要调整了应用的布局结构,并增加了历史记录功能,具体改动如下:

- 调整了主页面的布局,优化了三栏布局的比例和间距,使界面更加清晰。
- 优化了组件的层级,使用了卡片式设计,增强了视觉层级感。
- 增加了历史记录功能,用户可以查看和复用之前的 prompt 和优化结果。
- 优化了深色主题下的颜色搭配,提高了可读性。
- 统一了组件的样式,保持了视觉一致性。
- 调整了部分组件的结构和样式,使其更易于维护和扩展。
- 修改了 PromptManager,增加了获取历史记录,添加到历史记录,清除历史记录的方法
- 修改了 HistoryDrawer 组件,增加了历史记录展示
- 修改了 App 组件,调整了布局,增加了对历史记录的调用
- 修改了 ModelManager 组件,调整了弹窗的样式
- 修改了 InputPanel 组件,增加label,placeholder 属性,修改了组件的样式
- 修改了 OutputPanel 组件,增加了 loading 状态
- 修改了 PromptPanel 组件,修改了组件的样式
- 修改了 package.json,增加了 @vue/test-utils 依赖
- 修改了 vite.config.js,增加了测试覆盖率配置
2025-01-20 20:44:09 +08:00
linshen
6e341a4438 feat(单元测试): 增加单元测试,增加gemini代理地址以跑通本地单元测试 (master)
本次提交主要做了以下更改:
- **新增单元测试:** 为 LLM 服务添加了单元测试,确保核心功能正常运行。
- **增加 gemini 代理地址:**  在 `src/config/models.js` 中,将 Gemini 的 API 地址替换为代理地址,以便在本地环境进行单元测试。
- **更新经验文档:**  更新 `experience.md` 文件,记录了本次更改的细节和经验。
- **更新 package.json:** 添加了 `dotenv` 依赖,用于单元测试时加载环境变量。
2025-01-20 19:42:34 +08:00