solace-agent-mesh 1.4.12__py3-none-any.whl → 1.5.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 (181) hide show
  1. solace_agent_mesh/agent/adk/adk_llm.txt +3 -4
  2. solace_agent_mesh/agent/adk/adk_llm_detail.txt +566 -0
  3. solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +1 -1
  4. solace_agent_mesh/agent/adk/callbacks.py +51 -2
  5. solace_agent_mesh/agent/adk/models/lite_llm.py +1 -0
  6. solace_agent_mesh/agent/adk/models/models_llm.txt +1 -2
  7. solace_agent_mesh/agent/agent_llm.txt +1 -1
  8. solace_agent_mesh/agent/agent_llm_detail.txt +1702 -0
  9. solace_agent_mesh/agent/protocol/event_handlers.py +2 -13
  10. solace_agent_mesh/agent/protocol/protocol_llm.txt +15 -2
  11. solace_agent_mesh/agent/protocol/protocol_llm_detail.txt +92 -0
  12. solace_agent_mesh/agent/sac/component.py +51 -21
  13. solace_agent_mesh/agent/sac/sac_llm.txt +15 -1
  14. solace_agent_mesh/agent/sac/sac_llm_detail.txt +200 -0
  15. solace_agent_mesh/agent/sac/task_execution_context.py +73 -0
  16. solace_agent_mesh/agent/testing/testing_llm_detail.txt +68 -0
  17. solace_agent_mesh/agent/tools/tools_llm.txt +148 -154
  18. solace_agent_mesh/agent/tools/tools_llm_detail.txt +274 -0
  19. solace_agent_mesh/agent/utils/utils_llm.txt +1 -1
  20. solace_agent_mesh/agent/utils/utils_llm_detail.txt +149 -0
  21. solace_agent_mesh/assets/docs/404.html +3 -3
  22. solace_agent_mesh/assets/docs/assets/js/483cef9a.bf9398af.js +1 -0
  23. solace_agent_mesh/assets/docs/assets/js/{main.f67fc9f4.js → main.0c149855.js} +2 -2
  24. solace_agent_mesh/assets/docs/assets/js/{runtime~main.40527046.js → runtime~main.c66557e4.js} +1 -1
  25. solace_agent_mesh/assets/docs/docs/documentation/Enterprise/installation/index.html +3 -3
  26. solace_agent_mesh/assets/docs/docs/documentation/Enterprise/rbac-setup-guilde/index.html +3 -3
  27. solace_agent_mesh/assets/docs/docs/documentation/Enterprise/single-sign-on/index.html +8 -4
  28. solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html +3 -3
  29. solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-technical-migration-map/index.html +3 -3
  30. solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +3 -3
  31. solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +3 -3
  32. solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +3 -3
  33. solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +3 -3
  34. solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +3 -3
  35. solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +3 -3
  36. solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +3 -3
  37. solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +3 -3
  38. solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +3 -3
  39. solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +3 -3
  40. solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +3 -3
  41. solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/litellm_models/index.html +3 -3
  42. solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +3 -3
  43. solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +3 -3
  44. solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +3 -3
  45. solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +3 -3
  46. solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +3 -3
  47. solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +3 -3
  48. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +3 -3
  49. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +3 -3
  50. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +3 -3
  51. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +3 -3
  52. solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +3 -3
  53. solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +3 -3
  54. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +3 -3
  55. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +3 -3
  56. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +3 -3
  57. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +3 -3
  58. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +3 -3
  59. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +3 -3
  60. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +3 -3
  61. solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-python-tools/index.html +3 -3
  62. solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +3 -3
  63. solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +3 -3
  64. solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +3 -3
  65. solace_agent_mesh/assets/docs/lunr-index-1760032255022.json +1 -0
  66. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  67. solace_agent_mesh/assets/docs/search-doc-1760032255022.json +1 -0
  68. solace_agent_mesh/assets/docs/search-doc.json +1 -1
  69. solace_agent_mesh/cli/__init__.py +1 -1
  70. solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-j1LW-wlq.js → authCallback-DwrxZE0E.js} +1 -1
  71. solace_agent_mesh/client/webui/frontend/static/assets/{client-B9p_nFNA.js → client-DarGQzyw.js} +1 -1
  72. solace_agent_mesh/client/webui/frontend/static/assets/main-CZbpmwfA.css +1 -0
  73. solace_agent_mesh/client/webui/frontend/static/assets/main-C__uuUkB.js +339 -0
  74. solace_agent_mesh/client/webui/frontend/static/assets/{vendor-CS5YMf8a.js → vendor-BKIeiHj_.js} +80 -70
  75. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
  76. solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
  77. solace_agent_mesh/common/a2a/a2a_llm.txt +1 -1
  78. solace_agent_mesh/common/a2a/a2a_llm_detail.txt +193 -0
  79. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +1 -1
  80. solace_agent_mesh/common/a2a_spec/a2a_spec_llm_detail.txt +736 -0
  81. solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +23 -0
  82. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +93 -15
  83. solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +23 -0
  84. solace_agent_mesh/common/common_llm.txt +24 -39
  85. solace_agent_mesh/common/common_llm_detail.txt +2562 -0
  86. solace_agent_mesh/common/data_parts.py +9 -1
  87. solace_agent_mesh/common/middleware/middleware_llm_detail.txt +185 -0
  88. solace_agent_mesh/common/sac/sac_llm.txt +1 -1
  89. solace_agent_mesh/common/sac/sac_llm_detail.txt +82 -0
  90. solace_agent_mesh/common/sam_events/sam_events_llm.txt +104 -0
  91. solace_agent_mesh/common/sam_events/sam_events_llm_detail.txt +115 -0
  92. solace_agent_mesh/common/services/services_llm.txt +57 -6
  93. solace_agent_mesh/common/services/services_llm_detail.txt +459 -0
  94. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +1 -1
  95. solace_agent_mesh/common/utils/utils_llm.txt +75 -87
  96. solace_agent_mesh/common/utils/utils_llm_detail.txt +572 -0
  97. solace_agent_mesh/core_a2a/core_a2a_llm_detail.txt +101 -0
  98. solace_agent_mesh/gateway/base/app.py +1 -1
  99. solace_agent_mesh/gateway/base/base_llm.txt +1 -1
  100. solace_agent_mesh/gateway/base/base_llm_detail.txt +235 -0
  101. solace_agent_mesh/gateway/gateway_llm.txt +242 -235
  102. solace_agent_mesh/gateway/gateway_llm_detail.txt +3885 -0
  103. solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +295 -0
  104. solace_agent_mesh/gateway/http_sse/alembic/env.py +10 -1
  105. solace_agent_mesh/gateway/http_sse/alembic/versions/20251006_98882922fa59_add_tasks_events_feedback_chat_tasks.py +190 -0
  106. solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +155 -0
  107. solace_agent_mesh/gateway/http_sse/alembic.ini +1 -1
  108. solace_agent_mesh/gateway/http_sse/app.py +148 -2
  109. solace_agent_mesh/gateway/http_sse/component.py +368 -60
  110. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +46 -6
  111. solace_agent_mesh/gateway/http_sse/components/task_logger_forwarder.py +108 -0
  112. solace_agent_mesh/gateway/http_sse/components/visualization_forwarder_component.py +1 -1
  113. solace_agent_mesh/gateway/http_sse/dependencies.py +116 -26
  114. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +172 -172
  115. solace_agent_mesh/gateway/http_sse/http_sse_llm_detail.txt +3278 -0
  116. solace_agent_mesh/gateway/http_sse/main.py +146 -41
  117. solace_agent_mesh/gateway/http_sse/repository/__init__.py +3 -12
  118. solace_agent_mesh/gateway/http_sse/repository/chat_task_repository.py +103 -0
  119. solace_agent_mesh/gateway/http_sse/repository/entities/__init__.py +5 -3
  120. solace_agent_mesh/gateway/http_sse/repository/entities/chat_task.py +75 -0
  121. solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +263 -0
  122. solace_agent_mesh/gateway/http_sse/repository/entities/feedback.py +20 -0
  123. solace_agent_mesh/gateway/http_sse/repository/entities/session_history.py +0 -16
  124. solace_agent_mesh/gateway/http_sse/repository/entities/task.py +25 -0
  125. solace_agent_mesh/gateway/http_sse/repository/entities/task_event.py +21 -0
  126. solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +81 -0
  127. solace_agent_mesh/gateway/http_sse/repository/interfaces.py +73 -18
  128. solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +9 -5
  129. solace_agent_mesh/gateway/http_sse/repository/models/chat_task_model.py +31 -0
  130. solace_agent_mesh/gateway/http_sse/repository/models/feedback_model.py +21 -0
  131. solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +266 -0
  132. solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +3 -3
  133. solace_agent_mesh/gateway/http_sse/repository/models/task_event_model.py +25 -0
  134. solace_agent_mesh/gateway/http_sse/repository/models/task_model.py +32 -0
  135. solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +340 -0
  136. solace_agent_mesh/gateway/http_sse/repository/session_repository.py +4 -53
  137. solace_agent_mesh/gateway/http_sse/repository/task_repository.py +173 -0
  138. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +1 -1
  139. solace_agent_mesh/gateway/http_sse/routers/config.py +26 -4
  140. solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +346 -0
  141. solace_agent_mesh/gateway/http_sse/routers/dto/requests/__init__.py +3 -3
  142. solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +83 -0
  143. solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +2 -10
  144. solace_agent_mesh/gateway/http_sse/routers/dto/requests/task_requests.py +58 -0
  145. solace_agent_mesh/gateway/http_sse/routers/dto/responses/__init__.py +5 -3
  146. solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +107 -0
  147. solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +1 -15
  148. solace_agent_mesh/gateway/http_sse/routers/dto/responses/task_responses.py +30 -0
  149. solace_agent_mesh/gateway/http_sse/routers/feedback.py +37 -0
  150. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +255 -204
  151. solace_agent_mesh/gateway/http_sse/routers/sessions.py +220 -40
  152. solace_agent_mesh/gateway/http_sse/routers/tasks.py +168 -42
  153. solace_agent_mesh/gateway/http_sse/services/data_retention_service.py +272 -0
  154. solace_agent_mesh/gateway/http_sse/services/feedback_service.py +241 -0
  155. solace_agent_mesh/gateway/http_sse/services/people_service.py +0 -80
  156. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +177 -13
  157. solace_agent_mesh/gateway/http_sse/services/session_service.py +151 -84
  158. solace_agent_mesh/gateway/http_sse/services/task_logger_service.py +317 -0
  159. solace_agent_mesh/gateway/http_sse/shared/exception_handlers.py +25 -14
  160. solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +285 -0
  161. solace_agent_mesh/gateway/http_sse/shared/types.py +7 -0
  162. solace_agent_mesh/gateway/http_sse/utils/__init__.py +1 -0
  163. solace_agent_mesh/gateway/http_sse/utils/stim_utils.py +32 -0
  164. solace_agent_mesh/gateway/http_sse/utils/utils_llm.txt +47 -0
  165. solace_agent_mesh/solace_agent_mesh_llm.txt +1 -1
  166. solace_agent_mesh/solace_agent_mesh_llm_detail.txt +8599 -0
  167. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/METADATA +1 -1
  168. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/RECORD +172 -124
  169. solace_agent_mesh/agent/adk/invocation_monitor.py +0 -295
  170. solace_agent_mesh/assets/docs/assets/js/483cef9a.4736f2d8.js +0 -1
  171. solace_agent_mesh/assets/docs/lunr-index-1759936913198.json +0 -1
  172. solace_agent_mesh/assets/docs/search-doc-1759936913198.json +0 -1
  173. solace_agent_mesh/client/webui/frontend/static/assets/main-ChRwcV89.css +0 -1
  174. solace_agent_mesh/client/webui/frontend/static/assets/main-DnnE01OM.js +0 -339
  175. solace_agent_mesh/gateway/http_sse/repository/entities/message.py +0 -41
  176. solace_agent_mesh/gateway/http_sse/repository/message_repository.py +0 -84
  177. solace_agent_mesh/gateway/http_sse/repository/models/message_model.py +0 -45
  178. /solace_agent_mesh/assets/docs/assets/js/{main.f67fc9f4.js.LICENSE.txt → main.0c149855.js.LICENSE.txt} +0 -0
  179. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/WHEEL +0 -0
  180. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/entry_points.txt +0 -0
  181. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,125 +1,167 @@
