agentcrew-ai 0.8.13__tar.gz → 0.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentcrew_ai-0.9.1/AgentCrew/__init__.py +1 -0
- agentcrew_ai-0.9.1/AgentCrew/app.py +416 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/main_docker.py +1 -30
- agentcrew_ai-0.9.1/AgentCrew/modules/a2a/common/client/card_resolver.py +39 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/server.py +5 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/task_manager.py +1 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/local_agent.py +2 -2
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message/command_processor.py +33 -8
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message/conversation.py +18 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message/handler.py +5 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/service.py +50 -7
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/tool.py +9 -8
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/completers.py +5 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/console_ui.py +23 -11
- agentcrew_ai-0.9.1/AgentCrew/modules/console/conversation_browser/__init__.py +9 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/console/conversation_browser/browser.py +84 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/console/conversation_browser/browser_input_handler.py +279 -0
- agentcrew_ai-0.8.13/AgentCrew/modules/console/conversation_browser.py → agentcrew_ai-0.9.1/AgentCrew/modules/console/conversation_browser/browser_ui.py +249 -163
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/conversation_handler.py +34 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/display_handlers.py +127 -7
- agentcrew_ai-0.9.1/AgentCrew/modules/console/visual_mode/__init__.py +5 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/console/visual_mode/viewer.py +41 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/console/visual_mode/viewer_input_handler.py +315 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/console/visual_mode/viewer_ui.py +608 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/command_handler.py +137 -29
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/menu_components.py +8 -7
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/themes/README.md +30 -14
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/__init__.py +4 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/atom_light.yaml +1287 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/catppuccin.yaml +1276 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/dracula.yaml +1262 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/nord.yaml +1267 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/saigontech.yaml +1268 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/style_provider.py +236 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/theme_loader.py +379 -0
- agentcrew_ai-0.9.1/AgentCrew/modules/gui/themes/unicorn.yaml +1276 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/configs/global_settings.py +4 -4
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/history_sidebar.py +6 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/llm/constants.py +28 -9
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/mcpclient/service.py +0 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/base_service.py +13 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/chroma_service.py +50 -0
- agentcrew_ai-0.9.1/AgentCrew/setup.py +470 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/MANIFEST.in +1 -0
- {agentcrew_ai-0.8.13/agentcrew_ai.egg-info → agentcrew_ai-0.9.1}/PKG-INFO +1 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1/agentcrew_ai.egg-info}/PKG-INFO +1 -1
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/agentcrew_ai.egg-info/SOURCES.txt +16 -7
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/pyproject.toml +1 -1
- agentcrew_ai-0.8.13/AgentCrew/__init__.py +0 -1
- agentcrew_ai-0.8.13/AgentCrew/app.py +0 -1004
- agentcrew_ai-0.8.13/AgentCrew/modules/a2a/common/client/card_resolver.py +0 -20
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/__init__.py +0 -3
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/atom_light.py +0 -1365
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/catppuccin.py +0 -1404
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/dracula.py +0 -1372
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/nord.py +0 -1365
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/saigontech.py +0 -1359
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/style_provider.py +0 -422
- agentcrew_ai-0.8.13/AgentCrew/modules/gui/themes/unicorn.py +0 -1372
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/assets/agentcrew_logo.png +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/main.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/adapters.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/agent_cards.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/common/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/common/client/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/common/client/client.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/common/server/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/common/server/auth_middleware.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/common/server/task_manager.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/common/server/utils.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/errors.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/a2a/registry.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/base.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/example.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/manager.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/remote_agent.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/tools/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/tools/ask.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/tools/delegate.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/agents/tools/transfer.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/anthropic/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/anthropic/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/chrome_manager.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/element_extractor.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/click_element.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/draw_element_boxes.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/extract_clickable_elements.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/extract_elements_by_text.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/extract_input_elements.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/extract_scrollable_elements.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/filter_hidden_elements.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/focus_and_clear_element.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/remove_element_boxes.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/scroll_to_element.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js/trigger_input_events.js +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/js_loader.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/browser_automation/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/consolidation.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/file_handler.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/history.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message/base.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message/tool_manager.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message_handler.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/clipboard/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/clipboard/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/clipboard/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/file_search_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/grep_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/base.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/cpp_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/csharp_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/generic_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/go_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/java_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/javascript_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/kotlin_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/php_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/python_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/ruby_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/code_analysis/parsers/rust_parser.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/command_execution/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/command_execution/constants.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/command_execution/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/command_execution/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/command_execution/types.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/config/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/config/config_management.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/command_handlers.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/confirmation_handler.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/constants.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/diff_display.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/input_handler.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/tool_display.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/ui_effects.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/console/utils.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/custom_llm/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/custom_llm/copilot_response_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/custom_llm/deepinfra_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/custom_llm/github_copilot_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/custom_llm/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/file_editing/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/file_editing/safety_validator.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/file_editing/search_replace_engine.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/file_editing/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/file_editing/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/file_editing/tree_sitter_checker.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/google/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/google/native_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/google/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/groq/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/groq/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/chat_components.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/completers.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/conversation_components.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/input_components.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/keyboard_handler.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/message_handlers.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/tool_handlers.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/components/ui_state_manager.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/qt_ui.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/utils/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/utils/macos_clipboard.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/utils/strings.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/utils/wins_clipboard.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/config_window.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/configs/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/configs/agent_config.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/configs/custom_llm_provider.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/configs/mcp_config.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/configs/save_worker.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/diff_widget.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/json_editor.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/loading_overlay.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/markdown_editor.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/message_bubble.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/paste_aware_textedit.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/system_message.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/token_usage.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/widgets/tool_widget.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/gui/worker.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/image_generation/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/image_generation/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/image_generation/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/llm/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/llm/base.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/llm/model_registry.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/llm/service_manager.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/llm/types.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/mcpclient/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/mcpclient/auth.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/mcpclient/config.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/mcpclient/manager.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/mcpclient/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/context_persistent.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/github_copilot_ef.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/google_genai_ef.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/memory/voyageai_ef.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/openai/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/openai/response_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/openai/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/prompts/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/prompts/constants.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/tools/README.md +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/tools/registration.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/tools/registry.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/voice/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/voice/audio_handler.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/voice/base.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/voice/deepinfra_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/voice/elevenlabs_service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/voice/text_cleaner.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/web_search/__init__.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/web_search/service.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/web_search/tool.py +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/CONTRIBUTING.md +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/LICENSE +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/README.md +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/agentcrew_ai.egg-info/dependency_links.txt +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/agentcrew_ai.egg-info/entry_points.txt +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/agentcrew_ai.egg-info/requires.txt +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/agentcrew_ai.egg-info/top_level.txt +0 -0
- {agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.9.1"
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import json
|
|
4
|
+
import asyncio
|
|
5
|
+
import functools
|
|
6
|
+
import nest_asyncio
|
|
7
|
+
from typing import Optional, Dict, Any, List
|
|
8
|
+
|
|
9
|
+
import click
|
|
10
|
+
|
|
11
|
+
from AgentCrew.setup import ApplicationSetup, PROVIDER_LIST
|
|
12
|
+
from AgentCrew.modules.config import ConfigManagement
|
|
13
|
+
from AgentCrew.modules.llm.service_manager import ServiceManager
|
|
14
|
+
from AgentCrew.modules.agents.local_agent import LocalAgent
|
|
15
|
+
|
|
16
|
+
nest_asyncio.apply()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def common_options(func):
|
|
20
|
+
@click.option(
|
|
21
|
+
"--provider",
|
|
22
|
+
type=click.Choice(PROVIDER_LIST),
|
|
23
|
+
default=None,
|
|
24
|
+
help="LLM provider to use (claude, groq, openai, google, github_copilot, or deepinfra)",
|
|
25
|
+
)
|
|
26
|
+
@click.option(
|
|
27
|
+
"--agent-config",
|
|
28
|
+
default=None,
|
|
29
|
+
help="Path/URL to the agent configuration file.",
|
|
30
|
+
)
|
|
31
|
+
@click.option(
|
|
32
|
+
"--mcp-config", default=None, help="Path to the mcp servers configuration file."
|
|
33
|
+
)
|
|
34
|
+
@click.option(
|
|
35
|
+
"--memory-llm",
|
|
36
|
+
type=click.Choice(
|
|
37
|
+
["claude", "groq", "openai", "google", "deepinfra", "github_copilot"]
|
|
38
|
+
),
|
|
39
|
+
default=None,
|
|
40
|
+
help="LLM Model use for analyzing and processing memory",
|
|
41
|
+
)
|
|
42
|
+
@click.option(
|
|
43
|
+
"--memory-path", default=None, help="Path to the memory database location"
|
|
44
|
+
)
|
|
45
|
+
@functools.wraps(func)
|
|
46
|
+
def wrapper(*args, **kwargs):
|
|
47
|
+
return func(*args, **kwargs)
|
|
48
|
+
|
|
49
|
+
return wrapper
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AgentCrewApplication:
|
|
53
|
+
def __init__(self):
|
|
54
|
+
self.config_manager = ConfigManagement()
|
|
55
|
+
self.setup = ApplicationSetup(self.config_manager)
|
|
56
|
+
self.setup.load_api_keys_from_config()
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def services(self) -> Optional[Dict[str, Any]]:
|
|
60
|
+
return self.setup.services
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def agent_manager(self):
|
|
64
|
+
return self.setup.agent_manager
|
|
65
|
+
|
|
66
|
+
def run_console(
|
|
67
|
+
self,
|
|
68
|
+
provider: Optional[str] = None,
|
|
69
|
+
agent_config: Optional[str] = None,
|
|
70
|
+
mcp_config: Optional[str] = None,
|
|
71
|
+
memory_llm: Optional[str] = None,
|
|
72
|
+
with_voice: bool = False,
|
|
73
|
+
) -> None:
|
|
74
|
+
from AgentCrew.modules.console import ConsoleUI
|
|
75
|
+
from AgentCrew.modules.chat import MessageHandler
|
|
76
|
+
from AgentCrew.modules.mcpclient import MCPSessionManager
|
|
77
|
+
|
|
78
|
+
try:
|
|
79
|
+
if provider is None:
|
|
80
|
+
provider = self.setup.detect_provider()
|
|
81
|
+
if provider is None:
|
|
82
|
+
raise ValueError(
|
|
83
|
+
"No LLM API key found. Please set either ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY, GROQ_API_KEY, or DEEPINFRA_API_KEY"
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
services = self.setup.setup_services(provider, memory_llm)
|
|
87
|
+
|
|
88
|
+
if mcp_config:
|
|
89
|
+
os.environ["MCP_CONFIG_PATH"] = mcp_config
|
|
90
|
+
|
|
91
|
+
self.setup.setup_agents(services, agent_config)
|
|
92
|
+
self.setup.restore_last_agent()
|
|
93
|
+
|
|
94
|
+
message_handler = MessageHandler(
|
|
95
|
+
services["memory"], services["context_persistent"], with_voice
|
|
96
|
+
)
|
|
97
|
+
global_config = self.config_manager.read_global_config_data()
|
|
98
|
+
|
|
99
|
+
ui = ConsoleUI(
|
|
100
|
+
message_handler,
|
|
101
|
+
global_config.get("global_settings", {}).get("swap_enter", False),
|
|
102
|
+
)
|
|
103
|
+
ui.start()
|
|
104
|
+
except Exception as e:
|
|
105
|
+
import traceback
|
|
106
|
+
|
|
107
|
+
print(traceback.format_exc())
|
|
108
|
+
click.echo(f"❌ Error: {str(e)}", err=True)
|
|
109
|
+
finally:
|
|
110
|
+
MCPSessionManager.get_instance().cleanup()
|
|
111
|
+
|
|
112
|
+
def run_gui(
|
|
113
|
+
self,
|
|
114
|
+
provider: Optional[str] = None,
|
|
115
|
+
agent_config: Optional[str] = None,
|
|
116
|
+
mcp_config: Optional[str] = None,
|
|
117
|
+
memory_llm: Optional[str] = None,
|
|
118
|
+
with_voice: bool = False,
|
|
119
|
+
) -> None:
|
|
120
|
+
from PySide6.QtCore import QCoreApplication
|
|
121
|
+
from PySide6.QtCore import Qt
|
|
122
|
+
from PySide6.QtWidgets import QApplication
|
|
123
|
+
from AgentCrew.modules.gui import ChatWindow
|
|
124
|
+
from AgentCrew.modules.chat import MessageHandler
|
|
125
|
+
from AgentCrew.modules.mcpclient import MCPSessionManager
|
|
126
|
+
|
|
127
|
+
try:
|
|
128
|
+
if provider is None:
|
|
129
|
+
provider = self.setup.detect_provider()
|
|
130
|
+
if provider is None:
|
|
131
|
+
from AgentCrew.modules.gui.widgets.config_window import ConfigWindow
|
|
132
|
+
|
|
133
|
+
app = QApplication(sys.argv)
|
|
134
|
+
config_window = ConfigWindow()
|
|
135
|
+
config_window.tab_widget.setCurrentIndex(3)
|
|
136
|
+
config_window.show()
|
|
137
|
+
sys.exit(app.exec())
|
|
138
|
+
|
|
139
|
+
services = self.setup.setup_services(provider, memory_llm)
|
|
140
|
+
|
|
141
|
+
if mcp_config:
|
|
142
|
+
os.environ["MCP_CONFIG_PATH"] = mcp_config
|
|
143
|
+
|
|
144
|
+
self.setup.setup_agents(services, agent_config)
|
|
145
|
+
self.setup.restore_last_agent()
|
|
146
|
+
|
|
147
|
+
message_handler = MessageHandler(
|
|
148
|
+
services["memory"], services["context_persistent"], with_voice
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
QCoreApplication.setAttribute(Qt.ApplicationAttribute.AA_UseOpenGLES)
|
|
152
|
+
app = QApplication(sys.argv)
|
|
153
|
+
chat_window = ChatWindow(message_handler)
|
|
154
|
+
chat_window.show()
|
|
155
|
+
sys.exit(app.exec())
|
|
156
|
+
except Exception as e:
|
|
157
|
+
import traceback
|
|
158
|
+
|
|
159
|
+
print(traceback.format_exc())
|
|
160
|
+
click.echo(f"❌ Error: {str(e)}", err=True)
|
|
161
|
+
finally:
|
|
162
|
+
MCPSessionManager.get_instance().cleanup()
|
|
163
|
+
|
|
164
|
+
def run_server(
|
|
165
|
+
self,
|
|
166
|
+
host: str = "0.0.0.0",
|
|
167
|
+
port: int = 41241,
|
|
168
|
+
base_url: Optional[str] = None,
|
|
169
|
+
provider: Optional[str] = None,
|
|
170
|
+
model_id: Optional[str] = None,
|
|
171
|
+
agent_config: Optional[str] = None,
|
|
172
|
+
api_key: Optional[str] = None,
|
|
173
|
+
mcp_config: Optional[str] = None,
|
|
174
|
+
memory_llm: Optional[str] = None,
|
|
175
|
+
) -> None:
|
|
176
|
+
from AgentCrew.modules.a2a.server import A2AServer
|
|
177
|
+
from AgentCrew.modules.mcpclient import MCPSessionManager
|
|
178
|
+
|
|
179
|
+
try:
|
|
180
|
+
if not base_url:
|
|
181
|
+
base_url = f"http://{host}:{port}"
|
|
182
|
+
|
|
183
|
+
if provider is None:
|
|
184
|
+
provider = self.setup.detect_provider()
|
|
185
|
+
if provider is None:
|
|
186
|
+
raise ValueError(
|
|
187
|
+
"No LLM API key found. Please set either ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY, GROQ_API_KEY, or DEEPINFRA_API_KEY"
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
services = self.setup.setup_services(
|
|
191
|
+
provider, memory_llm, need_memory=False
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
if mcp_config:
|
|
195
|
+
os.environ["MCP_CONFIG_PATH"] = mcp_config
|
|
196
|
+
|
|
197
|
+
os.environ["AGENTCREW_DISABLE_GUI"] = "true"
|
|
198
|
+
|
|
199
|
+
self.setup.setup_agents(services, agent_config, provider, model_id)
|
|
200
|
+
|
|
201
|
+
if self.agent_manager is None:
|
|
202
|
+
raise ValueError("Agent manager is not initialized")
|
|
203
|
+
|
|
204
|
+
self.agent_manager.enforce_transfer = False
|
|
205
|
+
|
|
206
|
+
server = A2AServer(
|
|
207
|
+
agent_manager=self.agent_manager,
|
|
208
|
+
host=host,
|
|
209
|
+
port=port,
|
|
210
|
+
base_url=base_url,
|
|
211
|
+
api_key=api_key,
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
click.echo(f"Starting A2A server on {host}:{port}")
|
|
215
|
+
click.echo(
|
|
216
|
+
f"Available agents: {', '.join(self.agent_manager.agents.keys())}"
|
|
217
|
+
)
|
|
218
|
+
server.start()
|
|
219
|
+
except Exception as e:
|
|
220
|
+
import traceback
|
|
221
|
+
|
|
222
|
+
print(traceback.format_exc())
|
|
223
|
+
click.echo(f"❌ Error: {str(e)}", err=True)
|
|
224
|
+
finally:
|
|
225
|
+
MCPSessionManager.get_instance().cleanup()
|
|
226
|
+
|
|
227
|
+
def _parse_output_schema(self, schema_input: str) -> tuple[str, dict]:
|
|
228
|
+
try:
|
|
229
|
+
from AgentCrew.modules.prompts.constants import SCHEMA_ENFORCEMENT_PROMPT
|
|
230
|
+
|
|
231
|
+
if os.path.exists(schema_input):
|
|
232
|
+
with open(schema_input, "r", encoding="utf-8") as f:
|
|
233
|
+
schema_dict = json.load(f)
|
|
234
|
+
else:
|
|
235
|
+
schema_dict = json.loads(schema_input)
|
|
236
|
+
|
|
237
|
+
schema_json = json.dumps(schema_dict, indent=2)
|
|
238
|
+
|
|
239
|
+
enforcement_prompt = SCHEMA_ENFORCEMENT_PROMPT.replace(
|
|
240
|
+
"{schema_json}", schema_json
|
|
241
|
+
)
|
|
242
|
+
return enforcement_prompt, schema_dict
|
|
243
|
+
|
|
244
|
+
except json.JSONDecodeError as e:
|
|
245
|
+
raise ValueError(f"Invalid JSON schema: {e}")
|
|
246
|
+
except Exception as e:
|
|
247
|
+
raise ValueError(f"Failed to load output schema: {e}")
|
|
248
|
+
|
|
249
|
+
def _clean_json_response(self, response: str) -> str:
|
|
250
|
+
import re
|
|
251
|
+
|
|
252
|
+
cleaned = response.strip()
|
|
253
|
+
pattern = r"^```(?:json)?\s*\n?(.*?)\n?```$"
|
|
254
|
+
match = re.match(pattern, cleaned, re.DOTALL)
|
|
255
|
+
if match:
|
|
256
|
+
cleaned = match.group(1).strip()
|
|
257
|
+
return cleaned
|
|
258
|
+
|
|
259
|
+
def _validate_response_against_schema(
|
|
260
|
+
self, response: str, schema_dict: Dict[str, Any]
|
|
261
|
+
) -> tuple[bool, Optional[str]]:
|
|
262
|
+
from jsonschema import validate, ValidationError
|
|
263
|
+
|
|
264
|
+
try:
|
|
265
|
+
cleaned_response = self._clean_json_response(response)
|
|
266
|
+
response_json = json.loads(cleaned_response)
|
|
267
|
+
except json.JSONDecodeError as e:
|
|
268
|
+
return (
|
|
269
|
+
False,
|
|
270
|
+
f"Response is not valid JSON: {e}\n\nResponse received:\n{response[:500]}",
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
try:
|
|
274
|
+
validate(instance=response_json, schema=schema_dict)
|
|
275
|
+
return True, None
|
|
276
|
+
except ValidationError as e:
|
|
277
|
+
error_details = (
|
|
278
|
+
"JSON Schema Validation Error:\n"
|
|
279
|
+
f" - Path: {' -> '.join(str(p) for p in e.path) if e.path else 'root'}\n"
|
|
280
|
+
f" - Error: {e.message}\n"
|
|
281
|
+
f" - Failed value: {json.dumps(e.instance, indent=2)}\n"
|
|
282
|
+
)
|
|
283
|
+
if e.schema_path:
|
|
284
|
+
error_details += (
|
|
285
|
+
f" - Schema path: {' -> '.join(str(p) for p in e.schema_path)}\n"
|
|
286
|
+
)
|
|
287
|
+
return False, error_details
|
|
288
|
+
|
|
289
|
+
def run_job(
|
|
290
|
+
self,
|
|
291
|
+
agent: str,
|
|
292
|
+
task: str,
|
|
293
|
+
files: Optional[List[str]] = None,
|
|
294
|
+
provider: Optional[str] = None,
|
|
295
|
+
model_id: Optional[str] = None,
|
|
296
|
+
agent_config: Optional[str] = None,
|
|
297
|
+
mcp_config: Optional[str] = None,
|
|
298
|
+
memory_llm: Optional[str] = None,
|
|
299
|
+
output_schema: Optional[str] = None,
|
|
300
|
+
) -> str:
|
|
301
|
+
from AgentCrew.modules.chat import MessageHandler
|
|
302
|
+
from AgentCrew.modules.mcpclient import MCPSessionManager
|
|
303
|
+
from AgentCrew.modules.llm.model_registry import ModelRegistry
|
|
304
|
+
|
|
305
|
+
try:
|
|
306
|
+
if provider is None:
|
|
307
|
+
provider = self.setup.detect_provider()
|
|
308
|
+
if provider is None:
|
|
309
|
+
raise ValueError(
|
|
310
|
+
"No LLM API key found. Please set either ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY, GROQ_API_KEY, or DEEPINFRA_API_KEY"
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
services = self.setup.setup_services(
|
|
314
|
+
provider, memory_llm, need_memory=False
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
if mcp_config:
|
|
318
|
+
os.environ["MCP_CONFIG_PATH"] = mcp_config
|
|
319
|
+
|
|
320
|
+
os.environ["AGENTCREW_DISABLE_GUI"] = "true"
|
|
321
|
+
|
|
322
|
+
self.setup.setup_agents(services, agent_config)
|
|
323
|
+
|
|
324
|
+
llm_manager = ServiceManager.get_instance()
|
|
325
|
+
|
|
326
|
+
llm_service = llm_manager.get_service(provider)
|
|
327
|
+
if model_id:
|
|
328
|
+
llm_service.model = model_id
|
|
329
|
+
|
|
330
|
+
if self.agent_manager is None:
|
|
331
|
+
raise ValueError("Agent manager is not initialized")
|
|
332
|
+
|
|
333
|
+
self.agent_manager.update_llm_service(llm_service)
|
|
334
|
+
|
|
335
|
+
for local_agent in self.agent_manager.agents:
|
|
336
|
+
if isinstance(local_agent, LocalAgent):
|
|
337
|
+
local_agent.is_remoting_mode = True
|
|
338
|
+
|
|
339
|
+
self.agent_manager.enforce_transfer = False
|
|
340
|
+
self.agent_manager.one_turn_process = True
|
|
341
|
+
|
|
342
|
+
current_agent = self.agent_manager.get_local_agent(agent)
|
|
343
|
+
|
|
344
|
+
if current_agent:
|
|
345
|
+
schema_dict = None
|
|
346
|
+
if output_schema:
|
|
347
|
+
schema_prompt, schema_dict = self._parse_output_schema(
|
|
348
|
+
output_schema
|
|
349
|
+
)
|
|
350
|
+
if "structured_output" in ModelRegistry.get_model_capabilities(
|
|
351
|
+
f"{provider}/{model_id}"
|
|
352
|
+
):
|
|
353
|
+
current_agent.llm.structured_output = schema_dict
|
|
354
|
+
else:
|
|
355
|
+
current_agent.set_custom_system_prompt(schema_prompt)
|
|
356
|
+
|
|
357
|
+
self.agent_manager.select_agent(current_agent.name)
|
|
358
|
+
|
|
359
|
+
message_handler = MessageHandler(
|
|
360
|
+
services["memory"], services["context_persistent"]
|
|
361
|
+
)
|
|
362
|
+
message_handler.is_non_interactive = True
|
|
363
|
+
message_handler.agent = current_agent
|
|
364
|
+
|
|
365
|
+
if files:
|
|
366
|
+
for file_path in files:
|
|
367
|
+
asyncio.run(
|
|
368
|
+
message_handler.process_user_input(f"/file {file_path}")
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
max_attempts = 4
|
|
372
|
+
attempt = 0
|
|
373
|
+
response = None
|
|
374
|
+
|
|
375
|
+
asyncio.run(message_handler.process_user_input(task))
|
|
376
|
+
|
|
377
|
+
while attempt < max_attempts:
|
|
378
|
+
attempt += 1
|
|
379
|
+
response, _, _ = asyncio.run(
|
|
380
|
+
message_handler.get_assistant_response()
|
|
381
|
+
)
|
|
382
|
+
if not output_schema or not schema_dict:
|
|
383
|
+
break
|
|
384
|
+
|
|
385
|
+
if response is None:
|
|
386
|
+
asyncio.run(
|
|
387
|
+
message_handler.process_user_input(
|
|
388
|
+
"No response was generated. Please try again."
|
|
389
|
+
)
|
|
390
|
+
)
|
|
391
|
+
continue
|
|
392
|
+
|
|
393
|
+
success, retry_message = self._validate_response_against_schema(
|
|
394
|
+
response, schema_dict
|
|
395
|
+
)
|
|
396
|
+
if success:
|
|
397
|
+
break
|
|
398
|
+
else:
|
|
399
|
+
if retry_message:
|
|
400
|
+
asyncio.run(
|
|
401
|
+
message_handler.process_user_input(retry_message)
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
MCPSessionManager.get_instance().cleanup()
|
|
405
|
+
return response.strip() if response else ""
|
|
406
|
+
else:
|
|
407
|
+
raise ValueError(f"Agent '{agent}' not found")
|
|
408
|
+
|
|
409
|
+
except Exception:
|
|
410
|
+
import traceback
|
|
411
|
+
|
|
412
|
+
print(traceback.format_exc())
|
|
413
|
+
raise
|
|
414
|
+
|
|
415
|
+
def login(self) -> bool:
|
|
416
|
+
return self.setup.login()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import click
|
|
2
2
|
import os
|
|
3
3
|
import sys
|
|
4
|
+
from AgentCrew.app import common_options
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
def _custom_unraisable_hook(unraisable):
|
|
@@ -48,36 +49,6 @@ def cli():
|
|
|
48
49
|
)
|
|
49
50
|
|
|
50
51
|
|
|
51
|
-
def common_options(func):
|
|
52
|
-
import functools
|
|
53
|
-
|
|
54
|
-
@click.option(
|
|
55
|
-
"--provider",
|
|
56
|
-
type=click.Choice(PROVIDER_LIST),
|
|
57
|
-
default=None,
|
|
58
|
-
help="LLM provider to use (claude, groq, openai, google, github_copilot, or deepinfra)",
|
|
59
|
-
)
|
|
60
|
-
@click.option(
|
|
61
|
-
"--agent-config", default=None, help="Path/URL to the agent configuration file."
|
|
62
|
-
)
|
|
63
|
-
@click.option(
|
|
64
|
-
"--mcp-config", default=None, help="Path to the mcp servers configuration file."
|
|
65
|
-
)
|
|
66
|
-
@click.option(
|
|
67
|
-
"--memory-llm",
|
|
68
|
-
type=click.Choice(
|
|
69
|
-
["claude", "groq", "openai", "google", "deepinfra", "github_copilot"]
|
|
70
|
-
),
|
|
71
|
-
default=None,
|
|
72
|
-
help="LLM Model use for analyzing and processing memory",
|
|
73
|
-
)
|
|
74
|
-
@functools.wraps(func)
|
|
75
|
-
def wrapper(*args, **kwargs):
|
|
76
|
-
return func(*args, **kwargs)
|
|
77
|
-
|
|
78
|
-
return wrapper
|
|
79
|
-
|
|
80
|
-
|
|
81
52
|
def cli_prod():
|
|
82
53
|
if sys.argv[1] == "--version":
|
|
83
54
|
click.echo(f"AgentCrew version: {get_current_version()}")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
from a2a.types import AgentCard
|
|
6
|
+
|
|
7
|
+
DEFAULT_AGENT_CARD_PATHS = [
|
|
8
|
+
"/.well-known/agent-card.json",
|
|
9
|
+
"/.well-known/agent.json",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class A2ACardResolver:
|
|
14
|
+
def __init__(self, base_url, agent_card_path: str | None = None):
|
|
15
|
+
self.base_url = base_url.rstrip("/")
|
|
16
|
+
self.agent_card_path = agent_card_path.lstrip("/") if agent_card_path else None
|
|
17
|
+
|
|
18
|
+
def get_agent_card(self) -> AgentCard:
|
|
19
|
+
with httpx.Client() as client:
|
|
20
|
+
if self.agent_card_path:
|
|
21
|
+
return self._fetch_agent_card(client, self.agent_card_path)
|
|
22
|
+
|
|
23
|
+
for path in DEFAULT_AGENT_CARD_PATHS:
|
|
24
|
+
try:
|
|
25
|
+
return self._fetch_agent_card(client, path.lstrip("/"))
|
|
26
|
+
except httpx.HTTPStatusError:
|
|
27
|
+
continue
|
|
28
|
+
|
|
29
|
+
raise httpx.RequestError(
|
|
30
|
+
f"Agent card not found at any of the default paths: {DEFAULT_AGENT_CARD_PATHS}"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
def _fetch_agent_card(self, client: httpx.Client, path: str) -> AgentCard:
|
|
34
|
+
response = client.get(self.base_url + "/" + path)
|
|
35
|
+
response.raise_for_status()
|
|
36
|
+
try:
|
|
37
|
+
return AgentCard(**response.json())
|
|
38
|
+
except json.JSONDecodeError as e:
|
|
39
|
+
raise httpx.RequestError(str(e)) from e
|
|
@@ -82,6 +82,11 @@ class A2AServer:
|
|
|
82
82
|
agent_routes = Mount(
|
|
83
83
|
f"/{agent_name}",
|
|
84
84
|
routes=[
|
|
85
|
+
Route(
|
|
86
|
+
"/.well-known/agent-card.json",
|
|
87
|
+
self._get_agent_card_factory(agent_name),
|
|
88
|
+
methods=["GET"],
|
|
89
|
+
),
|
|
85
90
|
Route(
|
|
86
91
|
"/.well-known/agent.json",
|
|
87
92
|
self._get_agent_card_factory(agent_name),
|
|
@@ -608,6 +608,7 @@ class AgentTaskManager(TaskManager):
|
|
|
608
608
|
|
|
609
609
|
except Exception as e:
|
|
610
610
|
logger.error(str(e))
|
|
611
|
+
logger.debug(self.task_history[task.context_id])
|
|
611
612
|
# Handle errors
|
|
612
613
|
task.status.state = TaskState.failed
|
|
613
614
|
task.status.timestamp = datetime.now().isoformat()
|
|
@@ -672,7 +672,7 @@ Whenever condition on `when` clause in a **Behavior** matches, tailor your respo
|
|
|
672
672
|
adaptive_messages["content"].append(
|
|
673
673
|
{
|
|
674
674
|
"type": "text",
|
|
675
|
-
"text": f"
|
|
675
|
+
"text": f"cwd `{os.getcwd()}` structure:\n{dir_structure}",
|
|
676
676
|
}
|
|
677
677
|
)
|
|
678
678
|
|
|
@@ -763,7 +763,7 @@ Whenever condition on `when` clause in a **Behavior** matches, tailor your respo
|
|
|
763
763
|
continue
|
|
764
764
|
|
|
765
765
|
if is_shrinkable and i < shrink_threshold:
|
|
766
|
-
msg["content"] = "[
|
|
766
|
+
msg["content"] = "[PRUNED]"
|
|
767
767
|
continue
|
|
768
768
|
|
|
769
769
|
# Check if content starts with [UNIQUE]
|
{agentcrew_ai-0.8.13 → agentcrew_ai-0.9.1}/AgentCrew/modules/chat/message/command_processor.py
RENAMED
|
@@ -43,14 +43,8 @@ class CommandProcessor:
|
|
|
43
43
|
return CommandResult(handled=True, clear_flag=True)
|
|
44
44
|
elif user_input.lower().startswith("/copy"):
|
|
45
45
|
return await self._handle_copy_command(user_input)
|
|
46
|
-
elif user_input.lower()
|
|
47
|
-
self.
|
|
48
|
-
"debug_requested", self.message_handler.agent.clean_history
|
|
49
|
-
)
|
|
50
|
-
self.message_handler._notify(
|
|
51
|
-
"debug_requested", self.message_handler.streamline_messages
|
|
52
|
-
)
|
|
53
|
-
return CommandResult(handled=True, clear_flag=True)
|
|
46
|
+
elif user_input.lower().startswith("/debug"):
|
|
47
|
+
return self._handle_debug_command(user_input)
|
|
54
48
|
elif user_input.lower().startswith("/think "):
|
|
55
49
|
try:
|
|
56
50
|
budget = user_input[7:].strip()
|
|
@@ -759,6 +753,37 @@ class CommandProcessor:
|
|
|
759
753
|
self.message_handler._notify("voice_recording_completed", None)
|
|
760
754
|
return CommandResult(handled=True, clear_flag=True)
|
|
761
755
|
|
|
756
|
+
def _handle_debug_command(self, user_input: str) -> CommandResult:
|
|
757
|
+
"""Handle /debug command with optional filtering.
|
|
758
|
+
|
|
759
|
+
Usage:
|
|
760
|
+
/debug - Show both agent and chat messages
|
|
761
|
+
/debug agent - Show only agent messages
|
|
762
|
+
/debug chat - Show only chat/streamline messages
|
|
763
|
+
"""
|
|
764
|
+
parts = user_input.lower().split()
|
|
765
|
+
filter_type = parts[1] if len(parts) > 1 else None
|
|
766
|
+
|
|
767
|
+
if filter_type and filter_type not in ("agent", "chat"):
|
|
768
|
+
self.message_handler._notify(
|
|
769
|
+
"error", f"Invalid filter '{filter_type}'. Use 'agent' or 'chat'."
|
|
770
|
+
)
|
|
771
|
+
return CommandResult(handled=True, clear_flag=True)
|
|
772
|
+
|
|
773
|
+
if filter_type is None or filter_type == "agent":
|
|
774
|
+
self.message_handler._notify(
|
|
775
|
+
"debug_requested",
|
|
776
|
+
{"type": "agent", "messages": self.message_handler.agent.clean_history},
|
|
777
|
+
)
|
|
778
|
+
|
|
779
|
+
if filter_type is None or filter_type == "chat":
|
|
780
|
+
self.message_handler._notify(
|
|
781
|
+
"debug_requested",
|
|
782
|
+
{"type": "chat", "messages": self.message_handler.streamline_messages},
|
|
783
|
+
)
|
|
784
|
+
|
|
785
|
+
return CommandResult(handled=True, clear_flag=True)
|
|
786
|
+
|
|
762
787
|
def _handle_toggle_transfer_command(self, user_input: str) -> CommandResult:
|
|
763
788
|
"""Handle /toggle_transfer command to toggle the enforce_transfer property of agent_manager."""
|
|
764
789
|
try:
|
|
@@ -198,6 +198,7 @@ class ConversationManager:
|
|
|
198
198
|
def delete_conversation_by_id(self, conversation_id: str) -> bool:
|
|
199
199
|
"""
|
|
200
200
|
Deletes a conversation by its ID, handling file deletion and UI updates.
|
|
201
|
+
Also deletes associated memory data.
|
|
201
202
|
|
|
202
203
|
Args:
|
|
203
204
|
conversation_id: The ID of the conversation to delete.
|
|
@@ -215,6 +216,22 @@ class ConversationManager:
|
|
|
215
216
|
logger.info(
|
|
216
217
|
f"INFO: Successfully deleted conversation file for ID: {conversation_id}"
|
|
217
218
|
)
|
|
219
|
+
|
|
220
|
+
if self.message_handler.memory_service:
|
|
221
|
+
memory_result = (
|
|
222
|
+
self.message_handler.memory_service.delete_by_conversation_id(
|
|
223
|
+
conversation_id
|
|
224
|
+
)
|
|
225
|
+
)
|
|
226
|
+
if memory_result.get("success"):
|
|
227
|
+
logger.info(
|
|
228
|
+
f"INFO: Deleted {memory_result.get('count', 0)} memories for conversation {conversation_id}"
|
|
229
|
+
)
|
|
230
|
+
else:
|
|
231
|
+
logger.warning(
|
|
232
|
+
f"WARNING: Failed to delete memories for conversation {conversation_id}: {memory_result.get('message')}"
|
|
233
|
+
)
|
|
234
|
+
|
|
218
235
|
self.message_handler._notify("conversations_changed", None)
|
|
219
236
|
self.message_handler._notify(
|
|
220
237
|
"system_message", f"Conversation {conversation_id[:8]}... deleted."
|
|
@@ -224,7 +241,7 @@ class ConversationManager:
|
|
|
224
241
|
logger.info(
|
|
225
242
|
f"INFO: Deleted conversation {conversation_id} was the current one. Starting new conversation."
|
|
226
243
|
)
|
|
227
|
-
self.start_new_conversation()
|
|
244
|
+
self.start_new_conversation()
|
|
228
245
|
return True
|
|
229
246
|
else:
|
|
230
247
|
error_msg = f"Failed to delete conversation {conversation_id[:8]}..."
|
|
@@ -470,9 +470,13 @@ class MessageHandler(Observable):
|
|
|
470
470
|
if isinstance(e, BadRequestError):
|
|
471
471
|
if e.code == "model_max_prompt_tokens_exceeded":
|
|
472
472
|
from AgentCrew.modules.agents import LocalAgent
|
|
473
|
+
from AgentCrew.modules.llm.model_registry import ModelRegistry
|
|
473
474
|
|
|
474
475
|
if isinstance(self.agent, LocalAgent):
|
|
475
|
-
|
|
476
|
+
max_token = ModelRegistry.get_model_limit(
|
|
477
|
+
self.agent.get_model()
|
|
478
|
+
)
|
|
479
|
+
self.agent.input_tokens_usage = max_token
|
|
476
480
|
return await self.get_assistant_response()
|
|
477
481
|
if self.current_user_input:
|
|
478
482
|
self.conversation_manager.store_conversation_turn(
|