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,32 +1,41 @@
1
+ I notice the content was cut off at the end. Let me provide the complete developer guide based on the available information:
2
+
1
3
  # DEVELOPER GUIDE: gateway
2
4
 
3
5
  ## Quick Summary
4
- The `gateway` directory provides a comprehensive framework for building gateway implementations that bridge external platforms with the Solace AI Connector's A2A (Agent-to-Agent) messaging system. The architecture consists of a foundational base framework and three specialized gateway implementations: HTTP/SSE for web interfaces, Slack for team collaboration, and Webhook for external system integration. All gateways share common patterns for authentication, message translation, and real-time communication while providing platform-specific features.
6
+ The `gateway` directory provides a comprehensive framework for building gateways that connect external platforms (Slack, HTTP/SSE web interfaces) to the Solace AI Connector's A2A (Agent-to-Agent) messaging system. The architecture consists of a foundational `base` module that defines abstract classes for gateway implementations, and specific gateway implementations like `slack` for Slack integration and `http_sse` for web-based interfaces. The framework handles authentication, message translation between external formats and A2A protocol, real-time streaming updates, and manages the complete lifecycle of requests from external platforms to AI agents.
5
7
 
6
8
  ## Files and Subdirectories Overview
7
9
  - **Direct files:**
8
- - `__init__.py`: Marks the directory as a Python package.
10
+ - `__init__.py`: Standard Python package initializer
11
+ - `gateway_llm.txt`: Documentation or configuration file for LLM-related gateway functionality
12
+
9
13
  - **Subdirectories:**
10
- - `base/`: Foundational classes and utilities for building all gateway implementations.
11
- - `http_sse/`: A complete HTTP/SSE gateway with a FastAPI web server for real-time web UI backends.
12
- - `slack/`: A gateway for integrating with the Slack collaboration platform.
13
- - `webhook/`: A universal webhook gateway for receiving HTTP requests from external systems.
14
+ - `base/`: Foundational abstract classes and utilities for building gateway implementations
15
+ - `slack/`: Complete Slack platform integration gateway with bot functionality
16
+ - `http_sse/`: HTTP/Server-Sent Events gateway for web-based user interfaces
14
17
 
15
18
  ## Developer API Reference
16
19
 
17
20
  ### Direct Files
18
21
 
19
22
  #### __init__.py
20
- **Purpose:** Initializes the `gateway` module, making it a Python package.
23
+ **Purpose:** Initializes the `gateway` Python package
21
24
  **Import:** `from solace_agent_mesh.gateway import ...`
22
25
 
23
26
  **Classes/Functions/Constants:**
24
27
  This file is empty and contains no direct exports.
25
28
 
29
+ #### gateway_llm.txt
30
+ **Purpose:** Documentation or configuration file for LLM-related gateway functionality
31
+ **Import:** Not applicable (text/documentation file)
32
+
33
+ **Content:** This appears to be a documentation or configuration file rather than executable code.
34
+
26
35
  ### Subdirectory APIs
27
36
 
28
37
  #### base/
29
- **Purpose:** Provides the foundational, abstract classes for building all Gateway implementations. It establishes a framework for configuration, A2A message handling, and managing the lifecycle of requests from external platforms.
38
+ **Purpose:** Provides foundational abstract classes for building Gateway implementations
30
39
  **Key Exports:** `BaseGatewayApp`, `BaseGatewayComponent`, `TaskContextManager`
31
40
  **Import Examples:**
32
41
  ```python
@@ -35,332 +44,330 @@ from solace_agent_mesh.gateway.base.component import BaseGatewayComponent
35
44
  from solace_agent_mesh.gateway.base.task_context import TaskContextManager
36
45
  ```
37
46
 
38
- #### http_sse/
39
- **Purpose:** Implements a complete HTTP/SSE gateway to serve a web-based user interface, bridging web protocols with the backend A2A messaging fabric.
40
- **Key Exports:** `WebUIBackendApp`, `WebUIBackendComponent`, `SSEManager`, `SessionManager`, and various dependency injectors.
41
- **Import Examples:**
42
- ```python
43
- from solace_agent_mesh.gateway.http_sse.app import WebUIBackendApp
44
- from solace_agent_mesh.gateway.http_sse.component import WebUIBackendComponent
45
- from solace_agent_mesh.gateway.http_sse.sse_manager import SSEManager
46
- from solace_agent_mesh.gateway.http_sse.session_manager import SessionManager
47
- from solace_agent_mesh.gateway.http_sse.dependencies import get_agent_service, get_task_service, get_user_id
48
- ```
49
-
50
47
  #### slack/