1
- # DEVELOPER GUIDE for the http_sse directory
1
+ # DEVELOPER GUIDE: http_sse
2
2
 
3
3
  ## Quick Summary
4
- The `http_sse` directory implements a complete HTTP/SSE (Server-Sent Events) gateway for the A2A (Agent-to-Agent) system. Its primary purpose is to serve a web-based user interface and act as a bridge between standard web protocols (HTTP, WebSockets/SSE) and the backend A2A messaging fabric.
4
+ The `http_sse` directory implements a complete HTTP/SSE (Server-Sent Events) gateway for the A2A (Agent-to-Agent) system. It serves as a bridge between web-based user interfaces and the backend A2A messaging fabric, providing real-time communication capabilities through HTTP REST APIs and Server-Sent Events streaming.
5
5
 
6
- The architecture is centered around the `WebUIBackendComponent`, a custom Solace AI Connector (SAC) component that hosts an embedded FastAPI web server. This component manages shared state and resources, such as the `SSEManager` for real-time updates, the `SessionManager` for user sessions, and the `AgentRegistry` for discovering available agents.
6
+ The architecture centers around the `WebUIBackendComponent`, a custom Solace AI Connector (SAC) component that hosts an embedded FastAPI web server. This component manages shared resources including the `SSEManager` for real-time updates, `SessionManager` for user sessions, and `AgentRegistry` for agent discovery. The system provides comprehensive functionality including session management, task logging, data retention, feedback collection, and A2A message visualization.
7
7
 
