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
@@ -4,7 +4,7 @@ These models correspond to the JSON schemas defined in a2a_spec/schemas/
4
4
  and are used for validating non-visible status update messages.
5
5
  """
6
6
 
7
- from typing import Any, Dict, Literal, Union
7
+ from typing import Any, Dict, Literal, Optional, Union
8
8
  from pydantic import BaseModel, Field
9
9
 
10
10
 
@@ -39,6 +39,10 @@ class LlmInvocationData(BaseModel):
39
39
  ...,
40
40
  description="A sanitized representation of the LlmRequest object sent to the model.",
41
41
  )
42
+ usage: Optional[Dict[str, Any]] = Field(
43
+ None,
44
+ description="Token usage information for this LLM call (input_tokens, output_tokens, cached_input_tokens, model)",
45
+ )
42
46
 
43
47
 
44
48
  class AgentProgressUpdateData(BaseModel):
@@ -88,6 +92,10 @@ class ToolResultData(BaseModel):
88
92
  function_call_id: str = Field(
89
93
  ..., description="The ID from the LLM's function call."
90
94
  )
95
+ llm_usage: Optional[Dict[str, Any]] = Field(
96
+ None,
97
+ description="Token usage if this tool made LLM calls (input_tokens, output_tokens, cached_input_tokens, model)",
98
+ )
91
99
 
92
100
 
93
101
  SignalData = Union[
@@ -0,0 +1,185 @@
1
+ # LLM Summary Detail File
2
+
3
+ This file is a concatenation of all individual *llm.txt files found in the 'middleware' directory tree. Each section below corresponds to a specific directory's summary file.
4
+
5
+ ================================================================================
6
+
7
+ ## Section 1: solace_agent_mesh/common/middleware/middleware_llm.txt
8
+
9
+ **Source file:** `solace_agent_mesh/common/middleware/middleware_llm.txt`
10
+
11
+ # DEVELOPER GUIDE: middleware
12
+
13
+ ## Quick Summary
14
+ The `middleware` directory provides a pluggable framework for system components that can be extended or replaced at runtime. It offers a registry system to dynamically bind custom implementations for core functionalities like configuration resolution. The default implementations provide permissive behavior, making them suitable for development and testing environments where all features are enabled by default.
15
+
16
+ ## Files Overview
17
+ - `__init__.py`: Exposes the main public classes of the middleware package for easy importing.
18
+ - `config_resolver.py`: Defines the default, permissive configuration resolution middleware.
19
+ - `registry.py`: Provides the `MiddlewareRegistry` for dynamically binding custom middleware implementations.
20
+
21
+ ## Developer API Reference
22
+
23
+ ### __init__.py
24
+ **Purpose:** This file serves as the entry point to the `middleware` package, exporting the primary public interfaces for developers to use.
25
+
26
+ **Import:** `from solace_agent_mesh.common.middleware import ConfigResolver, MiddlewareRegistry`
27
+
28
+ **Usage Examples:**
29
+ ```python
30
+ # Import the main classes directly from the middleware package
31
+ from solace_agent_mesh.common.middleware import ConfigResolver, MiddlewareRegistry
32
+
33
+ # Now you can use ConfigResolver and MiddlewareRegistry
34
+ print(ConfigResolver)
35
+ print(MiddlewareRegistry)
36
+ ```
37
+
38
+ ### config_resolver.py
39
+ **Purpose:** This file provides a pluggable interface for resolving user-specific configuration and determining feature availability. The default `ConfigResolver` class is permissive, allowing all operations and enabling all features, which is ideal for development or simple deployments.
40
+
41
+ **Import:** `from solace_agent_mesh.common.middleware import ConfigResolver`
42
+
43
+ **Classes:**
44
+ - `ConfigResolver()` - A class containing static methods to resolve user-specific configuration and determine feature availability. This default implementation is permissive.
45
+ - `resolve_user_config(user_identity: Any, gateway_context: Dict[str, Any], base_config: Dict[str, Any]) -> Dict[str, Any]` - (async) Resolves user-specific configuration. The default implementation returns the `base_config` unchanged.
46
+ - `is_feature_enabled(user_config: Dict[str, Any], feature_descriptor: Dict[str, Any], context: Dict[str, Any]) -> bool` - Checks if a feature is enabled for a user. The default implementation always returns `True`.
47
+ - `validate_operation_config(user_config: Dict[str, Any], operation_spec: Dict[str, Any], validation_context: Dict[str, Any]) -> Dict[str, Any]` - Validates if an operation is allowed for a user. The default implementation always returns a dictionary with `{'valid': True}`.
48
+ - `filter_available_options(user_config: Dict[str, Any], available_options: List[Dict[str, Any]], filter_context: Dict[str, Any]) -> List[Dict[str, Any]]` - Filters a list of options based on user permissions. The default implementation returns the original `available_options` list.
49
+
50
+ **Usage Examples:**
51
+ ```python
52
+ import asyncio
53
+ from solace_agent_mesh.common.middleware import ConfigResolver
54
+
55
+ async def main():
56
+ # Example user identity and base configuration
57
+ user_id = "test-user@example.com"
58
+ base_conf = {"api_key": "default_key", "allowed_models": ["gpt-3.5-turbo"]}
59
+
60
+ # 1. Resolve user configuration (default implementation returns base_conf)
61
+ user_config = await ConfigResolver.resolve_user_config(
62
+ user_identity=user_id,
63
+ gateway_context={"gateway_id": "gw-1"},
64
+ base_config=base_conf
65
+ )
66
+ print(f"Resolved User Config: {user_config}")
67
+
68
+ # 2. Check if a feature is enabled (default is always True)
69
+ feature_desc = {"feature_type": "ai_tool", "function_name": "code_interpreter"}
70
+ is_enabled = ConfigResolver.is_feature_enabled(
71
+ user_config=user_config,
72
+ feature_descriptor=feature_desc,
73
+ context={}
74
+ )
75
+ print(f"Is Feature Enabled: {is_enabled}")
76
+
77
+ # 3. Validate an operation (default is always valid)
78
+ op_spec = {"operation_type": "model_inference", "model": "gpt-4"}
79
+ validation = ConfigResolver.validate_operation_config(
80
+ user_config=user_config,
81
+ operation_spec=op_spec,
82
+ validation_context={}
83
+ )
84
+ print(f"Operation Validation: {validation}")
85
+
86
+ # 4. Filter available options (default returns all options)
87
+ all_models = [
88
+ {"name": "gpt-3.5-turbo", "provider": "openai"},
89
+ {"name": "gpt-4", "provider": "openai"},
90
+ ]
91
+ available_models = ConfigResolver.filter_available_options(
92
+ user_config=user_config,
93
+ available_options=all_models,
94
+ filter_context={"type": "language_model"}
95
+ )
96
+ print(f"Filtered Options: {available_models}")
97
+
98
+ if __name__ == "__main__":
99
+ asyncio.run(main())
100
+ ```
101
+
102
+ ### registry.py
103
+ **Purpose:** This file provides the `MiddlewareRegistry`, a static class that allows developers to dynamically bind, or "plug in," their own custom middleware implementations at runtime. This is the core of the pluggable system.
104
+
105
+ **Import:** `from solace_agent_mesh.common.middleware import MiddlewareRegistry`
106
+
107
+ **Classes:**
108
+ - `MiddlewareRegistry()` - A registry for managing middleware implementations. All methods are class methods.
109
+ - `bind_config_resolver(resolver_class: Type)` - Binds a custom class that implements the `ConfigResolver` interface. This new class will be used for all subsequent configuration resolution calls.
110
+ - `get_config_resolver() -> Type` - Returns the currently bound `ConfigResolver` class. If no custom resolver has been bound, it returns the default `ConfigResolver`.
111
+ - `register_initialization_callback(callback: callable)` - Registers a function to be executed when `initialize_middleware()` is called. Useful for setting up custom middleware components at application startup.
112
+ - `initialize_middleware()` - Executes all registered initialization callbacks. This should be called once during application startup.
113
+ - `reset_bindings()` - Resets all bindings back to their defaults. This is primarily useful for testing environments.
114
+ - `get_registry_status() -> Dict[str, Any]` - Returns a dictionary containing the current status of the registry, such as which resolver is bound.
115
+
116
+ **Usage Examples:**
117
+ ```python
118
+ import asyncio
119
+ from typing import Any, Dict, List
120
+ from solace_agent_mesh.common.middleware import MiddlewareRegistry, ConfigResolver
121
+
122
+ # 1. Define a custom ConfigResolver implementation
123
+ class MyCustomConfigResolver:
124
+ """A custom resolver that only allows 'admin' users to use 'gpt-4'."""
125
+ @staticmethod
126
+ async def resolve_user_config(user_identity: Any, gateway_context: Dict[str, Any], base_config: Dict[str, Any]) -> Dict[str, Any]:
127
+ if user_identity == "admin":
128
+ return {"role": "admin", "allowed_models": ["gpt-4", "gpt-3.5-turbo"]}
129
+ return {"role": "user", "allowed_models": ["gpt-3.5-turbo"]}
130
+
131
+ @staticmethod
132
+ def validate_operation_config(user_config: Dict, operation_spec: Dict, validation_context: Dict) -> Dict:
133
+ model = operation_spec.get("model")
134
+ if model and model not in user_config.get("allowed_models", []):
135
+ return {"valid": False, "reason": f"Model '{model}' not allowed for this user."}
136
+ return {"valid": True}
137
+
138
+ # Inherit other methods from the default for simplicity
139
+ is_feature_enabled = ConfigResolver.is_feature_enabled
140
+ filter_available_options = ConfigResolver.filter_available_options
141
+
142
+ # 2. Define an initialization callback
143
+ def setup_custom_logging():
144
+ print("Custom middleware initialization logic is running!")
145
+
146
+ # 3. Bind the custom components
147
+ MiddlewareRegistry.bind_config_resolver(MyCustomConfigResolver)
148
+ MiddlewareRegistry.register_initialization_callback(setup_custom_logging)
149
+
150
+ # 4. Initialize the middleware (e.g., at application startup)
151
+ print("--- Initializing Middleware ---")
152
+ MiddlewareRegistry.initialize_middleware()
153
+ print("--- Initialization Complete ---")
154
+
155
+ # 5. Use the middleware system
156
+ async def check_permissions():
157
+ # The registry will now use MyCustomConfigResolver automatically
158
+ CurrentResolver = MiddlewareRegistry.get_config_resolver()
159
+ print(f"Current resolver is: {CurrentResolver.__name__}")
160
+
161
+ # Check an admin user
162
+ admin_config = await CurrentResolver.resolve_user_config("admin", {}, {})
163
+ validation_result = CurrentResolver.validate_operation_config(
164
+ admin_config, {"model": "gpt-4"}, {}
165
+ )
166
+ print(f"Admin validation for gpt-4: {validation_result}")
167
+
168
+ # Check a regular user
169
+ user_config = await CurrentResolver.resolve_user_config("user", {}, {})
170
+ validation_result = CurrentResolver.validate_operation_config(
171
+ user_config, {"model": "gpt-4"}, {}
172
+ )
173
+ print(f"User validation for gpt-4: {validation_result}")
174
+
175
+ # Run the example
176
+ asyncio.run(check_permissions())
177
+
178
+ # 6. Check status and reset (useful for testing)
179
+ print(f"\nRegistry Status: {MiddlewareRegistry.get_registry_status()}")
180
+ MiddlewareRegistry.reset_bindings()
181
+ print(f"Registry Status after reset: {MiddlewareRegistry.get_registry_status()}")
182
+ ```
183
+
184
+ ================================================================================
185
+
@@ -68,4 +68,4 @@ agent.run()
68
68
  agent.cleanup()
69
69
  ```
70
70
 
71
- # content_hash: 44ffaa77554dd658386afa3a420ade21c016b72b1e5394fdba814ea897b3480c
71
+ # content_hash: 8ba90bbcaab8684e6611224e74cb0bb86a9cf87d6dccd25352d70ee3d851a06b
@@ -0,0 +1,82 @@
1
+ # LLM Summary Detail File
2
+
3
+ This file is a concatenation of all individual *llm.txt files found in the 'sac' directory tree. Each section below corresponds to a specific directory's summary file.
4
+
5
+ ================================================================================
6
+
7
+ ## Section 1: solace_agent_mesh/common/sac/sac_llm.txt
8
+
9
+ **Source file:** `solace_agent_mesh/common/sac/sac_llm.txt`
10
+
11
+ # DEVELOPER GUIDE: sac
12
+
13
+ ## Quick Summary
14
+ The `sac` directory provides the base component framework for Solace Agent Mesh (SAM) implementations in the Solace AI Connector. It offers a standardized foundation for building high-level SAM components like Agents and Gateways with built-in async operations management and message publishing capabilities.
15
+
16
+ ## Files Overview
17
+ - `__init__.py` - Empty package initialization file
18
+ - `sam_component_base.py` - Abstract base class providing async thread management and A2A message publishing for SAM components
19
+
20
+ ## Developer API Reference
21
+
22
+ ### sam_component_base.py
23
+ **Purpose:** Provides an abstract base class for SAM components with managed asyncio event loops and message publishing
24
+ **Import:** `from solace_agent_mesh.common.sac.sam_component_base import SamComponentBase`
25
+
26
+ **Classes:**
27
+ - `SamComponentBase(info: Dict[str, Any], **kwargs: Any)` - Abstract base class for high-level SAM components (Agents, Gateways)
28
+ - `publish_a2a_message(payload: Dict, topic: str, user_properties: Optional[Dict] = None) -> None` - Publishes A2A messages with size validation
29
+ - `run() -> None` - Starts the component's dedicated async thread
30
+ - `cleanup() -> None` - Cleans up resources including async thread and loop
31
+ - `get_async_loop() -> Optional[asyncio.AbstractEventLoop]` - Returns the dedicated asyncio event loop
32
+ - `_async_setup_and_run() -> None` - Abstract method for subclasses to implement main async logic
33
+ - `_pre_async_cleanup() -> None` - Abstract method for cleanup before async loop stops
34
+ - `namespace: str` - The configured namespace for the component
35
+ - `max_message_size_bytes: int` - Maximum allowed message size in bytes
36
+
37
+ **Usage Examples:**
38
+ ```python
39
+ from solace_agent_mesh.common.sac.sam_component_base import SamComponentBase
40
+ from typing import Dict, Any
41
+ import asyncio
42
+
43
+ class MyAgent(SamComponentBase):
44
+ def __init__(self, info: Dict[str, Any], **kwargs: Any):
45
+ super().__init__(info, **kwargs)
46
+ # Additional initialization
47
+
48
+ async def _async_setup_and_run(self) -> None:
49
+ """Implement your main async logic here"""
50
+ while not self.stop_signal.is_set():
51
+ # Your async operations
52
+ await asyncio.sleep(1)
53
+
54
+ def _pre_async_cleanup(self) -> None:
55
+ """Cleanup before async loop stops"""
56
+ # Your cleanup logic
57
+ pass
58
+
59
+ # Usage
60
+ config = {
61
+ "namespace": "my_namespace",
62
+ "max_message_size_bytes": 1048576 # 1MB
63
+ }
64
+ agent = MyAgent(config)
65
+
66
+ # Publish a message
67
+ payload = {"message": "Hello World"}
68
+ agent.publish_a2a_message(
69
+ payload=payload,
70
+ topic="sam/agents/my_agent/response",
71
+ user_properties={"correlation_id": "123"}
72
+ )
73
+
74
+ # Start the component
75
+ agent.run()
76
+
77
+ # Later, cleanup
78
+ agent.cleanup()
79
+ ```
80
+
81
+ ================================================================================
82
+
@@ -0,0 +1,104 @@
1
+ # DEVELOPER GUIDE: sam_events
2
+
3
+ ## Quick Summary
4
+ The `sam_events` directory provides system-level event messaging for Solace Agent Mesh (SAM). It enables clean separation between agent-to-agent (A2A) task communication and system events like session lifecycle, agent health, and configuration changes.
5
+
6
+ ## Files Overview
7
+ - `__init__.py` - Package initialization and public API exports
8
+ - `event_service.py` - Core event service implementation with publishing/subscription capabilities
9
+
10
+ ## Developer API Reference
11
+
12
+ ### __init__.py
13
+ **Purpose:** Package entry point that exports the main classes for SAM event handling
14
+ **Import:** `from solace_agent_mesh.common.sam_events import SamEventService, SamEvent, SessionDeletedEvent`
15
+
16
+ ### event_service.py
17
+ **Purpose:** Implements the core event messaging service for system-level events in SAM
18
+ **Import:** `from solace_agent_mesh.common.sam_events.event_service import SamEventService, SamEvent, SessionDeletedEvent`
19
+
20
+ **Classes:**
21
+
22
+ - `SamEvent(event_type: str, event_id: str, timestamp: str, source_component: str, namespace: str, data: Dict[str, Any])` - Base class for all SAM system events
23
+ - `create(event_type: str, source_component: str, namespace: str, data: Dict[str, Any]) -> SamEvent` - Create a new event with auto-generated ID and timestamp
24
+ - `to_dict() -> Dict[str, Any]` - Convert event to dictionary for messaging
25
+ - `event_type: str` - Type of event (e.g., "session.deleted")
26
+ - `event_id: str` - Unique identifier for the event
27
+ - `timestamp: str` - ISO format timestamp when event was created
28
+ - `source_component: str` - Component that generated the event
29
+ - `namespace: str` - SAM namespace
30
+ - `data: Dict[str, Any]` - Event-specific data payload
31
+
32
+ - `SessionDeletedEvent(SamEvent)` - Specialized event for session deletion notifications
33
+ - `create(namespace: str, source_component: str, session_id: str, user_id: str, agent_id: str, gateway_id: str) -> SessionDeletedEvent` - Create a session deleted event
34
+
35
+ - `SamEventService(namespace: str, component_name: str, publish_func: Callable[[str, Dict, Optional[Dict]], None])` - Service for publishing and subscribing to SAM system events
36
+ - `publish_event(event: SamEvent) -> bool` - Publish a system event
37
+ - `publish_session_deleted(session_id: str, user_id: str, agent_id: str, gateway_id: str) -> bool` - Convenience method to publish session deleted event
38
+ - `subscribe_to_events(event_type: str, handler: Callable[[SamEvent], None]) -> bool` - Subscribe to events of a specific type
39
+ - `handle_incoming_event(topic: str, payload: Dict[str, Any]) -> None` - Handle incoming events from messaging system
40
+ - `namespace: str` - The SAM namespace
41
+ - `component_name: str` - Name of the component using this service
42
+
43
+ **Functions:**
44
+
45
+ - `SamEventService.get_event_topic(namespace: str, event_type: str) -> str` - Get the topic for a specific event type
46
+
47
+ **Usage Examples:**
48
+
49
+ ```python
50
+ # Basic event service setup
51
+ from solace_agent_mesh.common.sam_events import SamEventService, SamEvent, SessionDeletedEvent
52
+
53
+ # Initialize the event service
54
+ def my_publish_func(topic: str, payload: dict, headers: dict = None):
55
+ # Your A2A publishing implementation
56
+ pass
57
+
58
+ event_service = SamEventService(
59
+ namespace="my_namespace",
60
+ component_name="my_component",
61
+ publish_func=my_publish_func
62
+ )
63
+
64
+ # Create and publish a custom event
65
+ custom_event = SamEvent.create(
66
+ event_type="agent.health_check",
67
+ source_component="health_monitor",
68
+ namespace="my_namespace",
69
+ data={"status": "healthy", "cpu_usage": 45.2}
70
+ )
71
+ success = event_service.publish_event(custom_event)
72
+
73
+ # Publish a session deleted event (convenience method)
74
+ success = event_service.publish_session_deleted(
75
+ session_id="sess_123",
76
+ user_id="user_456",
77
+ agent_id="agent_789",
78
+ gateway_id="gateway_001"
79
+ )
80
+
81
+ # Subscribe to events
82
+ def handle_session_deleted(event: SamEvent):
83
+ session_id = event.data["session_id"]
84
+ print(f"Session {session_id} was deleted")
85
+
86
+ event_service.subscribe_to_events("session.deleted", handle_session_deleted)
87
+
88
+ # Handle incoming events (typically called by your messaging infrastructure)
89
+ incoming_payload = {
90
+ "event_type": "session.deleted",
91
+ "event_id": "evt_123",
92
+ "timestamp": "2024-01-01T12:00:00Z",
93
+ "source_component": "gateway",
94
+ "namespace": "my_namespace",
95
+ "data": {"session_id": "sess_123", "user_id": "user_456"}
96
+ }
97
+ event_service.handle_incoming_event("sam/events/session/deleted", incoming_payload)
98
+
99
+ # Get topic for an event type
100
+ topic = SamEventService.get_event_topic("my_namespace", "session.deleted")
101
+ print(topic) # Returns the proper SAM events topic
102
+ ```
103
+
104
+ # content_hash: e2f1353fe6841458c68f294efc03e1fdbac3632f78507e6e58044bb0c59919af
@@ -0,0 +1,115 @@
1
+ # LLM Summary Detail File
2
+
3
+ This file is a concatenation of all individual *llm.txt files found in the 'sam_events' directory tree. Each section below corresponds to a specific directory's summary file.
4
+
5
+ ================================================================================
6
+
7
+ ## Section 1: solace_agent_mesh/common/sam_events/sam_events_llm.txt
8
+
9
+ **Source file:** `solace_agent_mesh/common/sam_events/sam_events_llm.txt`
10
+
11
+ # DEVELOPER GUIDE: sam_events
12
+
13
+ ## Quick Summary
14
+ The `sam_events` directory provides system-level event messaging for Solace Agent Mesh (SAM). It enables clean separation between agent-to-agent (A2A) task communication and system events like session lifecycle, agent health, and configuration changes.
15
+
16
+ ## Files Overview
17
+ - `__init__.py` - Package initialization and public API exports
18
+ - `event_service.py` - Core event service implementation with publishing/subscription capabilities
19
+
20
+ ## Developer API Reference
21
+
22
+ ### __init__.py
23
+ **Purpose:** Package entry point that exports the main classes for SAM event handling
24
+ **Import:** `from solace_agent_mesh.common.sam_events import SamEventService, SamEvent, SessionDeletedEvent`
25
+
26
+ ### event_service.py
27
+ **Purpose:** Implements the core event messaging service for system-level events in SAM
28
+ **Import:** `from solace_agent_mesh.common.sam_events.event_service import SamEventService, SamEvent, SessionDeletedEvent`
29
+
30
+ **Classes:**
31
+
32
+ - `SamEvent(event_type: str, event_id: str, timestamp: str, source_component: str, namespace: str, data: Dict[str, Any])` - Base class for all SAM system events
33
+ - `create(event_type: str, source_component: str, namespace: str, data: Dict[str, Any]) -> SamEvent` - Create a new event with auto-generated ID and timestamp
34
+ - `to_dict() -> Dict[str, Any]` - Convert event to dictionary for messaging
35
+ - `event_type: str` - Type of event (e.g., "session.deleted")
36
+ - `event_id: str` - Unique identifier for the event
37
+ - `timestamp: str` - ISO format timestamp when event was created
38
+ - `source_component: str` - Component that generated the event
39
+ - `namespace: str` - SAM namespace
40
+ - `data: Dict[str, Any]` - Event-specific data payload
41
+
42
+ - `SessionDeletedEvent(SamEvent)` - Specialized event for session deletion notifications
43
+ - `create(namespace: str, source_component: str, session_id: str, user_id: str, agent_id: str, gateway_id: str) -> SessionDeletedEvent` - Create a session deleted event
44
+
45
+ - `SamEventService(namespace: str, component_name: str, publish_func: Callable[[str, Dict, Optional[Dict]], None])` - Service for publishing and subscribing to SAM system events
46
+ - `publish_event(event: SamEvent) -> bool` - Publish a system event
47
+ - `publish_session_deleted(session_id: str, user_id: str, agent_id: str, gateway_id: str) -> bool` - Convenience method to publish session deleted event
48
+ - `subscribe_to_events(event_type: str, handler: Callable[[SamEvent], None]) -> bool` - Subscribe to events of a specific type
49
+ - `handle_incoming_event(topic: str, payload: Dict[str, Any]) -> None` - Handle incoming events from messaging system
50
+ - `namespace: str` - The SAM namespace
51
+ - `component_name: str` - Name of the component using this service
52
+
53
+ **Functions:**
54
+
55
+ - `SamEventService.get_event_topic(namespace: str, event_type: str) -> str` - Get the topic for a specific event type
56
+
57
+ **Usage Examples:**
58
+
59
+ ```python
60
+ # Basic event service setup
61
+ from solace_agent_mesh.common.sam_events import SamEventService, SamEvent, SessionDeletedEvent
62
+
63
+ # Initialize the event service
64
+ def my_publish_func(topic: str, payload: dict, headers: dict = None):
65
+ # Your A2A publishing implementation
66
+ pass
67
+
68
+ event_service = SamEventService(
69
+ namespace="my_namespace",
70
+ component_name="my_component",
71
+ publish_func=my_publish_func
72
+ )
73
+
74
+ # Create and publish a custom event
75
+ custom_event = SamEvent.create(
76
+ event_type="agent.health_check",
77
+ source_component="health_monitor",
78
+ namespace="my_namespace",
79
+ data={"status": "healthy", "cpu_usage": 45.2}
80
+ )
81
+ success = event_service.publish_event(custom_event)
82
+
83
+ # Publish a session deleted event (convenience method)
84
+ success = event_service.publish_session_deleted(
85
+ session_id="sess_123",
86
+ user_id="user_456",
87
+ agent_id="agent_789",
88
+ gateway_id="gateway_001"
89
+ )
90
+
91
+ # Subscribe to events
92
+ def handle_session_deleted(event: SamEvent):
93
+ session_id = event.data["session_id"]
94
+ print(f"Session {session_id} was deleted")
95
+
96
+ event_service.subscribe_to_events("session.deleted", handle_session_deleted)
97
+
98
+ # Handle incoming events (typically called by your messaging infrastructure)
99
+ incoming_payload = {
100
+ "event_type": "session.deleted",
101
+ "event_id": "evt_123",
102
+ "timestamp": "2024-01-01T12:00:00Z",
103
+ "source_component": "gateway",
104
+ "namespace": "my_namespace",
105
+ "data": {"session_id": "sess_123", "user_id": "user_456"}
106
+ }
107
+ event_service.handle_incoming_event("sam/events/session/deleted", incoming_payload)
108
+
109
+ # Get topic for an event type
110
+ topic = SamEventService.get_event_topic("my_namespace", "session.deleted")
111
+ print(topic) # Returns the proper SAM events topic
112
+ ```
113
+
114
+ ================================================================================
115
+
@@ -3,7 +3,7 @@
3
3
  ## Quick Summary
4
4
  The `services` directory provides a modular and extensible framework for integrating external data sources related to identity and employee information into the Solace AI Connector. It is built on a provider pattern, defining abstract base classes (`BaseIdentityService`, `BaseEmployeeService`) that establish a clear contract for what data and functionality a service must provide.
5
5
 
6
- The core architecture revolves around factory functions (`create_identity_service`, `create_employee_service`) that instantiate specific service providers based on a configuration dictionary. This allows the application to remain decoupled from the concrete implementations. Providers can be either built-in (like the file-based identity service located in the `providers/` subdirectory) or dynamically loaded as external plugins, making the system highly flexible and easy to extend.
6
+ The core architecture revolves around factory functions (`create_identity_service`, `create_employee_service`) that instantiate specific service providers based on a configuration dictionary. This allows the application to remain decoupled from the concrete implementations. The `providers/` subdirectory contains concrete implementations, including a built-in file-based identity service, while external providers can be dynamically loaded as plugins through Python's entry points system.
7
7
 
8
8
  ## Files and Subdirectories Overview
9
9
  - **Direct files:**
@@ -44,12 +44,10 @@ The core architecture revolves around factory functions (`create_identity_servic
44
44
  ### Subdirectory APIs
45
45
 
46
46
  #### providers/
47
- **Purpose:** This subdirectory contains concrete implementations of the abstract service classes. It ships with a built-in provider for the `IdentityService` that is useful for development and testing.
47
+ **Purpose:** Contains concrete implementations of the abstract service classes, providing specific ways to fulfill service contracts such as sourcing user identity information from local files
48
48
  **Key Exports:** `LocalFileIdentityService`
49
49
  **Import Examples:**
50
50
  ```python
51
- # Typically, you would use the factory function.
52
- # But for direct instantiation (e.g., in tests), you can do this:
53
51
  from solace_agent_mesh.common.services.providers.local_file_identity_service import LocalFileIdentityService
54
52
  ```
55
53
 
@@ -307,6 +305,59 @@ async def main():
307
305
  asyncio.run(main())
308
306
  ```
309
307
 
310
- This comprehensive guide shows how the services framework provides a clean, extensible way to integrate various data sources while maintaining consistent interfaces and supporting both built-in providers and external plugins.
308
+ ### 5. Using the Built-in LocalFileIdentityService
309
+ The `providers/` subdirectory includes a ready-to-use file-based identity service that's perfect for development and testing.
311
310
 
312
- # content_hash: 63457e2c72256810f713e62325c1601a675951fe47c1121a647c404690179206
311
+ **Example: Setting up LocalFileIdentityService with Factory**
312
+
313
+ ```python
314
+ import asyncio
315
+ import json
316
+ from solace_agent_mesh.common.services.identity_service import create_identity_service
317
+
318
+ async def setup_file_based_identity():
319
+ # Create sample users.json file
320
+ users_data = [
321
+ {
322
+ "id": "jdoe",
323
+ "email": "jane.doe@example.com",
324
+ "name": "Jane Doe",
325
+ "title": "Senior Engineer",
326
+ "manager_id": "ssmith"
327
+ },
328
+ {
329
+ "id": "ssmith",
330
+ "email": "sam.smith@example.com",
331
+ "name": "Sam Smith",
332
+ "title": "Engineering Manager"
333
+ }
334
+ ]
335
+
336
+ with open("users.json", "w") as f:
337
+ json.dump(users_data, f)
338
+
339
+ # Use factory to create the service
340
+ config = {
341
+ "type": "local_file", # This triggers the built-in provider
342
+ "file_path": "users.json",
343
+ "lookup_key": "email", # Use email for lookups
344
+ "cache_ttl_seconds": 3600
345
+ }
346
+
347
+ identity_service = create_identity_service(config)
348
+
349
+ # Test the service
350
+ auth_claims = {"email": "jane.doe@example.com"}
351
+ profile = await identity_service.get_user_profile(auth_claims)
352
+ print(f"Profile found: {profile}")
353
+
354
+ # Search functionality
355
+ search_results = await identity_service.search_users("jane")
356
+ print(f"Search results: {search_results}")
357
+
358
+ asyncio.run(setup_file_based_identity())
359
+ ```
360
+
361
+ This comprehensive guide shows how the services framework provides a clean, extensible way to integrate various data sources while maintaining consistent interfaces and supporting both built-in providers and external plugins through the factory pattern and plugin system.
362
+
363
+ # content_hash: 879562926a7d3b7c6782ae395159d6c1f8a55663ce052a93eea8966e69b04444