Commit Graph

3846 Commits

Author SHA1 Message Date
qianlifeng 1f53bfa4df
refactor(ai): Improve tool call handling and UI updates in AI chat components
- Enhanced tool call information management in OpenAIBaseProvider and API implementation.
- Updated AIChatPlugin to streamline tool call status updates and conversation handling.
- Improved WoxAIChatView to conditionally render tool call badges and manage chat responses effectively.
- Refactored duration calculation in ToolCallInfo to account for various tool call statuses.
- Introduced a tool call start timestamp map for better tracking of tool call durations.
2025-04-16 16:06:10 +08:00
Weifeng Liu f32c9bcdc4 feat(file): Implement search plugin via locate on Linux
- On Linux, launch prevailing locate command to search for files.
- The maximum number of results is currently limited to 256 which should be reasonable for GUI use case.
2025-04-16 15:01:30 +08:00
qianlifeng fb9a5f64a3
refactor(ui): Update active index handling in WoxListController and WoxLauncherController
- Simplified the updateActiveIndexByDirection method to improve clarity in logging and functionality.
- Refactored active index updates in WoxLauncherController to enhance consistency in item selection logic.
- Improved debug logging messages for better traceability during active index updates.
2025-04-15 23:45:47 +08:00
qianlifeng 985a45a95c
refactor(ui): Update WoxAIChatView for improved UI consistency and tool call handling
- Changed background color handling for tool calls to match the AI assistant's background.
- Simplified border radius for chat message containers to enhance visual consistency.
- Refactored tool call badge to improve layout and display of tool call information.
- Updated avatar rendering logic to differentiate user and tool roles more clearly.
- Enhanced padding and margin for better spacing in UI elements, improving overall readability.
2025-04-15 23:26:04 +08:00
qianlifeng 26c47dec0d
refactor(ai): Enhance OpenAIBaseProvider with options and improved tool call handling
- Introduced OpenAIBaseProviderOptions to allow custom headers for API requests.
- Updated NewOpenAIBaseProvider to support options, enhancing flexibility in provider configuration.
- Improved tool call handling in convertConversations method for better integration with OpenAI responses.
- Refactored AIChatPlugin to streamline chat data management and update logic, ensuring consistent state handling.
2025-04-15 22:47:13 +08:00
qianlifeng ff0d7b8635
refactor(ai): Update AI chat components for improved tool call handling
- Removed deprecated WoxPreview and WoxPreviewChatConversation classes, consolidating functionality into WoxAIChatConversation.
- Introduced WoxAIChatData structure to manage chat conversations and tool call information effectively.
- Enhanced WoxAIChatView to better display tool call statuses and integrate new UI elements for improved user interaction.
- Updated WoxAIChatController to manage tool call states and improve message handling.
- Refactored related components for consistency and maintainability across the AI chat interface.
2025-04-15 20:07:46 +08:00
qianlifeng dd4b799369
refactor(ai): Revamp AI chat stream handling and tool call integration
- Updated ChatStream interface to return structured ChatStreamData, enhancing clarity in message handling.
- Improved logging and error handling for AI chat streams, ensuring robust communication with the AI provider.
- Refactored OpenAIBaseProvider to streamline tool call processing and status management.
- Enhanced WoxAIChatPlugin to support recursive chat calls for tool execution, improving user interaction flow.
- Updated UI components to better display tool call information and manage conversation states effectively.
2025-04-15 15:19:15 +08:00
qianlifeng 87f72c4c2e
refactor(ai): Enhance AI chat functionality with tool call support
- Added detailed logging for tool calls in MCPListTools and OpenAIBaseProvider.
- Updated ChatStream interface to include message type.
- Implemented tool call handling in OpenAIBaseProvider, including status tracking and response management.
- Enhanced WoxAIChatView to visually differentiate tool calls and display their status.
- Introduced ToolCallInfo structure to encapsulate tool call details.
- Updated WoxAIChatController to manage tool call expansion states.
- Improved JSON serialization/deserialization for tool call information.
- Added UI elements to display tool call details and statuses in the chat interface.
2025-04-14 22:20:57 +08:00
qianlifeng 01cbbd8f1f
refactor(ai): refactor tool use for chat plugin 2025-04-14 22:20:39 +08:00
qianlifeng 520c7a9d67
refactor(ai): Enhance AI chat functionality with improved tool handling and thinking tag processing
- Refactored the ChatStream method in OpenAIBaseProvider to conditionally handle tools, improving flexibility in chat interactions.
- Updated WoxAIChatController to utilize Rx types for aiChatData, enhancing state management and reactivity.
- Simplified processAIThinking function to streamline thinking tag extraction and content separation.
- Improved WoxAIChatView and related components to ensure consistent data handling and UI updates.
- Refactored WoxListController to support Rx types for item management, enhancing performance and maintainability.
2025-04-13 22:56:09 +08:00
qianlifeng b9ee44311b
refactor(ui): Streamline WoxListView and WoxAIChatController for improved functionality
- Simplified keyboard navigation in WoxListView by consolidating updateActiveIndexByDirection calls.
- Removed unnecessary initialization of chat select items in WoxAIChatController, enhancing clarity.
- Updated filtering logic in WoxListController to include parent groups for matched items, improving search results.
- Introduced WoxListItemTail class to replace WoxQueryResultTail, enhancing item representation and organization.
- Refactored WoxQueryResult to utilize the new WoxListItemTail structure, promoting consistency across the application.
2025-04-12 18:31:57 +08:00
qianlifeng d927f12a9a
refactor(ui): Integrate WoxAIChatController for enhanced chat functionality
- Added WoxAIChatController to manage AI chat interactions, including model selection and tool configuration.
- Refactored WoxAIChatView to utilize GetX for state management, improving responsiveness and code organization.
- Implemented chat select panel for dynamic model and tool selection, enhancing user experience.
- Updated WoxPreviewView to initialize chat data from WoxAIChatController, ensuring consistent data handling.
- Improved overall architecture by consolidating chat-related logic within the new controller, promoting maintainability.
2025-04-12 16:08:53 +08:00
qianlifeng 8b442825c3
refactor(api): Rename WoxPreviewChatData to WoxAIChatData and update related methods
- Renamed WoxPreviewChatData to WoxAIChatData for clarity in AI chat context.
- Updated method signatures in WoxLauncherController and WoxApi to reflect the new data class name.
- Refactored WoxListView to enhance focus handling and keyboard navigation for filter input.
- Removed deprecated WoxPreviewChatView component, streamlining the chat interface.
- Improved overall code organization and maintainability by consolidating chat-related functionalities.
2025-04-12 12:09:43 +08:00
qianlifeng 5cc5bf4c01
refactor(ui): Enhance WoxListView and WoxLauncherController with improved item handling and action execution
- Updated WoxListView to support generic item types, enhancing flexibility in item management.
- Refactored WoxLauncherController to streamline action execution and improve interaction handling.
- Introduced traceId parameter for action callbacks, allowing better tracking of user interactions.
- Enhanced filtering capabilities in WoxListController with fuzzy matching support for improved search functionality.
- Removed deprecated action handling methods and improved overall code organization for maintainability.
2025-04-12 11:22:31 +08:00
qianlifeng ac3b666975
refactor(ui): Refactor wox list view [WIP]
- Introduced WoxLauncherController and WoxListController to manage launcher and list functionalities, enhancing separation of concerns.
- Updated WoxSettingController to streamline settings management and improve user experience.
- Refactored theme handling in various components to utilize WoxThemeUtil for consistent theming across the application.
- Removed deprecated module imports and improved code organization for better maintainability.
- Enhanced WoxListItem to support generic data types, allowing for more flexible item management.
2025-04-11 23:58:57 +08:00
qianlifeng 073f31a929
feat(ui): Enhance WoxListView with maxHeight property and refactor theme utility methods
- Added maxHeight property to WoxListView for better height management.
- Refactored WoxThemeUtil to include methods for retrieving maximum result counts and heights, improving dynamic layout capabilities.
- Updated WoxQueryResultView to utilize new maxHeight property, ensuring consistent UI behavior across different views.
- Improved overall code organization and readability by streamlining height calculations and theme management.
2025-04-11 12:59:44 +08:00
Weifeng Liu 65351ee7ed Update icon to follow macOS icon design guidelines
- Use icon design pattern in [1] and [2] to make icon look consistent with others.