8
- Subdirectories organize the functionality:
9
- - `routers/` defines the REST API endpoints (e.g., `/tasks`, `/agents`).
10
- - `services/` contains the business logic that the API endpoints call.
11
- - `dependencies.py` uses FastAPI's dependency injection system to provide the routers and services with safe access to the shared resources managed by the main component.
12
- - `components/` contains specialized SAC components, for example, to forward A2A messages for real-time visualization.
13
-
14
- This design creates a clean separation of concerns, where the web layer (FastAPI) is decoupled from the core messaging and state management layer (SAC Component).
8
+ Subdirectories organize functionality by layer: `routers/` defines REST API endpoints, `services/` contains business logic, `repository/` handles data persistence, `components/` provides specialized SAC components, and `shared/` contains common utilities. The `dependencies.py` file uses FastAPI's dependency injection to provide clean separation between the web layer and core messaging components.
15
9
 
16
10
  ## Files and Subdirectories Overview
17
11
  - **Direct files:**
18
- - `__init__.py`: Standard Python package initializer.
19
- - `app.py`: Defines the main SAC `WebUIBackendApp`, which specifies configuration and launches the component.
20
- - `component.py`: The core SAC component that hosts the FastAPI server and manages all shared resources and A2A logic.
21
- - `dependencies.py`: Provides FastAPI dependency injectors for accessing shared resources like services and managers.
22
- - `main.py`: The main FastAPI application instance, including middleware, router mounting, and exception handling.
23
- - `session_manager.py`: Manages web user sessions and maps them to unique A2A client and session IDs.
24
- - `sse_manager.py`: Manages Server-Sent Event (SSE) connections for streaming real-time updates to clients.
12
+ - `__init__.py`: Standard Python package initializer
13
+ - `alembic.ini`: Alembic database migration configuration
14
+ - `app.py`: Main SAC `WebUIBackendApp` class defining configuration schema and component creation
15
+ - `component.py`: Core SAC component hosting FastAPI server and managing shared resources
16
+ - `dependencies.py`: FastAPI dependency injectors for accessing shared resources
17
+ - `main.py`: FastAPI application instance with middleware, routing, and exception handling
18
+ - `session_manager.py`: Web user session management and A2A identity mapping
19
+ - `sse_manager.py`: Server-Sent Event connection management for real-time streaming
20
+ - `sse_event_buffer.py`: Thread-safe buffer for early SSE events before client connection
25
21
  - **Subdirectories:**