51
- **Purpose:** Provides a gateway for integrating the Solace AI Connector with the Slack collaboration platform, enabling bot interactions within Slack channels and threads.
52
- **Key Exports:** `SlackGatewayApp`, `SlackGatewayComponent`, and various utility functions.
48
+ **Purpose:** Complete Slack platform integration with bot functionality, event handling, and A2A message translation
49
+ **Key Exports:** `SlackGatewayApp`, `SlackGatewayComponent`, utility functions for Slack operations
53
50
  **Import Examples:**
54
51
  ```python
55
52
  from solace_agent_mesh.gateway.slack.app import SlackGatewayApp
56
53
  from solace_agent_mesh.gateway.slack.component import SlackGatewayComponent
57
- from solace_agent_mesh.gateway.slack.utils import generate_a2a_session_id, send_slack_message, correct_slack_markdown
54
+ from solace_agent_mesh.gateway.slack.utils import generate_a2a_session_id, send_slack_message
58
55
  ```
59
56
 
60
- #### webhook/
61
- **Purpose:** Provides a universal webhook gateway for receiving HTTP requests from external systems and triggering A2A tasks. It is highly configurable for different authentication methods, payload formats, and target agents.
62
- **Key Exports:** `WebhookGatewayApp`, `WebhookGatewayComponent`
57
+ #### http_sse/
58
+ **Purpose:** HTTP/Server-Sent Events gateway for web-based user interfaces with real-time streaming
59
+ **Key Exports:** `WebUIBackendApp`, `WebUIBackendComponent`, `SSEManager`, `SessionManager`, routers, services
63
60
  **Import Examples:**
64
61
  ```python
65
- from solace_agent_mesh.gateway.webhook.app import WebhookGatewayApp
66
- from solace_agent_mesh.gateway.webhook.component import WebhookGatewayComponent
67
- from solace_agent_mesh.gateway.webhook.dependencies import get_sac_component
62
+ from solace_agent_mesh.gateway.http_sse.app import WebUIBackendApp
63
+ from solace_agent_mesh.gateway.http_sse.component import WebUIBackendComponent
64
+ from solace_agent_mesh.gateway.http_sse.sse_manager import SSEManager
65
+ from solace_agent_mesh.gateway.http_sse.dependencies import get_sse_manager, get_session_manager
68
66
  ```
69
67
 
70
68
  ## Complete Usage Guide
71
69
 
72
- ### 1. Creating a Custom Gateway
73
-
74
- This example shows how to use the `base` module to build a new gateway for a hypothetical external platform.
70
+ ### 1. Creating a Custom Gateway Implementation
75
71
 