[1] https://developer.apple.com/design/resources/#macos-apps
[2] https://developer.apple.com/design/human-interface-guidelines/app-icons
2025-04-11 10:43:04 +08:00
qianlifeng 93f14c2478
feat(ui): Enhance WoxListView and WoxListItemView with theme support and filtering [WIP]
- Updated WoxListItemView to accept a WoxTheme parameter, allowing for dynamic theming based on the current theme.
- Refactored WoxListView to include a filter box for improved item searching, utilizing fuzzy matching for better user experience.
- Removed direct references to WoxTheme in WoxListItem, simplifying the model and enhancing separation of concerns.
- Improved event handling for item interactions, including double-tap and keyboard shortcuts for executing actions.
- Enhanced the overall structure and readability of the code, promoting better maintainability and organization.
2025-04-11 00:14:01 +08:00
qianlifeng 62f215e469
refactor(ui): Update WoxListItemView to use WoxListItem model [WIP]
- Refactored WoxListItemView to accept a WoxListItem object, simplifying the widget's properties.
- Removed Rx types for title, subtitle, and icon, replacing them with direct properties from WoxListItem.
- Enhanced background color and padding logic based on the list view type.
- Updated WoxQueryResultView to utilize WoxListView for rendering results, improving code organization and readability.
- Introduced a new WoxListViewTypeEnum for chat view type, expanding the list view capabilities.
2025-04-10 23:28:21 +08:00
qianlifeng aa94fc6531
feat(ai): Add support for selected tools in AI chat functionality
- Introduced a new field `SelectedTools` in `AIChatData` to hold the list of selected tools for the chat session.
- Updated the `Chat` method in `AIChatPlugin` to filter tools based on the selected tools from the chat data.
- Enhanced the Flutter UI to include a chat select panel for selecting models and configuring tools, allowing users to filter and select tools dynamically.
- Modified `WoxPreviewChatData` to include `selectedTools` for serialization and deserialization.
- Removed unnecessary tool usage toggle and integrated tool selection directly into the chat interface.
2025-04-10 14:08:57 +08:00
qianlifeng 695ed532d8
feat(ai): Add endpoint for retrieving all MCP tools
- Implement GetAllTools method in AIChater interface to fetch all available MCP tools.
- Update AIChatPlugin to provide the implementation for retrieving tools.
- Introduce new API endpoint "/ai/mcp/tools/all" to handle requests for all MCP tools.
- Enhance WoxApi with a method to call the new endpoint, improving tool management capabilities.
2025-04-10 10:54:01 +08:00
qianlifeng 9f466ed61b
feat(ai): Add SiliconFlowProvider for AI integration
- Introduce SiliconFlowProvider to the AI provider factory, enabling integration with the SiliconFlow API.
- Implement default host configuration for the provider to streamline setup.
- Add GetIcon method to maintain consistency with other AI providers.
2025-04-09 15:01:00 +08:00
qianlifeng c6b2c7c89d
feat(ai): Refactor AI provider integration and enhance tool management
- Introduce a unified provider factory system for easier management of AI providers.
- Update AI provider interfaces to include GetIcon method for better UI representation.
- Refactor existing providers (OpenAI, Google, Groq, Ollama) to inherit from a common base provider, streamlining code and enhancing maintainability.
- Implement new API endpoints for fetching available AI providers and their tools.
- Update UI components to support dynamic tool selection and management within the chat interface.
- Modify conversation roles to include Assistant and Tool for improved clarity in AI interactions.
2025-04-08 23:03:28 +08:00
qianlifeng 256968643e
feat(ai): Enhance MCP tool integration and callback functionality [WIP]
- Introduce parameters and callback functions for MCP tools, allowing for dynamic tool execution within the AI chat framework.
- Update MCPTool struct to include parameters and a callback function for handling tool calls.
- Refactor GroqProvider to support tool callbacks and integrate tool responses into chat conversations.
- Modify AIChatPlugin to manage MCP tools as a slice, improving tool handling and interaction within the chat system.
2025-04-06 23:03:50 +08:00
qianlifeng cf2c622b27
feat(ai): Enhance MCP server tool management and add disabled state
- Refactor MCP client handling to cache clients and tools for improved performance.
- Introduce a disabled state for MCP server configurations, allowing for better control over active servers.
- Update language resources to include translations for the new disabled state and tool descriptions.
- Modify UI components to reflect the disabled state of MCP servers in the settings view.
2025-04-02 22:13:35 +08:00
qianlifeng 401e2c0b55
docs(README): Add Linux dependencies section for keybinder installation
- Introduce a new section in the README to outline Linux dependencies, specifically for keybinder.
- Provide installation instructions and a link to the keybinder repository for user convenience.
2025-04-02 19:59:00 +08:00
qianlifeng b8ad62df18
feat(ai): Refactor AI chat plugin and integrate MCP server tools [WIP]
- Update AIChatPlugin to manage MCP server tools, enhancing the chat functionality.
- Introduce new types and methods for handling MCP tools, including AIMCPTool and related API endpoints.
- Remove deprecated chat plugin code to streamline the system and improve maintainability.
- Update go.mod and go.sum for new dependencies and versioning.
- Refactor chat settings to accommodate new tool management features.
2025-04-01 23:30:50 +08:00
qianlifeng 3f8baf0562
feat(ai): Introduce default AI model selection in chat settings
- Add a new setting for selecting a default AI model in the AIChatPlugin, enhancing user customization options.
- Update language resources to include translations for the new default model setting and its tooltip in English, Portuguese, Russian, and Chinese.
- Refactor the AIChatPlugin to utilize the selected default model for chat interactions, improving the overall user experience.
- Correct the naming convention for AI model settings to ensure consistency across the codebase.
2025-04-01 20:01:14 +08:00
qianlifeng 71e430bab6
feat(chat): Enhance AIChatPlugin with tool listing and management [WIP]
- Refactor listTool method in AIChatMCPServerConfig to return a slice of common.Tool and handle errors appropriately.
- Introduce mcpToolsMap in AIChatPlugin to store tools associated with MCP servers for better management.
- Update Init and reloadMCPServers methods to populate mcpToolsMap with tools from MCP servers.
- Add Keys method to HashMap for retrieving keys, facilitating tool management in AIChatPlugin.
2025-04-01 15:07:39 +08:00
qianlifeng 37d0534cc8
feat(ai): Add tool conversion functionality to GroqProvider [WIP]
- Implement convertTools method to transform common.Tool into llms.Tool with JSON schema definitions.
- Enhance ChatStream method to utilize the new tools parameter for improved AI interaction capabilities.
- Update imports to include jsonschema for tool definition management.
2025-04-01 10:25:58 +08:00
qianlifeng e8759dd9a4
feat(ai): Enhance AI chat functionality with new options and MCP server integration [WIP]
- Update AI chat stream methods to include options for enhanced customization.
- Introduce new ChatOptions struct to manage tools and settings for AI interactions.
- Add MCP server configuration options in language resources for better user guidance.
- Remove deprecated AI chat plugin code to streamline the system.
- Ensure all AI providers are updated to handle the new options parameter in chat stream methods.
2025-03-31 22:51:16 +08:00
qianlifeng b99d2d5a31
refactor(launcher): Conditionally render WoxQueryToolbarView based on results
- Update WoxLauncherView to display WoxQueryToolbarView only when there are results, improving UI responsiveness and clarity.
- This change enhances the user experience by preventing unnecessary display of the toolbar when no results are available.
2025-03-31 16:38:12 +08:00
qianlifeng 5c45354967 feat(file): Add everything support for file plugin
- Introduce EverythingNotRunningError to handle cases when the Everything application is not running.
- Update searcher interfaces for Linux, macOS, and Windows to return errors, improving error management.
- Implement user notifications and logging for search errors in the file plugin.
- Add new translations for error messages in English, Portuguese, Russian, and Chinese.
- Refactor resource extraction to include additional files in the 'others' directory.
2025-03-31 16:29:35 +08:00
qianlifeng 78b1fb694d
refactor(launcher): Simplify toolbar and result view logic
- Remove conditional rendering of WoxQueryToolbarView in WoxLauncherView for consistent display.
- Update WoxQueryResultView to directly return WoxPreviewView with snapshot data, improving clarity and performance.
- Clean up clipboard copy text handling in WoxQueryToolbarView for better state management.
2025-03-31 15:43:39 +08:00
qianlifeng 5c44fcbef0
refactor(chat): Improve chat ui
- Update logging statements in various components to use debug level instead of info for size and paint logs, reducing log verbosity.
- Adjust WoxPreviewChatView and WoxQueryBoxView to improve logging clarity and maintainability.
- Ensure consistent logging practices across the application for better debugging and performance monitoring.
2025-03-30 15:45:59 +08:00
qianlifeng 66218db28d refactor(chat): Improve AI model handling and UI updates
- Initialize results as an empty slice in handleAIModels for clarity.
- Refactor WoxPreviewChatView to utilize Obx for reactive updates, enhancing model selection and chat data display.
- Introduce reloadAIModels method in WoxLauncherController to streamline AI model fetching and ensure UI reflects the latest data.
- Update WoxSettingController to trigger model reload when AIProviders setting is updated, improving responsiveness to configuration changes.
2025-03-29 21:48:35 +08:00
qianlifeng c96662f5aa
feat(chat): Implement result updating mechanism in AI chat
- Introduce UpdateableResult type to facilitate direct updates of chat results without polling.
- Enhance AIChatPlugin to utilize resultChatIdMap for managing chat result IDs, improving title updates.
- Refactor WoxPreviewChatView to support dynamic updates of chat messages and titles based on user interactions.
- Update WoxLauncherController to handle result updates and ensure UI reflects the latest chat data.
2025-03-29 20:21:12 +08:00
qianlifeng ee6d1106d6 feature(deeplink): Add select deeplink for query selection
- Move selection query handling from RegisterSelectionHotkey to a new QuerySelection method for improved code organization and readability.
- Update hotkey registration to call the new QuerySelection method, maintaining existing functionality.
- Enhance command processing to trigger selection query when the "select" command is received.
2025-03-28 23:51:20 +08:00
qianlifeng dcbfa61055 fix(setting): Correct import statement for wox_setting_ui_view
- Update the import statement in wox_setting_view.dart to use the correct casing for wox_setting_ui_view.dart, ensuring proper file reference and preventing potential runtime errors.
2025-03-28 23:44:05 +08:00
qianlifeng 4efe42bf4b
feat(hotkey): Introduce double hotkey
- Implement support for double hotkeys, allowing users to trigger actions with double presses of modifier keys.
- Refactor hotkey parsing and management to utilize a new HotkeyX class, enhancing clarity and functionality.
- Update WoxHotkey and related components to accommodate the new double hotkey logic, improving user experience.
- Adjust UI components to reflect changes in hotkey handling, ensuring consistent behavior across the application.
2025-03-28 23:18:49 +08:00
qianlifeng 129d85b2eb
refactor(chat): Update chat message display with Scrollbar and SingleChildScrollView
- Replace ListView.builder with Scrollbar and SingleChildScrollView for improved message display in WoxPreviewChatView.
- Enhance user experience by allowing smoother scrolling and better visibility of chat messages.
- Maintain padding and message item rendering within a Column for consistent layout.
2025-03-28 15:29:26 +08:00
qianlifeng 8478284b6f
feat(launcher): Enhance focus handling and hover state for query results
- Refactor focus handling in WoxLauncherController to streamline focus requests for the query box, ensuring text selection behavior is consistent.
- Introduce hover state management in WoxListItemView, allowing for visual feedback when items are hovered over, improving user interaction.
- Update WoxQueryResultView to utilize the new hover state and focus methods, enhancing the overall user experience in the query results display.
2025-03-28 15:21:37 +08:00
qianlifeng 849de7464a
feat(settings): Add max result count configuration and update UI translations
- Introduce a new setting for maximum results to display in the list, allowing users to configure values between 5-15 items.
- Update language files for English, Portuguese, Russian, and Chinese to include translations for the new max result count setting and tips.
- Refactor WoxSetting and related components to support the new configuration, enhancing user experience and flexibility in result display.
2025-03-28 14:28:59 +08:00
qianlifeng 335d2d6659
refactor(chat): Update AIChatData references and improve chat handling
- Change the AIChatData reference in the preview.go file for clarity.
- Enhance the Chat method in AIChatPlugin to provide clearer comments and streamline conversation handling.
- Simplify JSON marshaling for chat previews, improving code readability and maintainability.
- Update WoxLauncherController to set action type when focusing on chat input, enhancing user experience.
2025-03-28 13:07:08 +08:00
qianlifeng cd03091158
feat(chat): Implement chat summarization and enhance model selection
- Add functionality to summarize chats at specific conversation intervals, improving user experience by providing concise titles.
- Introduce a "Summarize Chat" action in the chat interface, allowing users to trigger summarization directly.
- Refactor AI model loading to utilize caching for improved performance in the chat view.
- Update UI components to reflect dynamic action titles based on the current context, enhancing clarity and usability.
2025-03-28 10:26:31 +08:00
qianlifeng 3334464314
feat(chat): Enhance ai model selection in chat view
- Introduce model selection functionality in WoxPreviewChatView, allowing users to select AI models through an action panel.
- Refactor model selection logic to improve state management and UI responsiveness.
- Implement hotkey support for triggering model selection, enhancing user experience and accessibility.
- Update WoxResultAction to include an onExecute callback for better action handling in the launcher controller.
2025-03-27 12:27:01 +08:00
qianlifeng cad61c7f71
feat(chat): Enhance chat input focus handling and toolbar updates
- Implement focus change handling in WoxPreviewChatView to update the toolbar based on input focus state.
- Introduce updateToolbarByChat method in WoxLauncherController to configure the toolbar for chat interactions.
- Refactor query handling to ensure proper toolbar updates when switching between chat and other actions.
2025-03-26 23:50:13 +08:00
qianlifeng 3b92d699b3
feat(plugin): Add resultPreviewWidthRatio feature, which allow user to set result list and preview width ratio in the metadata file
- Introduce a new feature for configuring the result preview width ratio, allowing plugins to specify a width ratio for better UI layout.
- Update debounce feature parameter naming for consistency, changing `intervalMs` to `IntervalMs`.
- Implement API endpoint to retrieve the result preview width ratio based on user queries.
- Refactor related components to support the new width ratio feature in both backend and Flutter UI.
- Enhance error handling for feature parameters to ensure robust functionality.
2025-03-26 21:53:36 +08:00
qianlifeng 687589b165
feat(settings): Add UI width configuration
- Introduce new settings for adjusting the application window width, allowing users to set values between 800-1600 pixels.
- Update language files for English, Portuguese, Russian, and Chinese to include translations for the new UI width settings and tips.
- Refactor UI positioning functions to utilize the configurable window width for better layout management.
- Enhance the settings view to include a dedicated section for UI-related configurations.
2025-03-26 21:22:43 +08:00
qianlifeng 0332a584ac
feat(chat): Implement AI chat functionality and enhance data handling [WIP]
- Introduce AIChatData structure to manage chat sessions, including conversations and metadata.
- Update UI components to support sending and receiving chat responses.
- Refactor chat handling in AIChatPlugin to streamline conversation management and improve user experience.
- Enhance WoxPreviewChatView to allow model selection and display chat messages effectively.
- Implement API endpoint for handling chat requests and responses, ensuring smooth integration with the UI.
2025-03-26 14:47:47 +08:00