26
- - `components/`: Contains specialized SAC components, such as for forwarding messages to the visualization system.
27
- - `routers/`: Defines the FastAPI `APIRouter` modules for all REST API endpoints.
28
- - `services/`: Encapsulates business logic for agents, tasks, and other domain-specific operations.
22
+ - `alembic/`: Database migration configuration and version files
23
+ - `components/`: Specialized SAC components for message forwarding and visualization
24
+ - `repository/`: Data access layer with Repository pattern and SQLAlchemy ORM models
25
+ - `routers/`: FastAPI router modules defining REST API endpoints
26
+ - `services/`: Business logic layer for domain-specific operations
27
+ - `shared/`: Common utilities, constants, enums, and exception handling
28
+ - `utils/`: Utility functions for creating .stim file structures from task data
29
29
 
30
30
  ## Developer API Reference
31
31
 
32
32
  ### Direct Files
33
33
 
34
34
  #### app.py
35
- **Purpose:** This file defines the `WebUIBackendApp`, a custom SAC (Solace AI Connector) App class. It is responsible for defining the configuration schema for the entire HTTP/SSE gateway and programmatically creating the `WebUIBackendComponent`.
35
+ **Purpose:** Defines the main SAC application class with configuration schema for the HTTP/SSE gateway
36
36
  **Import:** `from solace_agent_mesh.gateway.http_sse.app import WebUIBackendApp`
37
37
 
38
38
  **Classes/Functions/Constants:**
39
- - **`WebUIBackendApp(BaseGatewayApp)`**: The main application class. It extends `BaseGatewayApp` and adds a list of WebUI-specific configuration parameters to the application schema.
40
- - **`SPECIFIC_APP_SCHEMA_PARAMS: List[Dict[str, Any]]`**: A constant list defining the configuration parameters specific to the HTTP/SSE gateway, such as `session_secret_key`, `fastapi_host`, `fastapi_port`, and various frontend-related settings.
39
+ - **`WebUIBackendApp(BaseGatewayApp)`**: Main application class extending BaseGatewayApp with WebUI-specific configuration
40
+ - `get_component() -> WebUIBackendComponent | None`: Retrieves the running component instance
41
+ - `_get_gateway_component_class() -> type[BaseGatewayComponent]`: Returns WebUIBackendComponent class
42
+ - **`SPECIFIC_APP_SCHEMA_PARAMS: List[Dict[str, Any]]`**: Configuration parameters including session_secret_key, FastAPI settings, frontend configuration, database settings, and feature flags
41
43
 
42
44
  #### component.py
43
- **Purpose:** This is the core component of the gateway. It hosts the FastAPI server, manages all shared state (like the SSE and Session managers), handles the lifecycle of the web server, and implements the logic for translating between external HTTP requests and internal A2A messages.
45
+ **Purpose:** Core SAC component hosting FastAPI server and managing all shared resources and A2A logic
44
46
  **Import:** `from solace_agent_mesh.gateway.http_sse.component import WebUIBackendComponent`
45
47
 
46
48
  **Classes/Functions/Constants:**
