autobyteus 1.1.8__py3-none-any.whl → 1.2.0__py3-none-any.whl

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.
Files changed (127) hide show
  1. autobyteus/agent/bootstrap_steps/system_prompt_processing_step.py +6 -2
  2. autobyteus/agent/handlers/inter_agent_message_event_handler.py +17 -19
  3. autobyteus/agent/handlers/llm_complete_response_received_event_handler.py +6 -3
  4. autobyteus/agent/handlers/tool_result_event_handler.py +61 -18
  5. autobyteus/agent/handlers/user_input_message_event_handler.py +19 -10
  6. autobyteus/agent/hooks/base_phase_hook.py +17 -0
  7. autobyteus/agent/hooks/hook_registry.py +15 -27
  8. autobyteus/agent/input_processor/base_user_input_processor.py +17 -1
  9. autobyteus/agent/input_processor/processor_registry.py +15 -27
  10. autobyteus/agent/llm_response_processor/base_processor.py +17 -1
  11. autobyteus/agent/llm_response_processor/processor_registry.py +15 -24
  12. autobyteus/agent/llm_response_processor/provider_aware_tool_usage_processor.py +14 -0
  13. autobyteus/agent/message/agent_input_user_message.py +15 -2
  14. autobyteus/agent/message/send_message_to.py +1 -1
  15. autobyteus/agent/processor_option.py +17 -0
  16. autobyteus/agent/sender_type.py +1 -0
  17. autobyteus/agent/system_prompt_processor/base_processor.py +17 -1
  18. autobyteus/agent/system_prompt_processor/processor_registry.py +15 -27
  19. autobyteus/agent/system_prompt_processor/tool_manifest_injector_processor.py +10 -0
  20. autobyteus/agent/tool_execution_result_processor/base_processor.py +17 -1
  21. autobyteus/agent/tool_execution_result_processor/processor_registry.py +15 -1
  22. autobyteus/agent/workspace/base_workspace.py +1 -1
  23. autobyteus/agent/workspace/workspace_definition.py +1 -1
  24. autobyteus/agent_team/bootstrap_steps/team_context_initialization_step.py +1 -1
  25. autobyteus/agent_team/streaming/agent_team_stream_event_payloads.py +2 -2
  26. autobyteus/agent_team/task_notification/__init__.py +4 -0
  27. autobyteus/agent_team/task_notification/activation_policy.py +70 -0
  28. autobyteus/agent_team/task_notification/system_event_driven_agent_task_notifier.py +56 -122
  29. autobyteus/agent_team/task_notification/task_activator.py +66 -0
  30. autobyteus/cli/agent_team_tui/state.py +17 -20
  31. autobyteus/cli/agent_team_tui/widgets/focus_pane.py +1 -1
  32. autobyteus/cli/agent_team_tui/widgets/task_board_panel.py +1 -1
  33. autobyteus/clients/__init__.py +10 -0
  34. autobyteus/clients/autobyteus_client.py +318 -0
  35. autobyteus/clients/cert_utils.py +105 -0
  36. autobyteus/clients/certificates/cert.pem +34 -0
  37. autobyteus/events/event_types.py +2 -2
  38. autobyteus/llm/api/autobyteus_llm.py +1 -1
  39. autobyteus/llm/api/gemini_llm.py +45 -54
  40. autobyteus/llm/api/qwen_llm.py +25 -0
  41. autobyteus/llm/api/zhipu_llm.py +26 -0
  42. autobyteus/llm/autobyteus_provider.py +9 -3
  43. autobyteus/llm/llm_factory.py +39 -0
  44. autobyteus/llm/ollama_provider_resolver.py +1 -0
  45. autobyteus/llm/providers.py +1 -0
  46. autobyteus/llm/token_counter/token_counter_factory.py +3 -0
  47. autobyteus/llm/token_counter/zhipu_token_counter.py +24 -0
  48. autobyteus/multimedia/audio/api/autobyteus_audio_client.py +5 -2
  49. autobyteus/multimedia/audio/api/gemini_audio_client.py +84 -153
  50. autobyteus/multimedia/audio/audio_client_factory.py +47 -22
  51. autobyteus/multimedia/audio/audio_model.py +13 -6
  52. autobyteus/multimedia/audio/autobyteus_audio_provider.py +9 -3
  53. autobyteus/multimedia/audio/base_audio_client.py +3 -1
  54. autobyteus/multimedia/image/api/autobyteus_image_client.py +13 -6
  55. autobyteus/multimedia/image/api/gemini_image_client.py +72 -130
  56. autobyteus/multimedia/image/api/openai_image_client.py +4 -2
  57. autobyteus/multimedia/image/autobyteus_image_provider.py +9 -3
  58. autobyteus/multimedia/image/base_image_client.py +6 -2
  59. autobyteus/multimedia/image/image_client_factory.py +20 -19
  60. autobyteus/multimedia/image/image_model.py +13 -6
  61. autobyteus/multimedia/providers.py +1 -0
  62. autobyteus/task_management/__init__.py +10 -10
  63. autobyteus/task_management/base_task_board.py +14 -6
  64. autobyteus/task_management/converters/__init__.py +0 -2
  65. autobyteus/task_management/converters/task_board_converter.py +7 -16
  66. autobyteus/task_management/events.py +6 -6
  67. autobyteus/task_management/in_memory_task_board.py +48 -38
  68. autobyteus/task_management/schemas/__init__.py +2 -2
  69. autobyteus/task_management/schemas/{plan_definition.py → task_definition.py} +6 -7
  70. autobyteus/task_management/schemas/task_status_report.py +1 -2
  71. autobyteus/task_management/task.py +60 -0
  72. autobyteus/task_management/tools/__init__.py +6 -2
  73. autobyteus/task_management/tools/assign_task_to.py +125 -0
  74. autobyteus/task_management/tools/get_my_tasks.py +80 -0
  75. autobyteus/task_management/tools/get_task_board_status.py +3 -3
  76. autobyteus/task_management/tools/publish_task.py +77 -0
  77. autobyteus/task_management/tools/publish_tasks.py +74 -0
  78. autobyteus/task_management/tools/update_task_status.py +5 -5
  79. autobyteus/tools/__init__.py +54 -16
  80. autobyteus/tools/base_tool.py +4 -4
  81. autobyteus/tools/browser/session_aware/browser_session_aware_navigate_to.py +1 -1
  82. autobyteus/tools/browser/session_aware/browser_session_aware_web_element_trigger.py +1 -1
  83. autobyteus/tools/browser/session_aware/browser_session_aware_webpage_reader.py +1 -1
  84. autobyteus/tools/browser/session_aware/browser_session_aware_webpage_screenshot_taker.py +1 -1
  85. autobyteus/tools/browser/standalone/navigate_to.py +1 -1
  86. autobyteus/tools/browser/standalone/web_page_pdf_generator.py +1 -1
  87. autobyteus/tools/browser/standalone/webpage_image_downloader.py +1 -1
  88. autobyteus/tools/browser/standalone/webpage_reader.py +1 -1
  89. autobyteus/tools/browser/standalone/webpage_screenshot_taker.py +1 -1
  90. autobyteus/tools/download_media_tool.py +136 -0
  91. autobyteus/tools/file/file_editor.py +200 -0
  92. autobyteus/tools/functional_tool.py +1 -1
  93. autobyteus/tools/google_search.py +1 -1
  94. autobyteus/tools/mcp/factory.py +1 -1
  95. autobyteus/tools/mcp/schema_mapper.py +1 -1
  96. autobyteus/tools/mcp/tool.py +1 -1
  97. autobyteus/tools/multimedia/__init__.py +2 -0
  98. autobyteus/tools/multimedia/audio_tools.py +10 -20
  99. autobyteus/tools/multimedia/image_tools.py +21 -22
  100. autobyteus/tools/multimedia/media_reader_tool.py +117 -0
  101. autobyteus/tools/pydantic_schema_converter.py +1 -1
  102. autobyteus/tools/registry/tool_definition.py +1 -1
  103. autobyteus/tools/timer.py +1 -1
  104. autobyteus/tools/tool_meta.py +1 -1
  105. autobyteus/tools/usage/formatters/default_json_example_formatter.py +1 -1
  106. autobyteus/tools/usage/formatters/default_xml_example_formatter.py +1 -1
  107. autobyteus/tools/usage/formatters/default_xml_schema_formatter.py +59 -3
  108. autobyteus/tools/usage/formatters/gemini_json_example_formatter.py +1 -1
  109. autobyteus/tools/usage/formatters/google_json_example_formatter.py +1 -1
  110. autobyteus/tools/usage/formatters/openai_json_example_formatter.py +1 -1
  111. autobyteus/tools/usage/parsers/_string_decoders.py +18 -0
  112. autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py +9 -1
  113. autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py +15 -1
  114. autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py +4 -1
  115. autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py +4 -1
  116. autobyteus/{tools → utils}/parameter_schema.py +1 -1
  117. {autobyteus-1.1.8.dist-info → autobyteus-1.2.0.dist-info}/METADATA +4 -3
  118. {autobyteus-1.1.8.dist-info → autobyteus-1.2.0.dist-info}/RECORD +122 -108
  119. examples/run_poem_writer.py +1 -1
  120. autobyteus/task_management/converters/task_plan_converter.py +0 -48
  121. autobyteus/task_management/task_plan.py +0 -110
  122. autobyteus/task_management/tools/publish_task_plan.py +0 -101
  123. autobyteus/tools/image_downloader.py +0 -99
  124. autobyteus/tools/pdf_downloader.py +0 -89
  125. {autobyteus-1.1.8.dist-info → autobyteus-1.2.0.dist-info}/WHEEL +0 -0
  126. {autobyteus-1.1.8.dist-info → autobyteus-1.2.0.dist-info}/licenses/LICENSE +0 -0
  127. {autobyteus-1.1.8.dist-info → autobyteus-1.2.0.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,8 @@
1
1
  # file: autobyteus/autobyteus/tools/usage/formatters/default_xml_schema_formatter.py
2
2
  import xml.sax.saxutils
3
- from typing import TYPE_CHECKING, List
3
+ from typing import TYPE_CHECKING, List, Dict
4
4
 
5
- from autobyteus.tools.parameter_schema import ParameterType, ParameterDefinition, ParameterSchema
5
+ from autobyteus.utils.parameter_schema import ParameterType, ParameterDefinition, ParameterSchema
6
6
  from .base_formatter import BaseSchemaFormatter
7
7
 
8
8
  if TYPE_CHECKING:
@@ -30,6 +30,49 @@ class DefaultXmlSchemaFormatter(BaseSchemaFormatter):
30
30
  xml_parts.append("</tool>")
31
31
  return "\n".join(xml_parts)
32
32
 
33
+ def _json_schema_props_to_param_defs(self, schema_dict: Dict) -> List[ParameterDefinition]:
34
+ """
35
+ Converts a JSON schema's 'properties' dictionary into a list of ParameterDefinition objects.
36
+ This is used to bridge raw JSON schemas with the internal formatting logic.
37
+ """
38
+ param_defs = []
39
+ properties = schema_dict.get("properties", {})
40
+ required_fields = schema_dict.get("required", [])
41
+
42
+ for prop_name, prop_schema in properties.items():
43
+ if not isinstance(prop_schema, dict):
44
+ continue
45
+
46
+ param_type_str = prop_schema.get("type", "string").upper()
47
+ param_type = getattr(ParameterType, param_type_str, ParameterType.STRING)
48
+
49
+ # JSON Schema uses 'enum' key for enumerations
50
+ allowed_values = prop_schema.get("enum")
51
+ if param_type == ParameterType.STRING and allowed_values:
52
+ param_type = ParameterType.ENUM
53
+
54
+ object_schema = None
55
+ if param_type == ParameterType.OBJECT and "properties" in prop_schema:
56
+ # Recursively build a ParameterSchema for nested objects
57
+ nested_param_defs = self._json_schema_props_to_param_defs(prop_schema)
58
+ object_schema = ParameterSchema(parameters=nested_param_defs)
59
+
60
+ array_item_schema = None
61
+ if param_type == ParameterType.ARRAY and "items" in prop_schema:
62
+ # Pass the nested schema down; it will be handled by the next recursive call
63
+ array_item_schema = prop_schema["items"]
64
+
65
+ param_defs.append(ParameterDefinition(
66
+ name=prop_name,
67
+ param_type=param_type,
68
+ description=prop_schema.get("description", ""),
69
+ required=(prop_name in required_fields),
70
+ enum_values=allowed_values,
71
+ object_schema=object_schema,
72
+ array_item_schema=array_item_schema
73
+ ))
74
+ return param_defs
75
+
33
76
  def _format_params_recursively(self, params: List[ParameterDefinition], indent_level: int) -> List[str]:
34
77
  """Recursively formats parameter definitions into XML strings."""
35
78
  xml_lines = []
@@ -61,13 +104,26 @@ class DefaultXmlSchemaFormatter(BaseSchemaFormatter):
61
104
  elif is_array:
62
105
  xml_lines.append(f'{indent}<arg {" ".join(attrs)}>')
63
106
  if isinstance(param.array_item_schema, ParameterSchema):
64
- # Array of objects
107
+ # Array of objects defined with our internal ParameterSchema
65
108
  xml_lines.append(f'{indent} <items type="object">')
66
109
  xml_lines.extend(self._format_params_recursively(param.array_item_schema.parameters, indent_level + 2))
67
110
  xml_lines.append(f'{indent} </items>')
68
111
  elif isinstance(param.array_item_schema, ParameterType):
69
112
  # Array of primitives
70
113
  xml_lines.append(f'{indent} <items type="{param.array_item_schema.value}" />')
114
+ elif isinstance(param.array_item_schema, dict):
115
+ # FIX: Handle array of objects defined with a raw JSON schema dict
116
+ item_schema_dict = param.array_item_schema
117
+ item_type = item_schema_dict.get("type", "string")
118
+
119
+ xml_lines.append(f'{indent} <items type="{item_type}">')
120
+
121
+ if item_type == "object":
122
+ # Convert the JSON schema properties to our internal ParameterDefinition list
123
+ param_defs = self._json_schema_props_to_param_defs(item_schema_dict)
124
+ xml_lines.extend(self._format_params_recursively(param_defs, indent_level + 2))
125
+
126
+ xml_lines.append(f'{indent} </items>')
71
127
  xml_lines.append(f'{indent}</arg>')
72
128
  else:
73
129
  # This is a simple/primitive type or a generic array
@@ -2,7 +2,7 @@
2
2
  import json
3
3
  from typing import Dict, Any, TYPE_CHECKING, Optional
4
4
 
5
- from autobyteus.tools.parameter_schema import ParameterSchema, ParameterDefinition
5
+ from autobyteus.utils.parameter_schema import ParameterSchema, ParameterDefinition
6
6
  from .base_formatter import BaseExampleFormatter
7
7
  from .default_json_example_formatter import DefaultJsonExampleFormatter # Import for reuse
8
8
 
@@ -2,7 +2,7 @@
2
2
  import json
3
3
  from typing import Dict, Any, TYPE_CHECKING, Optional
4
4
 
5
- from autobyteus.tools.parameter_schema import ParameterSchema, ParameterDefinition
5
+ from autobyteus.utils.parameter_schema import ParameterSchema, ParameterDefinition
6
6
  from .base_formatter import BaseExampleFormatter
7
7
  # Import for reuse of the intelligent example generation logic
8
8
  from .default_json_example_formatter import DefaultJsonExampleFormatter
@@ -2,7 +2,7 @@
2
2
  import json
3
3
  from typing import Dict, Any, TYPE_CHECKING, Optional
4
4
 
5
- from autobyteus.tools.parameter_schema import ParameterSchema, ParameterDefinition
5
+ from autobyteus.utils.parameter_schema import ParameterSchema, ParameterDefinition
6
6
  from .base_formatter import BaseExampleFormatter
7
7
  from .default_json_example_formatter import DefaultJsonExampleFormatter # Import for reuse
8
8
 
@@ -0,0 +1,18 @@
1
+ # file: autobyteus/autobyteus/tools/usage/parsers/_string_decoders.py
2
+ """Utility helpers for normalizing string content inside parsed tool payloads."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import html
7
+ from typing import Any
8
+
9
+
10
+ def decode_html_entities(data: Any) -> Any:
11
+ """Recursively decode HTML/XML entities in strings within a data structure."""
12
+ if isinstance(data, dict):
13
+ return {key: decode_html_entities(value) for key, value in data.items()}
14
+ if isinstance(data, list):
15
+ return [decode_html_entities(item) for item in data]
16
+ if isinstance(data, str):
17
+ return html.unescape(data)
18
+ return data
@@ -3,6 +3,8 @@ import json
3
3
  import logging
4
4
  from typing import Dict, Any, TYPE_CHECKING, List
5
5
 
6
+ from ._string_decoders import decode_html_entities
7
+
6
8
  from autobyteus.agent.tool_invocation import ToolInvocation
7
9
  from .base_parser import BaseToolUsageParser
8
10
  from .exceptions import ToolUsageParseException
@@ -53,9 +55,15 @@ class DefaultJsonToolUsageParser(BaseToolUsageParser):
53
55
  logger.debug(f"Skipping tool block with invalid 'parameters' type ({type(arguments)}): {tool_block}")
54
56
  continue
55
57
 
58
+ decoded_arguments = decode_html_entities(arguments)
59
+ decoded_tool_name = decode_html_entities(tool_name)
56
60
  try:
57
61
  # Pass id=None to trigger deterministic ID generation.
58
- tool_invocation = ToolInvocation(name=tool_name, arguments=arguments, id=None)
62
+ tool_invocation = ToolInvocation(
63
+ name=decoded_tool_name,
64
+ arguments=decoded_arguments,
65
+ id=None,
66
+ )
59
67
  invocations.append(tool_invocation)
60
68
  logger.info(f"Successfully parsed default JSON tool invocation for '{tool_name}'.")
61
69
  except Exception as e:
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  import re
3
+ import html
3
4
  from typing import TYPE_CHECKING, Dict, Any, List
4
5
  from dataclasses import dataclass, field
5
6
 
@@ -124,6 +125,7 @@ class _XmlArgumentsParser:
124
125
 
125
126
  final_args = context.stack[0]
126
127
  self._cleanup_internal_keys(final_args)
128
+ final_args = self._decode_entities_inplace(final_args)
127
129
  return final_args
128
130
 
129
131
  def process_tag(self, tag_content: str, context: '_ParsingContext'):
@@ -213,6 +215,19 @@ class _XmlArgumentsParser:
213
215
  for item in data:
214
216
  self._cleanup_internal_keys(item)
215
217
 
218
+ def _decode_entities_inplace(self, data: Any):
219
+ if isinstance(data, dict):
220
+ for key, value in list(data.items()):
221
+ data[key] = self._decode_entities_inplace(value)
222
+ return data
223
+ if isinstance(data, list):
224
+ for index, item in enumerate(data):
225
+ data[index] = self._decode_entities_inplace(item)
226
+ return data
227
+ if isinstance(data, str):
228
+ return html.unescape(data)
229
+ return data
230
+
216
231
 
217
232
  # --- Main Parser Class ---
218
233
 
@@ -299,4 +314,3 @@ class DefaultXmlToolUsageParser(BaseToolUsageParser):
299
314
  """
300
315
  parser = _XmlArgumentsParser(xml_string)
301
316
  return parser.parse()
302
-
@@ -7,6 +7,7 @@ from autobyteus.agent.tool_invocation import ToolInvocation
7
7
  from .base_parser import BaseToolUsageParser
8
8
  from .exceptions import ToolUsageParseException
9
9
  from ._json_extractor import _find_json_blobs
10
+ from ._string_decoders import decode_html_entities
10
11
 
11
12
  if TYPE_CHECKING:
12
13
  from autobyteus.llm.utils.response_types import CompleteResponse
@@ -55,8 +56,10 @@ class GeminiJsonToolUsageParser(BaseToolUsageParser):
55
56
  arguments = call_data.get("args")
56
57
 
57
58
  if tool_name and isinstance(tool_name, str) and isinstance(arguments, dict):
59
+ decoded_tool_name = decode_html_entities(tool_name)
60
+ decoded_arguments = decode_html_entities(arguments)
58
61
  # Pass id=None to trigger deterministic ID generation in ToolInvocation
59
- tool_invocation = ToolInvocation(name=tool_name, arguments=arguments)
62
+ tool_invocation = ToolInvocation(name=decoded_tool_name, arguments=decoded_arguments)
60
63
  invocations.append(tool_invocation)
61
64
  logger.info(f"Successfully parsed Gemini JSON tool invocation for '{tool_name}'.")
62
65
  else:
@@ -7,6 +7,7 @@ from autobyteus.agent.tool_invocation import ToolInvocation
7
7
  from .base_parser import BaseToolUsageParser
8
8
  from .exceptions import ToolUsageParseException
9
9
  from ._json_extractor import _find_json_blobs
10
+ from ._string_decoders import decode_html_entities
10
11
 
11
12
  if TYPE_CHECKING:
12
13
  from autobyteus.llm.utils.response_types import CompleteResponse
@@ -138,7 +139,9 @@ class OpenAiJsonToolUsageParser(BaseToolUsageParser):
138
139
 
139
140
  try:
140
141
  # The ToolInvocation constructor will generate a deterministic ID if 'id' is None.
141
- tool_invocation = ToolInvocation(name=tool_name, arguments=arguments, id=None)
142
+ decoded_tool_name = decode_html_entities(tool_name)
143
+ decoded_arguments = decode_html_entities(arguments)
144
+ tool_invocation = ToolInvocation(name=decoded_tool_name, arguments=decoded_arguments, id=None)
142
145
  logger.info(f"Successfully parsed OpenAI-style JSON tool invocation for '{tool_name}'.")
143
146
  return tool_invocation
144
147
  except Exception as e:
@@ -1,4 +1,4 @@
1
- # file: autobyteus/autobyteus/tools/parameter_schema.py
1
+ # file: autobyteus/autobyteus/utils/parameter_schema.py
2
2
  from __future__ import annotations
3
3
  import logging
4
4
  from typing import Dict, Any, List, Optional, Union, Type
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: autobyteus
3
- Version: 1.1.8
3
+ Version: 1.2.0
4
4
  Summary: Multi-Agent framework
5
5
  Home-page: https://github.com/AutoByteus/autobyteus
6
6
  Author: Ryan Zheng
@@ -16,14 +16,15 @@ Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
17
  Requires-Dist: aiohttp
18
18
  Requires-Dist: anthropic
19
- Requires-Dist: autobyteus-llm-client==1.1.3
20
19
  Requires-Dist: beautifulsoup4
21
20
  Requires-Dist: boto3
22
21
  Requires-Dist: botocore
23
22
  Requires-Dist: brui-core==1.0.9
24
23
  Requires-Dist: certifi==2025.4.26
24
+ Requires-Dist: cryptography
25
25
  Requires-Dist: google-api-python-client
26
- Requires-Dist: google-generativeai
26
+ Requires-Dist: google-genai==1.38.0
27
+ Requires-Dist: httpx
27
28
  Requires-Dist: Jinja2
28
29
  Requires-Dist: mcp[cli]
29
30
  Requires-Dist: mistral_common