aiecs 2.1.2__tar.gz → 2.2.0__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.
Files changed (363) hide show
  1. {aiecs-2.1.2/aiecs.egg-info → aiecs-2.2.0}/PKG-INFO +1 -1
  2. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/__init__.py +1 -1
  3. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/base_agent.py +169 -3
  4. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/hybrid_agent.py +220 -160
  5. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/retry_policy.py +50 -6
  6. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/llm_agent.py +98 -71
  7. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tool_agent.py +401 -334
  8. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tool_loop_core.py +2 -0
  9. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/base_client.py +2 -0
  10. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/google_function_calling_mixin.py +26 -15
  11. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/openai_client.py +99 -6
  12. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/openrouter_client.py +2 -0
  13. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/vertex_client.py +34 -331
  14. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/xai_client.py +2 -0
  15. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/main.py +2 -2
  16. {aiecs-2.1.2 → aiecs-2.2.0/aiecs.egg-info}/PKG-INFO +1 -1
  17. {aiecs-2.1.2 → aiecs-2.2.0}/pyproject.toml +2 -2
  18. {aiecs-2.1.2 → aiecs-2.2.0}/LICENSE +0 -0
  19. {aiecs-2.1.2 → aiecs-2.2.0}/LICENSE_HEADER.txt +0 -0
  20. {aiecs-2.1.2 → aiecs-2.2.0}/MANIFEST.in +0 -0
  21. {aiecs-2.1.2 → aiecs-2.2.0}/README.md +0 -0
  22. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/__main__.py +0 -0
  23. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/aiecs_client.py +0 -0
  24. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/application/__init__.py +0 -0
  25. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/application/executors/__init__.py +0 -0
  26. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/application/executors/operation_executor.py +0 -0
  27. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/common/__init__.py +0 -0
  28. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/__init__.py +0 -0
  29. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/config.py +0 -0
  30. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/skills_config.py +0 -0
  31. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/config/tool_config.py +0 -0
  32. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/__init__.py +0 -0
  33. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/interface/__init__.py +0 -0
  34. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/interface/execution_interface.py +0 -0
  35. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/interface/storage_interface.py +0 -0
  36. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/registry/__init__.py +0 -0
  37. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/core/registry/service_registry.py +0 -0
  38. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/__init__.py +0 -0
  39. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/__init__.py +0 -0
  40. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/exceptions.py +0 -0
  41. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/goal_graph.py +0 -0
  42. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/__init__.py +0 -0
  43. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/context_compressor.py +0 -0
  44. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/context_engine_adapter.py +0 -0
  45. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/protocols.py +0 -0
  46. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/integration/role_config.py +0 -0
  47. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/lifecycle.py +0 -0
  48. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/loop_detection.py +0 -0
  49. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/memory/__init__.py +0 -0
  50. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/memory/conversation.py +0 -0
  51. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/migration/__init__.py +0 -0
  52. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/migration/conversion.py +0 -0
  53. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/migration/legacy_wrapper.py +0 -0
  54. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/models.py +0 -0
  55. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/observability.py +0 -0
  56. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/persistence.py +0 -0
  57. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/__init__.py +0 -0
  58. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/base.py +0 -0
  59. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/__init__.py +0 -0
  60. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/collaboration_plugin.py +0 -0
  61. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/dawp_plugin.py +0 -0
  62. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/hook_plugin.py +0 -0
  63. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/knowledge_plugin.py +0 -0
  64. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/memory_plugin.py +0 -0
  65. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/skill_plugin.py +0 -0
  66. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/temporal_memory_plugin.py +0 -0
  67. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/tool_plugin.py +0 -0
  68. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/tools/__init__.py +0 -0
  69. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/builtin/tools/dawp_start_tool.py +0 -0
  70. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/context.py +0 -0
  71. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/__init__.py +0 -0
  72. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/budget.py +0 -0
  73. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/completion.py +0 -0
  74. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/document_loader.py +0 -0
  75. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/document_path_policy.py +0 -0
  76. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/enqueue_guard.py +0 -0
  77. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/inject.py +0 -0
  78. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/loop_scope.py +0 -0
  79. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/metrics.py +0 -0
  80. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/prompt_chain_runner.py +0 -0
  81. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/run_scheduler.py +0 -0
  82. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/schema.py +0 -0
  83. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/step_handlers.py +0 -0
  84. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/step_handoff.py +0 -0
  85. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/stream_consumer.py +0 -0
  86. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/suppress.py +0 -0
  87. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/temp_store.py +0 -0
  88. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/temporal_memory_context.py +0 -0
  89. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/tools_filter.py +0 -0
  90. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/dawp/workflow_registry.py +0 -0
  91. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/defaults.py +0 -0
  92. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/errors.py +0 -0
  93. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/__init__.py +0 -0
  94. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/bridge_compression.py +0 -0
  95. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/dispatch.py +0 -0
  96. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/events.py +0 -0
  97. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/executor.py +0 -0
  98. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/gvr_blocking.py +0 -0
  99. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/loader.py +0 -0
  100. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/notifications.py +0 -0
  101. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/payload.py +0 -0
  102. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/permission.py +0 -0
  103. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/prompt_client.py +0 -0
  104. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/registry.py +0 -0
  105. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/schemas.py +0 -0
  106. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/task_boundary.py +0 -0
  107. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/tool_dispatch.py +0 -0
  108. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/hooks/types.py +0 -0
  109. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/identifier.py +0 -0
  110. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/manager.py +0 -0
  111. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/manifest_loader.py +0 -0
  112. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/models.py +0 -0
  113. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/protocols.py +0 -0
  114. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/registry.py +0 -0
  115. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/__init__.py +0 -0
  116. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/dependency.py +0 -0
  117. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/manifest.py +0 -0
  118. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/schema/validation.py +0 -0
  119. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/__init__.py +0 -0
  120. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/capture.py +0 -0
  121. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/normalize.py +0 -0
  122. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/plugins/testing/parity.py +0 -0
  123. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/__init__.py +0 -0
  124. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/builder.py +0 -0
  125. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/formatters.py +0 -0
  126. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/prompts/template.py +0 -0
  127. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/registry.py +0 -0
  128. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/search_burst_guard.py +0 -0
  129. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/__init__.py +0 -0
  130. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/__init__.py +0 -0
  131. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/api-integration/examples/api-client-example.py +0 -0
  132. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/data-analysis/examples/analysis-example.py +0 -0
  133. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/data-analysis/scripts/validate-data.py +0 -0
  134. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/builtin/python-coding/examples/code-patterns.py +0 -0
  135. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/context.py +0 -0
  136. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/discovery.py +0 -0
  137. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/executor.py +0 -0
  138. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/loader.py +0 -0
  139. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/matcher.py +0 -0
  140. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/mixin.py +0 -0
  141. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/models.py +0 -0
  142. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/registry.py +0 -0
  143. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/skills/validator.py +0 -0
  144. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tool_result_matcher.py +0 -0
  145. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/__init__.py +0 -0
  146. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/models.py +0 -0
  147. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/registry.py +0 -0
  148. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/tools/schema_generator.py +0 -0
  149. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/__init__.py +0 -0
  150. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/context_builder.py +0 -0
  151. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/criteria.py +0 -0
  152. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/cwe_verifier.py +0 -0
  153. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/cwe_verifier_policy_models.py +0 -0
  154. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/dawp_result.py +0 -0
  155. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/__init__.py +0 -0
  156. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/citation_url_gate.py +0 -0
  157. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/conversion.py +0 -0
  158. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/gate_criterion.py +0 -0
  159. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/models.py +0 -0
  160. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/protocol.py +0 -0
  161. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/registry.py +0 -0
  162. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gates/spec_gate.py +0 -0
  163. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/gvr_checkpoints.py +0 -0
  164. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/models.py +0 -0
  165. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/peer_review.py +0 -0
  166. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/peer_review_policy_models.py +0 -0
  167. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/policy_models.py +0 -0
  168. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/policy_runner.py +0 -0
  169. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/read_only_verifier.py +0 -0
  170. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/review_refinement.py +0 -0
  171. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/agent/verification/verifier.py +0 -0
  172. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/__init__.py +0 -0
  173. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/agent_adapter.py +0 -0
  174. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/analytics.py +0 -0
  175. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/collaborative_workflow.py +0 -0
  176. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/communication_hub.py +0 -0
  177. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/community_builder.py +0 -0
  178. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/community_integration.py +0 -0
  179. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/community_manager.py +0 -0
  180. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/decision_engine.py +0 -0
  181. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/exceptions.py +0 -0
  182. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/models/__init__.py +0 -0
  183. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/models/community_models.py +0 -0
  184. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/resource_manager.py +0 -0
  185. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/community/shared_context_manager.py +0 -0
  186. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/__init__.py +0 -0
  187. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/__init__.py +0 -0
  188. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/adapters/__init__.py +0 -0
  189. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/adapters/conversation_message.py +0 -0
  190. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/adapters/llm_message.py +0 -0
  191. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/collapse.py +0 -0
  192. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/constants.py +0 -0
  193. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/gvr_preserve.py +0 -0
  194. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/hooks.py +0 -0
  195. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/images.py +0 -0
  196. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/legacy.py +0 -0
  197. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/llm_compact.py +0 -0
  198. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/metadata.py +0 -0
  199. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/microcompact.py +0 -0
  200. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/orchestrator.py +0 -0
  201. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/pairs.py +0 -0
  202. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/policy.py +0 -0
  203. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/policy_resolver.py +0 -0
  204. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/progress.py +0 -0
  205. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/ptl.py +0 -0
  206. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/result.py +0 -0
  207. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/session_memory.py +0 -0
  208. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/state.py +0 -0
  209. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/tokens.py +0 -0
  210. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/tool_budget.py +0 -0
  211. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/truncation.py +0 -0
  212. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/compression/types.py +0 -0
  213. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/context_engine.py +0 -0
  214. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/context/conversation_models.py +0 -0
  215. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/execution/__init__.py +0 -0
  216. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/execution/model.py +0 -0
  217. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/memory/__init__.py +0 -0
  218. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/memory/models.py +0 -0
  219. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/memory/unified_retriever.py +0 -0
  220. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/__init__.py +0 -0
  221. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/dsl_processor.py +0 -0
  222. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/model.py +0 -0
  223. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/task/task_context.py +0 -0
  224. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/__init__.py +0 -0
  225. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/constants.py +0 -0
  226. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/engine.py +0 -0
  227. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/episode_bridge.py +0 -0
  228. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/group_id.py +0 -0
  229. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/models/__init__.py +0 -0
  230. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/models/episode.py +0 -0
  231. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/models/fact.py +0 -0
  232. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/pii.py +0 -0
  233. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/ports.py +0 -0
  234. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/domain/temporal_memory/search_cache.py +0 -0
  235. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/__init__.py +0 -0
  236. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/__init__.py +0 -0
  237. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/config.py +0 -0
  238. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/l2_mc_adapter.py +0 -0
  239. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/progress_bridge.py +0 -0
  240. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/s3_tool_artifact_port.py +0 -0
  241. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/compression/transcript_compact.py +0 -0
  242. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/hooks/__init__.py +0 -0
  243. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/host/hooks/sse_bridge.py +0 -0
  244. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/__init__.py +0 -0
  245. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/__init__.py +0 -0
  246. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/graph_store_factory.py +0 -0
  247. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/graph_store_protocol.py +0 -0
  248. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/knowledge/noop_graph_store.py +0 -0
  249. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/messaging/__init__.py +0 -0
  250. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/messaging/celery_task_manager.py +0 -0
  251. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/messaging/websocket_manager.py +0 -0
  252. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/__init__.py +0 -0
  253. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/executor_metrics.py +0 -0
  254. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/global_metrics_manager.py +0 -0
  255. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/structured_logger.py +0 -0
  256. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/monitoring/tracing_manager.py +0 -0
  257. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/__init__.py +0 -0
  258. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/clickhouse_client.py +0 -0
  259. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/clickhouse_permanent_backend.py +0 -0
  260. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/context_engine_client.py +0 -0
  261. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/database_manager.py +0 -0
  262. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/file_storage.py +0 -0
  263. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/permanent_backend_factory.py +0 -0
  264. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/permanent_backend_utils.py +0 -0
  265. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/postgres_permanent_backend.py +0 -0
  266. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/persistence/redis_client.py +0 -0
  267. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/__init__.py +0 -0
  268. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/__init__.py +0 -0
  269. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/llm_adapter.py +0 -0
  270. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/search_filters.py +0 -0
  271. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/graphiti/store.py +0 -0
  272. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/ingest_queue.py +0 -0
  273. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/metrics.py +0 -0
  274. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/noop_store.py +0 -0
  275. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/postgres/__init__.py +0 -0
  276. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/postgres/store.py +0 -0
  277. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/infrastructure/temporal_memory/store_factory.py +0 -0
  278. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/__init__.py +0 -0
  279. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/callbacks/__init__.py +0 -0
  280. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/callbacks/custom_callbacks.py +0 -0
  281. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/client_factory.py +0 -0
  282. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/client_resolver.py +0 -0
  283. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/__init__.py +0 -0
  284. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/anthropic_client.py +0 -0
  285. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/googleai_client.py +0 -0
  286. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/openai_compatible_mixin.py +0 -0
  287. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/schemas.py +0 -0
  288. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/clients/vertex_maas_client.py +0 -0
  289. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/__init__.py +0 -0
  290. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/config_loader.py +0 -0
  291. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/config_validator.py +0 -0
  292. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/config/model_config.py +0 -0
  293. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/protocols.py +0 -0
  294. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/__init__.py +0 -0
  295. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/gcp_credentials.py +0 -0
  296. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/image_utils.py +0 -0
  297. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/llm/utils/validate_config.py +0 -0
  298. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/__init__.py +0 -0
  299. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/VERSION_MANAGEMENT.md +0 -0
  300. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/__init__.py +0 -0
  301. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/module_checker.py +0 -0
  302. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/aid/version_manager.py +0 -0
  303. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/__init__.py +0 -0
  304. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/README_WEASEL_PATCH.md +0 -0
  305. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/__init__.py +0 -0
  306. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.py +0 -0
  307. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.sh +0 -0
  308. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/patch_weasel_library.sh +0 -0
  309. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/dependance_patch/fix_weasel/run_weasel_patch.sh +0 -0
  310. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/scripts/migrations/multi_tenancy/README.md +0 -0
  311. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tasks/__init__.py +0 -0
  312. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tasks/worker.py +0 -0
  313. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/__init__.py +0 -0
  314. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/_builtin_tool_deprecation.py +0 -0
  315. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/base_tool.py +0 -0
  316. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/schema_generator.py +0 -0
  317. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/__init__.py +0 -0
  318. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/analyzers.py +0 -0
  319. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/__init__.py +0 -0
  320. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/_resilience_factory.py +0 -0
  321. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/async_bridge.py +0 -0
  322. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/credentials.py +0 -0
  323. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/gemini_grounding.py +0 -0
  324. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/google_cse.py +0 -0
  325. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/grok_grounding.py +0 -0
  326. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/protocol.py +0 -0
  327. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/backends/registry.py +0 -0
  328. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/cache.py +0 -0
  329. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/cache_fingerprint.py +0 -0
  330. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/constants.py +0 -0
  331. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/context.py +0 -0
  332. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/core.py +0 -0
  333. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/deduplicator.py +0 -0
  334. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/error_handler.py +0 -0
  335. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/errors.py +0 -0
  336. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/metrics.py +0 -0
  337. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/normalizer.py +0 -0
  338. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/partition.py +0 -0
  339. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/rate_limiter.py +0 -0
  340. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/resilience.py +0 -0
  341. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/router.py +0 -0
  342. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/search_tool/schemas.py +0 -0
  343. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/task_tools/__init__.py +0 -0
  344. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/task_tools/image_tool.py +0 -0
  345. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/temp_file_manager.py +0 -0
  346. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/tool_executor/__init__.py +0 -0
  347. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/tools/tool_executor/tool_executor.py +0 -0
  348. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/LLM_output_structor.py +0 -0
  349. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/__init__.py +0 -0
  350. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/base_callback.py +0 -0
  351. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/cache_provider.py +0 -0
  352. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/execution_utils.py +0 -0
  353. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/logging.py +0 -0
  354. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/prompt_loader.py +0 -0
  355. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/utils/token_usage_repository.py +0 -0
  356. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/ws/__init__.py +0 -0
  357. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs/ws/socket_server.py +0 -0
  358. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/SOURCES.txt +0 -0
  359. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/dependency_links.txt +0 -0
  360. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/entry_points.txt +0 -0
  361. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/requires.txt +0 -0
  362. {aiecs-2.1.2 → aiecs-2.2.0}/aiecs.egg-info/top_level.txt +0 -0
  363. {aiecs-2.1.2 → aiecs-2.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiecs
3
- Version: 2.1.2
3
+ Version: 2.2.0
4
4
  Summary: AI Execute Services - A middleware framework for AI-powered task execution and tool orchestration
5
5
  Author-email: AIECS Team <iretbl@gmail.com>
6
6
  License-Expression: MIT
@@ -9,7 +9,7 @@ A powerful Python middleware framework for building AI-powered applications
9
9
  with tool orchestration, task execution, and multi-provider LLM support.
10
10
  """
11
11
 
12
- __version__ = "2.1.2"
12
+ __version__ = "2.2.0"
13
13
  __author__ = "AIECS Team"
14
14
  __email__ = "iretbl@gmail.com"
15
15
 
@@ -910,6 +910,23 @@ class BaseAIAgent(SkillCapableMixin, ABC):
910
910
 
911
911
  logger.info(f"Agent {self.agent_id} state: {self._previous_state.value} → {new_state.value}")
912
912
 
913
+ def _require_ready_for_task(self) -> None:
914
+ """Refuse work when initialize() failed and the agent is still ERROR."""
915
+ if self._state == AgentState.ERROR:
916
+ raise TaskExecutionError(
917
+ "Agent is not ready: initialization failed or agent is in ERROR state",
918
+ agent_id=self.agent_id,
919
+ )
920
+
921
+ def _release_task(self, entered_busy: bool) -> None:
922
+ """Return BUSY (or this task's ERROR) to ACTIVE and clear the current task id."""
923
+ if not entered_busy or self._state == AgentState.STOPPED:
924
+ return
925
+ self._current_task_id = None
926
+ if self._state in (AgentState.BUSY, AgentState.ERROR):
927
+ self._transition_state(AgentState.ACTIVE)
928
+ self.last_active_at = datetime.utcnow()
929
+
913
930
  # ==================== Lifecycle Methods ====================
914
931
 
915
932
  async def initialize(self) -> None:
@@ -1538,6 +1555,133 @@ class BaseAIAgent(SkillCapableMixin, ABC):
1538
1555
  # Execute with retry
1539
1556
  return await retry_policy.execute_with_retry(func, *args, **kwargs)
1540
1557
 
1558
+ def _resolved_llm_client(self) -> Optional["LLMClientProtocol"]:
1559
+ return getattr(self, "llm_client", None) or self._llm_client
1560
+
1561
+ def _agent_retry_policy(self):
1562
+ from .integration.retry_policy import EnhancedRetryPolicy
1563
+
1564
+ retry_config = self._config.retry_policy
1565
+ return EnhancedRetryPolicy(
1566
+ max_retries=retry_config.max_retries,
1567
+ base_delay=retry_config.base_delay,
1568
+ max_delay=retry_config.max_delay,
1569
+ exponential_base=retry_config.exponential_factor,
1570
+ jitter_factor=retry_config.jitter_factor,
1571
+ )
1572
+
1573
+ def _build_llm_call_kwargs(
1574
+ self,
1575
+ messages: List[Any],
1576
+ context: Dict[str, Any],
1577
+ extra: Optional[Dict[str, Any]] = None,
1578
+ ) -> Dict[str, Any]:
1579
+ kwargs: Dict[str, Any] = dict(
1580
+ messages=messages,
1581
+ model=self._config.llm_model,
1582
+ temperature=self._config.temperature,
1583
+ max_tokens=self._config.max_tokens,
1584
+ context=context,
1585
+ )
1586
+ kwargs.update(self._config.get_llm_call_kwargs())
1587
+ if extra:
1588
+ kwargs.update(extra)
1589
+ return kwargs
1590
+
1591
+ async def _call_llm(
1592
+ self,
1593
+ messages: List[Any],
1594
+ context: Dict[str, Any],
1595
+ **extra: Any,
1596
+ ) -> Any:
1597
+ """One generate_text call. Agent retries only when the client does not."""
1598
+ client = self._resolved_llm_client()
1599
+ if client is None:
1600
+ raise TaskExecutionError("LLM client is not configured", agent_id=self.agent_id)
1601
+
1602
+ kwargs = self._build_llm_call_kwargs(messages, context, extra)
1603
+
1604
+ async def _once() -> Any:
1605
+ return await client.generate_text(**kwargs)
1606
+
1607
+ if getattr(client, "retries_generate_text", False):
1608
+ return await _once()
1609
+ return await self._agent_retry_policy().execute_with_retry(_once)
1610
+
1611
+ async def _stream_llm(
1612
+ self,
1613
+ messages: List[Any],
1614
+ context: Dict[str, Any],
1615
+ **extra: Any,
1616
+ ) -> AsyncGenerator[Any, None]:
1617
+ """Read stream_text. Retry only before any chunk is handed to the caller."""
1618
+ from .integration.retry_policy import ErrorClassifier
1619
+
1620
+ client = self._resolved_llm_client()
1621
+ if client is None:
1622
+ raise TaskExecutionError("LLM client is not configured", agent_id=self.agent_id)
1623
+
1624
+ kwargs = self._build_llm_call_kwargs(messages, context, extra)
1625
+ kwargs["return_chunks"] = True
1626
+ policy = self._agent_retry_policy()
1627
+ last_error: Optional[Exception] = None
1628
+
1629
+ for attempt in range(policy.max_retries + 1):
1630
+ handed_off = False
1631
+ stream_gen = client.stream_text(**kwargs)
1632
+ try:
1633
+ async for chunk in stream_gen:
1634
+ handed_off = True
1635
+ yield chunk
1636
+ return
1637
+ except Exception as exc:
1638
+ last_error = exc
1639
+ if handed_off:
1640
+ raise
1641
+ error_type = ErrorClassifier.classify(exc)
1642
+ if attempt >= policy.max_retries or not ErrorClassifier.is_retryable(error_type):
1643
+ raise
1644
+ delay = policy.calculate_delay(attempt, error_type)
1645
+ logger.warning(f"Agent {self.agent_id} stream attempt {attempt + 1} failed " f"({error_type.value}). Retrying in {delay:.2f}s...")
1646
+ aclose = getattr(stream_gen, "aclose", None)
1647
+ if callable(aclose):
1648
+ await aclose()
1649
+ await asyncio.sleep(delay)
1650
+
1651
+ if last_error is None:
1652
+ raise RuntimeError("Stream retry failed but no error was captured")
1653
+ raise last_error
1654
+
1655
+ async def _iter_user_stream_tokens(
1656
+ self,
1657
+ task: Dict[str, Any],
1658
+ context: Dict[str, Any],
1659
+ ) -> AsyncGenerator[str, None]:
1660
+ """Forward tokens from execute_task_streaming; raise on error; yield result body once if no tokens."""
1661
+ yielded_token = False
1662
+ result_output: Optional[Any] = None
1663
+ error_message: Optional[str] = None
1664
+ async for event in self.execute_task_streaming(task, context):
1665
+ event_type = event.get("type")
1666
+ if event_type == "error":
1667
+ error_message = str(event.get("error") or "Streaming failed")
1668
+ continue
1669
+ if event_type == "token":
1670
+ content = event.get("content")
1671
+ if content:
1672
+ yielded_token = True
1673
+ yield str(content)
1674
+ elif event_type == "result":
1675
+ result_output = event.get("output")
1676
+ if error_message:
1677
+ raise TaskExecutionError(
1678
+ error_message,
1679
+ agent_id=self.agent_id,
1680
+ task_id=task.get("task_id"),
1681
+ )
1682
+ if not yielded_token and result_output:
1683
+ yield str(result_output)
1684
+
1541
1685
  # ==================== Memory Management ====================
1542
1686
 
1543
1687
  async def add_to_memory(
@@ -1905,6 +2049,28 @@ class BaseAIAgent(SkillCapableMixin, ABC):
1905
2049
  self._metrics.updated_at = datetime.utcnow()
1906
2050
  logger.debug(f"Agent {self.agent_id} cache metrics updated: " f"hit_rate={self._metrics.cache_hit_rate:.2%}, " f"read_tokens={cache_read_tokens}, creation_tokens={cache_creation_tokens}")
1907
2051
 
2052
+ def record_prompt_cache(
2053
+ self,
2054
+ cache_read_tokens: Optional[int] = None,
2055
+ cache_creation_tokens: Optional[int] = None,
2056
+ ) -> Dict[str, Any]:
2057
+ """Record one LLM response's implicit-cache usage and return a caller event.
2058
+
2059
+ A hit is ``cache_read_tokens > 0``. Zero or a missing count is a miss.
2060
+ """
2061
+ tokens = cache_read_tokens if isinstance(cache_read_tokens, int) and cache_read_tokens > 0 else 0
2062
+ hit = tokens > 0
2063
+ self.update_cache_metrics(
2064
+ cache_read_tokens=cache_read_tokens if isinstance(cache_read_tokens, int) else None,
2065
+ cache_creation_tokens=cache_creation_tokens,
2066
+ cache_hit=hit,
2067
+ )
2068
+ return {
2069
+ "type": "cache_status",
2070
+ "cache_hit": hit,
2071
+ "cache_read_tokens": tokens,
2072
+ }
2073
+
1908
2074
  def update_session_metrics(
1909
2075
  self,
1910
2076
  session_status: str,
@@ -4383,7 +4549,7 @@ class BaseAIAgent(SkillCapableMixin, ABC):
4383
4549
  break
4384
4550
 
4385
4551
  if strategy == RecoveryStrategy.RETRY:
4386
- result = await self._execute_with_retry(self.execute_task, task, context)
4552
+ result = await self.execute_task(task, context)
4387
4553
  elif strategy == RecoveryStrategy.SIMPLIFY:
4388
4554
  simplified_task = await self._simplify_task(task)
4389
4555
  result = await self.execute_task(simplified_task, context)
@@ -4401,11 +4567,11 @@ class BaseAIAgent(SkillCapableMixin, ABC):
4401
4567
  if structured:
4402
4568
  return RecoveryResult(
4403
4569
  success=True,
4404
- result=cast(Dict[str, Any], result),
4570
+ result=result,
4405
4571
  strategies_attempted=attempted,
4406
4572
  errors=errors,
4407
4573
  )
4408
- return cast(Dict[str, Any], result)
4574
+ return result
4409
4575
 
4410
4576
  except VerificationExhausted as exc:
4411
4577
  verification_exhausted = exc