47
- - **`WebUIBackendComponent(BaseGatewayComponent)`**: The main component class. Developers will primarily interact with its instances via the dependency injection system.
48
- - **Public Accessor Methods (for Dependencies):**
49
- - `get_sse_manager() -> SSEManager`: Returns the shared `SSEManager` instance.
50
- - `get_session_manager() -> SessionManager`: Returns the shared `SessionManager` instance.
51
- - `get_agent_registry() -> AgentRegistry`: Returns the shared `AgentRegistry` instance.
52
- - `get_core_a2a_service() -> CoreA2AService`: Returns the core service for creating A2A messages.
53
- - `get_shared_artifact_service() -> Optional[BaseArtifactService]`: Returns the service for artifact storage.
54
- - `get_namespace() -> str`: Returns the configured A2A namespace.
55
- - `get_gateway_id() -> str`: Returns the unique ID of this gateway.
56
- - **Core Logic Methods:**
57
- - `publish_a2a(topic: str, payload: Dict, user_properties: Optional[Dict] = None)`: Publishes a message onto the A2A messaging fabric. This is the primary method for sending data to agents.
58
- - **Gateway-Development-Kit (GDK) Hooks:** These methods implement the `BaseGatewayComponent` abstract interface.
59
- - `_start_listener()`: Starts the FastAPI/Uvicorn server.
60
- - `_stop_listener()`: Stops the FastAPI/Uvicorn server.
61
- - `_translate_external_input(...)`: Translates an incoming HTTP request (e.g., form data with files) into a structured A2A message (`List[ContentPart]`).
62
- - `_send_update_to_external(...)`: Sends an intermediate status update from an agent back to the client via SSE.
63
- - `_send_final_response_to_external(...)`: Sends the final A2A Task result to the client via SSE.
64
- - `_send_error_to_external(...)`: Sends an error notification to the client via SSE.
49
+ - **`WebUIBackendComponent(BaseGatewayComponent)`**: Main component class implementing the gateway functionality
50
+ - **Public Accessor Methods:**
51
+ - `get_sse_manager() -> SSEManager`: Returns SSE manager for real-time updates
52
+ - `get_session_manager() -> SessionManager`: Returns session manager
53
+ - `get_agent_registry() -> AgentRegistry`: Returns agent registry
54
+ - `get_core_a2a_service() -> CoreA2AService`: Returns core A2A service
55
+ - `get_shared_artifact_service() -> BaseArtifactService | None`: Returns artifact service
56
+ - `get_namespace() -> str`: Returns A2A namespace
57
+ - `get_gateway_id() -> str`: Returns unique gateway identifier
58
+ - **Core Methods:**
59
+ - `publish_a2a(topic: str, payload: dict, user_properties: dict | None = None)`: Publishes A2A messages
60
+ - **GDK Implementation Methods:**
61
+ - `_start_listener()`: Starts FastAPI server
62
+ - `_stop_listener()`: Stops FastAPI server
63
+ - `_translate_external_input(...)`: Converts HTTP requests to A2A messages
64
+ - `_send_update_to_external(...)`: Sends intermediate updates via SSE
65
+ - `_send_final_response_to_external(...)`: Sends final responses via SSE
66
+ - `_send_error_to_external(...)`: Sends error notifications via SSE
65
67
 
66
68
  #### dependencies.py
67
- **Purpose:** Defines FastAPI dependency injectors to access shared resources managed by the WebUIBackendComponent.
68
- **Import:** `from solace_agent_mesh.gateway.http_sse.dependencies import *`
69
+ **Purpose:** FastAPI dependency injectors providing access to shared resources
70
+ **Import:** `from solace_agent_mesh.gateway.http_sse.dependencies import get_sac_component, get_agent_registry, get_sse_manager, get_user_id`
69
71
 
70
72
  **Functions:**
71
- - `get_sac_component() -> WebUIBackendComponent`: Returns the main component instance.
72
- - `get_agent_registry() -> AgentRegistry`: Returns the shared agent registry.
73
- - `get_sse_manager() -> SSEManager`: Returns the SSE manager for real-time updates.
74
- - `get_session_manager() -> SessionManager`: Returns the session manager.
75
- - `get_user_id(request: Request) -> str`: Returns the current user's identity.
76
- - `get_publish_a2a_func() -> PublishFunc`: Returns the function for publishing A2A messages.
77
- - `get_core_a2a_service() -> CoreA2AService`: Returns the core A2A service.
78
- - `get_shared_artifact_service() -> Optional[BaseArtifactService]`: Returns the artifact service.
73
+ - `get_sac_component() -> WebUIBackendComponent`: Returns main component instance
74
+ - `get_agent_registry() -> AgentRegistry`: Returns agent registry
75
+ - `get_sse_manager() -> SSEManager`: Returns SSE manager
76
+ - `get_session_manager() -> SessionManager`: Returns session manager
77
+ - `get_user_id(request: Request) -> str`: Returns current user identity
78
+ - `get_publish_a2a_func() -> PublishFunc`: Returns A2A publishing function
79
+ - `get_core_a2a_service() -> CoreA2AService`: Returns core A2A service
80
+ - `get_shared_artifact_service() -> BaseArtifactService | None`: Returns artifact service
81
+ - `get_db() -> Generator[Session, None, None]`: Returns database session
82
+ - `ValidatedUserConfig(required_scopes: list[str])`: Dependency class for scope validation
79
83
 
80
84
  #### main.py
81
- **Purpose:** Defines the FastAPI application instance, mounts routers, and configures middleware.
85
+ **Purpose:** FastAPI application instance with middleware, routing, and exception handling
82
86
  **Import:** `from solace_agent_mesh.gateway.http_sse.main import app, setup_dependencies`
83
87
 
84
88
  **Classes/Functions/Constants:**
