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
@@ -0,0 +1,37 @@
1
+ """
2
+ Request DTOs for API endpoints.
3
+ """
4
+
5
+ from .session_requests import (
6
+ GetSessionsRequest,
7
+ GetSessionRequest,
8
+ GetSessionHistoryRequest,
9
+ UpdateSessionRequest,
10
+ DeleteSessionRequest,
11
+ CreateSessionRequest,
12
+ )
13
+ from .task_requests import (
14
+ SendTaskRequest,
15
+ SubscribeTaskRequest,
16
+ CancelTaskRequest,
17
+ GetTaskStatusRequest,
18
+ TaskFilesInfo,
19
+ ProcessedTaskRequest,
20
+ )
21
+
22
+ __all__ = [
23
+ # Session requests
24
+ "GetSessionsRequest",
25
+ "GetSessionRequest",
26
+ "GetSessionHistoryRequest",
27
+ "UpdateSessionRequest",
28
+ "DeleteSessionRequest",
29
+ "CreateSessionRequest",
30
+ # Task requests
31
+ "SendTaskRequest",
32
+ "SubscribeTaskRequest",
33
+ "CancelTaskRequest",
34
+ "GetTaskStatusRequest",
35
+ "TaskFilesInfo",
36
+ "ProcessedTaskRequest",
37
+ ]
@@ -0,0 +1,49 @@
1
+ """
2
+ Session-related request DTOs.
3
+ """
4
+
5
+ from typing import Optional, List
6
+ from pydantic import BaseModel, Field
7
+
8
+ from ....shared.types import SessionId, UserId, SortInfo, FilterInfo, PaginationInfo
9
+
10
+
11
+ class GetSessionsRequest(BaseModel):
12
+ """Request DTO for retrieving sessions."""
13
+ user_id: UserId
14
+ pagination: Optional[PaginationInfo] = None
15
+ sort: Optional[SortInfo] = None
16
+ filters: Optional[List[FilterInfo]] = None
17
+
18
+
19
+ class GetSessionRequest(BaseModel):
20
+ """Request DTO for retrieving a specific session."""
21
+ session_id: SessionId
22
+ user_id: UserId
23
+
24
+
25
+ class GetSessionHistoryRequest(BaseModel):
26
+ """Request DTO for retrieving session message history."""
27
+ session_id: SessionId
28
+ user_id: UserId
29
+ pagination: Optional[PaginationInfo] = None
30
+
31
+
32
+ class UpdateSessionRequest(BaseModel):
33
+ """Request DTO for updating session details."""
34
+ session_id: SessionId
35
+ user_id: UserId
36
+ name: str = Field(..., min_length=1, max_length=255, description="New session name")
37
+
38
+
39
+ class DeleteSessionRequest(BaseModel):
40
+ """Request DTO for deleting a session."""
41
+ session_id: SessionId
42
+ user_id: UserId
43
+
44
+
45
+ class CreateSessionRequest(BaseModel):
46
+ """Request DTO for creating a new session."""
47
+ user_id: UserId
48
+ name: Optional[str] = Field(None, max_length=255, description="Session name")
49
+ agent_id: Optional[str] = Field(None, description="Associated agent ID")
@@ -0,0 +1,66 @@
1
+ """
2
+ Task-related request DTOs.
3
+ """
4
+
5
+ from typing import List, Optional, Dict, Any
6
+ from pydantic import BaseModel, Field
7
+ from fastapi import UploadFile
8
+
9
+ from ....shared.types import TaskId, UserId, SessionId, AgentId
10
+
11
+
12
+ class SendTaskRequest(BaseModel):
13
+ """Request DTO for sending a non-streaming task."""
14
+ agent_name: str = Field(..., description="The name of the target A2A agent")
15
+ message: str = Field(..., description="The user's message or prompt")
16
+ user_id: UserId
17
+ client_id: Optional[str] = None
18
+ session_id: Optional[SessionId] = None
19
+
20
+ class Config:
21
+ # UploadFile cannot be included in Pydantic models directly
22
+ # Files will be handled separately in the controller
23
+ arbitrary_types_allowed = True
24
+
25
+
26
+ class SubscribeTaskRequest(BaseModel):
27
+ """Request DTO for sending a streaming task."""
28
+ agent_name: str = Field(..., description="The name of the target A2A agent")
29
+ message: str = Field(..., description="The user's message or prompt")
30
+ user_id: UserId
31
+ session_id: Optional[SessionId] = None
32
+ client_id: Optional[str] = None
33
+
34
+ class Config:
35
+ arbitrary_types_allowed = True
36
+
37
+
38
+ class CancelTaskRequest(BaseModel):
39
+ """Request DTO for cancelling a task."""
40
+ task_id: TaskId = Field(..., description="The ID of the task to cancel")
41
+ client_id: Optional[str] = None
42
+ user_id: UserId
43
+
44
+
45
+ class GetTaskStatusRequest(BaseModel):
46
+ """Request DTO for getting task status."""
47
+ task_id: TaskId
48
+ user_id: UserId
49
+
50
+
51
+ class TaskFilesInfo(BaseModel):
52
+ """Information about uploaded files for a task."""
53
+ filename: str
54
+ content_type: str
55
+ size: int
56
+
57
+
58
+ class ProcessedTaskRequest(BaseModel):
59
+ """Internal DTO for processed task request with file information."""
60
+ agent_name: str
61
+ message: str
62
+ user_id: UserId
63
+ session_id: Optional[SessionId] = None
64
+ client_id: Optional[str] = None
65
+ files: List[TaskFilesInfo] = []
66
+ metadata: Optional[Dict[str, Any]] = None
@@ -0,0 +1,43 @@
1
+ """
2
+ Response DTOs for API endpoints.
3
+ """
4
+
5
+ from .session_responses import (
6
+ MessageResponse,
7
+ SessionResponse,
8
+ SessionListResponse,
9
+ SessionHistoryResponse,
10
+ SessionCreatedResponse,
11
+ SessionUpdatedResponse,
12
+ SessionDeletedResponse,
13
+ )
14
+ from .task_responses import (
15
+ TaskResponse,
16
+ SendTaskResponse,
17
+ SubscribeTaskResponse,
18
+ CancelTaskResponse,
19
+ TaskStatusResponse,
20
+ TaskListResponse,
21
+ TaskErrorResponse,
22
+ JSONRPCTaskResponse,
23
+ )
24
+
25
+ __all__ = [
26
+ # Session responses
27
+ "MessageResponse",
28
+ "SessionResponse",
29
+ "SessionListResponse",
30
+ "SessionHistoryResponse",
31
+ "SessionCreatedResponse",
32
+ "SessionUpdatedResponse",
33
+ "SessionDeletedResponse",
34
+ # Task responses
35
+ "TaskResponse",
36
+ "SendTaskResponse",
37
+ "SubscribeTaskResponse",
38
+ "CancelTaskResponse",
39
+ "TaskStatusResponse",
40
+ "TaskListResponse",
41
+ "TaskErrorResponse",
42
+ "JSONRPCTaskResponse",
43
+ ]
@@ -0,0 +1,68 @@
1
+ """
2
+ Session-related response DTOs.
3
+ """
4
+
5
+ from typing import List, Optional
6
+ from datetime import datetime
7
+ from pydantic import BaseModel, Field
8
+
9
+ from ....shared.types import SessionId, UserId, MessageId, PaginationInfo, Timestamp
10
+ from ....shared.enums import SessionStatus, SenderType, MessageType
11
+
12
+
13
+ class MessageResponse(BaseModel):
14
+ """Response DTO for a chat message."""
15
+ id: MessageId
16
+ session_id: SessionId
17
+ message: str
18
+ sender_type: SenderType
19
+ sender_name: str
20
+ message_type: MessageType = MessageType.TEXT
21
+ timestamp: datetime
22
+ created_at: datetime
23
+ updated_at: Optional[datetime] = None
24
+
25
+
26
+ class SessionResponse(BaseModel):
27
+ """Response DTO for a session."""
28
+ id: SessionId
29
+ user_id: UserId
30
+ name: Optional[str] = None
31
+ agent_id: Optional[str] = None
32
+ status: SessionStatus = SessionStatus.ACTIVE
33
+ created_at: datetime
34
+ updated_at: Optional[datetime] = None
35
+ last_activity: Optional[datetime] = None
36
+
37
+
38
+ class SessionListResponse(BaseModel):
39
+ """Response DTO for a list of sessions."""
40
+ sessions: List[SessionResponse]
41
+ pagination: Optional[PaginationInfo] = None
42
+ total_count: int
43
+
44
+
45
+ class SessionHistoryResponse(BaseModel):
46
+ """Response DTO for session message history."""
47
+ session_id: SessionId
48
+ messages: List[MessageResponse]
49
+ pagination: Optional[PaginationInfo] = None
50
+ total_count: int
51
+
52
+
53
+ class SessionCreatedResponse(BaseModel):
54
+ """Response DTO for session creation."""
55
+ session: SessionResponse
56
+ message: str = "Session created successfully"
57
+
58
+
59
+ class SessionUpdatedResponse(BaseModel):
60
+ """Response DTO for session update."""
61
+ session: SessionResponse
62
+ message: str = "Session updated successfully"
63
+
64
+
65
+ class SessionDeletedResponse(BaseModel):
66
+ """Response DTO for session deletion."""
67
+ session_id: SessionId
68
+ message: str = "Session deleted successfully"
@@ -0,0 +1,74 @@
1
+ """
2
+ Task-related response DTOs.
3
+ """
4
+
5
+ from typing import Optional, Dict, Any, List
6
+ from datetime import datetime
7
+ from pydantic import BaseModel, Field
8
+
9
+ from ....shared.types import TaskId, UserId, SessionId, AgentId
10
+ from ....shared.enums import TaskStatus
11
+
12
+
13
+ class TaskResponse(BaseModel):
14
+ """Response DTO for task information."""
15
+ task_id: TaskId
16
+ agent_name: str
17
+ status: TaskStatus
18
+ user_id: UserId
19
+ session_id: Optional[SessionId] = None
20
+ created_at: datetime
21
+ updated_at: Optional[datetime] = None
22
+ completed_at: Optional[datetime] = None
23
+ error_message: Optional[str] = None
24
+ metadata: Optional[Dict[str, Any]] = None
25
+
26
+
27
+ class SendTaskResponse(BaseModel):
28
+ """Response DTO for send task endpoint."""
29
+ task_id: TaskId
30
+ message: str = "Task submitted successfully"
31
+ status: TaskStatus = TaskStatus.PENDING
32
+
33
+
34
+ class SubscribeTaskResponse(BaseModel):
35
+ """Response DTO for subscribe task endpoint."""
36
+ task_id: TaskId
37
+ session_id: SessionId
38
+ message: str = "Streaming task submitted successfully"
39
+ status: TaskStatus = TaskStatus.PENDING
40
+
41
+
42
+ class CancelTaskResponse(BaseModel):
43
+ """Response DTO for cancel task endpoint."""
44
+ task_id: TaskId
45
+ message: str = "Cancellation request sent successfully"
46
+ cancelled_at: datetime
47
+
48
+
49
+ class TaskStatusResponse(BaseModel):
50
+ """Response DTO for task status."""
51
+ task: TaskResponse
52
+
53
+
54
+ class TaskListResponse(BaseModel):
55
+ """Response DTO for listing tasks."""
56
+ tasks: List[TaskResponse]
57
+ total_count: int
58
+
59
+
60
+ class TaskErrorResponse(BaseModel):
61
+ """Response DTO for task errors."""
62
+ task_id: TaskId
63
+ error_type: str
64
+ error_message: str
65
+ error_details: Optional[Dict[str, Any]] = None
66
+ occurred_at: datetime
67
+
68
+
69
+ class JSONRPCTaskResponse(BaseModel):
70
+ """Response DTO matching the existing JSONRPC format."""
71
+ result: Dict[str, Any]
72
+ error: Optional[Dict[str, Any]] = None
73
+ id: Optional[str] = None
74
+ jsonrpc: str = "2.0"
@@ -4,6 +4,9 @@ Defines configuration schema and programmatically creates the WebUIBackendCompon
4
4
  """
5
5
 
6
6
  from typing import Any, Dict, List
7
+ import os
8
+ from alembic import command
9
+ from alembic.config import Config
7
10
  from solace_ai_connector.common.log import log
8
11
 
9
12
  from ...gateway.http_sse.component import WebUIBackendComponent
@@ -183,7 +186,34 @@ class WebUIBackendApp(BaseGatewayApp):
183
186
  "%s Initializing WebUIBackendApp...",
184
187
  app_info.get("name", "WebUIBackendApp"),
185
188
  )
186
- super().__init__(app_info=app_info, **kwargs)
189
+ super().__init__(app_info, **kwargs)
190
+
191
+ try:
192
+
193
+ alembic_ini_path = os.path.join(os.path.dirname(__file__), "alembic.ini")
194
+ if os.path.exists(alembic_ini_path):
195
+ log.debug("Loading Alembic configuration from alembic.ini.")
196
+ alembic_cfg = Config(alembic_ini_path)
197
+ else:
198
+ log.warning(
199
+ "alembic.ini not found. Falling back to programmatic configuration."
200
+ )
201
+ alembic_cfg = Config()
202
+ alembic_cfg.set_main_option(
203
+ "script_location",
204
+ os.path.join(os.path.dirname(__file__), "alembic"),
205
+ )
206
+
207
+ session_service_config = self.get_config("session_service", {})
208
+ db_url = session_service_config.get("database_url")
209
+ if db_url:
210
+ alembic_cfg.set_main_option("sqlalchemy.url", db_url)
211
+ command.upgrade(alembic_cfg, "head")
212
+ else:
213
+ log.warning("Database URL not configured. Skipping migrations.")
214
+ except Exception as e:
215
+ log.warning(f"Alembic migration failed: {e}")
216
+
187
217
  log.debug("%s WebUIBackendApp initialization complete.", self.name)
188
218
 
189
219
  def _get_gateway_component_class(self) -> type[BaseGatewayComponent]:
@@ -0,0 +1,3 @@
1
+ from .services.session_service import SessionService
2
+
3
+ __all__ = ["SessionService"]
@@ -0,0 +1,3 @@
1
+ from .session_service import SessionService
2
+
3
+ __all__ = ["SessionService"]
@@ -0,0 +1,135 @@
1
+ import uuid
2
+ from datetime import datetime, timezone
3
+
4
+ from solace_ai_connector.common.log import log
5
+
6
+ from ...domain.entities.session import Message, Session, SessionHistory
7
+ from ...domain.repositories.session_repository import (
8
+ IMessageRepository,
9
+ ISessionRepository,
10
+ )
11
+ from ...shared.enums import MessageType, SenderType, SessionStatus
12
+ from ...shared.types import PaginationInfo, SessionId, UserId
13
+
14
+
15
+ class SessionService:
16
+ def __init__(
17
+ self,
18
+ session_repository: ISessionRepository,
19
+ message_repository: IMessageRepository,
20
+ ):
21
+ self.session_repository = session_repository
22
+ self.message_repository = message_repository
23
+
24
+ def get_user_sessions(
25
+ self, user_id: UserId, pagination: PaginationInfo | None = None
26
+ ) -> list[Session]:
27
+ return self.session_repository.get_by_user_id(user_id, pagination)
28
+
29
+ def get_session(self, session_id: SessionId, user_id: UserId) -> Session | None:
30
+ return self.session_repository.get_user_session(session_id, user_id)
31
+
32
+ def get_session_history(
33
+ self,
34
+ session_id: SessionId,
35
+ user_id: UserId,
36
+ pagination: PaginationInfo | None = None,
37
+ ) -> SessionHistory | None:
38
+ session = self.session_repository.get_user_session(session_id, user_id)
39
+ if not session:
40
+ return None
41
+
42
+ messages = self.message_repository.get_by_session_id(session_id, pagination)
43
+
44
+ return SessionHistory(
45
+ session=session,
46
+ messages=messages,
47
+ total_message_count=len(messages),
48
+ )
49
+
50
+ def create_session(
51
+ self,
52
+ user_id: UserId,
53
+ name: str | None = None,
54
+ agent_id: str | None = None,
55
+ session_id: str | None = None,
56
+ ) -> Session:
57
+ if not user_id or user_id.strip() == "":
58
+ raise ValueError(f"user_id cannot be None or empty. Received: {user_id}")
59
+
60
+ if not session_id:
61
+ session_id = str(uuid.uuid4())
62
+
63
+ now = datetime.now(timezone.utc)
64
+ session = Session(
65
+ id=session_id,
66
+ user_id=user_id,
67
+ name=name,
68
+ agent_id=agent_id,
69
+ status=SessionStatus.ACTIVE,
70
+ created_at=now,
71
+ updated_at=now,
72
+ last_activity=now,
73
+ )
74
+
75
+ return self.session_repository.create(session)
76
+
77
+ def update_session_name(
78
+ self, session_id: SessionId, user_id: UserId, name: str
79
+ ) -> Session | None:
80
+ session = self.session_repository.get_user_session(session_id, user_id)
81
+ if not session:
82
+ return None
83
+
84
+ session.update_name(name)
85
+ return self.session_repository.update(session)
86
+
87
+ def delete_session(self, session_id: SessionId, user_id: UserId) -> bool:
88
+ session = self.session_repository.get_user_session(session_id, user_id)
89
+ if not session:
90
+ return False
91
+
92
+ if not session.can_be_deleted_by_user(user_id):
93
+ return False
94
+
95
+ self.message_repository.delete_by_session_id(session_id)
96
+ return self.session_repository.delete(session_id, user_id)
97
+
98
+ def add_message_to_session(
99
+ self,
100
+ session_id: SessionId,
101
+ user_id: UserId,
102
+ message: str,
103
+ sender_type: SenderType,
104
+ sender_name: str,
105
+ agent_id: str | None = None,
106
+ ) -> Message | None:
107
+ if not user_id or user_id.strip() == "":
108
+ raise ValueError(f"user_id cannot be None or empty. Received: {user_id}")
109
+
110
+ session = self.session_repository.get_user_session(session_id, user_id)
111
+ if not session:
112
+ log.error(f"Session {session_id} not found for user {user_id}")
113
+ return None
114
+
115
+ if agent_id and not session.agent_id:
116
+ session.agent_id = agent_id
117
+ self.session_repository.update(session)
118
+ log.info(f"Updated session {session_id} with agent_id: {agent_id}")
119
+
120
+ message_entity = Message(
121
+ id=str(uuid.uuid4()),
122
+ session_id=session_id,
123
+ message=message,
124
+ sender_type=sender_type,
125
+ sender_name=sender_name,
126
+ message_type=MessageType.TEXT,
127
+ created_at=datetime.now(timezone.utc),
128
+ )
129
+
130
+ message_entity.validate_message_content()
131
+
132
+ session.mark_activity()
133
+ self.session_repository.update(session)
134
+
135
+ return self.message_repository.create(message_entity)