76
72
  ```python
77
- # my_gateway/app.py
78
- from typing import Type, List, Dict, Any
73
+ from typing import Type, List, Dict, Any, Optional, Tuple, Union
79
74
  from solace_agent_mesh.gateway.base.app import BaseGatewayApp
80
- from .component import MyGatewayComponent
75
+ from solace_agent_mesh.gateway.base.component import BaseGatewayComponent
76
+ from solace_agent_mesh.common.a2a.types import ContentPart, TextPart
77
+ from a2a.types import Task, TaskStatusUpdateEvent, TaskArtifactUpdateEvent, JSONRPCError
81
78
 
82
- class MyGatewayApp(BaseGatewayApp):
83
- """Defines the application and its configuration for My Platform."""
79
+ # Step 1: Define your gateway app class
80
+ class MyCustomGatewayApp(BaseGatewayApp):
81
+ """Custom gateway for My Platform integration."""
84
82
 
83
+ # Define platform-specific configuration parameters
85
84
  SPECIFIC_APP_SCHEMA_PARAMS: List[Dict[str, Any]] = [
86
85
  {
87
86
  "name": "my_platform_api_key",
88
87
  "required": True,
89
88
  "type": "string",
90
- "description": "API key for connecting to My Platform."
89
+ "description": "API key for My Platform"
91
90
  },
92
91
  {
93
92
  "name": "my_platform_webhook_url",
94
93
  "required": False,
95
94
  "type": "string",
96
- "description": "Webhook URL for receiving events from My Platform."
95
+ "description": "Webhook URL for receiving events"
96
+ },
97
+ {
98
+ "name": "default_agent_name",
99
+ "required": False,
100
+ "type": "string",
101
+ "default": "assistant",
102
+ "description": "Default agent to route messages to"
97
103
  }
98
104
  ]
99
105
 
100
- def _get_gateway_component_class(self) -> Type[MyGatewayComponent]:
101
- return MyGatewayComponent
106
+ def _get_gateway_component_class(self) -> Type[BaseGatewayComponent]:
107
+ return MyCustomGatewayComponent
102
108
 
103
- # my_gateway/component.py
104
- from typing import Any, Dict, List, Optional, Tuple, Union
105
- from solace_agent_mesh.gateway.base.component import BaseGatewayComponent
106
- from a2a.types import Part as A2APart, TextPart, Task, TaskStatusUpdateEvent, TaskArtifactUpdateEvent, JSONRPCError
107
-
108
- class MyGatewayComponent(BaseGatewayComponent):
109
+ # Step 2: Implement your gateway component
110
+ class MyCustomGatewayComponent(BaseGatewayComponent):
111
+ """Component implementing My Platform integration logic."""
109
112
 
110
113
  def __init__(self, **kwargs):
111
114
  super().__init__(**kwargs)
112
115
  self.api_key = self.get_config("my_platform_api_key")
113
116
  self.webhook_url = self.get_config("my_platform_webhook_url")
114
- self.server = None
117
+ self.default_agent = self.get_config("default_agent_name", "assistant")
118
+ self.platform_client = None # Initialize your platform client
115
119
 
116
120
  async def _extract_initial_claims(self, external_event_data: Any) -> Optional[Dict[str, Any]]:
117
- """Extract user identity from platform-specific event."""
121
+ """Extract user identity from platform event."""
122
+ # Example: Extract user ID from your platform's event structure
118
123
  if hasattr(external_event_data, 'user_id'):
119
- return {"id": external_event_data.user_id, "source": "my_platform"}
124
+ return {
125
+ "id": external_event_data.user_id,
126
+ "platform": "my_platform",
127
+ "username": getattr(external_event_data, 'username', None)
128
+ }
120
129
  return None
121
130
 
122
131
  def _start_listener(self) -> None:
123
- """Start your platform listener (web server, etc.)."""
124
- # Example: Start a web server to receive webhooks
125
- from fastapi import FastAPI
126
- import uvicorn
127
-
128
- app = FastAPI()
129
-
130
- @app.post("/webhook")
131
- async def handle_webhook(request_data: dict):
132
- await self.handle_external_event(request_data)
133
- return {"status": "ok"}
134
-
135
- self.server = uvicorn.Server(
136
- uvicorn.Config(app, host="0.0.0.0", port=8080)
137
- )
138
- # Start server in background thread
139
- import threading
140
- self.server_thread = threading.Thread(target=self.server.run)
141
- self.server_thread.start()
132
+ """Start your platform's event listener."""
133
+ # Example: Start webhook server, WebSocket connection, etc.
134
+ print(f"Starting My Platform listener on {self.webhook_url}")
135
+ # Initialize your platform client/listener here
142
136
 
143
137
  def _stop_listener(self) -> None:
144
- """Stop your platform listener."""
145
- if self.server:
146
- self.server.should_exit = True
138
+ """Stop your platform's event listener."""
139
+ print("Stopping My Platform listener")
140
+ # Clean up platform client/listener here
147
141
 
148
- def _translate_external_input(self, external_event: Any) -> Tuple[str, List[A2APart], Dict[str, Any]]:
149
- """Convert external event to A2A format."""
150
- target_agent = external_event.get("target_agent", "default-agent")
151
- message_text = external_event.get("message", "Hello")
142
+ async def _translate_external_input(self, external_event: Any) -> Tuple[str, List[ContentPart], Dict[str, Any]]:
143
+ """Convert platform event to A2A format."""
144
+ # Extract message content
145
+ message_text = getattr(external_event, 'message', '')
146
+
147
+ # Determine target agent (could be extracted from message or use default)
148
+ target_agent = getattr(external_event, 'target_agent', self.default_agent)
152
149
 
150
+ # Create A2A content parts
153
151
  a2a_parts = [TextPart(text=message_text)]
154
152
 
153
+ # Create context for tracking this request
155
154
  context = {
156
155
  "platform": "my_platform",
157
- "user_id_for_artifacts": external_event.get("user_id"),
158
- "a2a_session_id": f"my-platform-{external_event.get('session_id', 'default')}"
156
+ "event_id": getattr(external_event, 'id', ''),
157
+ "channel_id": getattr(external_event, 'channel_id', ''),
158
+ "user_id_for_artifacts": getattr(external_event, 'user_id', ''),
159
+ "a2a_session_id": f"my_platform_{getattr(external_event, 'session_id', '')}"
159
160
  }
160
161
 
161
162
  return target_agent, a2a_parts, context
162
163
 
163
- async def _send_update_to_external(self, external_request_context: Dict[str, Any],
164
+ async def _send_update_to_external(self,
165
+ external_request_context: Dict[str, Any],
164
166
  event_data: Union[TaskStatusUpdateEvent, TaskArtifactUpdateEvent],
165
167
  is_final_chunk_of_update: bool) -> None:
166
- """Send streaming update back to external platform."""
167
- # Extract text from event and send to your platform
168
+ """Send streaming update to your platform."""
169
+ channel_id = external_request_context.get("channel_id")
170
+
171
+ # Extract text content from the event
168
172
  if hasattr(event_data, 'text_delta'):
169
- await self.send_to_platform(
170
- user_id=external_request_context["user_id_for_artifacts"],
171
- message=event_data.text_delta,
172
- is_partial=not is_final_chunk_of_update
173
- )
173
+ text_content = event_data.text_delta
174
+ elif hasattr(event_data, 'content'):
175
+ text_content = str(event_data.content)
176
+ else:
177
+ text_content = "Update received"
178
+
179
+ # Send to your platform (example)
180
+ await self._send_to_platform(channel_id, text_content, is_partial=not is_final_chunk_of_update)
174
181
 
175
- async def _send_final_response_to_external(self, external_request_context: Dict[str, Any],
182
+ async def _send_final_response_to_external(self,
183
+ external_request_context: Dict[str, Any],
176
184
  task_data: Task) -> None:
177
- """Send final response back to external platform."""
178
- final_text = ""
179
- for part in task_data.result.parts:
180
- if hasattr(part, 'text'):
181
- final_text += part.text
185
+ """Send final response to your platform."""
186
+ channel_id = external_request_context.get("channel_id")
187
+
188
+ # Extract final response from task data
189
+ final_response = "Task completed"
190
+ if task_data.result and hasattr(task_data.result, 'content'):
191
+ final_response = str(task_data.result.content)
182
192
 
183
- await self.send_to_platform(
184
- user_id=external_request_context["user_id_for_artifacts"],
185
- message=final_text,
186
- is_final=True
187
- )
193
+ await self._send_to_platform(channel_id, final_response, is_final=True)
188
194
 
189
- async def _send_error_to_external(self, external_request_context: Dict[str, Any],
195
+ async def _send_error_to_external(self,
196
+ external_request_context: Dict[str, Any],
190
197
  error_data: JSONRPCError) -> None:
191
- """Send error back to external platform."""
192
- await self.send_to_platform(
193
- user_id=external_request_context["user_id_for_artifacts"],
194
- message=f"Error: {error_data.message}",
195
- is_error=True
196
- )
198
+ """Send error to your platform."""
199
+ channel_id = external_request_context.get("channel_id")
200
+ error_message = f"Error: {error_data.message}"
201
+ await self._send_to_platform(channel_id, error_message, is_error=True)
197
202
 
198
- async def send_to_platform(self, user_id: str, message: str, **kwargs):
203
+ async def _send_to_platform(self, channel_id: str, message: str, **kwargs):
199
204
  """Helper method to send messages to your platform."""
200
- # Implement your platform-specific sending logic here
201
- print(f"Sending to {user_id}: {message}")
205
+ # Implement your platform's message sending logic here
206
+ print(f"Sending to {channel_id}: {message}")
202
207
 
203
- # Usage
208
+ # Step 3: Usage
204
209
  if __name__ == "__main__":
205
- app_config = {
206
- "namespace": "myorg/prod",
210
+ config = {
211
+ "name": "my-custom-gateway",
212
+ "namespace": "/myorg/prod",
207
213
  "gateway_id": "my-gateway-01",
208
- "my_platform_api_key": "secret-key-here",
209
- "my_platform_webhook_url": "https://myplatform.com/webhook"
214
+ "my_platform_api_key": "your-api-key",
215
+ "my_platform_webhook_url": "https://my-webhook.example.com",
216
+ "default_agent_name": "my-assistant",
217
+ "solace_config": {
218
+ "broker_url": "tcp://localhost:55555",
219
+ "vpn_name": "default",
220
+ "username": "default",
221
+ "password": "default"
222
+ }
210
223
  }
211
224
 
212
- gateway_app = MyGatewayApp(app_info=app_config)
213
- gateway_app.run()
225
+ app = MyCustomGatewayApp(app_info=config)
226
+ app.run()
214
227
  ```