85
- - **`app: FastAPI`**: The main FastAPI application instance.
86
- - **`setup_dependencies(component: WebUIBackendComponent)`**: Configures middleware, routers, and dependency injection based on the component instance.
89
+ - **`app: FastAPI`**: Main FastAPI application instance
90
+ - **`setup_dependencies(component: WebUIBackendComponent, database_url: str = None)`**: Configures middleware, routers, and dependency injection
91
+ - **Exception Handlers:**
92
+ - `http_exception_handler()`: Handles HTTP exceptions with format detection
93
+ - `validation_exception_handler()`: Handles Pydantic validation errors
94
+ - `generic_exception_handler()`: Handles unexpected exceptions
87
95
 
88
96
  #### session_manager.py
89
- **Purpose:** Manages web user sessions and mapping to A2A Client IDs.
97
+ **Purpose:** Manages web user sessions and mapping to A2A Client IDs
90
98
  **Import:** `from solace_agent_mesh.gateway.http_sse.session_manager import SessionManager`
91
99
 
92
100
  **Classes/Functions/Constants:**
93
- - **`SessionManager(secret_key: str, app_config: Dict[str, Any])`**: Manages user sessions and A2A identity mapping.
94
- - `get_a2a_client_id(request: Request) -> str`: Returns the A2A client ID for the current request.
95
- - `start_new_a2a_session(request: Request) -> str`: Creates a new A2A session ID.
96
- - `ensure_a2a_session(request: Request) -> str`: Ensures a session ID exists, creating one if necessary.
97
- - `store_auth_tokens(request: Request, access_token: str, refresh_token: Optional[str])`: Stores authentication tokens.
98
- - `get_access_token(request: Request) -> Optional[str]`: Retrieves stored access token.
101
+ - **`SessionManager(secret_key: str, app_config: Dict[str, Any])`**: Session management class
102
+ - `get_a2a_client_id(request: Request) -> str | None`: Returns A2A client ID
103
+ - `start_new_a2a_session(request: Request) -> str`: Creates new A2A session
104
+ - `ensure_a2a_session(request: Request) -> str`: Ensures session exists
105
+ - `store_auth_tokens(request: Request, access_token: str, refresh_token: str | None)`: Stores auth tokens
106
+ - `get_access_token(request: Request) -> str | None`: Retrieves access token
107
+ - `dep_get_client_id() -> Callable`: Returns FastAPI dependency callable
99
108
 
100
109
  #### sse_manager.py
101
- **Purpose:** Manages Server-Sent Event (SSE) connections for streaming task updates.
110
+ **Purpose:** Manages Server-Sent Event connections for streaming task updates
102
111
  **Import:** `from solace_agent_mesh.gateway.http_sse.sse_manager import SSEManager`
103
112
 
104
113
  **Classes/Functions/Constants:**
105
- - **`SSEManager(max_queue_size: int = 200)`**: Manages active SSE connections and distributes events.
106
- - `create_sse_connection(task_id: str) -> asyncio.Queue`: Creates a new SSE connection queue for a task.
107
- - `send_event(task_id: str, event_data: Dict[str, Any], event_type: str)`: Sends an event to all connections for a task.
108
- - `close_all_for_task(task_id: str)`: Closes all SSE connections for a specific task.
109
- - `close_all()`: Closes all active SSE connections.
114
+ - **`SSEManager(max_queue_size: int, event_buffer: SSEEventBuffer)`**: SSE connection manager
115
+ - `create_sse_connection(task_id: str) -> asyncio.Queue`: Creates SSE connection queue
116
+ - `send_event(task_id: str, event_data: Dict[str, Any], event_type: str)`: Sends event to connections
117
+ - `close_all_for_task(task_id: str)`: Closes connections for specific task
118
+ - `close_all()`: Closes all active connections
119
+
120
+ #### sse_event_buffer.py
121
+ **Purpose:** Thread-safe buffer for holding early SSE events before client connection
122
+ **Import:** `from solace_agent_mesh.gateway.http_sse.sse_event_buffer import SSEEventBuffer`
123
+
124
+ **Classes/Functions/Constants:**
125
+ - **`SSEEventBuffer(max_queue_size: int, max_age_seconds: int)`**: Event buffering system
126
+ - `buffer_event(task_id: str, event: Dict[str, Any])`: Buffers event for task
127
+ - `get_and_remove_buffer(task_id: str) -> Optional[List[Dict[str, Any]]]`: Retrieves and removes buffer
128
+ - `cleanup_stale_buffers()`: Removes old buffers
110
129
 
111
130
  ### Subdirectory APIs
112
131
 
132
+ #### alembic/
133
+ **Purpose:** Database migration configuration and version files for schema management
134
+ **Key Exports:** Migration functions for schema evolution (upgrade/downgrade operations)
135
+ **Import Examples:**
136
+ ```python
137
+ # These are migration files executed by Alembic CLI, not directly imported
138
+ # Access via Alembic commands:
139
+ # alembic upgrade head
140
+ # alembic downgrade base
141
+ ```
142
+
113
143
  #### components/
114
- **Purpose:** Contains specialized SAC components for message forwarding and visualization
115
- **Key Exports:** `VisualizationForwarderComponent`
144
+ **Purpose:** Specialized SAC components for message forwarding and visualization
145
+ **Key Exports:** `VisualizationForwarderComponent`, `TaskLoggerForwarderComponent`
116
146
  **Import Examples:**
