Commit Graph
103 Commits
Author SHA1 Message Date
linshen bf9d98eb69 ✨ 新增 Vercel 跨域代理支持和环境检测功能
- 在核心服务中添加 Vercel 环境检测和代理工具函数
- 更新 LLM 服务,支持通过 Vercel 代理解决跨域问题
- 扩展模型配置类型,新增 `useVercelProxy` 选项
- 在 ModelManager 组件中添加 Vercel 代理可用性检测和配置
- 更新技术开发指南,详细说明跨域代理解决方案
- 调整 Vercel 配置,支持 API 代理和环境变量设置
2025-03-03 00:25:02 +08:00
linshen 964a8676fc 🌟 优化 README Star History 展示和 Docker 工作流配置
- 在 README 中使用响应式 Star History 图表,支持浅色和深色主题
- 更新 Docker 工作流配置,忽略 Markdown 和文档目录的变更触发
2025-03-01 18:25:01 +08:00
linshen cac806388e 📝 重构 README,提升项目展示和用户体验
- 添加项目徽章,包括 GitHub Stars、许可证和 Docker 拉取数
- 优化项目简介和功能展示区域,增加居中布局
- 新增项目导航链接,包括在线体验、安装指南和开发文档
- 调整功能截图展示,增加居中对齐和宽度控制
- 在页面底部添加鼓励用户 Star 项目的提示
2025-03-01 12:01:43 +08:00
linshen 15685808fb 🔧 更新 GitHub Actions Docker 工作流配置
- 扩展 Docker 工作流触发分支,支持 main 和 master 分支
2025-03-01 11:41:04 +08:00
linshen b16fa400e1 📝 更新 README.md,添加 Chrome 商店插件链接
- 在 README 中为 Chrome 商店插件添加直接链接
2025-03-01 11:38:33 +08:00
linshen 544a225163 🔧 优化项目配置和部署文档
- 更新 `.dockerignore` 文件,完善忽略规则和文件分类
- 在 `.env.example` 中新增 SiliconFlow API 配置
- 重构 Dockerfile,优化构建和部署步骤
- 更新 `package.json` 版本号至 1.0.0
- 重写 README.md,简化安装和部署说明
- 新增 Docker 部署和 API 密钥配置指南
2025-03-01 11:25:43 +08:00
且炼时光 c6d84ab75e Merge pull request #5 from zzzhouuu/master
添加容器打包
2025-03-01 09:22:15 +08:00
周游 2527a917b5 ✨ feat: Add docker file 2025-03-01 07:22:18 +08:00
linshen 59c2c7db80 feat: 添加 Star 趋势图并优化 Vercel 部署配置
- 在 README 中嵌入 Star History 趋势图,展示项目受欢迎程度
- 重构 Vercel 配置:适配vercel对于多模块项目时错误自动识别根目录为packages/extension
2025-02-28 23:13:34 +08:00
linshen c8f948fa16 docs: 更新 README 开发命令和项目状态
- 移除 `pnpm dev:ext` 开发命令
- 更新主要开发命令说明,推荐使用 `pnpm dev`
- 新增 `pnpm dev:fresh` 命令描述
- 更新项目状态,标记 Chrome 插件发布为已完成
2025-02-28 00:56:39 +08:00
linshen 0f5e31ce1f fix: 优化 LLM 服务和模型管理器的 API 地址处理
- 修复 LLMService 中 baseURL 处理逻辑,移除 '/chat/completions' 后缀
- 更新 ModelManager 组件中 API 地址输入框的占位符,简化示例 URL
- 确保 OpenAI 实例创建时使用正确的基础 URL
2025-02-28 00:32:19 +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 e9f37c1152 docs: Update README with Chrome Web Store extension link
- Add direct link to Chrome Web Store for Prompt Optimizer extension
- Update README with official Chrome extension download URL
- Enhance user accessibility to the browser extension
2025-02-27 23:04:19 +08:00
linshen 42cdea517a feat: Add new template for prompt optimization with output format requirements
- Introduce 'output-format-optimize' template with comprehensive structure
- Update version to 1.3.0 for existing templates
- Enhance template metadata with more descriptive information
- Add detailed sections for role, skills, rules, workflows, and output format
2025-02-26 22:16:48 +08:00
linshen c1f08bb4e2 refactor: Remove Gemini model instance caching in LLM service
- Eliminate geminiInstances cache map in LLMService
- Simplify getGeminiModel method to create model instances directly
- Remove unnecessary caching logic for Gemini models
- Update PromptService to use synchronous template retrieval
2025-02-23 23:43:18 +08:00
linshen c1f7a2b1fe fix: Simplify Vite asset file naming configuration
- Update asset file naming in Vite config to use a static 'style.css' filename
- Remove dynamic asset file naming logic
- Disable CSS code splitting for consistent output
2025-02-23 23:37:01 +08:00
linshen d8e87079ae docs: Update README screenshot reference
- Change screenshot image path from `images/screenshot.png` to `images/main.png`
2025-02-23 23:30:03 +08:00
linshen 872f3c091f docs: Update project documentation and extension metadata
- Revise README with more detailed project features and description
- Update Chrome extension metadata with refined descriptions
- Add permissions explanation document with comprehensive details
- Remove outdated screenshot image
- Ignore extension distribution files in .gitignore
2025-02-23 23:07:47 +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 c1acf7d7b6 chore: Update project dependencies and development scripts
- Upgrade Vite, Vitest, and Vue-related dependencies to latest versions
- Modify package scripts for improved development workflow
- Update environment variable loading configuration
- Enhance test configuration and mocking strategies
- Simplify root and package-level scripts
- Improve cross-platform development support
2025-02-23 21:44:38 +08:00
linshen 8260ea0d8b docs: Remove deprecated documentation files
- Delete outdated documentation files from the docs directory
- Remove files related to previous project iterations
- Clean up project documentation structure
- Prepare for updated documentation approach
2025-02-23 21:09:30 +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 e568dd77a0 feat: Enhance environment variable loading for testing and integration
- Update Vitest configuration to dynamically load environment variables
- Add dotenv configuration in test setup files
- Modify integration test files to use process.env instead of import.meta.env
- Add logging for environment variable status in test files
- Improve test configuration for different LLM service integrations
2025-02-22 22:03:28 +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 e567f5f2dc refactor: Optimize UI package service imports and build scripts
- Remove redundant `services/index.ts` file
- Update service imports to use `@prompt-optimizer/core` directly
- Add Windows-specific build script with readme note
- Clarify component export strategy with 'UI' suffix comment
2025-02-22 14:20:09 +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 373cc0ec2a feat: 重构历史记录管理,移除初始化逻辑并优化UI组件 (master)
此提交重构了历史记录管理,主要变更如下:

- **核心层 (packages/core):**
    - 移除 `IHistoryManager` 接口中的 `init` 方法。
    - `HistoryManager` 类不再包含 `init` 方法和初始化状态检查,构造函数直接进行存储可用性验证。
    - `StorageError` 类型新增 `storage` 操作类型。
    - `PromptService` 工厂函数不再进行 `historyManager` 的初始化。

- **UI层 (packages/ui):**
    - `HistoryDrawer.vue` 组件不再接收 `history` prop,而是直接使用 `historyManager.getAllChains()` 获取排序后的历史记录。
    - 移除 `HistoryDrawer.vue` 中对 `history` prop 的监听和展开状态重置逻辑。
    - `useServiceInitializer.ts` 移除历史记录管理器的初始化逻辑。
    - `useHistoryManager.ts` 移除 `initHistory` 方法和 `onMounted` 钩子。

**目的:**

- 简化历史记录管理器的初始化流程,改为在构造函数中进行存储可用性验证。
- 提高 UI 组件的性能,避免不必要的 prop 传递和监听。
- 使代码结构更加清晰,降低维护成本。
2025-02-20 16:14:49 +08:00
linshen a5a55de7b8 refactor: Improve template selection type safety and error handling
- Enhance saveTemplateSelection method signature with stricter type constraints
- Add type assertion for template selection type to ensure correct usage
- Improve template selection toast message generation
- Simplify template selection logic in useTemplateManager
2025-02-18 21:19:00 +08:00
linshen 9902d7b0d8 refactor: Modularize UI package and improve type safety in extension and web apps
- Extract common composables and services in UI package
- Implement useServiceInitializer, useModelManager, and useHistoryManager
- Enhance type safety with TypeScript configuration updates
- Simplify App.vue in extension and web packages
- Remove redundant code and improve component modularity
- Update package dependencies and lock files
2025-02-18 21:03:41 +08:00
linshen 7b2145cb37 refactor: Improve template and model management with dynamic selection and state synchronization
- Update ModelManager to use synchronous methods without async/await
- Enhance TemplateManager to automatically select first available template after deletion
- Implement reactive template list watching in TemplateSelect to handle dynamic changes
- Add automatic template selection fallback when current template is removed
- Simplify component logic by removing unnecessary async operations
- Improve state management across template and model selection components
2025-02-17 22:01:39 +08:00
linshen 653772ca78 refactor: Synchronize core and UI package interfaces with async/sync method transformations
- Modify TemplateManager to use synchronous methods instead of async
- Update core service interfaces to remove async/await requirements
- Simplify initialization and method calls across core and UI packages
- Remove unnecessary async/await wrappers in composables and components
- Enhance error handling and logging during service initialization
- Standardize method signatures in template, history, and model managers
2025-02-17 21:19:51 +08:00
linshen 27f03a40f2 refactor: Standardize UI component naming and improve type imports
- Rename UI components with 'UI' suffix for clarity (e.g., MainLayoutUI, ActionButtonUI)
- Remove redundant local types file in UI package
- Update type imports from @prompt-optimizer/core across composables
- Synchronize component imports in App.vue for extension and web packages
- Simplify type references and remove duplicate type definitions
2025-02-16 23:50:25 +08:00
linshen a6eb88c6b2 refactor: Enhance App.vue with improved model and template management
- Integrate ModelSelect component into InputPanel via slots
- Implement more robust model and template selection handling
- Add dedicated methods for managing model and template manager interactions
- Simplify component logic by extracting management functions
- Improve initialization and update processes for models and templates
2025-02-16 22:51:41 +08:00
linshen 629034bcea feat: Add prompt history management and refactor App.vue
- Introduce usePromptHistory composable for centralized history management
- Simplify App.vue by extracting history-related logic to composable
- Modify custom model name capitalization in defaults
- Export usePromptHistory in UI package index
2025-02-16 22:10:52 +08:00
linshen 8c9b09c4ae refactor: Enhance model selection and management across components
- Update ModelManager to support more robust model initialization and retrieval
- Modify ModelSelect to dynamically fetch and refresh enabled models
- Implement comprehensive model selection persistence in usePromptOptimizer
- Refactor InputPanel to use slot-based model selection
- Add getEnabledModels method to ModelManager for consistent model filtering
- Improve model selection handling in App.vue with more flexible update mechanisms
2025-02-16 21:51:06 +08:00
linshen ea353fe053 refactor: Improve model selection persistence and loading strategy
- Integrate localStorage model selection directly into loadModels function
- Remove separate restoreModelSelection method
- Enhance model selection logic to prioritize saved selections
- Simplify onMounted initialization by removing redundant restoration step
2025-02-16 21:35:52 +08:00
linshen f9d083e83b refactor: Optimize model management and component reactivity
- Simplify ModelManager initialization and storage handling
- Streamline model loading and update logic in ModelManager
- Remove redundant refresh triggers in ModelSelect
- Improve model list sorting and selection handling
- Clean up unnecessary console logs and emit calls
2025-02-16 21:28:37 +08:00
linshen dedf5b1420 refactor: Improve model and template management with enhanced reactivity and state management
- Update ModelManager to support async operations and improved model loading
- Enhance ModelSelect with reactive model list and selection handling
- Modify TemplateManager to support better template synchronization
- Add persistent model and template selection in App.vue
- Implement more robust error handling and state updates across components
2025-02-16 20:58:49 +08:00
linshen 14f5abbf63 refactor: Improve environment variable retrieval with robust fallback mechanism
- Enhance getEnvVar function to support multiple environment contexts
- Add fallback strategies for process.env, import.meta.env, and globalThis
- Implement error-tolerant environment variable lookup
- Maintain backward compatibility with existing environment variable access
2025-02-16 15:38:55 +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 187635e71a chore: Update Vercel build command to include core and UI packages 2025-02-16 00:24:14 +08:00
linshen 78fef3418f docs: Simplify Vercel deployment instructions in README
- Remove environment variable configuration from Vercel deployment link
- Update deployment guidance to suggest configuring API key later
- Streamline README deployment section for easier onboarding
2025-02-16 00:00:03 +08:00
linshen 66fb24bae4 docs: Update README with improved deployment and configuration instructions
- Revise Vercel deployment link to point to environment variables section
- Update model support description
- Add detailed setup instructions for online, Chrome extension, and local development
- Introduce comprehensive environment variable configuration guide
- Enhance roadmap with current progress and future goals
2025-02-15 23:57:10 +08:00
linshen 6e01bfee48 chore: Enhance extension configuration and styling
- Update Tailwind config to include UI package and custom styles
- Modify manifest.json with content security policy
- Refactor App.vue to improve history and version tracking
- Adjust main.ts and style.css for better performance and rendering
- Optimize font and style loading order
2025-02-15 23:47:02 +08:00
linshen 78ed263e95 refactor: Modify usePromptOptimizer and usePromptTester to use Ref for promptService
- Update composables to accept Ref<PromptService | null> instead of direct service
- Modify service method calls to use .value for reactive references
- Add Vue Ref import to support the new type
- Update App.vue to use ref for promptService initialization
- Add watchers to refresh history on version changes and history view
2025-02-15 22:55:32 +08:00
linshen 5dac3a33e6 docs: Revamp README with comprehensive project overview and enhanced documentation
- Update README with more engaging and informative content
- Add emoji icons to improve readability
- Restructure sections for better navigation
- Include project structure, development commands, and technology stack
- Enhance deployment and configuration instructions
- Add roadmap and contribution guidelines
- Improve overall presentation and clarity
2025-02-15 22:10:51 +08:00
linshen fb4671df7f feat: Add ModelSelect component and configuration modal support
- Introduce ModelSelect component in UI package
- Update InputPanel to use ModelSelect instead of native select
- Add @configModel event to trigger configuration modal in App.vue
- Export ModelSelect in UI package index
2025-02-15 21:57:41 +08:00
linshen 2e6246aa7a feat: Enhance error handling, testing, and extension development
- Implement comprehensive error handling strategies in app-flow.md
- Add detailed testing workflows for unit, integration, and E2E tests
- Update Chrome extension manifest and icon configurations
- Improve UI package configuration and component structure
- Update project progress and tech stack documentation
- Optimize extension package icon and HTML setup
2025-02-15 21:17:23 +08:00