215
228
 
216
- ### 2. Using the HTTP/SSE Gateway
229
+ ### 2. Using the Slack Gateway
217
230
 
218
231
  ```python
219
- from solace_agent_mesh.gateway.http_sse.app import WebUIBackendApp
232
+ from solace_agent_mesh.gateway.slack.app import SlackGatewayApp
220
233
 
221
- # Configuration for the web UI gateway
222
- app_config = {
223
- "name": "my-webui-gateway",
224
- "session_secret_key": "your-secret-key-here",
225
- "fastapi_host": "0.0.0.0",
226
- "fastapi_port": 8000,
227
- "namespace": "myorg/prod",
228
- "gateway_id": "webui-gateway-01",
229
- "cors_allowed_origins": ["http://localhost:3000"],
230
- "frontend_welcome_message": "Welcome to my A2A system!",
231
- "frontend_bot_name": "My Assistant",
232
- "frontend_enable_file_upload": True,
233
- "frontend_enable_agent_selection": True
234
+ # Configure Slack gateway
235
+ slack_config = {
236
+ "name": "my-slack-bot",
237
+ "namespace": "/myorg/prod",
238
+ "gateway_id": "slack-bot-01",
239
+
240
+ # Slack credentials (get these from your Slack app)
241
+ "slack_bot_token": "xoxb-your-bot-token",
242
+ "slack_app_token": "xapp-your-app-token",
243
+ "slack_signing_secret": "your-signing-secret",
244
+
245
+ # Gateway settings
246
+ "default_agent_name": "assistant",
247
+ "enable_socket_mode": True,
248
+ "enable_file_upload": True,
249
+ "slack_request_timeout": 30,
250
+
251
+ # A2A system configuration
252
+ "solace_config": {
253
+ "broker_url": "tcp://localhost:55555",
254
+ "vpn_name": "default",
255
+ "username": "default",
256
+ "password": "default"
257
+ }
234
258
  }
235
259
 
236
- # Initialize and run the web UI gateway
237
- webui_app = WebUIBackendApp(app_info=app_config)
238
- webui_app.run()
239
-
240
- # The gateway will start a FastAPI server with endpoints like:
241
- # GET /api/agents - List available agents
242
- # POST /api/tasks - Submit new tasks
243
- # GET /api/tasks/{task_id}/sse - Stream task updates via SSE
244
- # POST /api/artifacts - Upload files
260
+ # Create and run the Slack gateway
261
+ slack_app = SlackGatewayApp(app_info=slack_config)
262
+ slack_app.run()
245
263
  ```