117
147
  ```python
118
148
  from solace_agent_mesh.gateway.http_sse.components import VisualizationForwarderComponent
149
+ from solace_agent_mesh.gateway.http_sse.components.task_logger_forwarder import TaskLoggerForwarderComponent
150
+ ```
151
+
152
+ #### repository/
153
+ **Purpose:** Data access layer implementing Repository pattern with SQLAlchemy ORM models
154
+ **Key Exports:** Repository interfaces, implementations, domain entities, and SQLAlchemy models
155
+ **Import Examples:**
156
+ ```python
157
+ from solace_agent_mesh.gateway.http_sse.repository import (
158
+ ISessionRepository, IMessageRepository, SessionRepository, MessageRepository,
159
+ Session, Message, SessionHistory, Base, SessionModel, MessageModel
160
+ )
119
161
  ```
120
162
 
121
163
  #### routers/
122
- **Purpose:** Defines FastAPI APIRouter modules for all REST API endpoints
164
+ **Purpose:** FastAPI router modules defining REST API endpoints
123
165
  **Key Exports:** Router instances for agents, tasks, SSE, artifacts, auth, config, sessions, people, users, visualization
124
166
  **Import Examples:**
125
167
  ```python
@@ -128,15 +170,33 @@ from solace_agent_mesh.gateway.http_sse.routers.tasks import CancelTaskApiPayloa
128
170
  ```
129
171
 
130
172
  #### services/
131
- **Purpose:** Encapsulates business logic for domain-specific operations
132
- **Key Exports:** `AgentService`, `TaskService`, `PeopleService`
173
+ **Purpose:** Business logic layer for domain-specific operations
174
+ **Key Exports:** `AgentCardService`, `TaskService`, `PeopleService`, `SessionService`, `FeedbackService`, `TaskLoggerService`
133
175
  **Import Examples:**
134
176
  ```python
135
- from solace_agent_mesh.gateway.http_sse.services.agent_service import AgentService
177
+ from solace_agent_mesh.gateway.http_sse.services.agent_card_service import AgentCardService
136
178
  from solace_agent_mesh.gateway.http_sse.services.task_service import TaskService
137
179
  from solace_agent_mesh.gateway.http_sse.services.people_service import PeopleService
138
180
  ```
139
181
 
182
+ #### shared/
183
+ **Purpose:** Common utilities, constants, enums, and exception handling
184
+ **Key Exports:** Authentication utilities, timestamp functions, enums, exception handlers, and type definitions
185
+ **Import Examples:**
186
+ ```python
187
+ from solace_agent_mesh.gateway.http_sse.shared import get_current_user, now_epoch_ms
188
+ from solace_agent_mesh.gateway.http_sse.shared.enums import SenderType, TaskStatus
189
+ from solace_agent_mesh.gateway.http_sse.shared.types import UserId, SessionId, PaginationInfo
190
+ ```
191
+
192
+ #### utils/
193
+ **Purpose:** Utility functions for creating .stim file structures from task data
194
+ **Key Exports:** `create_stim_from_task_data`
195
+ **Import Examples:**
196
+ ```python
197
+ from solace_agent_mesh.gateway.http_sse.utils.stim_utils import create_stim_from_task_data
198
+ ```
199
+
140
200
  ## Complete Usage Guide
141
201
 
142
202
  ### 1. Setting Up the Gateway Application
@@ -155,13 +215,27 @@ app_config = {
155
215
  "cors_allowed_origins": ["http://localhost:3000"],
156
216
  "frontend_welcome_message": "Welcome to my A2A system!",
157
217
  "frontend_bot_name": "My Assistant",
158
- # ... other configuration parameters
218
+ # Database configuration for persistence
219
+ "session_service": {
220
+ "type": "sql",
221
+ "database_url": "sqlite:///./sessions.db"
222
+ },
223
+ # Task logging configuration
224
+ "task_logging": {
225
+ "enabled": True,
226
+ "log_status_updates": True,
227
+ "log_artifact_events": True
228
+ },
229
+ # Data retention configuration
230
+ "data_retention": {
231
+ "enabled": True,
232
+ "task_retention_days": 90,
233
+ "cleanup_interval_hours": 24
234
+ }
159
235
  }
160
236
 
161
- # Initialize the app
237
+ # Initialize and run the app
162
238
  webui_app = WebUIBackendApp(app_info=app_config)
163
-
164
- # Run the app (this starts the FastAPI server)
165
239
  webui_app.run()
