solace-agent-mesh 1.0.9__py3-none-any.whl → 1.3.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.

Potentially problematic release.


This version of solace-agent-mesh might be problematic. Click here for more details.

Files changed (220) hide show
  1. solace_agent_mesh/agent/adk/adk_llm.txt +182 -42
  2. solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +171 -0
  3. solace_agent_mesh/agent/adk/callbacks.py +165 -104
  4. solace_agent_mesh/agent/adk/embed_resolving_mcp_toolset.py +0 -18
  5. solace_agent_mesh/agent/adk/models/models_llm.txt +104 -55
  6. solace_agent_mesh/agent/adk/runner.py +25 -17
  7. solace_agent_mesh/agent/adk/services.py +3 -3
  8. solace_agent_mesh/agent/adk/setup.py +11 -0
  9. solace_agent_mesh/agent/adk/stream_parser.py +8 -1
  10. solace_agent_mesh/agent/adk/tool_wrapper.py +10 -3
  11. solace_agent_mesh/agent/agent_llm.txt +355 -18
  12. solace_agent_mesh/agent/protocol/event_handlers.py +460 -317
  13. solace_agent_mesh/agent/protocol/protocol_llm.txt +54 -7
  14. solace_agent_mesh/agent/sac/app.py +2 -2
  15. solace_agent_mesh/agent/sac/component.py +211 -517
  16. solace_agent_mesh/agent/sac/sac_llm.txt +133 -63
  17. solace_agent_mesh/agent/testing/testing_llm.txt +25 -58
  18. solace_agent_mesh/agent/tools/peer_agent_tool.py +15 -11
  19. solace_agent_mesh/agent/tools/tools_llm.txt +234 -69
  20. solace_agent_mesh/agent/utils/artifact_helpers.py +35 -1
  21. solace_agent_mesh/agent/utils/utils_llm.txt +90 -105
  22. solace_agent_mesh/assets/docs/404.html +3 -3
  23. solace_agent_mesh/assets/docs/assets/js/6e0db977.39a79ca9.js +1 -0
  24. solace_agent_mesh/assets/docs/assets/js/{75384d09.ccd480c4.js → 75384d09.bf78fbdb.js} +1 -1
  25. solace_agent_mesh/assets/docs/assets/js/90dd9cf6.88f385ea.js +1 -0
  26. solace_agent_mesh/assets/docs/assets/js/f284c35a.fb68323a.js +1 -0
  27. solace_agent_mesh/assets/docs/assets/js/main.08d30374.js +2 -0
  28. solace_agent_mesh/assets/docs/assets/js/runtime~main.458efb1d.js +1 -0
  29. solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +4 -4
  30. solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +4 -4
  31. solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +4 -4
  32. solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +4 -4
  33. solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +4 -4
  34. solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +4 -4
  35. solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +4 -4
  36. solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +4 -4
  37. solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +4 -4
  38. solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +4 -4
  39. solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +4 -4
  40. solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +4 -4
  41. solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +4 -4
  42. solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +4 -4
  43. solace_agent_mesh/assets/docs/docs/documentation/migration-guides/a2a-upgrade-to-0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html +105 -0
  44. solace_agent_mesh/assets/docs/docs/documentation/migration-guides/a2a-upgrade-to-0.3.0/a2a-technical-migration-map/index.html +53 -0
  45. solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +4 -4
  46. solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +4 -4
  47. solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +4 -4
  48. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +4 -4
  49. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +4 -4
  50. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +4 -4
  51. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +4 -4
  52. solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +4 -4
  53. solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +4 -4
  54. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +4 -4
  55. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +4 -4
  56. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +4 -4
  57. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +4 -4
  58. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +4 -4
  59. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +4 -4
  60. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +4 -4
  61. solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +4 -4
  62. solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +4 -4
  63. solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +4 -4
  64. solace_agent_mesh/assets/docs/lunr-index-1757433031159.json +1 -0
  65. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  66. solace_agent_mesh/assets/docs/search-doc-1757433031159.json +1 -0
  67. solace_agent_mesh/assets/docs/search-doc.json +1 -1
  68. solace_agent_mesh/assets/docs/sitemap.xml +1 -1
  69. solace_agent_mesh/cli/__init__.py +1 -1
  70. solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +125 -48
  71. solace_agent_mesh/cli/commands/eval_cmd.py +14 -0
  72. solace_agent_mesh/cli/commands/init_cmd/__init__.py +53 -31
  73. solace_agent_mesh/cli/commands/init_cmd/database_step.py +91 -0
  74. solace_agent_mesh/cli/commands/init_cmd/env_step.py +19 -8
  75. solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +80 -25
  76. solace_agent_mesh/cli/commands/init_cmd/web_init_step.py +32 -10
  77. solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +74 -15
  78. solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +0 -2
  79. solace_agent_mesh/cli/commands/run_cmd.py +5 -3
  80. solace_agent_mesh/cli/utils.py +68 -12
  81. solace_agent_mesh/client/webui/frontend/static/assets/authCallback-vY5eu2lI.js +1 -0
  82. solace_agent_mesh/client/webui/frontend/static/assets/client-BeBkzgWW.js +25 -0
  83. solace_agent_mesh/client/webui/frontend/static/assets/main-Bjys1KQs.js +339 -0
  84. solace_agent_mesh/client/webui/frontend/static/assets/main-C03yrETa.css +1 -0
  85. solace_agent_mesh/client/webui/frontend/static/assets/vendor-CE0AeXyK.js +395 -0
  86. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -2
  87. solace_agent_mesh/client/webui/frontend/static/index.html +4 -3
  88. solace_agent_mesh/common/a2a/__init__.py +213 -0
  89. solace_agent_mesh/common/a2a/a2a_llm.txt +182 -0
  90. solace_agent_mesh/common/a2a/artifact.py +328 -0
  91. solace_agent_mesh/common/a2a/events.py +183 -0
  92. solace_agent_mesh/common/a2a/message.py +307 -0
  93. solace_agent_mesh/common/a2a/protocol.py +513 -0
  94. solace_agent_mesh/common/a2a/task.py +127 -0
  95. solace_agent_mesh/common/a2a/translation.py +653 -0
  96. solace_agent_mesh/common/a2a/types.py +54 -0
  97. solace_agent_mesh/common/a2a_spec/a2a.json +2576 -0
  98. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +407 -0
  99. solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json +18 -0
  100. solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +31 -0
  101. solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +18 -0
  102. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +235 -0
  103. solace_agent_mesh/common/a2a_spec/schemas/tool_invocation_start.json +26 -0
  104. solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +25 -0
  105. solace_agent_mesh/common/agent_registry.py +1 -1
  106. solace_agent_mesh/common/common_llm.txt +192 -70
  107. solace_agent_mesh/common/data_parts.py +99 -0
  108. solace_agent_mesh/common/middleware/middleware_llm.txt +17 -17
  109. solace_agent_mesh/common/sac/__init__.py +0 -0
  110. solace_agent_mesh/common/sac/sac_llm.txt +71 -0
  111. solace_agent_mesh/common/sac/sam_component_base.py +252 -0
  112. solace_agent_mesh/common/services/providers/providers_llm.txt +51 -84
  113. solace_agent_mesh/common/services/services_llm.txt +206 -26
  114. solace_agent_mesh/common/utils/artifact_utils.py +29 -0
  115. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +176 -80
  116. solace_agent_mesh/common/utils/embeds/resolver.py +1 -0
  117. solace_agent_mesh/common/utils/utils_llm.txt +323 -42
  118. solace_agent_mesh/config_portal/backend/common.py +2 -2
  119. solace_agent_mesh/config_portal/backend/plugin_catalog/constants.py +1 -1
  120. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-bFMKlzKf.js +98 -0
  121. solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-d845808d.js → manifest-89db7c30.js} +1 -1
  122. solace_agent_mesh/config_portal/frontend/static/client/index.html +1 -1
  123. solace_agent_mesh/core_a2a/core_a2a_llm.txt +10 -8
  124. solace_agent_mesh/core_a2a/service.py +20 -44
  125. solace_agent_mesh/evaluation/message_organizer.py +35 -56
  126. solace_agent_mesh/evaluation/run.py +26 -5
  127. solace_agent_mesh/evaluation/subscriber.py +35 -10
  128. solace_agent_mesh/evaluation/summary_builder.py +27 -34
  129. solace_agent_mesh/gateway/base/app.py +27 -1
  130. solace_agent_mesh/gateway/base/base_llm.txt +177 -72
  131. solace_agent_mesh/gateway/base/component.py +294 -523
  132. solace_agent_mesh/gateway/gateway_llm.txt +299 -58
  133. solace_agent_mesh/gateway/http_sse/ARCHITECTURE_GUIDE.md +676 -0
  134. solace_agent_mesh/gateway/http_sse/alembic/env.py +85 -0
  135. solace_agent_mesh/gateway/http_sse/alembic/script.py.mako +28 -0
  136. solace_agent_mesh/gateway/http_sse/alembic/versions/b1c2d3e4f5g6_add_database_indexes.py +83 -0
  137. solace_agent_mesh/gateway/http_sse/alembic/versions/d5b3f8f2e9a0_create_initial_database.py +58 -0
  138. solace_agent_mesh/gateway/http_sse/alembic.ini +147 -0
  139. solace_agent_mesh/gateway/http_sse/api/__init__.py +11 -0
  140. solace_agent_mesh/gateway/http_sse/api/controllers/__init__.py +9 -0
  141. solace_agent_mesh/gateway/http_sse/api/controllers/session_controller.py +355 -0
  142. solace_agent_mesh/gateway/http_sse/api/controllers/task_controller.py +279 -0
  143. solace_agent_mesh/gateway/http_sse/api/controllers/user_controller.py +35 -0
  144. solace_agent_mesh/gateway/http_sse/api/dto/__init__.py +10 -0
  145. solace_agent_mesh/gateway/http_sse/api/dto/requests/__init__.py +37 -0
  146. solace_agent_mesh/gateway/http_sse/api/dto/requests/session_requests.py +49 -0
  147. solace_agent_mesh/gateway/http_sse/api/dto/requests/task_requests.py +66 -0
  148. solace_agent_mesh/gateway/http_sse/api/dto/responses/__init__.py +43 -0
  149. solace_agent_mesh/gateway/http_sse/api/dto/responses/session_responses.py +68 -0
  150. solace_agent_mesh/gateway/http_sse/api/dto/responses/task_responses.py +74 -0
  151. solace_agent_mesh/gateway/http_sse/app.py +31 -1
  152. solace_agent_mesh/gateway/http_sse/application/__init__.py +3 -0
  153. solace_agent_mesh/gateway/http_sse/application/services/__init__.py +3 -0
  154. solace_agent_mesh/gateway/http_sse/application/services/session_service.py +135 -0
  155. solace_agent_mesh/gateway/http_sse/component.py +371 -236
  156. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +29 -29
  157. solace_agent_mesh/gateway/http_sse/dependencies.py +142 -39
  158. solace_agent_mesh/gateway/http_sse/domain/entities/__init__.py +3 -0
  159. solace_agent_mesh/gateway/http_sse/domain/entities/session.py +90 -0
  160. solace_agent_mesh/gateway/http_sse/domain/repositories/__init__.py +3 -0
  161. solace_agent_mesh/gateway/http_sse/domain/repositories/session_repository.py +54 -0
  162. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +272 -36
  163. solace_agent_mesh/gateway/http_sse/infrastructure/__init__.py +4 -0
  164. solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/__init__.py +3 -0
  165. solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/container.py +123 -0
  166. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/__init__.py +4 -0
  167. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_persistence_service.py +16 -0
  168. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_service.py +119 -0
  169. solace_agent_mesh/gateway/http_sse/infrastructure/persistence/models.py +31 -0
  170. solace_agent_mesh/gateway/http_sse/infrastructure/persistence_service.py +12 -0
  171. solace_agent_mesh/gateway/http_sse/infrastructure/repositories/__init__.py +3 -0
  172. solace_agent_mesh/gateway/http_sse/infrastructure/repositories/session_repository.py +174 -0
  173. solace_agent_mesh/gateway/http_sse/main.py +293 -91
  174. solace_agent_mesh/gateway/http_sse/routers/agents.py +1 -1
  175. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +137 -56
  176. solace_agent_mesh/gateway/http_sse/routers/config.py +3 -1
  177. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +231 -5
  178. solace_agent_mesh/gateway/http_sse/routers/tasks.py +199 -171
  179. solace_agent_mesh/gateway/http_sse/routers/visualization.py +7 -7
  180. solace_agent_mesh/gateway/http_sse/services/agent_service.py +1 -1
  181. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +89 -135
  182. solace_agent_mesh/gateway/http_sse/services/task_service.py +2 -5
  183. solace_agent_mesh/gateway/http_sse/session_manager.py +64 -30
  184. solace_agent_mesh/gateway/http_sse/shared/__init__.py +9 -0
  185. solace_agent_mesh/gateway/http_sse/shared/auth_utils.py +29 -0
  186. solace_agent_mesh/gateway/http_sse/shared/enums.py +45 -0
  187. solace_agent_mesh/gateway/http_sse/shared/types.py +45 -0
  188. solace_agent_mesh/solace_agent_mesh_llm.txt +362 -0
  189. solace_agent_mesh/templates/gateway_component_template.py +149 -98
  190. solace_agent_mesh/templates/shared_config.yaml +4 -5
  191. solace_agent_mesh/templates/webui.yaml +8 -10
  192. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/METADATA +9 -6
  193. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/RECORD +197 -141
  194. solace_agent_mesh/assets/docs/assets/js/f284c35a.731836ad.js +0 -1
  195. solace_agent_mesh/assets/docs/assets/js/main.3d0e7879.js +0 -2
  196. solace_agent_mesh/assets/docs/assets/js/runtime~main.05d19492.js +0 -1
  197. solace_agent_mesh/assets/docs/lunr-index-1757091012487.json +0 -1
  198. solace_agent_mesh/assets/docs/search-doc-1757091012487.json +0 -1
  199. solace_agent_mesh/client/webui/frontend/static/assets/authCallback-BmF2l6vg.js +0 -1
  200. solace_agent_mesh/client/webui/frontend/static/assets/client-D881Dttc.js +0 -49
  201. solace_agent_mesh/client/webui/frontend/static/assets/main-D0FnP_W4.css +0 -1
  202. solace_agent_mesh/client/webui/frontend/static/assets/main-Do32sFPX.js +0 -708
  203. solace_agent_mesh/common/a2a_protocol.py +0 -564
  204. solace_agent_mesh/common/client/__init__.py +0 -4
  205. solace_agent_mesh/common/client/card_resolver.py +0 -21
  206. solace_agent_mesh/common/client/client.py +0 -85
  207. solace_agent_mesh/common/client/client_llm.txt +0 -133
  208. solace_agent_mesh/common/server/__init__.py +0 -4
  209. solace_agent_mesh/common/server/server.py +0 -122
  210. solace_agent_mesh/common/server/server_llm.txt +0 -169
  211. solace_agent_mesh/common/server/task_manager.py +0 -291
  212. solace_agent_mesh/common/server/utils.py +0 -28
  213. solace_agent_mesh/common/types.py +0 -411
  214. solace_agent_mesh/config_portal/frontend/static/client/assets/_index-Bym6YkMd.js +0 -98
  215. solace_agent_mesh/gateway/http_sse/routers/sessions.py +0 -80
  216. solace_agent_mesh/gateway/http_sse/routers/users.py +0 -59
  217. /solace_agent_mesh/assets/docs/assets/js/{main.3d0e7879.js.LICENSE.txt → main.08d30374.js.LICENSE.txt} +0 -0
  218. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/WHEEL +0 -0
  219. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/entry_points.txt +0 -0
  220. {solace_agent_mesh-1.0.9.dist-info → solace_agent_mesh-1.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,44 +1,34 @@
1
+ # DEVELOPER GUIDE for the directory: sac
2
+
1
3
  ## Quick Summary
2
4
  The `sac` (Solace AI Connector) directory provides the core implementation for hosting a Google ADK (Agent Development Kit) agent within the Solace AI Connector framework. It acts as a bridge, enabling ADK agents to communicate using the A2A (Agent-to-Agent) protocol over Solace messaging. This allows for the creation of distributed, collaborative agent systems where agents can delegate tasks, share information, and work together to solve complex problems.
3
5
 
4
- The main components are `SamAgentApp`, which handles the initial setup and configuration, and `SamAgentComponent`, which hosts the ADK agent instance, manages its lifecycle, and translates between the A2A protocol and the ADK's internal event model.
5
-
6
6
  ## Files Overview
7
- - `__init__.py`: An empty file that marks the `sac` directory as a Python package.
8
- - `app.py`: Defines a custom SAC `App` class that automatically configures Solace subscriptions and broker settings for A2A communication.
9
- - `component.py`: The main SAC `Component` that hosts the ADK agent, manages its lifecycle, and handles all A2A protocol messaging.
10
- - `patch_adk.py`: Contains runtime patches for the Google ADK library to enhance or correct its behavior for this specific use case.
11
- - `task_execution_context.py`: A state management class that encapsulates all runtime information for a single, in-flight A2A task.
7
+ - `__init__.py` - Empty package marker file
8
+ - `app.py` - Custom SAC App class that automatically configures Solace subscriptions and broker settings for A2A communication
9
+ - `component.py` - Main SAC Component that hosts the ADK agent, manages its lifecycle, and handles all A2A protocol messaging
10
+ - `patch_adk.py` - Runtime patches for the Google ADK library to enhance or correct its behavior
11
+ - `task_execution_context.py` - State management class that encapsulates all runtime information for a single, in-flight A2A task
12
12
 
13
13
  ## Developer API Reference
14
14
 
15
- ---
16
- ### __init__.py
17
- **Purpose:** A standard Python file that makes the `sac` directory a package, allowing its modules to be imported.
18
- **Import:** This file is not meant to be imported from directly.
19
-
20
- ---
21
15
  ### app.py
22
- **Purpose:** Provides a custom SAC `App` class (`SamAgentApp`) that simplifies the configuration of an A2A agent. It automatically generates the required Solace topic subscriptions and configures the message broker based on the provided `namespace` and `agent_name` in the configuration file. This class is the main entry point for running an agent host.
23
- **Import:** `from src.solace_agent_mesh.agent.sac.app import SamAgentApp`
16
+ **Purpose:** Provides a custom SAC App class that simplifies the configuration of an A2A agent
17
+ **Import:** `from solace_agent_mesh.agent.sac.app import SamAgentApp`
24
18
 
25
19
  **Classes:**
26
- - `SamAgentApp(app_info: Dict[str, Any], **kwargs)` - A custom App class for the SAM Agent Host. It handles namespace prefixing, automatic subscription generation, and programmatic definition of the `SamAgentComponent`.
27
- - `app_schema: Dict` - A class attribute that defines the comprehensive configuration schema for the agent host. This schema is used by the SAC framework to validate the application's YAML configuration file, ensuring all required parameters are present and correctly typed.
20
+ - `SamAgentApp(app_info: Dict[str, Any], **kwargs)` - Custom App class for SAM Agent Host with namespace prefixing and automatic subscription generation
21
+ - `app_schema: Dict` - Class attribute defining comprehensive configuration schema for agent host validation
28
22
 
29
23
  **Constants/Variables:**
30
- - `info: Dict[str, str]` - A dictionary containing metadata about the `SamAgentApp` class, required by the SAC framework for discovery.
24
+ - `info: Dict[str, str]` - Metadata dictionary about the SamAgentApp class for SAC framework discovery
31
25
 
32
26
  **Usage Examples:**
33
27
  ```python
34
- # The SamAgentApp is typically instantiated by the Solace AI Connector framework,
35
- # not directly by a developer. The framework reads a YAML configuration file,
36
- # validates it against the app_schema, and passes the resulting configuration
37
- # to the SamAgentApp constructor.
38
-
39
- # --- Example agent-config.yaml ---
28
+ # SamAgentApp is typically instantiated by the SAC framework from YAML config
29
+ # Example agent-config.yaml:
40
30
  # app:
41
- # class_name: src.solace_agent_mesh.agent.sac.app.SamAgentApp
31
+ # class_name: solace_agent_mesh.agent.sac.app.SamAgentApp
42
32
  # app_config:
43
33
  # namespace: "my-org/production"
44
34
  # agent_name: "customer-support-agent"
@@ -50,56 +40,136 @@ The main components are `SamAgentApp`, which handles the initial setup and confi
50
40
  # description: "An agent that can answer questions about customer accounts."
51
41
  # agent_card_publishing:
52
42
  # interval_seconds: 60
53
- # agent_discovery:
54
- # enabled: true
55
- # inter_agent_communication:
56
- # allow_list: ["*"]
57
- # request_timeout_seconds: 45
58
43
  # session_service:
59
44
  # type: "memory"
60
- # # ... other configuration parameters
61
45
  ```
62
46
 
63
- ---
64
47
  ### component.py
65
- **Purpose:** This is the core component that hosts a Google ADK agent and bridges its communication to the A2A protocol over Solace. It handles incoming task requests, manages the agent's lifecycle, processes ADK events, orchestrates tool calls (including peer agent delegation), and sends status updates and final responses. Developers can interact with this component's state and lifecycle via custom initialization and cleanup functions.
66
- **Import:** `from src.solace_agent_mesh.agent.sac.component import SamAgentComponent`
48
+ **Purpose:** Core component that hosts a Google ADK agent and bridges communication to A2A protocol
49
+ **Import:** `from solace_agent_mesh.agent.sac.component import SamAgentComponent`
67
50
 
68
51
  **Classes:**
69
- - `SamAgentComponent(**kwargs)` - A Solace AI Connector component that hosts a Google ADK agent and communicates via the A2A protocol.
70
- - `process_event(self, event: Event)` - The main entry point for all events from the SAC framework (e.g., incoming messages, timers). This method orchestrates the processing of A2A requests.
71
- - `handle_timer_event(self, timer_data: Dict[str, Any])` - Handles scheduled timer events, primarily used for periodically publishing the agent's discovery card.
72
- - `handle_cache_expiry_event(self, cache_data: Dict[str, Any])` - Handles cache expiry events, used to detect timeouts for requests sent to peer agents.
73
- - `finalize_task_success(self, a2a_context: Dict)` - An async method that finalizes a task successfully, sending the final `COMPLETED` response.
74
- - `finalize_task_canceled(self, a2a_context: Dict)` - Finalizes a task as `CANCELED` and sends the corresponding response.
75
- - `finalize_task_error(self, exception: Exception, a2a_context: Dict)` - An async method that finalizes a task as `FAILED`, sending an error response.
76
- - `cleanup(self)` - Cleans up all resources when the component is shut down, including stopping the async loop and calling any custom cleanup functions.
77
- - `set_agent_specific_state(self, key: str, value: Any)` - Sets a key-value pair in a dedicated state dictionary. This is intended for use within a custom `agent_init_function` to store state (e.g., database connections, API clients) that can be accessed by tools.
78
- - `get_agent_specific_state(self, key: str, default: Optional[Any] = None) -> Any` - Retrieves a value from the agent-specific state dictionary. This is intended for use by tools or a custom `agent_cleanup_function`.
79
- - `get_async_loop(self) -> Optional[asyncio.AbstractEventLoop]` - Returns the dedicated asyncio event loop used by the component for all its asynchronous operations. This is useful for scheduling custom async work from synchronous code (e.g., tools).
80
- - `set_agent_system_instruction_string(self, instruction_string: str) -> None` - Sets a static string to be injected into the agent's system prompt. This should be called from a custom `agent_init_function`.
81
- - `set_agent_system_instruction_callback(self, callback_function: Callable[[CallbackContext, LlmRequest], Optional[str]]) -> None` - Sets a callback function to dynamically generate parts of the system prompt at runtime. This should be called from a custom `agent_init_function`.
82
- - `get_gateway_id(self) -> str` - Returns a unique identifier for this agent host instance, typically the agent's name.
83
- - `submit_a2a_task(self, target_agent_name: str, a2a_message: A2AMessage, original_session_id: str, main_logical_task_id: str, user_id: str, user_config: Dict[str, Any], sub_task_id: str, function_call_id: Optional[str] = None) -> str` - Submits a task to a peer agent in a non-blocking way. This is the core mechanism for agent delegation. Returns the `sub_task_id` used for correlation.
84
- - `get_agent_context(self) -> Dict[str, Any]` - Returns a dictionary containing context about the agent, used for interactions with the middleware system.
52
+ - `SamAgentComponent(**kwargs)` - Solace AI Connector component that hosts a Google ADK agent
53
+ - `process_event(event: Event) -> None` - Main entry point for all SAC framework events
54
+ - `handle_timer_event(timer_data: Dict[str, Any]) -> None` - Handles scheduled timer events for agent card publishing
55
+ - `handle_cache_expiry_event(cache_data: Dict[str, Any]) -> None` - Handles cache expiry events for peer agent timeouts
56
+ - `finalize_task_success(a2a_context: Dict) -> None` - Async method to finalize successful task completion
57
+ - `finalize_task_canceled(a2a_context: Dict) -> None` - Finalizes task as CANCELED
58
+ - `finalize_task_error(exception: Exception, a2a_context: Dict) -> None` - Async method to finalize failed tasks
59
+ - `cleanup() -> None` - Cleans up resources on component shutdown
60
+ - `set_agent_specific_state(key: str, value: Any) -> None` - Sets key-value pair in agent state dictionary
61
+ - `get_agent_specific_state(key: str, default: Optional[Any] = None) -> Any` - Retrieves value from agent state
62
+ - `get_async_loop() -> Optional[asyncio.AbstractEventLoop]` - Returns dedicated asyncio event loop
63
+ - `set_agent_system_instruction_string(instruction_string: str) -> None` - Sets static system prompt injection
64
+ - `set_agent_system_instruction_callback(callback_function: Callable) -> None` - Sets dynamic system prompt callback
65
+ - `get_gateway_id() -> str` - Returns unique identifier for agent host instance
66
+ - `submit_a2a_task(target_agent_name: str, a2a_message: A2AMessage, user_id: str, user_config: Dict[str, Any], sub_task_id: str) -> str` - Submits task to peer agent
67
+ - `get_agent_context() -> Dict[str, Any]` - Returns agent context for middleware interactions
85
68
 
86
69
  **Constants/Variables:**
87
- - `info: Dict` - A dictionary containing metadata about the `SamAgentComponent` class, required by the SAC framework.
88
- - `CORRELATION_DATA_PREFIX: str` - A public constant string used as a prefix for cache keys when tracking peer-to-peer requests.
89
- - `HOST_COMPONENT_VERSION: str` - The version string of the host component.
70
+ - `info: Dict` - Metadata dictionary for SAC framework
71
+ - `CORRELATION_DATA_PREFIX: str` - Prefix for cache keys when tracking peer requests
72
+ - `HOST_COMPONENT_VERSION: str` - Version string of the host component
90
73
 
91
74
  **Usage Examples:**
92
75
  ```python
93
- # This component is instantiated by the SamAgentApp. Developers interact with it
94
- # primarily through custom init/cleanup functions and by building tools that
95
- # may need access to its state or methods.
76
+ # Custom initialization function example
77
+ from solace_agent_mesh.agent.sac.component import SamAgentComponent
96
78
 
97
- # --- In a custom init module (e.g., my_agent_init.py) ---
98
- import asyncio
99
- from src.solace_agent_mesh.agent.sac.component import SamAgentComponent
100
- from src.solace_agent_mesh.common.types import A2AMessage, TextPart
101
-
102
- # This function would be configured in the agent's YAML config
103
79
  def initialize_my_agent(host_component: SamAgentComponent, config: dict):
104
80
  """Custom initialization function for the agent."""
105
- print("Initializing my custom agent...")
81
+ # Store database connection in agent state
82
+ db_connection = create_database_connection(config.get('db_url'))
83
+ host_component.set_agent_specific_state('db_connection', db_connection)
84
+
85
+ # Set custom system instruction
86
+ host_component.set_agent_system_instruction_string(
87
+ "You are a specialized customer service agent with access to our database."
88
+ )
89
+
90
+ # Tool accessing agent state
91
+ def my_custom_tool(host_component: SamAgentComponent, query: str) -> str:
92
+ """Tool that uses stored database connection."""
93
+ db_connection = host_component.get_agent_specific_state('db_connection')
94
+ if db_connection:
95
+ return db_connection.execute_query(query)
96
+ return "Database not available"
97
+
98
+ # Scheduling async work from synchronous code
99
+ def schedule_background_task(host_component: SamAgentComponent):
100
+ """Schedule async work on the component's event loop."""
101
+ loop = host_component.get_async_loop()
102
+ if loop:
103
+ asyncio.run_coroutine_threadsafe(my_async_task(), loop)
104
+ ```
105
+
106
+ ### patch_adk.py
107
+ **Purpose:** Contains runtime patches for the Google ADK library to enhance behavior
108
+ **Import:** `from solace_agent_mesh.agent.sac.patch_adk import patch_adk`
109
+
110
+ **Functions:**
111
+ - `patch_adk() -> None` - Applies all necessary patches to the ADK library
112
+
113
+ **Usage Examples:**
114
+ ```python
115
+ from solace_agent_mesh.agent.sac.patch_adk import patch_adk
116
+
117
+ # Apply patches before using ADK
118
+ patch_adk()
119
+ ```
120
+
121
+ ### task_execution_context.py
122
+ **Purpose:** State management class for single, in-flight agent tasks
123
+ **Import:** `from solace_agent_mesh.agent.sac.task_execution_context import TaskExecutionContext`
124
+
125
+ **Classes:**
126
+ - `TaskExecutionContext(task_id: str, a2a_context: Dict[str, Any])` - Encapsulates runtime state for a single agent task
127
+ - `cancel() -> None` - Signals that the task should be cancelled
128
+ - `is_cancelled() -> bool` - Checks if cancellation event has been set
129
+ - `append_to_streaming_buffer(text: str) -> None` - Appends text to streaming buffer
130
+ - `flush_streaming_buffer() -> str` - Returns and clears streaming buffer content
131
+ - `get_streaming_buffer_content() -> str` - Returns buffer content without clearing
132
+ - `append_to_run_based_buffer(text: str) -> None` - Appends text to run-based response buffer
133
+ - `register_peer_sub_task(sub_task_id: str, correlation_data: Dict[str, Any]) -> None` - Adds peer sub-task tracking
134
+ - `claim_sub_task_completion(sub_task_id: str) -> Optional[Dict[str, Any]]` - Atomically retrieves and removes sub-task data
135
+ - `register_parallel_call_sent(invocation_id: str) -> None` - Registers new parallel tool call
136
+ - `handle_peer_timeout(sub_task_id: str, correlation_data: Dict, timeout_sec: int, invocation_id: str) -> bool` - Handles peer timeout
137
+ - `record_parallel_result(result: Dict, invocation_id: str) -> bool` - Records parallel tool call result
138
+ - `clear_parallel_invocation_state(invocation_id: str) -> None` - Removes completed invocation state
139
+ - `register_produced_artifact(filename: str, version: int) -> None` - Tracks newly created artifacts
140
+ - `add_artifact_signal(signal: Dict[str, Any]) -> None` - Adds artifact return signal
141
+ - `get_and_clear_artifact_signals() -> List[Dict[str, Any]]` - Retrieves and clears artifact signals
142
+ - `set_event_loop(loop: asyncio.AbstractEventLoop) -> None` - Stores event loop reference
143
+ - `get_event_loop() -> Optional[asyncio.AbstractEventLoop]` - Retrieves stored event loop
144
+
145
+ **Usage Examples:**
146
+ ```python
147
+ from solace_agent_mesh.agent.sac.task_execution_context import TaskExecutionContext
148
+
149
+ # Create task context
150
+ a2a_context = {
151
+ "logical_task_id": "task-123",
152
+ "user_id": "user-456",
153
+ "session_id": "session-789"
154
+ }
155
+ task_context = TaskExecutionContext("task-123", a2a_context)
156
+
157
+ # Use streaming buffer
158
+ task_context.append_to_streaming_buffer("Hello ")
159
+ task_context.append_to_streaming_buffer("world!")
160
+ content = task_context.flush_streaming_buffer() # Returns "Hello world!"
161
+
162
+ # Track peer sub-tasks
163
+ correlation_data = {
164
+ "peer_agent_name": "math-agent",
165
+ "adk_function_call_id": "call-123"
166
+ }
167
+ task_context.register_peer_sub_task("sub-task-456", correlation_data)
168
+
169
+ # Handle completion
170
+ completed_data = task_context.claim_sub_task_completion("sub-task-456")
171
+ if completed_data:
172
+ print(f"Sub-task completed: {completed_data}")
173
+ ```
174
+
175
+ # content_hash: 79c043cb89eecb2b6a6f05113ff223c5064861f1a537d8e832ebb2738f5801e8
@@ -1,90 +1,57 @@
1
1
  ## Quick Summary
2
-
3
- The `testing` directory provides a suite of utilities designed to facilitate the testing of the A2A (Agent-to-Agent) framework. Its primary function is to offer tools that simplify debugging and validation of agent interactions during test runs, particularly for declarative tests.
2
+ The `testing` directory provides utilities for testing the A2A (Agent-to-Agent) framework, with a focus on debugging tools that help developers understand test failures by providing readable representations of agent event histories.
4
3
 
5
4
  ## Files Overview
6
-
7
- - `__init__.py`: Marks the directory as a Python package.
8
- - `debug_utils.py`: Provides helper functions for debugging test failures, most notably a pretty-printer for A2A event histories.
5
+ - `__init__.py` - Package initialization file marking the directory as a Python module
6
+ - `debug_utils.py` - Debugging utilities including pretty-printing for A2A event history
7
+ - `testing_llm.txt` - Documentation file (not a code module)
9
8
 
10
9
  ## Developer API Reference
11
10
 
12
11
  ### debug_utils.py
13
-
14
- **Purpose:** This module contains utilities to help developers debug failing tests by providing human-readable representations of complex data structures, such as the event history from an A2A task.
15
-
16
- **Import:** `from agent.testing.debug_utils import pretty_print_event_history`
12
+ **Purpose:** Provides debugging utilities for the declarative test framework, including a pretty-printer for A2A event history
13
+ **Import:** `from solace_agent_mesh.agent.testing.debug_utils import pretty_print_event_history`
17
14
 
18
15
  **Functions:**
19
-
20
- - `pretty_print_event_history(event_history: List[Dict[str, Any]], max_string_length: int = 200) -> None`
21
- Formats and prints a list of A2A event payloads to the console in a structured, readable format. It intelligently parses different event types (status updates, final responses, errors) and truncates long strings to keep the output concise. This is invaluable for quickly diagnosing why a test failed by inspecting the sequence of events leading up to the failure.
16
+ - `pretty_print_event_history(event_history: List[Dict[str, Any]], max_string_length: int = 200) -> None` - Formats and prints a list of A2A event payloads for debugging, intelligently parsing different event types and truncating long strings for readability
22
17
 
23
18
  **Usage Examples:**
24
-
25
19
  ```python
26
- # Show how to import and use the main classes/functions
27
- from agent.testing.debug_utils import pretty_print_event_history
20
+ # Import the debugging utility
21
+ from solace_agent_mesh.agent.testing.debug_utils import pretty_print_event_history
28
22
  from typing import List, Dict, Any
29
23
 
30
- # Example event history captured during a test run
31
- sample_event_history: List[Dict[str, Any]] = [
24
+ # Example: Debug a failed test by printing event history
25
+ event_history: List[Dict[str, Any]] = [
32
26
  {
33
27
  "result": {
34
28
  "status": {
35
29
  "state": "EXECUTING",
36
30
  "message": {
37
31
  "parts": [
38
- {"type": "text", "text": "Okay, I am starting the process to find the latest sales report."}
32
+ {"type": "text", "text": "Processing your request..."}
39
33
  ]
40
- },
34
+ }
41
35
  },
42
- "final": False,
43
- }
44
- },
45
- {
46
- "result": {
47
- "artifact": {
48
- "name": "sales_report_q4.pdf",
49
- "parts": [
50
- {
51
- "type": "file",
52
- "file": {
53
- "name": "sales_report_q4.pdf",
54
- "mimeType": "application/pdf",
55
- "uri": "file://path/to/sales_report_q4.pdf"
56
- }
57
- }
58
- ]
59
- }
36
+ "final": False
60
37
  }
61
38
  },
62
39
  {
63
40
  "error": {
64
- "code": "INTERNAL_ERROR",
65
- "message": "Failed to access the database due to a connection timeout. The database server at db.example.com might be down or unreachable. Please check the server status and network connectivity."
66
- }
67
- },
68
- {
69
- "result": {
70
- "status": {
71
- "state": "FAILED",
72
- "message": {
73
- "parts": [
74
- {"type": "text", "text": "I encountered an error and could not complete the task."}
75
- ]
76
- }
77
- },
78
- "sessionId": "task-12345",
41
+ "code": "TIMEOUT_ERROR",
42
+ "message": "Request timed out after 30 seconds"
79
43
  }
80
44
  }
81
45
  ]
82
46
 
83
- # In a test's `tearDown` or `except` block, you can print the history.
84
- print("A test failed! Dumping the event history for review:")
85
- pretty_print_event_history(sample_event_history, max_string_length=100)
47
+ # Print formatted event history for debugging
48
+ pretty_print_event_history(event_history)
86
49
 
87
- # Example with no events
88
- print("\n--- Example with no events ---")
50
+ # Print with custom string truncation length
51
+ pretty_print_event_history(event_history, max_string_length=100)
52
+
53
+ # Handle empty event history (when test fails before any events)
89
54
  pretty_print_event_history([])
90
- ```
55
+ ```
56
+
57
+ # content_hash: 890ba89aa47c5be30f5ec9cdbb4a05e9ee3bd022e56a56fcc4feea72aac653e8
@@ -10,15 +10,15 @@ from google.genai import types as adk_types
10
10
  from pydantic import BaseModel, Field
11
11
  from solace_ai_connector.common.log import log
12
12
 
13
- from ...common.types import (
14
- Message as A2AMessage,
15
- TextPart,
16
- FilePart,
13
+ from ...common.a2a.types import ContentPart
14
+ from a2a.types import (
17
15
  AgentCard,
18
16
  )
17
+ from ...common import a2a
19
18
  from ...common.constants import DEFAULT_COMMUNICATION_TIMEOUT
20
19
  from ...common.exceptions import MessageSizeExceededError
21
20
 
21
+
22
22
  class ArtifactIdentifier(BaseModel):
23
23
  """Identifies a specific version of an artifact."""
24
24
 
@@ -140,7 +140,7 @@ class PeerAgentTool(BaseTool):
140
140
 
141
141
  def _prepare_a2a_parts(
142
142
  self, args: Dict[str, Any], tool_context: ToolContext
143
- ) -> List[TextPart]:
143
+ ) -> List[ContentPart]:
144
144
  """
145
145
  Prepares the A2A message parts from tool arguments.
146
146
  """
@@ -159,7 +159,7 @@ class PeerAgentTool(BaseTool):
159
159
  f"Now please execute this task that was given to you:\n\n{task_description}"
160
160
  )
161
161
 
162
- return [TextPart(text=context_message)]
162
+ return [a2a.create_text_part(text=context_message)]
163
163
 
164
164
  async def run_async(
165
165
  self, *, args: Dict[str, Any], tool_context: ToolContext
@@ -231,8 +231,15 @@ class PeerAgentTool(BaseTool):
231
231
  e,
232
232
  )
233
233
 
234
- a2a_message = A2AMessage(
235
- role="user", parts=a2a_message_parts, metadata=a2a_metadata
234
+ a2a_metadata["sessionBehavior"] = "RUN_BASED"
235
+ a2a_metadata["parentTaskId"] = main_logical_task_id
236
+ a2a_metadata["function_call_id"] = tool_context.function_call_id
237
+ a2a_metadata["agent_name"] = self.target_agent_name
238
+
239
+ a2a_message = a2a.create_user_message(
240
+ parts=a2a_message_parts,
241
+ metadata=a2a_metadata,
242
+ context_id=original_task_context.get("contextId"),
236
243
  )
237
244
 
238
245
  correlation_data = {
@@ -259,12 +266,9 @@ class PeerAgentTool(BaseTool):
259
266
  self.host_component.submit_a2a_task(
260
267
  target_agent_name=self.target_agent_name,
261
268
  a2a_message=a2a_message,
262
- original_session_id=original_session_id,
263
- main_logical_task_id=main_logical_task_id,
264
269
  user_id=user_id,
265
270
  user_config=user_config,
266
271
  sub_task_id=sub_task_id,
267
- function_call_id=tool_context.function_call_id,
268
272
  )
269
273
  except MessageSizeExceededError as e:
270
274
  log.error(