246
264
 
247
- ### 3. Creating Custom API Endpoints for HTTP/SSE Gateway
265
+ ### 3. Using the HTTP/SSE Gateway for Web Interfaces
248
266
 
249
267
  ```python
268
+ from solace_agent_mesh.gateway.http_sse.app import WebUIBackendApp
250
269
  from fastapi import APIRouter, Depends, Request
251
270
  from solace_agent_mesh.gateway.http_sse.dependencies import (
252
- get_agent_registry,
253
- get_user_id,
254
- get_publish_a2a_func,
255
- get_sse_manager,
256
- get_session_manager
271
+ get_sse_manager, get_session_manager, get_core_a2a_service
257
272
  )
258
273
 
259
- # Create a custom router
274
+ # Configure web UI gateway
275
+ webui_config = {
276
+ "name": "my-webui",
277
+ "session_secret_key": "your-secret-key",
278
+ "fastapi_host": "0.0.0.0",
279
+ "fastapi_port": 8000,
280
+ "namespace": "/myorg/prod",
281
+ "gateway_id": "webui-01",
282
+ "cors_allowed_origins": ["http://localhost:3000"],
283
+ "frontend_welcome_message": "Welcome to AI Assistant!",
284
+ "frontend_bot_name": "Assistant",
285
+ "frontend_enable_file_upload": True,
286
+ "frontend_enable_agent_selection": True,
287
+
288
+ # Database for session persistence
289
+ "session_service": {
290
+ "type": "sql",
291
+ "database_url": "sqlite:///./sessions.db"
292
+ },
293
+
294
+ # A2A system configuration
295
+ "solace_config": {
296
+ "broker_url": "tcp://localhost:55555",
297
+ "vpn_name": "default",
298
+ "username": "default",
299
+ "password": "default"
300
+ }
301
+ }
302
+
303
+ # Create custom router for additional endpoints
260
304
  custom_router = APIRouter(prefix="/api/custom")
261
305
 
262
- @custom_router.get("/my-agents")
263
- async def get_my_agents(
264
- user_id: str = Depends(get_user_id),
265
- agent_registry = Depends(get_agent_registry)
266
- ):
267
- """Get agents filtered by user permissions."""
268
- all_agents = agent_registry.get_all_agents()
269
- # Filter agents based on user permissions
270
- user_agents = [agent for agent in all_agents if user_can_access_agent(user_id, agent)]
271
- return {"agents": user_agents, "user_id": user_id}
272
-
273
- @custom_router.post("/broadcast-message")
274
- async def broadcast_message(
275
- message: str,
276
- publish_func = Depends(get_publish_a2a_func),
277
- user_id: str = Depends(get_user_id)
306
+ @custom_router.get("/my-endpoint")
307
+ async def my_custom_endpoint(
308
+ request: Request,
309
+ sse_manager = Depends(get_sse_manager),
310
+ session_manager = Depends(get_session_manager)
278
311
  ):
279
- """Broadcast a message to all agents."""
280
- publish_func(
281
- topic="/myorg/prod/a2a/v1/broadcast",
282
- payload={
283
- "method": "broadcast/message",
284
- "params": {"message": message, "from_user": user_id}
285
- },
286
- user_properties={"clientId": user_id}
287
- )
288
- return {"status": "broadcasted", "message": message}
312
+ """Custom endpoint with access to gateway services."""
313
+ user_id = session_manager.get_a2a_client_id(request)
314
+ return {"user_id": user_id, "message": "Custom endpoint response"}
289
315
 
290
- # Add the router to your FastAPI app
291
- # This would typically be done in the main.py or during app setup
316
+ # Create and run the web UI gateway
317
+ webui_app = WebUIBackendApp(app_info=webui_config)
318
+ webui_app.run()
292
319
  ```