166
240
  ```
167
241
 
@@ -173,7 +247,9 @@ from solace_agent_mesh.gateway.http_sse.dependencies import (
173
247
  get_agent_registry,
174
248
  get_user_id,
175
249
  get_publish_a2a_func,
176
- get_core_a2a_service
250
+ get_core_a2a_service,
251
+ get_sse_manager,
252
+ ValidatedUserConfig
177
253
  )
178
254
  from solace_agent_mesh.common.agent_registry import AgentRegistry
179
255
 
@@ -183,7 +259,8 @@ router = APIRouter()
183
259
  async def my_custom_endpoint(
184
260
  user_id: str = Depends(get_user_id),
185
261
  agent_registry: AgentRegistry = Depends(get_agent_registry),
186
- publish_func = Depends(get_publish_a2a_func)
262
+ publish_func = Depends(get_publish_a2a_func),
263
+ user_config: dict = Depends(ValidatedUserConfig(["custom:endpoint:access"]))
187
264
  ):
188
265
  # Access discovered agents
189
266
  agents = agent_registry.get_all_agents()
@@ -195,105 +272,28 @@ async def my_custom_endpoint(
195
272
  user_properties={"clientId": user_id}
196
273
  )
197
274
 
198
- return {"agents_count": len(agents), "user_id": user_id}
275
+ return {"agents": len(agents), "user": user_id}
199
276
  ```
200
277
 
201
- ### 3. Managing SSE Connections
278
+ ### 3. Working with Sessions and Messages
202
279
 
203
280
  ```python
204
- from fastapi import APIRouter, Depends
205
- from fastapi.responses import StreamingResponse
206
- from solace_agent_mesh.gateway.http_sse.dependencies import get_sse_manager
207
- from solace_agent_mesh.gateway.http_sse.sse_manager import SSEManager
208
- import asyncio
209
- import json
210
-
211
- router = APIRouter()
212
-
213
- @router.get("/my-sse-endpoint/{task_id}")
214
- async def my_sse_endpoint(
215
- task_id: str,
216
- sse_manager: SSEManager = Depends(get_sse_manager)
217
- ):
218
- # Create SSE connection for the task
219
- connection_queue = await sse_manager.create_sse_connection(task_id)
220
-
221
- async def event_generator():
222
- try:
223
- while True:
224
- # Wait for events from the queue
225
- event = await connection_queue.get()
226
- if event is None: # Close signal
227
- break
228
-
229
- # Format as SSE
230
- yield f"event: {event['event']}\n"
231
- yield f"data: {event['data']}\n\n"
232
-
233
- except asyncio.CancelledError:
234
- pass
235
- finally:
236
- # Clean up connection
237
- await sse_manager.remove_sse_connection(task_id, connection_queue)
238
-
239
- return StreamingResponse(
240
- event_generator(),
241
- media_type="text/event-stream",
242
- headers={
243
- "Cache-Control": "no-cache",
244
- "Connection": "keep-alive",
245
- }
246
- )
247
-
248
- # Send events to SSE connections
249
- async def send_custom_event(sse_manager: SSEManager, task_id: str):
250
- await sse_manager.send_event(
251
- task_id=task_id,
252
- event_data={"message": "Custom event", "timestamp": "2024-01-01T00:00:00Z"},
253
- event_type="custom_event"
254
- )
255
- ```
256
-
257
- ### 4. Working with Sessions and User Identity
258
-
259
- ```python
260
- from fastapi import APIRouter, Depends, Request
281
+ from fastapi import Depends
282
+ from sqlalchemy.orm import Session
261
283
  from solace_agent_mesh.gateway.http_sse.dependencies import (
262
- get_session_manager,
263
- get_user_id,
264
- ensure_session_id
284
+ get_db, get_session_business_service_optional
265
285
  )
266
- from solace_agent_mesh.gateway.http_sse.session_manager import SessionManager
267
-
268
- router = APIRouter()
286
+ from solace_agent_mesh.gateway.http_sse.services.session_service import SessionService
287
+ from solace_agent_mesh.gateway.http_sse.shared.enums import SenderType
269
288
 
270
- @router.post("/start-conversation")
271
- async def start_conversation(
272
- request: Request,
289
+ @router.post("/sessions/{session_id}/messages")
290
+ async def add_message_to_session(
291
+ session_id: str,
292
+ message_text: str,
273
293
  user_id: str = Depends(get_user_id),
274
- session_id: str = Depends(ensure_session_id),
275
- session_manager: SessionManager = Depends(get_session_manager)
294
+ db: Session = Depends(get_db),
295
+ session_service: SessionService = Depends(get_session_business_service_optional)
276
296
  ):
277
- # Start a new A2A session for this conversation
278
- new_session_id = session_manager.start_new_a2a_session(request)
279
-
280
- return {
281
- "user_id": user_id,
282
- "old_session_id": session_id,
283
- "new_session_id": new_session_id,
284
- "message": "New conversation started"
285
- }
286
- ```
287
-
288
- ### 5. Using Services for Business Logic
289
-
290
- ```python
291
- from fastapi import APIRouter, Depends
292
- from solace_agent_mesh.gateway.http_sse.dependencies import (
293
- get_agent_service,
294
- get_task_service,
295
- get_people_service
296
- )
297
- from solace_agent_mesh.gateway.http_sse.services.agent_service import AgentService
297
+ if session_
298
298
 
299
- # content_hash: 765fb33c6a30298c67ac7c1525df5787791b2b37e0d69b046e405aec85287feb
299
+ # content_hash: 1ec069cbf74863d29b45cd3b1031e6ab820e1b30d7c8b631488a54630a936828