solace-agent-mesh 1.1.0__py3-none-any.whl → 1.3.1__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.
- solace_agent_mesh/agent/adk/runner.py +18 -12
- solace_agent_mesh/agent/adk/services.py +3 -3
- solace_agent_mesh/agent/adk/setup.py +141 -34
- solace_agent_mesh/agent/protocol/event_handlers.py +27 -21
- solace_agent_mesh/agent/sac/app.py +0 -1
- solace_agent_mesh/agent/sac/component.py +0 -1
- solace_agent_mesh/agent/tools/__init__.py +1 -0
- solace_agent_mesh/agent/tools/dynamic_tool.py +362 -0
- solace_agent_mesh/assets/docs/404.html +3 -3
- solace_agent_mesh/assets/docs/assets/js/42b3f8d8.d97b8e94.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/483cef9a.4e972867.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/55f47984.cf3781c4.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/664b740a.1b744a32.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/75384d09.c193a8f0.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/9a09e75d.d6607c56.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/aba87c2f.071e2d94.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/ae0e903d.4d8dda10.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/c835a94d.146e3186.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/f284c35a.7334119c.js +1 -0
- solace_agent_mesh/assets/docs/assets/js/main.1c79039d.js +2 -0
- solace_agent_mesh/assets/docs/assets/js/runtime~main.858117b7.js +1 -0
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/installation/index.html +29 -0
- solace_agent_mesh/assets/docs/docs/documentation/Enterprise/single-sign-on/index.html +25 -0
- solace_agent_mesh/assets/docs/docs/documentation/{migration-guides/a2a-upgrade-to-0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html → Migrations/A2A Upgrade To 0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html } +6 -6
- solace_agent_mesh/assets/docs/docs/documentation/{migration-guides/a2a-upgrade-to-0.3.0/a2a-technical-migration-map/index.html → Migrations/A2A Upgrade To 0.3.0/a2a-technical-migration-map/index.html } +6 -6
- solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +19 -27
- solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +5 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-python-tools/index.html +63 -0
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +4 -4
- solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +4 -4
- solace_agent_mesh/assets/docs/lunr-index-1757531604543.json +1 -0
- solace_agent_mesh/assets/docs/lunr-index.json +1 -1
- solace_agent_mesh/assets/docs/search-doc-1757531604543.json +1 -0
- solace_agent_mesh/assets/docs/search-doc.json +1 -1
- solace_agent_mesh/assets/docs/sitemap.xml +1 -1
- solace_agent_mesh/cli/__init__.py +1 -1
- solace_agent_mesh/cli/commands/add_cmd/agent_cmd.py +125 -48
- solace_agent_mesh/cli/commands/eval_cmd.py +14 -0
- solace_agent_mesh/cli/commands/init_cmd/__init__.py +53 -31
- solace_agent_mesh/cli/commands/init_cmd/database_step.py +91 -0
- solace_agent_mesh/cli/commands/init_cmd/env_step.py +19 -8
- solace_agent_mesh/cli/commands/init_cmd/orchestrator_step.py +80 -25
- solace_agent_mesh/cli/commands/init_cmd/web_init_step.py +32 -10
- solace_agent_mesh/cli/commands/init_cmd/webui_gateway_step.py +74 -15
- solace_agent_mesh/cli/commands/plugin_cmd/create_cmd.py +0 -2
- solace_agent_mesh/cli/commands/run_cmd.py +5 -3
- solace_agent_mesh/cli/utils.py +68 -12
- solace_agent_mesh/client/webui/frontend/static/assets/authCallback-CAX9u8a7.js +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/client-DXU9SPI5.js +25 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-C03yrETa.css +1 -0
- solace_agent_mesh/client/webui/frontend/static/assets/main-C1k9E0aC.js +339 -0
- solace_agent_mesh/client/webui/frontend/static/assets/vendor-B0BEKoAR.js +390 -0
- solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -2
- solace_agent_mesh/client/webui/frontend/static/index.html +4 -3
- solace_agent_mesh/common/utils/embeds/resolver.py +1 -0
- solace_agent_mesh/config_portal/backend/common.py +2 -2
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-bFMKlzKf.js +98 -0
- solace_agent_mesh/config_portal/frontend/static/client/assets/{manifest-d845808d.js → manifest-89db7c30.js} +1 -1
- solace_agent_mesh/config_portal/frontend/static/client/index.html +1 -1
- solace_agent_mesh/evaluation/message_organizer.py +35 -56
- solace_agent_mesh/evaluation/run.py +26 -5
- solace_agent_mesh/evaluation/subscriber.py +35 -10
- solace_agent_mesh/evaluation/summary_builder.py +27 -34
- solace_agent_mesh/gateway/http_sse/ARCHITECTURE_GUIDE.md +676 -0
- solace_agent_mesh/gateway/http_sse/alembic/env.py +85 -0
- solace_agent_mesh/gateway/http_sse/alembic/script.py.mako +28 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/b1c2d3e4f5g6_add_database_indexes.py +83 -0
- solace_agent_mesh/gateway/http_sse/alembic/versions/d5b3f8f2e9a0_create_initial_database.py +58 -0
- solace_agent_mesh/gateway/http_sse/alembic.ini +147 -0
- solace_agent_mesh/gateway/http_sse/api/__init__.py +11 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/__init__.py +9 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/session_controller.py +355 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/task_controller.py +279 -0
- solace_agent_mesh/gateway/http_sse/api/controllers/user_controller.py +35 -0
- solace_agent_mesh/gateway/http_sse/api/dto/__init__.py +10 -0
- solace_agent_mesh/gateway/http_sse/api/dto/requests/__init__.py +37 -0
- solace_agent_mesh/gateway/http_sse/api/dto/requests/session_requests.py +49 -0
- solace_agent_mesh/gateway/http_sse/api/dto/requests/task_requests.py +66 -0
- solace_agent_mesh/gateway/http_sse/api/dto/responses/__init__.py +43 -0
- solace_agent_mesh/gateway/http_sse/api/dto/responses/session_responses.py +68 -0
- solace_agent_mesh/gateway/http_sse/api/dto/responses/task_responses.py +74 -0
- solace_agent_mesh/gateway/http_sse/app.py +31 -1
- solace_agent_mesh/gateway/http_sse/application/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/application/services/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/application/services/session_service.py +135 -0
- solace_agent_mesh/gateway/http_sse/component.py +224 -62
- solace_agent_mesh/gateway/http_sse/dependencies.py +148 -45
- solace_agent_mesh/gateway/http_sse/domain/entities/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/domain/entities/session.py +90 -0
- solace_agent_mesh/gateway/http_sse/domain/repositories/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/domain/repositories/session_repository.py +54 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/__init__.py +4 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/dependency_injection/container.py +123 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/__init__.py +4 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_persistence_service.py +16 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/database_service.py +119 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence/models.py +31 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/persistence_service.py +12 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/repositories/__init__.py +3 -0
- solace_agent_mesh/gateway/http_sse/infrastructure/repositories/session_repository.py +174 -0
- solace_agent_mesh/gateway/http_sse/main.py +291 -87
- solace_agent_mesh/gateway/http_sse/routers/{agents.py → agent_cards.py} +7 -7
- solace_agent_mesh/gateway/http_sse/routers/artifacts.py +121 -54
- solace_agent_mesh/gateway/http_sse/routers/config.py +3 -1
- solace_agent_mesh/gateway/http_sse/routers/tasks.py +83 -2
- solace_agent_mesh/gateway/http_sse/routers/visualization.py +7 -7
- solace_agent_mesh/gateway/http_sse/services/{agent_service.py → agent_card_service.py} +19 -19
- solace_agent_mesh/gateway/http_sse/session_manager.py +64 -30
- solace_agent_mesh/gateway/http_sse/shared/__init__.py +9 -0
- solace_agent_mesh/gateway/http_sse/shared/auth_utils.py +29 -0
- solace_agent_mesh/gateway/http_sse/shared/enums.py +45 -0
- solace_agent_mesh/gateway/http_sse/shared/types.py +45 -0
- solace_agent_mesh/templates/shared_config.yaml +4 -5
- solace_agent_mesh/templates/webui.yaml +8 -10
- {solace_agent_mesh-1.1.0.dist-info → solace_agent_mesh-1.3.1.dist-info}/METADATA +5 -3
- {solace_agent_mesh-1.1.0.dist-info → solace_agent_mesh-1.3.1.dist-info}/RECORD +150 -104
- solace_agent_mesh/assets/docs/assets/js/42b3f8d8.8ccb9901.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/55f47984.c484bf96.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/6e0db977.39a79ca9.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/75384d09.bf78fbdb.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/90dd9cf6.88f385ea.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/aba87c2f.76376d7c.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/f284c35a.fb68323a.js +0 -1
- solace_agent_mesh/assets/docs/assets/js/main.a75ecc0d.js +0 -2
- solace_agent_mesh/assets/docs/assets/js/runtime~main.458efb1d.js +0 -1
- solace_agent_mesh/assets/docs/lunr-index-1756992446316.json +0 -1
- solace_agent_mesh/assets/docs/search-doc-1756992446316.json +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/authCallback-BmF2l6vg.js +0 -1
- solace_agent_mesh/client/webui/frontend/static/assets/client-D881Dttc.js +0 -49
- solace_agent_mesh/client/webui/frontend/static/assets/main-C0jZjYa8.js +0 -699
- solace_agent_mesh/client/webui/frontend/static/assets/main-CCeG324-.css +0 -1
- solace_agent_mesh/config_portal/frontend/static/client/assets/_index-Bym6YkMd.js +0 -98
- solace_agent_mesh/gateway/http_sse/routers/sessions.py +0 -85
- solace_agent_mesh/gateway/http_sse/routers/users.py +0 -59
- /solace_agent_mesh/assets/docs/assets/js/{main.a75ecc0d.js.LICENSE.txt → main.1c79039d.js.LICENSE.txt} +0 -0
- {solace_agent_mesh-1.1.0.dist-info → solace_agent_mesh-1.3.1.dist-info}/WHEEL +0 -0
- {solace_agent_mesh-1.1.0.dist-info → solace_agent_mesh-1.3.1.dist-info}/entry_points.txt +0 -0
- {solace_agent_mesh-1.1.0.dist-info → solace_agent_mesh-1.3.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -3,10 +3,13 @@ Manages web user sessions and mapping to A2A Client IDs.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import uuid
|
|
6
|
-
from
|
|
7
|
-
from typing import
|
|
6
|
+
from collections.abc import Callable
|
|
7
|
+
from typing import Any
|
|
8
8
|
|
|
9
9
|
from solace_ai_connector.common.log import log
|
|
10
|
+
from starlette.requests import Request
|
|
11
|
+
|
|
12
|
+
from .infrastructure.persistence_service import PersistenceService
|
|
10
13
|
|
|
11
14
|
SESSION_KEY_CLIENT_ID = "a2a_client_id"
|
|
12
15
|
SESSION_KEY_SESSION_ID = "a2a_session_id"
|
|
@@ -21,12 +24,18 @@ class SessionManager:
|
|
|
21
24
|
Generates and stores unique A2A Client IDs and manages the current A2A Session ID per web session.
|
|
22
25
|
"""
|
|
23
26
|
|
|
24
|
-
def __init__(
|
|
27
|
+
def __init__(
|
|
28
|
+
self,
|
|
29
|
+
secret_key: str,
|
|
30
|
+
app_config: dict[str, Any],
|
|
31
|
+
persistence_service: "PersistenceService",
|
|
32
|
+
):
|
|
25
33
|
if not secret_key:
|
|
26
34
|
raise ValueError("Session secret key cannot be empty.")
|
|
27
35
|
self.secret_key = secret_key
|
|
28
36
|
self.force_user_identity = app_config.get("force_user_identity")
|
|
29
|
-
self.
|
|
37
|
+
self.use_authorization = app_config.get("frontend_use_authorization", False)
|
|
38
|
+
self.persistence_service = persistence_service
|
|
30
39
|
self._temp_code_cache = {}
|
|
31
40
|
log.info("[SessionManager] Initialized.")
|
|
32
41
|
if self.force_user_identity:
|
|
@@ -34,10 +43,11 @@ class SessionManager:
|
|
|
34
43
|
f"[SessionManager] Forcing user identity to: {self.force_user_identity}"
|
|
35
44
|
)
|
|
36
45
|
|
|
37
|
-
def _get_or_create_client_id(self, request: Request) -> str:
|
|
46
|
+
def _get_or_create_client_id(self, request: Request) -> str | None:
|
|
38
47
|
"""
|
|
39
48
|
Retrieves the A2A Client ID. It prioritizes the authenticated user from
|
|
40
49
|
`request.state.user` and falls back to session-based or generated IDs.
|
|
50
|
+
If authorization is enabled, it returns None if no user can be identified.
|
|
41
51
|
"""
|
|
42
52
|
if self.force_user_identity:
|
|
43
53
|
return self.force_user_identity
|
|
@@ -64,35 +74,35 @@ class SessionManager:
|
|
|
64
74
|
return user_id
|
|
65
75
|
|
|
66
76
|
client_id = request.session.get(SESSION_KEY_CLIENT_ID)
|
|
67
|
-
if
|
|
68
|
-
if self.default_user_identity:
|
|
69
|
-
log.info(
|
|
70
|
-
"[SessionManager] Using default_user_identity as A2A Client ID: %s",
|
|
71
|
-
self.default_user_identity,
|
|
72
|
-
)
|
|
73
|
-
client_id = self.default_user_identity
|
|
74
|
-
else:
|
|
75
|
-
client_id = f"web-client-{uuid.uuid4().hex}"
|
|
76
|
-
log.info(
|
|
77
|
-
"[SessionManager] Created new A2A Client ID: %s for web session.",
|
|
78
|
-
client_id,
|
|
79
|
-
)
|
|
80
|
-
request.session[SESSION_KEY_CLIENT_ID] = client_id
|
|
81
|
-
else:
|
|
77
|
+
if client_id:
|
|
82
78
|
log.debug(
|
|
83
79
|
"[SessionManager] Using existing A2A Client ID: %s for web session.",
|
|
84
80
|
client_id,
|
|
85
81
|
)
|
|
86
|
-
|
|
82
|
+
return client_id
|
|
83
|
+
|
|
84
|
+
if not self.use_authorization:
|
|
85
|
+
client_id = "sam_dev_user"
|
|
86
|
+
log.info(
|
|
87
|
+
"[SessionManager] No authenticated user and auth is disabled, using client ID: %s for web session.",
|
|
88
|
+
client_id,
|
|
89
|
+
)
|
|
90
|
+
request.session[SESSION_KEY_CLIENT_ID] = client_id
|
|
91
|
+
return client_id
|
|
92
|
+
|
|
93
|
+
log.warning(
|
|
94
|
+
"[SessionManager] Could not determine client ID and authorization is enabled."
|
|
95
|
+
)
|
|
96
|
+
return None
|
|
87
97
|
|
|
88
|
-
def get_a2a_client_id(self, request: Request) -> str:
|
|
98
|
+
def get_a2a_client_id(self, request: Request) -> str | None:
|
|
89
99
|
"""
|
|
90
100
|
FastAPI dependency callable to get the A2A Client ID for the current request.
|
|
91
|
-
Ensures a client ID exists in the session.
|
|
101
|
+
Ensures a client ID exists in the session if auth is disabled.
|
|
92
102
|
"""
|
|
93
103
|
return self._get_or_create_client_id(request)
|
|
94
104
|
|
|
95
|
-
def get_a2a_session_id(self, request: Request) ->
|
|
105
|
+
def get_a2a_session_id(self, request: Request) -> str | None:
|
|
96
106
|
"""
|
|
97
107
|
FastAPI dependency callable to get the current A2A Session ID for the current request.
|
|
98
108
|
Returns None if no session has been started for the current agent in this web session.
|
|
@@ -107,6 +117,11 @@ class SessionManager:
|
|
|
107
117
|
This should be called when the user explicitly starts a new chat or switches agents.
|
|
108
118
|
"""
|
|
109
119
|
client_id = self._get_or_create_client_id(request)
|
|
120
|
+
if not client_id:
|
|
121
|
+
# This case should ideally be prevented by middleware raising 401
|
|
122
|
+
raise RuntimeError(
|
|
123
|
+
"Cannot start a new A2A session without a client ID when authorization is enabled."
|
|
124
|
+
)
|
|
110
125
|
new_session_id = f"web-session-{uuid.uuid4().hex}"
|
|
111
126
|
request.session[SESSION_KEY_SESSION_ID] = new_session_id
|
|
112
127
|
log.info(
|
|
@@ -116,6 +131,25 @@ class SessionManager:
|
|
|
116
131
|
)
|
|
117
132
|
return new_session_id
|
|
118
133
|
|
|
134
|
+
def create_new_session_id(self, request: Request) -> str:
|
|
135
|
+
"""
|
|
136
|
+
Generates a new A2A Session ID without storing it in cookies.
|
|
137
|
+
This should be used when the frontend manages session state.
|
|
138
|
+
"""
|
|
139
|
+
client_id = self._get_or_create_client_id(request)
|
|
140
|
+
if not client_id:
|
|
141
|
+
# This case should ideally be prevented by middleware raising 401
|
|
142
|
+
raise RuntimeError(
|
|
143
|
+
"Cannot start a new A2A session without a client ID when authorization is enabled."
|
|
144
|
+
)
|
|
145
|
+
new_session_id = f"web-session-{uuid.uuid4().hex}"
|
|
146
|
+
log.info(
|
|
147
|
+
"[SessionManager] Generated new A2A Session ID: %s for Client ID: %s (not stored in cookies)",
|
|
148
|
+
new_session_id,
|
|
149
|
+
client_id,
|
|
150
|
+
)
|
|
151
|
+
return new_session_id
|
|
152
|
+
|
|
119
153
|
def ensure_a2a_session(self, request: Request) -> str:
|
|
120
154
|
"""
|
|
121
155
|
Ensures an A2A session ID exists, creating one if necessary.
|
|
@@ -131,7 +165,7 @@ class SessionManager:
|
|
|
131
165
|
return session_id
|
|
132
166
|
|
|
133
167
|
def store_auth_tokens(
|
|
134
|
-
self, request: Request, access_token: str, refresh_token:
|
|
168
|
+
self, request: Request, access_token: str, refresh_token: str | None = None
|
|
135
169
|
):
|
|
136
170
|
"""
|
|
137
171
|
Stores authentication tokens directly in the user's session.
|
|
@@ -141,13 +175,13 @@ class SessionManager:
|
|
|
141
175
|
request.session[SESSION_KEY_REFRESH_TOKEN] = refresh_token
|
|
142
176
|
log.info("[SessionManager] Stored auth tokens directly in session.")
|
|
143
177
|
|
|
144
|
-
def get_access_token(self, request: Request) ->
|
|
178
|
+
def get_access_token(self, request: Request) -> str | None:
|
|
145
179
|
"""
|
|
146
180
|
Retrieves the access token from the web session.
|
|
147
181
|
"""
|
|
148
182
|
return request.session.get(SESSION_KEY_ACCESS_TOKEN)
|
|
149
183
|
|
|
150
|
-
def get_refresh_token(self, request: Request) ->
|
|
184
|
+
def get_refresh_token(self, request: Request) -> str | None:
|
|
151
185
|
"""
|
|
152
186
|
Retrieves the refresh token from the web session.
|
|
153
187
|
"""
|
|
@@ -168,17 +202,17 @@ class SessionManager:
|
|
|
168
202
|
request.session[SESSION_KEY_USER_ID] = user_id
|
|
169
203
|
log.info("[SessionManager] Stored user ID in session: %s", user_id)
|
|
170
204
|
|
|
171
|
-
def get_user_id(self, request: Request) ->
|
|
205
|
+
def get_user_id(self, request: Request) -> str | None:
|
|
172
206
|
"""
|
|
173
207
|
Retrieves the user ID from the web session.
|
|
174
208
|
"""
|
|
175
209
|
return request.session.get(SESSION_KEY_USER_ID)
|
|
176
210
|
|
|
177
|
-
def dep_get_client_id(self) -> Callable[[Request], str]:
|
|
211
|
+
def dep_get_client_id(self) -> Callable[[Request], str | None]:
|
|
178
212
|
"""Returns a callable suitable for FastAPI Depends to get the client ID."""
|
|
179
213
|
return self.get_a2a_client_id
|
|
180
214
|
|
|
181
|
-
def dep_get_session_id(self) -> Callable[[Request],
|
|
215
|
+
def dep_get_session_id(self) -> Callable[[Request], str | None]:
|
|
182
216
|
"""Returns a callable suitable for FastAPI Depends to get the current session ID."""
|
|
183
217
|
return self.get_a2a_session_id
|
|
184
218
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Authentication utilities for the FastAPI application.
|
|
3
|
+
|
|
4
|
+
This module provides common authentication functions used across controllers.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from fastapi import Depends, Request as FastAPIRequest
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
async def get_current_user(request: FastAPIRequest) -> dict:
|
|
11
|
+
"""
|
|
12
|
+
Extracts the current user from the request state.
|
|
13
|
+
|
|
14
|
+
This function is used as a FastAPI dependency to get the authenticated user
|
|
15
|
+
information that was set by the AuthMiddleware.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
request: The FastAPI request object with user state
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
dict: User information dictionary containing id, name, email, etc.
|
|
22
|
+
"""
|
|
23
|
+
return getattr(request.state, "user", {
|
|
24
|
+
"id": "anonymous",
|
|
25
|
+
"name": "Anonymous User",
|
|
26
|
+
"email": "anonymous@localhost",
|
|
27
|
+
"authenticated": False,
|
|
28
|
+
"auth_method": "none"
|
|
29
|
+
})
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Enumerations used throughout the application.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from enum import Enum
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SenderType(str, Enum):
|
|
9
|
+
"""Types of message senders."""
|
|
10
|
+
USER = "user"
|
|
11
|
+
AGENT = "agent"
|
|
12
|
+
SYSTEM = "system"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TaskStatus(str, Enum):
|
|
16
|
+
"""Task execution status."""
|
|
17
|
+
PENDING = "pending"
|
|
18
|
+
RUNNING = "running"
|
|
19
|
+
COMPLETED = "completed"
|
|
20
|
+
FAILED = "failed"
|
|
21
|
+
CANCELLED = "cancelled"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class SessionStatus(str, Enum):
|
|
25
|
+
"""Session status."""
|
|
26
|
+
ACTIVE = "active"
|
|
27
|
+
INACTIVE = "inactive"
|
|
28
|
+
ARCHIVED = "archived"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class MessageType(str, Enum):
|
|
32
|
+
"""Types of messages."""
|
|
33
|
+
TEXT = "text"
|
|
34
|
+
FILE = "file"
|
|
35
|
+
IMAGE = "image"
|
|
36
|
+
DOCUMENT = "document"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class ValidationErrorType(str, Enum):
|
|
40
|
+
"""Types of validation errors."""
|
|
41
|
+
REQUIRED_FIELD = "required_field"
|
|
42
|
+
INVALID_FORMAT = "invalid_format"
|
|
43
|
+
OUT_OF_RANGE = "out_of_range"
|
|
44
|
+
DUPLICATE_VALUE = "duplicate_value"
|
|
45
|
+
BUSINESS_RULE = "business_rule"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Custom types and type aliases used throughout the application.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Dict, Any, List, Optional, Union
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from pydantic import BaseModel
|
|
8
|
+
|
|
9
|
+
# Basic type aliases
|
|
10
|
+
UserId = str
|
|
11
|
+
SessionId = str
|
|
12
|
+
MessageId = str
|
|
13
|
+
TaskId = str
|
|
14
|
+
AgentId = str
|
|
15
|
+
|
|
16
|
+
# Dictionary types
|
|
17
|
+
JsonDict = Dict[str, Any]
|
|
18
|
+
Headers = Dict[str, str]
|
|
19
|
+
QueryParams = Dict[str, Union[str, List[str]]]
|
|
20
|
+
|
|
21
|
+
# Common data structures
|
|
22
|
+
class Timestamp(BaseModel):
|
|
23
|
+
"""Standardized timestamp representation."""
|
|
24
|
+
created_at: datetime
|
|
25
|
+
updated_at: Optional[datetime] = None
|
|
26
|
+
|
|
27
|
+
class PaginationInfo(BaseModel):
|
|
28
|
+
"""Pagination information for list responses."""
|
|
29
|
+
page: int
|
|
30
|
+
page_size: int
|
|
31
|
+
total_items: int
|
|
32
|
+
total_pages: int
|
|
33
|
+
has_next: bool
|
|
34
|
+
has_previous: bool
|
|
35
|
+
|
|
36
|
+
class SortInfo(BaseModel):
|
|
37
|
+
"""Sorting information for list requests."""
|
|
38
|
+
field: str
|
|
39
|
+
direction: str = "asc" # asc or desc
|
|
40
|
+
|
|
41
|
+
class FilterInfo(BaseModel):
|
|
42
|
+
"""Filtering information for list requests."""
|
|
43
|
+
field: str
|
|
44
|
+
operator: str # eq, ne, gt, lt, gte, lte, contains, in
|
|
45
|
+
value: Any
|
|
@@ -6,8 +6,7 @@ shared_config:
|
|
|
6
6
|
broker_password: ${SOLACE_BROKER_PASSWORD, default}
|
|
7
7
|
broker_vpn: ${SOLACE_BROKER_VPN, default}
|
|
8
8
|
temporary_queue: ${USE_TEMPORARY_QUEUES, true}
|
|
9
|
-
|
|
10
|
-
# max_connection_retries: -1 # Retry forever
|
|
9
|
+
|
|
11
10
|
|
|
12
11
|
- models:
|
|
13
12
|
planning: &planning_model
|
|
@@ -57,13 +56,13 @@ shared_config:
|
|
|
57
56
|
- services:
|
|
58
57
|
# Default session service configuration
|
|
59
58
|
session_service: &default_session_service
|
|
60
|
-
type: "
|
|
61
|
-
default_behavior: "
|
|
59
|
+
type: "memory"
|
|
60
|
+
default_behavior: "PERSISTENT"
|
|
62
61
|
|
|
63
62
|
# Default artifact service configuration
|
|
64
63
|
artifact_service: &default_artifact_service
|
|
65
64
|
type: "__DEFAULT_ARTIFACT_SERVICE_TYPE__"
|
|
66
|
-
__DEFAULT_ARTIFACT_SERVICE_BASE_PATH_LINE__
|
|
65
|
+
# __DEFAULT_ARTIFACT_SERVICE_BASE_PATH_LINE__
|
|
67
66
|
artifact_scope: __DEFAULT_ARTIFACT_SERVICE_SCOPE__
|
|
68
67
|
|
|
69
68
|
# Default data tools configuration
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
|
|
3
3
|
log:
|
|
4
4
|
stdout_log_level: INFO
|
|
5
5
|
log_file_level: DEBUG
|
|
6
6
|
log_file: webui_app.log
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
!include ../shared_config.yaml
|
|
10
10
|
|
|
11
11
|
apps:
|
|
@@ -21,14 +21,13 @@ apps:
|
|
|
21
21
|
session_secret_key: ${SESSION_SECRET_KEY}
|
|
22
22
|
|
|
23
23
|
artifact_service: *default_artifact_service
|
|
24
|
-
|
|
24
|
+
session_service: __SESSION_SERVICE__
|
|
25
25
|
gateway_id: ${WEBUI_GATEWAY_ID}
|
|
26
26
|
fastapi_host: ${FASTAPI_HOST}
|
|
27
27
|
fastapi_port: ${FASTAPI_PORT}
|
|
28
|
-
cors_allowed_origins:
|
|
29
|
-
- "http://localhost:3000"
|
|
28
|
+
cors_allowed_origins:
|
|
29
|
+
- "http://localhost:3000"
|
|
30
30
|
- "http://127.0.0.1:3000"
|
|
31
|
-
# Add other origins as needed, or use ["*"] for wide open (less secure)
|
|
32
31
|
|
|
33
32
|
enable_embed_resolution: ${ENABLE_EMBED_RESOLUTION} # Enable late-stage resolution
|
|
34
33
|
gateway_artifact_content_limit_bytes: ${GATEWAY_ARTIFACT_LIMIT_BYTES, 10000000} # Max size for late-stage embeds
|
|
@@ -47,7 +46,6 @@ apps:
|
|
|
47
46
|
Format responses to the user in Markdown using appropriate formatting.
|
|
48
47
|
|
|
49
48
|
# --- Frontend Config Passthrough ---
|
|
50
|
-
frontend_welcome_message:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
frontend_collect_feedback: __FRONTEND_COLLECT_FEEDBACK__
|
|
49
|
+
frontend_welcome_message: ${FRONTEND_WELCOME_MESSAGE}
|
|
50
|
+
frontend_bot_name: ${FRONTEND_BOT_NAME}
|
|
51
|
+
frontend_collect_feedback: ${FRONTEND_COLLECT_FEEDBACK}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: solace-agent-mesh
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Solace Agent Mesh is an open-source framework for building event-driven, multi-agent AI systems where specialized agents collaborate on complex tasks.
|
|
5
5
|
Project-URL: Homepage, https://github.com/SolaceLabs/solace-agent-mesh
|
|
6
6
|
Project-URL: Repository, https://github.com/SolaceLabs/solace-agent-mesh
|
|
@@ -215,6 +215,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
215
215
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
216
216
|
Requires-Python: >=3.10.16
|
|
217
217
|
Requires-Dist: a2a-sdk[http-server]>=0.3.1
|
|
218
|
+
Requires-Dist: alembic>=1.13.1
|
|
218
219
|
Requires-Dist: asteval>=1.0.6
|
|
219
220
|
Requires-Dist: asteval~=1.0.0
|
|
220
221
|
Requires-Dist: beautifulsoup4>=4.12.0
|
|
@@ -250,6 +251,7 @@ Requires-Dist: python-multipart>=0.0.7
|
|
|
250
251
|
Requires-Dist: pyyaml>=6.0
|
|
251
252
|
Requires-Dist: rouge~=1.0.1
|
|
252
253
|
Requires-Dist: solace-ai-connector~=1.1.8
|
|
254
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
253
255
|
Requires-Dist: sse-starlette>=1.6
|
|
254
256
|
Requires-Dist: toml~=0.10.2
|
|
255
257
|
Requires-Dist: uvicorn[standard]>=0.20
|
|
@@ -257,12 +259,12 @@ Provides-Extra: cli
|
|
|
257
259
|
Requires-Dist: click>=8.0; extra == 'cli'
|
|
258
260
|
Requires-Dist: prompt-toolkit>=3.0; extra == 'cli'
|
|
259
261
|
Requires-Dist: rich>=13.0; extra == 'cli'
|
|
260
|
-
Provides-Extra: database
|
|
261
|
-
Requires-Dist: sqlalchemy>=2.0; extra == 'database'
|
|
262
262
|
Provides-Extra: employee-tools
|
|
263
263
|
Requires-Dist: holidays>=0.24; extra == 'employee-tools'
|
|
264
264
|
Provides-Extra: gcs
|
|
265
265
|
Requires-Dist: google-cloud-storage>=2.0; extra == 'gcs'
|
|
266
|
+
Provides-Extra: postgresql
|
|
267
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == 'postgresql'
|
|
266
268
|
Provides-Extra: s3
|
|
267
269
|
Requires-Dist: boto3<2.0,>=1.35.0; extra == 's3'
|
|
268
270
|
Provides-Extra: vertex
|