293
320
 
294
- ### 4. Using the Slack Gateway
321
+ ### 4. Working with Task Context and Session Management
295
322
 
296
323
  ```python
297
- from solace_agent_mesh.gateway.slack.app import SlackGatewayApp
298
-
299
- # Configuration for Slack gateway
300
- slack_config = {
301
- "name": "my-slack-gateway",
302
- "namespace": "myorg/prod",
303
- "gateway_id": "slack-gateway-01",
304
- "slack_bot_token": "xoxb-your-bot-token",
305
- "slack_app_token": "xapp-your-app-token",
306
- "slack_signing_secret": "your-signing-secret",
307
- "default_agent_name": "assistant",
308
- "enable_socket_mode": True,
309
- "enable_file_upload": True
310
- }
311
-
312
- # Initialize and run the Slack gateway
313
- slack_app = SlackGatewayApp(app_info=slack_config)
314
- slack_app.run()
315
-
316
- # The gateway will:
317
- # - Connect to Slack via Socket Mode or HTTP
318
- # - Listen for mentions and direct messages
319
- # - Translate Slack messages to A2A format
320
- # - Send responses back to Slack channels/threads
321
- ```
324
+ from solace_agent_mesh.gateway.base.task_context import TaskContextManager
325
+ from solace_agent_mesh.gateway.http_sse.session_manager import SessionManager
322
326
 
