Commit Graph
94 Commits
Author SHA1 Message Date
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
linshen 58deb54a01 fix: Update Gemini API base URL and improve test suite
- Correct Gemini API base URL to official Google endpoint
- Enhance core package LLM tests with localStorage mock
- Update test cases for model management and service initialization
- Improve test coverage for App.vue with mocked components and services
2025-02-15 20:34:20 +08:00
linshen 72b7be65a8 feat: Add currentChainId to App.vue and update handleTest method
- Introduce currentChainId to extension and web package App.vue
- Modify handleTest method to pass optimizedPrompt as an argument
- Ensure consistent state management across packages
2025-02-15 19:49:59 +08:00
linshen 04dccf3e38 refactor: Migrate extension package components to UI package
- Move all Vue components from extension package to @prompt-optimizer/ui
- Remove local component implementations in extension package
- Update import statements to use UI package components
- Add necessary dependencies for component migration
- Simplify extension package structure and improve code modularity
- Prepare for unified component management across packages
2025-02-15 19:28:14 +08:00
linshen f1a8f44034 refactor: Modularize App.vue with UI package components and composables
- Integrate MainLayout, ContentCard, and ActionButton components
- Implement usePromptOptimizer and usePromptTester composables
- Simplify App.vue structure and improve component composition
- Extract complex logic into reusable composable functions
- Enhance code readability and maintainability
2025-02-15 16:33:08 +08:00
linshen 671872b9a4 refactor: Move useToast and clickOutside to UI package
- Export useToast composable from @prompt-optimizer/ui
- Remove local useToast and clickOutside implementations from web package
- Update import statements in App.vue to use UI package exports
2025-02-15 15:54:29 +08:00
linshen 5e42a81aa4 refactor: Extract UI components to separate package
- Move common Vue components from web package to new @prompt-optimizer/ui package
- Update import statements in web package to use @prompt-optimizer/ui
- Add necessary dependencies for UI package
- Simplify component imports and improve code modularity
- Update package.json files to include new UI package dependency
2025-02-15 15:18:59 +08:00
linshen 89f82da862 chore: Update pnpm-lock.yaml with extension package dependencies
- Add LangChain and related dependencies for the extension package
- Update package versions for core libraries like Vue, Element Plus, and LangChain
- Include development dependencies for Tailwind CSS and Vite
2025-02-15 12:43:11 +08:00
linshen bff8f667a3 refactor: Simplify LLM service and remove deprecated request methods
- Remove manual request configuration and sending methods from LLMService
- Streamline model initialization logic with simplified provider handling
- Remove unnecessary type imports and unused request-related interfaces
- Update test suites to reflect new service architecture
- Add logging for connection testing
- Clean up unused code and improve type consistency
2025-02-15 00:06:58 +08:00
linshen 7a5836191d docs: Update project documentation with comprehensive architecture and development guidelines
- Revamp README with new monorepo structure and detailed project overview
- Enhance file structure documentation with package-specific details
- Update frontend development guidelines with modern best practices
- Refactor progress tracking document with detailed milestones and risk assessment
- Expand tech stack documentation with in-depth technology descriptions
- Improve app flow documentation with TypeScript-based code examples
2025-02-14 22:27:34 +08:00