autobyteus 1.1.1__tar.gz → 1.1.3__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.
- {autobyteus-1.1.1 → autobyteus-1.1.3}/PKG-INFO +4 -2
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/bootstrap_steps/__init__.py +2 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/bootstrap_steps/agent_bootstrapper.py +2 -0
- autobyteus-1.1.3/autobyteus/agent/bootstrap_steps/mcp_server_prewarming_step.py +71 -0
- autobyteus-1.1.3/autobyteus/agent/llm_response_processor/provider_aware_tool_usage_processor.py +83 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/runtime/agent_runtime.py +1 -4
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/runtime/agent_worker.py +56 -23
- autobyteus-1.1.3/autobyteus/agent/shutdown_steps/__init__.py +17 -0
- autobyteus-1.1.3/autobyteus/agent/shutdown_steps/agent_shutdown_orchestrator.py +63 -0
- autobyteus-1.1.3/autobyteus/agent/shutdown_steps/base_shutdown_step.py +33 -0
- autobyteus-1.1.3/autobyteus/agent/shutdown_steps/llm_instance_cleanup_step.py +45 -0
- autobyteus-1.1.3/autobyteus/agent/shutdown_steps/mcp_server_cleanup_step.py +32 -0
- autobyteus-1.1.3/autobyteus/llm/api/deepseek_llm.py +26 -0
- autobyteus-1.1.3/autobyteus/llm/api/grok_llm.py +26 -0
- autobyteus-1.1.3/autobyteus/llm/api/kimi_llm.py +24 -0
- autobyteus-1.1.1/autobyteus/llm/api/deepseek_llm.py → autobyteus-1.1.3/autobyteus/llm/api/openai_compatible_llm.py +39 -34
- autobyteus-1.1.3/autobyteus/llm/api/openai_llm.py +26 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/llm_factory.py +62 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/providers.py +1 -0
- autobyteus-1.1.3/autobyteus/llm/token_counter/kimi_token_counter.py +24 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/token_counter/token_counter_factory.py +3 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/messages.py +3 -3
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/base_tool.py +2 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/__init__.py +10 -7
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/call_handlers/__init__.py +0 -2
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/config_service.py +1 -6
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/factory.py +12 -26
- autobyteus-1.1.3/autobyteus/tools/mcp/registrar.py +202 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/server/__init__.py +16 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/server/base_managed_mcp_server.py +139 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/server/http_managed_mcp_server.py +29 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/server/proxy.py +36 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/server/stdio_managed_mcp_server.py +33 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/server_instance_manager.py +93 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/tool.py +83 -0
- autobyteus-1.1.3/autobyteus/tools/mcp/tool_registrar.py +177 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/types.py +10 -21
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/registry/tool_definition.py +11 -2
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/registry/tool_registry.py +27 -28
- autobyteus-1.1.3/autobyteus/tools/usage/parsers/_json_extractor.py +99 -0
- autobyteus-1.1.3/autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py +75 -0
- autobyteus-1.1.3/autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py +126 -0
- autobyteus-1.1.3/autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py +58 -0
- autobyteus-1.1.3/autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py +146 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus.egg-info/PKG-INFO +4 -2
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus.egg-info/SOURCES.txt +17 -1
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus.egg-info/requires.txt +3 -1
- {autobyteus-1.1.1 → autobyteus-1.1.3}/setup.py +4 -2
- autobyteus-1.1.1/autobyteus/agent/llm_response_processor/provider_aware_tool_usage_processor.py +0 -54
- autobyteus-1.1.1/autobyteus/llm/api/grok_llm.py +0 -187
- autobyteus-1.1.1/autobyteus/llm/api/openai_llm.py +0 -154
- autobyteus-1.1.1/autobyteus/tools/mcp/call_handlers/sse_handler.py +0 -22
- autobyteus-1.1.1/autobyteus/tools/mcp/registrar.py +0 -323
- autobyteus-1.1.1/autobyteus/tools/mcp/tool.py +0 -101
- autobyteus-1.1.1/autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py +0 -106
- autobyteus-1.1.1/autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py +0 -136
- autobyteus-1.1.1/autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py +0 -66
- autobyteus-1.1.1/autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py +0 -196
- {autobyteus-1.1.1 → autobyteus-1.1.3}/LICENSE +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/README.md +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/agent.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/bootstrap_steps/agent_runtime_queue_initialization_step.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/bootstrap_steps/base_bootstrap_step.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/bootstrap_steps/system_prompt_processing_step.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/bootstrap_steps/workspace_context_initialization_step.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/context/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/context/agent_config.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/context/agent_context.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/context/agent_phase_manager.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/context/agent_runtime_state.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/context/phases.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/events/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/events/agent_events.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/events/agent_input_event_queue_manager.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/events/notifiers.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/events/worker_event_dispatcher.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/exceptions.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/factory/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/factory/agent_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/group/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/group/agent_group.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/group/agent_group_context.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/approved_tool_invocation_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/base_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/event_handler_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/generic_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/inter_agent_message_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/lifecycle_event_logger.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/llm_complete_response_received_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/llm_user_message_ready_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/tool_execution_approval_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/tool_invocation_request_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/tool_result_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/handlers/user_input_message_event_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/hooks/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/hooks/base_phase_hook.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/hooks/hook_definition.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/hooks/hook_meta.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/hooks/hook_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/base_user_input_processor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/content_prefixing_input_processor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/metadata_appending_input_processor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/passthrough_input_processor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/processor_definition.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/processor_meta.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/input_processor/processor_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/llm_response_processor/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/llm_response_processor/base_processor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/llm_response_processor/processor_definition.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/llm_response_processor/processor_meta.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/llm_response_processor/processor_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/message/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/message/agent_input_user_message.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/message/context_file.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/message/context_file_type.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/message/inter_agent_message.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/message/inter_agent_message_type.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/message/send_message_to.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/phases/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/phases/discover.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/phases/manager.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/phases/phase_enum.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/phases/transition_decorator.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/phases/transition_info.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/remote_agent.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/runtime/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/runtime/agent_thread_pool_manager.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/streaming/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/streaming/agent_event_stream.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/streaming/queue_streamer.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/streaming/stream_event_payloads.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/streaming/stream_events.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/system_prompt_processor/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/system_prompt_processor/base_processor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/system_prompt_processor/processor_definition.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/system_prompt_processor/processor_meta.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/system_prompt_processor/processor_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/system_prompt_processor/tool_manifest_injector_processor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/tool_invocation.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/utils/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/utils/wait_for_idle.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workflow/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workflow/agentic_workflow.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workflow/base_agentic_workflow.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workspace/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workspace/base_workspace.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workspace/workspace_config.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workspace/workspace_definition.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workspace/workspace_meta.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/workspace/workspace_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/check_requirements.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/cli/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/cli/agent_cli.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/cli/cli_display.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/events/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/events/event_emitter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/events/event_manager.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/events/event_types.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/autobyteus_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/bedrock_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/claude_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/gemini_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/groq_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/mistral_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/nvidia_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/api/ollama_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/autobyteus_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/base_llm.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/extensions/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/extensions/base_extension.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/extensions/extension_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/extensions/token_usage_tracking_extension.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/models.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/ollama_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/ollama_provider_resolver.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/token_counter/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/token_counter/base_token_counter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/token_counter/claude_token_counter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/token_counter/deepseek_token_counter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/token_counter/mistral_token_counter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/token_counter/openai_token_counter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/user_message.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/image_payload_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/llm_config.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/rate_limiter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/response_types.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/token_pricing_config.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/token_usage.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/llm/utils/token_usage_tracker.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/person/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/person/examples/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/person/examples/sample_persons.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/person/examples/sample_roles.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/person/person.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/person/role.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/prompt/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/prompt/prompt_builder.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/prompt/prompt_template.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/client/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/client/abstract_client_connection.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/client/client_connection_manager.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/client/sse_client_connection.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/client/stdio_client_connection.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/config/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/config/agent_server_config.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/config/agent_server_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/hosting.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/protocol.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/server/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/server/agent_server_endpoint.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/server/base_method_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/server/method_handlers.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/server/sse_server_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/server/stdio_server_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/server_main.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/rpc/transport_type.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/ask_user_input.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/bash/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/bash/bash_executor.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/browser_session_aware_navigate_to.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/browser_session_aware_tool.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/browser_session_aware_web_element_trigger.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/browser_session_aware_webpage_reader.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/browser_session_aware_webpage_screenshot_taker.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/factory/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/factory/browser_session_aware_web_element_trigger_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/factory/browser_session_aware_webpage_reader_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/factory/browser_session_aware_webpage_screenshot_taker_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/shared_browser_session.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/shared_browser_session_manager.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/session_aware/web_element_action.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/factory/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/factory/google_search_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/factory/webpage_reader_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/factory/webpage_screenshot_taker_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/google_search_ui.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/navigate_to.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/web_page_pdf_generator.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/webpage_image_downloader.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/webpage_reader.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/browser/standalone/webpage_screenshot_taker.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/factory/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/factory/tool_factory.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/file/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/file/file_reader.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/file/file_writer.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/functional_tool.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/handlers/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/handlers/shell_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/image_downloader.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/call_handlers/base_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/call_handlers/stdio_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/call_handlers/streamable_http_handler.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/mcp/schema_mapper.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/operation/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/operation/file_operation.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/operation/file_rename_operation.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/operation/operation.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/operation/shell_operation.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/parameter_schema.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/pdf_downloader.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/registry/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/timer.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/tool_category.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/tool_config.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/tool_meta.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/tool_state.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/anthropic_json_example_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/anthropic_json_schema_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/base_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/default_json_example_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/default_json_schema_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/default_xml_example_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/default_xml_schema_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/gemini_json_example_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/gemini_json_schema_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/google_json_example_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/google_json_schema_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/openai_json_example_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/formatters/openai_json_schema_formatter.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/parsers/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/parsers/anthropic_xml_tool_usage_parser.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/parsers/base_parser.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/parsers/exceptions.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/parsers/provider_aware_tool_usage_parser.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/json_example_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/json_schema_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/json_tool_usage_parser_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/tool_manifest_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/xml_example_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/xml_schema_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/providers/xml_tool_usage_parser_provider.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/registries/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/registries/json_example_formatter_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/registries/json_schema_formatter_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/registries/json_tool_usage_parser_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/registries/xml_example_formatter_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/registries/xml_schema_formatter_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/usage/registries/xml_tool_usage_parser_registry.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/tools/utils.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/utils/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/utils/dynamic_enum.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/utils/file_utils.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/utils/html_cleaner.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/utils/singleton.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/workflow/__init__.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/workflow/simple_task.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/workflow/task.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/workflow/workflow.py +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus.egg-info/dependency_links.txt +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus.egg-info/top_level.txt +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/pyproject.toml +0 -0
- {autobyteus-1.1.1 → autobyteus-1.1.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autobyteus
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Summary: Multi-Agent framework
|
|
5
5
|
Home-page: https://github.com/AutoByteus/autobyteus
|
|
6
6
|
Author: Ryan Zheng
|
|
@@ -26,12 +26,14 @@ Requires-Dist: botocore
|
|
|
26
26
|
Requires-Dist: anthropic==0.37.1
|
|
27
27
|
Requires-Dist: Jinja2
|
|
28
28
|
Requires-Dist: ollama
|
|
29
|
-
Requires-Dist: mistral_common
|
|
29
|
+
Requires-Dist: mistral_common==1.6.3
|
|
30
|
+
Requires-Dist: mistralai==1.5.2
|
|
30
31
|
Requires-Dist: certifi==2025.4.26
|
|
31
32
|
Requires-Dist: numpy==2.2.5
|
|
32
33
|
Requires-Dist: aiohttp
|
|
33
34
|
Requires-Dist: autobyteus-llm-client==1.1.1
|
|
34
35
|
Requires-Dist: brui-core==1.0.8
|
|
36
|
+
Requires-Dist: mcp[cli]==1.9.1
|
|
35
37
|
Provides-Extra: dev
|
|
36
38
|
Requires-Dist: coverage; extra == "dev"
|
|
37
39
|
Requires-Dist: flake8; extra == "dev"
|
|
@@ -9,6 +9,7 @@ from .agent_runtime_queue_initialization_step import AgentRuntimeQueueInitializa
|
|
|
9
9
|
from .workspace_context_initialization_step import WorkspaceContextInitializationStep
|
|
10
10
|
# ToolInitializationStep is no longer a bootstrap step.
|
|
11
11
|
from .system_prompt_processing_step import SystemPromptProcessingStep
|
|
12
|
+
from .mcp_server_prewarming_step import McpServerPrewarmingStep
|
|
12
13
|
# LLMConfigFinalizationStep and LLMInstanceCreationStep removed.
|
|
13
14
|
|
|
14
15
|
__all__ = [
|
|
@@ -16,4 +17,5 @@ __all__ = [
|
|
|
16
17
|
"AgentRuntimeQueueInitializationStep", # UPDATED
|
|
17
18
|
"WorkspaceContextInitializationStep",
|
|
18
19
|
"SystemPromptProcessingStep",
|
|
20
|
+
"McpServerPrewarmingStep",
|
|
19
21
|
]
|
{autobyteus-1.1.1 → autobyteus-1.1.3}/autobyteus/agent/bootstrap_steps/agent_bootstrapper.py
RENAMED
|
@@ -6,6 +6,7 @@ from .base_bootstrap_step import BaseBootstrapStep
|
|
|
6
6
|
from .agent_runtime_queue_initialization_step import AgentRuntimeQueueInitializationStep
|
|
7
7
|
from .workspace_context_initialization_step import WorkspaceContextInitializationStep
|
|
8
8
|
from .system_prompt_processing_step import SystemPromptProcessingStep
|
|
9
|
+
from .mcp_server_prewarming_step import McpServerPrewarmingStep
|
|
9
10
|
from autobyteus.agent.events import AgentReadyEvent
|
|
10
11
|
|
|
11
12
|
if TYPE_CHECKING:
|
|
@@ -31,6 +32,7 @@ class AgentBootstrapper:
|
|
|
31
32
|
self.bootstrap_steps: List[BaseBootstrapStep] = [
|
|
32
33
|
AgentRuntimeQueueInitializationStep(),
|
|
33
34
|
WorkspaceContextInitializationStep(),
|
|
35
|
+
McpServerPrewarmingStep(),
|
|
34
36
|
SystemPromptProcessingStep(),
|
|
35
37
|
]
|
|
36
38
|
logger.debug("AgentBootstrapper initialized with default steps.")
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/agent/bootstrap_steps/mcp_server_prewarming_step.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import TYPE_CHECKING, Set
|
|
4
|
+
|
|
5
|
+
from .base_bootstrap_step import BaseBootstrapStep
|
|
6
|
+
from autobyteus.tools.mcp.config_service import McpConfigService
|
|
7
|
+
from autobyteus.tools.mcp.server_instance_manager import McpServerInstanceManager
|
|
8
|
+
from autobyteus.tools.tool_category import ToolCategory
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from autobyteus.agent.context import AgentContext
|
|
12
|
+
from autobyteus.agent.phases import AgentPhaseManager
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
class McpServerPrewarmingStep(BaseBootstrapStep):
|
|
17
|
+
"""
|
|
18
|
+
Bootstrap step to eagerly start all MCP servers associated with an agent's tools.
|
|
19
|
+
This ensures servers are running and ready before the agent becomes idle.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self):
|
|
23
|
+
self._config_service = McpConfigService()
|
|
24
|
+
self._instance_manager = McpServerInstanceManager()
|
|
25
|
+
logger.debug("McpServerPrewarmingStep initialized.")
|
|
26
|
+
|
|
27
|
+
async def execute(self,
|
|
28
|
+
context: 'AgentContext',
|
|
29
|
+
phase_manager: 'AgentPhaseManager') -> bool:
|
|
30
|
+
agent_id = context.agent_id
|
|
31
|
+
logger.info(f"Agent '{agent_id}': Executing McpServerPrewarmingStep.")
|
|
32
|
+
|
|
33
|
+
# 1. Find all unique server IDs by inspecting tool definitions.
|
|
34
|
+
mcp_server_ids: Set[str] = set()
|
|
35
|
+
for tool in context.config.tools:
|
|
36
|
+
# This is the new, superior check. It relies on abstract metadata, not concrete types.
|
|
37
|
+
if tool.definition and tool.definition.category == ToolCategory.MCP:
|
|
38
|
+
# This is the new, superior way to get the server_id.
|
|
39
|
+
# It does not rely on private attributes of the tool instance.
|
|
40
|
+
server_id = tool.definition.metadata.get("mcp_server_id")
|
|
41
|
+
if server_id:
|
|
42
|
+
mcp_server_ids.add(server_id)
|
|
43
|
+
|
|
44
|
+
if not mcp_server_ids:
|
|
45
|
+
logger.debug(f"Agent '{agent_id}': No MCP tools found. Skipping MCP server pre-warming.")
|
|
46
|
+
return True
|
|
47
|
+
|
|
48
|
+
logger.info(f"Agent '{agent_id}': Found {len(mcp_server_ids)} unique MCP server IDs to pre-warm: {mcp_server_ids}")
|
|
49
|
+
|
|
50
|
+
# 2. For each server ID, unconditionally start its server instance for this agent.
|
|
51
|
+
for server_id in mcp_server_ids:
|
|
52
|
+
try:
|
|
53
|
+
config = self._config_service.get_config(server_id)
|
|
54
|
+
if not config:
|
|
55
|
+
logger.warning(f"Agent '{agent_id}': Could not find config for server_id '{server_id}' used by a tool. Cannot pre-warm.")
|
|
56
|
+
continue
|
|
57
|
+
|
|
58
|
+
logger.info(f"Agent '{agent_id}': Pre-warming MCP server '{server_id}'.")
|
|
59
|
+
# Get the instance for this agent, which creates it if it doesn't exist.
|
|
60
|
+
server_instance = self._instance_manager.get_server_instance(agent_id, server_id)
|
|
61
|
+
# Explicitly connect to start the server process.
|
|
62
|
+
await server_instance.connect()
|
|
63
|
+
logger.info(f"Agent '{agent_id}': Successfully connected to pre-warmed MCP server '{server_id}'.")
|
|
64
|
+
|
|
65
|
+
except Exception as e:
|
|
66
|
+
error_message = f"Agent '{agent_id}': Failed to pre-warm MCP server '{server_id}': {e}"
|
|
67
|
+
logger.error(error_message, exc_info=True)
|
|
68
|
+
# A failure to pre-warm a server is a critical bootstrap failure.
|
|
69
|
+
return False
|
|
70
|
+
|
|
71
|
+
return True
|
autobyteus-1.1.3/autobyteus/agent/llm_response_processor/provider_aware_tool_usage_processor.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/agent/llm_response_processor/provider_aware_tool_usage_processor.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import TYPE_CHECKING, List
|
|
4
|
+
|
|
5
|
+
from .base_processor import BaseLLMResponseProcessor
|
|
6
|
+
from autobyteus.agent.events import PendingToolInvocationEvent
|
|
7
|
+
from autobyteus.agent.tool_invocation import ToolInvocation
|
|
8
|
+
from autobyteus.tools.usage.parsers import ProviderAwareToolUsageParser
|
|
9
|
+
from autobyteus.tools.usage.parsers.exceptions import ToolUsageParseException
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from autobyteus.agent.context import AgentContext
|
|
13
|
+
from autobyteus.agent.events import LLMCompleteResponseReceivedEvent
|
|
14
|
+
from autobyteus.llm.utils.response_types import CompleteResponse
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
class ProviderAwareToolUsageProcessor(BaseLLMResponseProcessor):
|
|
19
|
+
"""
|
|
20
|
+
A "master" tool usage processor that uses a high-level parser from the
|
|
21
|
+
`tools` module to extract tool invocations. It then ensures each invocation
|
|
22
|
+
has a session-unique ID before enqueuing the necessary agent events.
|
|
23
|
+
"""
|
|
24
|
+
INVOCATION_COUNTS_KEY = "agent_tool_invocation_counts"
|
|
25
|
+
|
|
26
|
+
def __init__(self):
|
|
27
|
+
self._parser = ProviderAwareToolUsageParser()
|
|
28
|
+
logger.debug("ProviderAwareToolUsageProcessor initialized.")
|
|
29
|
+
|
|
30
|
+
async def process_response(self, response: 'CompleteResponse', context: 'AgentContext', triggering_event: 'LLMCompleteResponseReceivedEvent') -> bool:
|
|
31
|
+
"""
|
|
32
|
+
Uses a ProviderAwareToolUsageParser to get tool invocations, makes their
|
|
33
|
+
IDs unique within the agent's session, and then enqueues a
|
|
34
|
+
PendingToolInvocationEvent for each one.
|
|
35
|
+
Propagates ToolUsageParseException if parsing fails.
|
|
36
|
+
"""
|
|
37
|
+
try:
|
|
38
|
+
# Delegate parsing to the high-level parser
|
|
39
|
+
tool_invocations = self._parser.parse(response, context)
|
|
40
|
+
except ToolUsageParseException:
|
|
41
|
+
# Re-raise the exception to be caught by the event handler
|
|
42
|
+
raise
|
|
43
|
+
|
|
44
|
+
if not tool_invocations:
|
|
45
|
+
return False
|
|
46
|
+
|
|
47
|
+
# --- NEW LOGIC FOR UNIQUE ID GENERATION ---
|
|
48
|
+
|
|
49
|
+
# Ensure the counter map exists in the agent's state's custom data
|
|
50
|
+
if self.INVOCATION_COUNTS_KEY not in context.custom_data:
|
|
51
|
+
context.custom_data[self.INVOCATION_COUNTS_KEY] = {}
|
|
52
|
+
|
|
53
|
+
invocation_counts = context.custom_data[self.INVOCATION_COUNTS_KEY]
|
|
54
|
+
|
|
55
|
+
processed_invocations: List[ToolInvocation] = []
|
|
56
|
+
|
|
57
|
+
for invocation in tool_invocations:
|
|
58
|
+
base_id = invocation.id
|
|
59
|
+
|
|
60
|
+
# Get the current count for this base ID, default to 0
|
|
61
|
+
count = invocation_counts.get(base_id, 0)
|
|
62
|
+
|
|
63
|
+
# Create the new session-unique ID
|
|
64
|
+
unique_id = f"{base_id}_{count}"
|
|
65
|
+
|
|
66
|
+
# Update the invocation's ID in-place
|
|
67
|
+
invocation.id = unique_id
|
|
68
|
+
|
|
69
|
+
# Increment the counter for the next time this base ID is seen
|
|
70
|
+
invocation_counts[base_id] = count + 1
|
|
71
|
+
|
|
72
|
+
processed_invocations.append(invocation)
|
|
73
|
+
|
|
74
|
+
# --- END NEW LOGIC ---
|
|
75
|
+
|
|
76
|
+
logger.info(f"Agent '{context.agent_id}': Parsed {len(processed_invocations)} tool invocations. Enqueuing events with unique IDs.")
|
|
77
|
+
for invocation in processed_invocations:
|
|
78
|
+
logger.info(f"Agent '{context.agent_id}' ({self.get_name()}) identified tool invocation: {invocation.name} with unique ID {invocation.id}. Enqueuing event.")
|
|
79
|
+
await context.input_event_queues.enqueue_tool_invocation_request(
|
|
80
|
+
PendingToolInvocationEvent(tool_invocation=invocation)
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return True
|
|
@@ -120,10 +120,7 @@ class AgentRuntime:
|
|
|
120
120
|
await self.phase_manager.notify_shutdown_initiated()
|
|
121
121
|
await self._worker.stop(timeout=timeout)
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
cleanup_func = self.context.llm_instance.cleanup
|
|
125
|
-
if asyncio.iscoroutinefunction(cleanup_func): await cleanup_func()
|
|
126
|
-
else: cleanup_func()
|
|
123
|
+
# LLM instance cleanup is now handled by the AgentWorker before its loop closes.
|
|
127
124
|
|
|
128
125
|
await self.phase_manager.notify_final_shutdown_complete()
|
|
129
126
|
logger.info(f"AgentRuntime for '{agent_id}' stop() method completed.")
|
|
@@ -15,6 +15,7 @@ from autobyteus.agent.events import (
|
|
|
15
15
|
from autobyteus.agent.events import WorkerEventDispatcher
|
|
16
16
|
from autobyteus.agent.runtime.agent_thread_pool_manager import AgentThreadPoolManager
|
|
17
17
|
from autobyteus.agent.bootstrap_steps.agent_bootstrapper import AgentBootstrapper
|
|
18
|
+
from autobyteus.agent.shutdown_steps import AgentShutdownOrchestrator
|
|
18
19
|
|
|
19
20
|
if TYPE_CHECKING:
|
|
20
21
|
from autobyteus.agent.context import AgentContext
|
|
@@ -140,19 +141,19 @@ class AgentWorker:
|
|
|
140
141
|
|
|
141
142
|
async def async_run(self) -> None:
|
|
142
143
|
agent_id = self.context.agent_id
|
|
143
|
-
logger.info(f"AgentWorker '{agent_id}' async_run(): Starting.")
|
|
144
|
-
|
|
145
|
-
# --- Direct Initialization ---
|
|
146
|
-
initialization_successful = await self._initialize()
|
|
147
|
-
if not initialization_successful:
|
|
148
|
-
logger.critical(f"AgentWorker '{agent_id}' failed to initialize. Worker is shutting down.")
|
|
149
|
-
if self._async_stop_event and not self._async_stop_event.is_set():
|
|
150
|
-
self._async_stop_event.set()
|
|
151
|
-
return
|
|
152
|
-
|
|
153
|
-
# --- Main Event Loop ---
|
|
154
|
-
logger.info(f"AgentWorker '{agent_id}' initialized successfully. Entering main event loop.")
|
|
155
144
|
try:
|
|
145
|
+
logger.info(f"AgentWorker '{agent_id}' async_run(): Starting.")
|
|
146
|
+
|
|
147
|
+
# --- Direct Initialization ---
|
|
148
|
+
initialization_successful = await self._initialize()
|
|
149
|
+
if not initialization_successful:
|
|
150
|
+
logger.critical(f"AgentWorker '{agent_id}' failed to initialize. Worker is shutting down.")
|
|
151
|
+
if self._async_stop_event and not self._async_stop_event.is_set():
|
|
152
|
+
self._async_stop_event.set()
|
|
153
|
+
return
|
|
154
|
+
|
|
155
|
+
# --- Main Event Loop ---
|
|
156
|
+
logger.info(f"AgentWorker '{agent_id}' initialized successfully. Entering main event loop.")
|
|
156
157
|
while not self._async_stop_event.is_set():
|
|
157
158
|
try:
|
|
158
159
|
queue_event_tuple = await asyncio.wait_for(
|
|
@@ -176,25 +177,57 @@ class AgentWorker:
|
|
|
176
177
|
logger.error(f"Fatal error in AgentWorker '{agent_id}' async_run() loop: {e}", exc_info=True)
|
|
177
178
|
finally:
|
|
178
179
|
logger.info(f"AgentWorker '{agent_id}' async_run() loop has finished.")
|
|
180
|
+
# --- Shutdown sequence moved here, inside the original task's finally block ---
|
|
181
|
+
logger.info(f"AgentWorker '{agent_id}': Running shutdown sequence on worker loop.")
|
|
182
|
+
orchestrator = AgentShutdownOrchestrator()
|
|
183
|
+
cleanup_successful = await orchestrator.run(self.context)
|
|
184
|
+
|
|
185
|
+
if not cleanup_successful:
|
|
186
|
+
logger.critical(f"AgentWorker '{agent_id}': Shutdown resource cleanup failed. The agent may not have shut down cleanly.")
|
|
187
|
+
else:
|
|
188
|
+
logger.info(f"AgentWorker '{agent_id}': Shutdown resource cleanup completed successfully.")
|
|
189
|
+
logger.info(f"AgentWorker '{agent_id}': Shutdown sequence completed.")
|
|
179
190
|
|
|
180
|
-
async def _signal_internal_stop(self):
|
|
181
|
-
if self._async_stop_event and not self._async_stop_event.is_set():
|
|
182
|
-
self._async_stop_event.set()
|
|
183
|
-
if self.context.state.input_event_queues:
|
|
184
|
-
await self.context.state.input_event_queues.enqueue_internal_system_event(AgentStoppedEvent())
|
|
185
191
|
|
|
186
192
|
async def stop(self, timeout: float = 10.0) -> None:
|
|
193
|
+
"""
|
|
194
|
+
Gracefully stops the worker by signaling its event loop to terminate,
|
|
195
|
+
then waiting for the thread to complete its cleanup and exit.
|
|
196
|
+
"""
|
|
187
197
|
if not self._is_active or self._stop_initiated:
|
|
188
198
|
return
|
|
199
|
+
|
|
200
|
+
agent_id = self.context.agent_id
|
|
201
|
+
logger.info(f"AgentWorker '{agent_id}': Stop requested.")
|
|
189
202
|
self._stop_initiated = True
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
203
|
+
|
|
204
|
+
# Schedule a coroutine on the worker's loop to set the stop event.
|
|
205
|
+
if self.get_worker_loop():
|
|
206
|
+
def _coro_factory():
|
|
207
|
+
async def _signal_coro():
|
|
208
|
+
if self._async_stop_event and not self._async_stop_event.is_set():
|
|
209
|
+
self._async_stop_event.set()
|
|
210
|
+
if self.context.state.input_event_queues:
|
|
211
|
+
await self.context.state.input_event_queues.enqueue_internal_system_event(AgentStoppedEvent())
|
|
212
|
+
return _signal_coro()
|
|
213
|
+
|
|
214
|
+
future = self.schedule_coroutine_on_worker_loop(_coro_factory)
|
|
215
|
+
try:
|
|
216
|
+
# Wait for the signal to be processed.
|
|
217
|
+
future.result(timeout=max(1.0, timeout-1))
|
|
218
|
+
except Exception as e:
|
|
219
|
+
logger.error(f"AgentWorker '{agent_id}': Error signaling stop event: {e}", exc_info=True)
|
|
220
|
+
|
|
221
|
+
# Wait for the main thread future to complete.
|
|
194
222
|
if self._thread_future:
|
|
195
|
-
try:
|
|
196
|
-
|
|
223
|
+
try:
|
|
224
|
+
await asyncio.wait_for(asyncio.wrap_future(self._thread_future), timeout=timeout)
|
|
225
|
+
logger.info(f"AgentWorker '{agent_id}': Worker thread has terminated.")
|
|
226
|
+
except asyncio.TimeoutError:
|
|
227
|
+
logger.warning(f"AgentWorker '{agent_id}': Timeout waiting for worker thread to terminate.")
|
|
228
|
+
|
|
197
229
|
self._is_active = False
|
|
198
230
|
|
|
231
|
+
|
|
199
232
|
def is_alive(self) -> bool:
|
|
200
233
|
return self._thread_future is not None and not self._thread_future.done()
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/agent/shutdown_steps/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
Defines individual, self-contained steps for the agent shutdown process.
|
|
4
|
+
These steps are orchestrated by the AgentShutdownOrchestrator.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .base_shutdown_step import BaseShutdownStep
|
|
8
|
+
from .llm_instance_cleanup_step import LLMInstanceCleanupStep
|
|
9
|
+
from .mcp_server_cleanup_step import McpServerCleanupStep
|
|
10
|
+
from .agent_shutdown_orchestrator import AgentShutdownOrchestrator
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"BaseShutdownStep",
|
|
14
|
+
"LLMInstanceCleanupStep",
|
|
15
|
+
"McpServerCleanupStep",
|
|
16
|
+
"AgentShutdownOrchestrator",
|
|
17
|
+
]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/agent/shutdown_steps/agent_shutdown_orchestrator.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
4
|
+
|
|
5
|
+
from .base_shutdown_step import BaseShutdownStep
|
|
6
|
+
from .llm_instance_cleanup_step import LLMInstanceCleanupStep
|
|
7
|
+
from .mcp_server_cleanup_step import McpServerCleanupStep
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from autobyteus.agent.context import AgentContext
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
class AgentShutdownOrchestrator:
|
|
15
|
+
"""
|
|
16
|
+
Orchestrates the agent's shutdown process by executing a sequence of
|
|
17
|
+
self-contained cleanup steps.
|
|
18
|
+
"""
|
|
19
|
+
def __init__(self, steps: Optional[List[BaseShutdownStep]] = None):
|
|
20
|
+
"""
|
|
21
|
+
Initializes the AgentShutdownOrchestrator.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
steps: An optional list of shutdown steps to execute. If not provided,
|
|
25
|
+
a default sequence will be used.
|
|
26
|
+
"""
|
|
27
|
+
if steps is None:
|
|
28
|
+
self.shutdown_steps: List[BaseShutdownStep] = [
|
|
29
|
+
LLMInstanceCleanupStep(),
|
|
30
|
+
McpServerCleanupStep(),
|
|
31
|
+
]
|
|
32
|
+
logger.debug("AgentShutdownOrchestrator initialized with default steps.")
|
|
33
|
+
else:
|
|
34
|
+
self.shutdown_steps = steps
|
|
35
|
+
logger.debug(f"AgentShutdownOrchestrator initialized with {len(steps)} custom steps.")
|
|
36
|
+
|
|
37
|
+
async def run(self, context: 'AgentContext') -> bool:
|
|
38
|
+
"""
|
|
39
|
+
Executes the configured sequence of shutdown steps.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
context: The agent's context.
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
True if all steps completed successfully, False otherwise.
|
|
46
|
+
"""
|
|
47
|
+
agent_id = context.agent_id
|
|
48
|
+
logger.info(f"Agent '{agent_id}': AgentShutdownOrchestrator starting execution.")
|
|
49
|
+
|
|
50
|
+
for step_index, step_instance in enumerate(self.shutdown_steps):
|
|
51
|
+
step_name = step_instance.__class__.__name__
|
|
52
|
+
logger.debug(f"Agent '{agent_id}': Executing shutdown step {step_index + 1}/{len(self.shutdown_steps)}: {step_name}")
|
|
53
|
+
|
|
54
|
+
success = await step_instance.execute(context)
|
|
55
|
+
|
|
56
|
+
if not success:
|
|
57
|
+
error_message = f"Shutdown step {step_name} failed."
|
|
58
|
+
logger.error(f"Agent '{agent_id}': {error_message} Halting shutdown orchestration.")
|
|
59
|
+
# The step itself is responsible for detailed error logging.
|
|
60
|
+
return False
|
|
61
|
+
|
|
62
|
+
logger.info(f"Agent '{agent_id}': All shutdown steps completed successfully.")
|
|
63
|
+
return True
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/agent/shutdown_steps/base_shutdown_step.py
|
|
2
|
+
import logging
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from autobyteus.agent.context import AgentContext
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
class BaseShutdownStep(ABC):
|
|
12
|
+
"""
|
|
13
|
+
Abstract base class for individual steps in the agent shutdown process.
|
|
14
|
+
Each step is responsible for a specific part of the cleanup and
|
|
15
|
+
for reporting its success or failure.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
async def execute(self, context: 'AgentContext') -> bool:
|
|
20
|
+
"""
|
|
21
|
+
Executes the shutdown step.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
context: The agent's context, providing access to state and resources.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
True if the step completed successfully, False otherwise.
|
|
28
|
+
If False, the step is expected to have handled its own detailed logging.
|
|
29
|
+
"""
|
|
30
|
+
raise NotImplementedError("Subclasses must implement the 'execute' method.")
|
|
31
|
+
|
|
32
|
+
def __repr__(self) -> str:
|
|
33
|
+
return f"<{self.__class__.__name__}>"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/agent/shutdown_steps/llm_instance_cleanup_step.py
|
|
2
|
+
import asyncio
|
|
3
|
+
import logging
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from .base_shutdown_step import BaseShutdownStep
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from autobyteus.agent.context import AgentContext
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
|
|
13
|
+
class LLMInstanceCleanupStep(BaseShutdownStep):
|
|
14
|
+
"""
|
|
15
|
+
Shutdown step for cleaning up the agent's LLM instance.
|
|
16
|
+
"""
|
|
17
|
+
def __init__(self):
|
|
18
|
+
logger.debug("LLMInstanceCleanupStep initialized.")
|
|
19
|
+
|
|
20
|
+
async def execute(self, context: 'AgentContext') -> bool:
|
|
21
|
+
agent_id = context.agent_id
|
|
22
|
+
logger.info(f"Agent '{agent_id}': Executing LLMInstanceCleanupStep.")
|
|
23
|
+
|
|
24
|
+
llm_instance = context.llm_instance
|
|
25
|
+
if not llm_instance:
|
|
26
|
+
logger.debug(f"Agent '{agent_id}': No LLM instance found in context. Skipping cleanup.")
|
|
27
|
+
return True
|
|
28
|
+
|
|
29
|
+
if hasattr(llm_instance, 'cleanup') and callable(getattr(llm_instance, 'cleanup')):
|
|
30
|
+
try:
|
|
31
|
+
logger.info(f"Agent '{agent_id}': Running LLM instance cleanup for '{llm_instance.__class__.__name__}'.")
|
|
32
|
+
cleanup_func = llm_instance.cleanup
|
|
33
|
+
if asyncio.iscoroutinefunction(cleanup_func):
|
|
34
|
+
await cleanup_func()
|
|
35
|
+
else:
|
|
36
|
+
cleanup_func()
|
|
37
|
+
logger.info(f"Agent '{agent_id}': LLM instance cleanup completed successfully.")
|
|
38
|
+
return True
|
|
39
|
+
except Exception as e:
|
|
40
|
+
error_message = f"Agent '{agent_id}': Error during LLM instance cleanup: {e}"
|
|
41
|
+
logger.error(error_message, exc_info=True)
|
|
42
|
+
return False
|
|
43
|
+
else:
|
|
44
|
+
logger.debug(f"Agent '{agent_id}': LLM instance of type '{llm_instance.__class__.__name__}' does not have a 'cleanup' method. Skipping.")
|
|
45
|
+
return True
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# file: autobyteus/autobyteus/agent/shutdown_steps/mcp_server_cleanup_step.py
|
|
2
|
+
import logging
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from .base_shutdown_step import BaseShutdownStep
|
|
6
|
+
from autobyteus.tools.mcp.server_instance_manager import McpServerInstanceManager
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from autobyteus.agent.context import AgentContext
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
|
|
13
|
+
class McpServerCleanupStep(BaseShutdownStep):
|
|
14
|
+
"""
|
|
15
|
+
Shutdown step for cleaning up all MCP server instances associated with an agent.
|
|
16
|
+
"""
|
|
17
|
+
def __init__(self):
|
|
18
|
+
self._instance_manager = McpServerInstanceManager()
|
|
19
|
+
logger.debug("McpServerCleanupStep initialized.")
|
|
20
|
+
|
|
21
|
+
async def execute(self, context: 'AgentContext') -> bool:
|
|
22
|
+
agent_id = context.agent_id
|
|
23
|
+
logger.info(f"Agent '{agent_id}': Executing McpServerCleanupStep.")
|
|
24
|
+
|
|
25
|
+
try:
|
|
26
|
+
await self._instance_manager.cleanup_mcp_server_instances_for_agent(agent_id)
|
|
27
|
+
logger.info(f"Agent '{agent_id}': MCP server instance cleanup completed successfully.")
|
|
28
|
+
return True
|
|
29
|
+
except Exception as e:
|
|
30
|
+
error_message = f"Agent '{agent_id}': Critical failure during McpServerCleanupStep: {e}"
|
|
31
|
+
logger.error(error_message, exc_info=True)
|
|
32
|
+
return False
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from autobyteus.llm.models import LLMModel
|
|
4
|
+
from autobyteus.llm.utils.llm_config import LLMConfig
|
|
5
|
+
from autobyteus.llm.api.openai_compatible_llm import OpenAICompatibleLLM
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
class DeepSeekLLM(OpenAICompatibleLLM):
|
|
10
|
+
def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
|
|
11
|
+
# Provide defaults if not specified
|
|
12
|
+
if model is None:
|
|
13
|
+
model = LLMModel['deepseek-chat']
|
|
14
|
+
if llm_config is None:
|
|
15
|
+
llm_config = LLMConfig()
|
|
16
|
+
|
|
17
|
+
super().__init__(
|
|
18
|
+
model=model,
|
|
19
|
+
llm_config=llm_config,
|
|
20
|
+
api_key_env_var="DEEPSEEK_API_KEY",
|
|
21
|
+
base_url="https://api.deepseek.com"
|
|
22
|
+
)
|
|
23
|
+
logger.info(f"DeepSeekLLM initialized with model: {self.model}")
|
|
24
|
+
|
|
25
|
+
async def cleanup(self):
|
|
26
|
+
await super().cleanup()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from autobyteus.llm.models import LLMModel
|
|
4
|
+
from autobyteus.llm.utils.llm_config import LLMConfig
|
|
5
|
+
from autobyteus.llm.api.openai_compatible_llm import OpenAICompatibleLLM
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
class GrokLLM(OpenAICompatibleLLM):
|
|
10
|
+
def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
|
|
11
|
+
# Provide defaults if not specified
|
|
12
|
+
if model is None:
|
|
13
|
+
model = LLMModel['grok-2-1212']
|
|
14
|
+
if llm_config is None:
|
|
15
|
+
llm_config = LLMConfig()
|
|
16
|
+
|
|
17
|
+
super().__init__(
|
|
18
|
+
model=model,
|
|
19
|
+
llm_config=llm_config,
|
|
20
|
+
api_key_env_var="GROK_API_KEY",
|
|
21
|
+
base_url="https://api.x.ai/v1"
|
|
22
|
+
)
|
|
23
|
+
logger.info(f"GrokLLM initialized with model: {self.model}")
|
|
24
|
+
|
|
25
|
+
async def cleanup(self):
|
|
26
|
+
await super().cleanup()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from autobyteus.llm.models import LLMModel
|
|
4
|
+
from autobyteus.llm.utils.llm_config import LLMConfig
|
|
5
|
+
from autobyteus.llm.api.openai_compatible_llm import OpenAICompatibleLLM
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
class KimiLLM(OpenAICompatibleLLM):
|
|
10
|
+
def __init__(self, model: LLMModel = None, llm_config: LLMConfig = None):
|
|
11
|
+
# Provide defaults if not specified
|
|
12
|
+
if model is None:
|
|
13
|
+
# Setting a default Kimi model from the factory ones
|
|
14
|
+
model = LLMModel['kimi-latest']
|
|
15
|
+
if llm_config is None:
|
|
16
|
+
llm_config = LLMConfig()
|
|
17
|
+
|
|
18
|
+
super().__init__(
|
|
19
|
+
model=model,
|
|
20
|
+
llm_config=llm_config,
|
|
21
|
+
api_key_env_var="KIMI_API_KEY",
|
|
22
|
+
base_url="https://api.moonshot.cn/v1"
|
|
23
|
+
)
|
|
24
|
+
logger.info(f"KimiLLM initialized with model: {self.model}")
|