323
- ### 5. Using the Webhook Gateway
327
+ # Task context management (used internally by gateways)
328
+ context_manager = TaskContextManager()
324
329
 
325
- ```python
326
- from solace_agent_mesh.gateway.webhook.app import WebhookGatewayApp
327
-
328
- # Configuration for webhook gateway
329
- webhook_config = {
330
- "name": "my-webhook-gateway",
331
- "namespace": "myorg/prod",
332
- "gateway_id": "webhook-gateway-01",
333
- "webhook_host": "0.0.0.0",
334
- "webhook_port": 9000,
335
- "webhook_path": "/webhook",
336
- "target_agent_name": "data-processor",
337
- "auth_method": "header",
338
- "auth_header_name": "X-API-Key",
339
- "auth_header_value": "secret-webhook-key",
340
- "payload_format": "json",
341
- "user_id_extraction": {
342
- "method": "json_path",
343
- "path": "$.user.id"
344
- }
330
+ # Store context when submitting a task
331
+ task_id = "task-123"
332
+ context = {
333
+ "platform": "slack",
334
+ "channel_id": "C1234567890",
335
+ "user_id": "U1234567890",
336
+ "thread_ts": "1234567890.123456"
345
337
  }
338
+ context_manager.store_context(task_id, context)
339
+
340
+ # Retrieve context when processing response
341
+ retrieved_context = context_manager.get_context(task_id)
342
+ if retrieved_context:
343
+ # Send response back to original platform
344
+ channel_id = retrieved_context["channel_id"]
345
+
346
+ # Session management for web interfaces
347
+ session_manager = SessionManager(
348
+ secret_key="your-secret-key",
349
+ app_config={"session_timeout": 3600}
350
+ )
346
351
 
347
- # Initialize and run the webhook gateway
348
- webhook_app = WebhookGatewayApp(app_info=webhook_config)
349
- webhook_app.run()
350
-
351
- # The gateway will:
352
- # - Start an HTTP server on the specified host/port
353
- # - Authenticate incoming requests
354
- # - Extract user identity from payloads
355
- # - Convert webhook data to A2A messages
356
- # - Send to the specified target agent
352
+ # In a FastAPI endpoint
353
+ @app.get("/api/session-info")
354
+ async def get_session_info(request: Request):
355
+ # Get A2A client ID for this web session
356
+ client_id = session_manager.get_a2a_client_id(request)
357
+
358
+ # Ensure we have an A2A session
359
+ session_id = session_manager.ensure_a2a_session(request)
360
+
361
+ return {
362
+ "client_id": client_id,
363
+ "session_id": session_id
364
+ }
357
365
  ```
358
366
 
359
- ### 6. Working with Task Context Management
367
+ ### 5. Advanced Integration: Combining Multiple Gateways
360
368
 
361
369
  ```python
362
- from solace_agent_mesh.gateway.base.task_context import TaskContextManager
363
-
364
- # Initialize the task context manager (usually done by BaseGat
370
+ import asyncio
371
+ from solace_agent_mesh.gateway.slack.app import Sl
365
372
 
366
- # content_hash: 8ff3c690b39ed85edd13c1e9f2965e9da9050eeeea66823dbbad322f600f0d09
373
+ # content_hash: 39731f2779a4f0ef42b1948f8441baf5b76eff10fbfc48def5fbb270fa334f6b