solace-agent-mesh 1.0.8__py3-none-any.whl → 1.1.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 (162) 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 +7 -5
  7. solace_agent_mesh/agent/adk/setup.py +11 -0
  8. solace_agent_mesh/agent/adk/stream_parser.py +8 -1
  9. solace_agent_mesh/agent/adk/tool_wrapper.py +10 -3
  10. solace_agent_mesh/agent/agent_llm.txt +355 -18
  11. solace_agent_mesh/agent/protocol/event_handlers.py +433 -296
  12. solace_agent_mesh/agent/protocol/protocol_llm.txt +54 -7
  13. solace_agent_mesh/agent/sac/app.py +1 -1
  14. solace_agent_mesh/agent/sac/component.py +212 -517
  15. solace_agent_mesh/agent/sac/sac_llm.txt +133 -63
  16. solace_agent_mesh/agent/testing/testing_llm.txt +25 -58
  17. solace_agent_mesh/agent/tools/peer_agent_tool.py +15 -11
  18. solace_agent_mesh/agent/tools/tools_llm.txt +234 -69
  19. solace_agent_mesh/agent/utils/artifact_helpers.py +35 -1
  20. solace_agent_mesh/agent/utils/utils_llm.txt +90 -105
  21. solace_agent_mesh/assets/docs/404.html +3 -3
  22. solace_agent_mesh/assets/docs/assets/js/{3d406171.7d02a73b.js → 3d406171.0b9eeed1.js} +1 -1
  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.a75ecc0d.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 +8 -8
  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-1756992446316.json +1 -0
  65. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  66. solace_agent_mesh/assets/docs/search-doc-1756992446316.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/web_add_agent_step.py +12 -3
  71. solace_agent_mesh/cli/commands/add_cmd/web_add_gateway_step.py +10 -14
  72. solace_agent_mesh/cli/commands/init_cmd/web_init_step.py +2 -15
  73. solace_agent_mesh/cli/commands/plugin_cmd/catalog_cmd.py +6 -2
  74. solace_agent_mesh/cli/utils.py +15 -0
  75. solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-DvlO62me.js → authCallback-BmF2l6vg.js} +1 -1
  76. solace_agent_mesh/client/webui/frontend/static/assets/{client-bp6u3qVZ.js → client-D881Dttc.js} +4 -4
  77. solace_agent_mesh/client/webui/frontend/static/assets/main-C0jZjYa8.js +699 -0
  78. solace_agent_mesh/client/webui/frontend/static/assets/main-CCeG324-.css +1 -0
  79. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +2 -2
  80. solace_agent_mesh/client/webui/frontend/static/index.html +3 -3
  81. solace_agent_mesh/common/a2a/__init__.py +213 -0
  82. solace_agent_mesh/common/a2a/a2a_llm.txt +182 -0
  83. solace_agent_mesh/common/a2a/artifact.py +328 -0
  84. solace_agent_mesh/common/a2a/events.py +183 -0
  85. solace_agent_mesh/common/a2a/message.py +307 -0
  86. solace_agent_mesh/common/a2a/protocol.py +513 -0
  87. solace_agent_mesh/common/a2a/task.py +127 -0
  88. solace_agent_mesh/common/a2a/translation.py +653 -0
  89. solace_agent_mesh/common/a2a/types.py +54 -0
  90. solace_agent_mesh/common/a2a_spec/a2a.json +2576 -0
  91. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +407 -0
  92. solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json +18 -0
  93. solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json +31 -0
  94. solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +18 -0
  95. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +235 -0
  96. solace_agent_mesh/common/a2a_spec/schemas/tool_invocation_start.json +26 -0
  97. solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +25 -0
  98. solace_agent_mesh/common/agent_registry.py +1 -1
  99. solace_agent_mesh/common/common_llm.txt +192 -70
  100. solace_agent_mesh/common/data_parts.py +99 -0
  101. solace_agent_mesh/common/middleware/middleware_llm.txt +17 -17
  102. solace_agent_mesh/common/sac/__init__.py +0 -0
  103. solace_agent_mesh/common/sac/sac_llm.txt +71 -0
  104. solace_agent_mesh/common/sac/sam_component_base.py +252 -0
  105. solace_agent_mesh/common/services/providers/providers_llm.txt +51 -84
  106. solace_agent_mesh/common/services/services_llm.txt +206 -26
  107. solace_agent_mesh/common/utils/artifact_utils.py +29 -0
  108. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +176 -80
  109. solace_agent_mesh/common/utils/utils_llm.txt +323 -42
  110. solace_agent_mesh/config_portal/backend/common.py +1 -1
  111. solace_agent_mesh/config_portal/frontend/static/client/assets/{_index-MqsrTd6g.js → _index-Bym6YkMd.js} +74 -24
  112. solace_agent_mesh/config_portal/frontend/static/client/assets/{components-B7lKcHVY.js → components-Rk0n-9cK.js} +1 -1
  113. solace_agent_mesh/config_portal/frontend/static/client/assets/{entry.client-CEumGClk.js → entry.client-mvZjNKiz.js} +1 -1
  114. solace_agent_mesh/config_portal/frontend/static/client/assets/{index-DSo1AH_7.js → index-DzNKzXrc.js} +1 -1
  115. solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-d845808d.js +1 -0
  116. solace_agent_mesh/config_portal/frontend/static/client/assets/{root-C4XmHinv.js → root-BWvk5-gF.js} +1 -1
  117. solace_agent_mesh/config_portal/frontend/static/client/index.html +3 -3
  118. solace_agent_mesh/core_a2a/core_a2a_llm.txt +10 -8
  119. solace_agent_mesh/core_a2a/service.py +20 -44
  120. solace_agent_mesh/gateway/base/app.py +27 -1
  121. solace_agent_mesh/gateway/base/base_llm.txt +177 -72
  122. solace_agent_mesh/gateway/base/component.py +294 -523
  123. solace_agent_mesh/gateway/gateway_llm.txt +299 -58
  124. solace_agent_mesh/gateway/http_sse/component.py +156 -183
  125. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +29 -29
  126. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +272 -36
  127. solace_agent_mesh/gateway/http_sse/main.py +8 -10
  128. solace_agent_mesh/gateway/http_sse/routers/agents.py +1 -1
  129. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +18 -4
  130. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +231 -5
  131. solace_agent_mesh/gateway/http_sse/routers/sessions.py +12 -7
  132. solace_agent_mesh/gateway/http_sse/routers/tasks.py +116 -169
  133. solace_agent_mesh/gateway/http_sse/services/agent_service.py +1 -1
  134. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +89 -135
  135. solace_agent_mesh/gateway/http_sse/services/task_service.py +2 -5
  136. solace_agent_mesh/solace_agent_mesh_llm.txt +362 -0
  137. solace_agent_mesh/templates/gateway_component_template.py +149 -98
  138. {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/METADATA +5 -4
  139. {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/RECORD +143 -126
  140. solace_agent_mesh/assets/docs/assets/js/f284c35a.731836ad.js +0 -1
  141. solace_agent_mesh/assets/docs/assets/js/main.6dba4a66.js +0 -2
  142. solace_agent_mesh/assets/docs/assets/js/runtime~main.6415ad00.js +0 -1
  143. solace_agent_mesh/assets/docs/lunr-index-1756153049706.json +0 -1
  144. solace_agent_mesh/assets/docs/search-doc-1756153049706.json +0 -1
  145. solace_agent_mesh/client/webui/frontend/static/assets/main-BCpII1-0.css +0 -1
  146. solace_agent_mesh/client/webui/frontend/static/assets/main-BucUdn9m.js +0 -673
  147. solace_agent_mesh/common/a2a_protocol.py +0 -564
  148. solace_agent_mesh/common/client/__init__.py +0 -4
  149. solace_agent_mesh/common/client/card_resolver.py +0 -21
  150. solace_agent_mesh/common/client/client.py +0 -85
  151. solace_agent_mesh/common/client/client_llm.txt +0 -133
  152. solace_agent_mesh/common/server/__init__.py +0 -4
  153. solace_agent_mesh/common/server/server.py +0 -122
  154. solace_agent_mesh/common/server/server_llm.txt +0 -169
  155. solace_agent_mesh/common/server/task_manager.py +0 -291
  156. solace_agent_mesh/common/server/utils.py +0 -28
  157. solace_agent_mesh/common/types.py +0 -411
  158. solace_agent_mesh/config_portal/frontend/static/client/assets/manifest-28271392.js +0 -1
  159. /solace_agent_mesh/assets/docs/assets/js/{main.6dba4a66.js.LICENSE.txt → main.a75ecc0d.js.LICENSE.txt} +0 -0
  160. {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/WHEEL +0 -0
  161. {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/entry_points.txt +0 -0
  162. {solace_agent_mesh-1.0.8.dist-info → solace_agent_mesh-1.1.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,235 @@
1
+ # DEVELOPER GUIDE: schemas
2
+
3
+ ## Quick Summary
4
+ This directory contains JSON Schema definitions for various agent-to-agent (A2A) communication signals in the Solace Agent Mesh. These schemas define the structure and validation rules for different types of progress updates, tool invocations, and LLM interactions that agents can send to each other.
5
+
6
+ ## Files Overview
7
+ - `agent_progress_update.json` - Schema for general agent progress status messages
8
+ - `artifact_creation_progress.json` - Schema for tracking file/artifact creation progress with chunked data
9
+ - `llm_invocation.json` - Schema for LLM model invocation signals
10
+ - `tool_invocation_start.json` - Schema for tool execution start notifications
11
+ - `tool_result.json` - Schema for tool execution completion results
12
+ - `schemas_llm.txt` - Previous developer guide (legacy documentation)
13
+
14
+ ## Developer API Reference
15
+
16
+ ### agent_progress_update.json
17
+ **Purpose:** Defines the schema for agent progress update signals that communicate human-readable status messages between agents.
18
+
19
+ **Schema Structure:**
20
+ ```json
21
+ {
22
+ "type": "agent_progress_update",
23
+ "status_text": "string"
24
+ }
25
+ ```
26
+
27
+ **Properties:**
28
+ - `type: "agent_progress_update"` - Constant identifier for this signal type (required)
29
+ - `status_text: string` - Human-readable progress message (required)
30
+
31
+ **Usage Examples:**
32
+ ```python
33
+ import json
34
+ from jsonschema import validate
35
+
36
+ # Load and use schema
37
+ with open('solace_agent_mesh/common/a2a_spec/schemas/agent_progress_update.json') as f:
38
+ schema = json.load(f)
39
+
40
+ # Valid data example
41
+ data = {
42
+ "type": "agent_progress_update",
43
+ "status_text": "Analyzing the report..."
44
+ }
45
+ validate(instance=data, schema=schema)
46
+ ```
47
+
48
+ ### artifact_creation_progress.json
49
+ **Purpose:** Defines the schema for tracking progress during file or artifact creation operations with chunked data transfer.
50
+
51
+ **Schema Structure:**
52
+ ```json
53
+ {
54
+ "type": "artifact_creation_progress",
55
+ "filename": "string",
56
+ "bytes_saved": "integer",
57
+ "artifact_chunk": "string"
58
+ }
59
+ ```
60
+
61
+ **Properties:**
62
+ - `type: "artifact_creation_progress"` - Constant identifier for this signal type (required)
63
+ - `filename: string` - Name of the artifact being created (required)
64
+ - `bytes_saved: integer` - Number of bytes saved so far (required)
65
+ - `artifact_chunk: string` - The chunk of artifact data that was saved in this update (required)
66
+
67
+ **Usage Examples:**
68
+ ```python
69
+ import json
70
+ from jsonschema import validate
71
+
72
+ # Load and use schema
73
+ with open('solace_agent_mesh/common/a2a_spec/schemas/artifact_creation_progress.json') as f:
74
+ schema = json.load(f)
75
+
76
+ # Valid data example
77
+ data = {
78
+ "type": "artifact_creation_progress",
79
+ "filename": "report.pdf",
80
+ "bytes_saved": 1024,
81
+ "artifact_chunk": "JVBERi0xLjQKJcOkw7zDtsO..."
82
+ }
83
+ validate(instance=data, schema=schema)
84
+ ```
85
+
86
+ ### llm_invocation.json
87
+ **Purpose:** Defines the schema for LLM invocation signals that communicate when an agent is calling a language model.
88
+
89
+ **Schema Structure:**
90
+ ```json
91
+ {
92
+ "type": "llm_invocation",
93
+ "request": "object"
94
+ }
95
+ ```
96
+
97
+ **Properties:**
98
+ - `type: "llm_invocation"` - Constant identifier for this signal type (required)
99
+ - `request: object` - Sanitized representation of the LlmRequest object sent to the model (required)
100
+
101
+ **Usage Examples:**
102
+ ```python
103
+ import json
104
+ from jsonschema import validate
105
+
106
+ # Load and use schema
107
+ with open('solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json') as f:
108
+ schema = json.load(f)
109
+
110
+ # Valid data example
111
+ data = {
112
+ "type": "llm_invocation",
113
+ "request": {
114
+ "model": "gpt-4",
115
+ "messages": [{"role": "user", "content": "Analyze this data"}],
116
+ "temperature": 0.7
117
+ }
118
+ }
119
+ validate(instance=data, schema=schema)
120
+ ```
121
+
122
+ ### tool_invocation_start.json
123
+ **Purpose:** Defines the schema for tool invocation start signals that notify when an agent begins executing a tool.
124
+
125
+ **Schema Structure:**
126
+ ```json
127
+ {
128
+ "type": "tool_invocation_start",
129
+ "tool_name": "string",
130
+ "tool_args": "object",
131
+ "function_call_id": "string"
132
+ }
133
+ ```
134
+
135
+ **Properties:**
136
+ - `type: "tool_invocation_start"` - Constant identifier for this signal type (required)
137
+ - `tool_name: string` - Name of the tool being called (required)
138
+ - `tool_args: object` - Arguments passed to the tool (required)
139
+ - `function_call_id: string` - ID from the LLM's function call (required)
140
+
141
+ **Usage Examples:**
142
+ ```python
143
+ import json
144
+ from jsonschema import validate
145
+
146
+ # Load and use schema
147
+ with open('solace_agent_mesh/common/a2a_spec/schemas/tool_invocation_start.json') as f:
148
+ schema = json.load(f)
149
+
150
+ # Valid data example
151
+ data = {
152
+ "type": "tool_invocation_start",
153
+ "tool_name": "file_reader",
154
+ "tool_args": {
155
+ "filepath": "/path/to/file.txt",
156
+ "encoding": "utf-8"
157
+ },
158
+ "function_call_id": "call_abc123"
159
+ }
160
+ validate(instance=data, schema=schema)
161
+ ```
162
+
163
+ ### tool_result.json
164
+ **Purpose:** Defines the schema for tool execution result signals that communicate the completion and results of tool invocations.
165
+
166
+ **Schema Structure:**
167
+ ```json
168
+ {
169
+ "type": "tool_result",
170
+ "tool_name": "string",
171
+ "result_data": "any",
172
+ "function_call_id": "string"
173
+ }
174
+ ```
175
+
176
+ **Properties:**
177
+ - `type: "tool_result"` - Constant identifier for this signal type (required)
178
+ - `tool_name: string` - Name of the tool that was called (required)
179
+ - `result_data: any` - The data returned by the tool (required, can be any type)
180
+ - `function_call_id: string` - ID from the LLM's function call that this result corresponds to (required)
181
+
182
+ **Usage Examples:**
183
+ ```python
184
+ import json
185
+ from jsonschema import validate
186
+
187
+ # Load and use schema
188
+ with open('solace_agent_mesh/common/a2a_spec/schemas/tool_result.json') as f:
189
+ schema = json.load(f)
190
+
191
+ # Valid data example
192
+ data = {
193
+ "type": "tool_result",
194
+ "tool_name": "file_reader",
195
+ "result_data": {
196
+ "content": "File contents here...",
197
+ "size": 1024,
198
+ "encoding": "utf-8"
199
+ },
200
+ "function_call_id": "call_abc123"
201
+ }
202
+ validate(instance=data, schema=schema)
203
+ ```
204
+
205
+ **Common Usage Pattern:**
206
+ ```python
207
+ import json
208
+ from jsonschema import validate
209
+ from pathlib import Path
210
+
211
+ def validate_a2a_signal(signal_data: dict, schema_name: str) -> bool:
212
+ """Validate A2A signal data against its schema."""
213
+ schema_path = Path(f"solace_agent_mesh/common/a2a_spec/schemas/{schema_name}.json")
214
+
215
+ with open(schema_path) as f:
216
+ schema = json.load(f)
217
+
218
+ try:
219
+ validate(instance=signal_data, schema=schema)
220
+ return True
221
+ except Exception as e:
222
+ print(f"Validation failed: {e}")
223
+ return False
224
+
225
+ # Example usage
226
+ progress_data = {
227
+ "type": "agent_progress_update",
228
+ "status_text": "Processing request..."
229
+ }
230
+
231
+ if validate_a2a_signal(progress_data, "agent_progress_update"):
232
+ print("Signal is valid!")
233
+ ```
234
+
235
+ # content_hash: 3e5a2f693dc3f4536f9c958168677fe2e3a0e18b3dc319891aceccb5ccfdda8a
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ToolInvocationStartData",
4
+ "description": "Schema for the data part of a tool invocation start signal.",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "tool_invocation_start",
10
+ "description": "The constant type for this data part."
11
+ },
12
+ "tool_name": {
13
+ "type": "string",
14
+ "description": "The name of the tool being called."
15
+ },
16
+ "tool_args": {
17
+ "type": "object",
18
+ "description": "The arguments passed to the tool."
19
+ },
20
+ "function_call_id": {
21
+ "type": "string",
22
+ "description": "The ID from the LLM's function call."
23
+ }
24
+ },
25
+ "required": ["type", "tool_name", "tool_args", "function_call_id"]
26
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ToolResultData",
4
+ "description": "Schema for the data part of a tool execution result signal.",
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "tool_result",
10
+ "description": "The constant type for this data part."
11
+ },
12
+ "tool_name": {
13
+ "type": "string",
14
+ "description": "The name of the tool that was called."
15
+ },
16
+ "result_data": {
17
+ "description": "The data returned by the tool."
18
+ },
19
+ "function_call_id": {
20
+ "type": "string",
21
+ "description": "The ID from the LLM's function call that this result corresponds to."
22
+ }
23
+ },
24
+ "required": ["type", "tool_name", "result_data", "function_call_id"]
25
+ }
@@ -6,7 +6,7 @@ Consolidated from src/tools/common/agent_registry.py and src/tools/a2a_cli_clien
6
6
  import threading
7
7
  from typing import Dict, List, Optional
8
8
 
9
- from ..common.types import AgentCard
9
+ from a2a.types import AgentCard
10
10
 
11
11
 
12
12
  class AgentRegistry:
@@ -1,34 +1,39 @@
1
- Here is the comprehensive developer guide for the `common` directory.
1
+ # DEVELOPER GUIDE: common
2
2
 
3
3
  ## Quick Summary
4
- The `common` directory provides the foundational infrastructure for Agent-to-Agent (A2A) communication within the Solace AI Connector. It establishes the core protocol, data types, and message translation logic that underpins all interactions between AI agents and gateways.
4
+ The `common` directory provides the foundational infrastructure for Agent-to-Agent (A2A) communication within the Solace Agent Mesh. It establishes the core protocol, data types, and message translation logic that underpins all interactions between AI agents and gateways.
5
5
 
6
6
  The architecture is designed for clarity and extensibility. Core, low-level definitions are located in **direct files**:
7
- * `types.py` defines the canonical data structures (e.g., `Message`, `Task`, `AgentCard`).
8
- * `a2a_protocol.py` handles the construction of Solace topics and the translation between A2A and Google ADK message formats.
9
- * `agent_registry.py` provides a simple, thread-safe mechanism for discovering and tracking available agents.
7
+ - `types.py` defines the canonical data structures (e.g., `Message`, `Task`, `AgentCard`).
8
+ - `a2a_protocol.py` handles the construction of Solace topics and the translation between A2A and Google ADK message formats.
9
+ - `agent_registry.py` provides a simple, thread-safe mechanism for discovering and tracking available agents.
10
10
 
11
11
  This foundation is then leveraged by specialized **subdirectories**, which provide higher-level, ready-to-use components:
12
- * `client/`: A complete client library for discovering and interacting with remote agents.
13
- * `server/`: A stand-alone server implementation for building A2A-compliant agents.
14
- * `middleware/`: A pluggable framework for customizing configuration and feature access.
15
- * `services/`: A factory-based system for integrating identity and other external data sources.
16
- * `utils/`: A collection of cross-cutting utilities for caching, logging, and dynamic content processing.
12
+ - `client/`: A complete client library for discovering and interacting with remote agents.
13
+ - `server/`: A stand-alone server implementation for building A2A-compliant agents.
14
+ - `middleware/`: A pluggable framework for customizing configuration and feature access.
15
+ - `services/`: A factory-based system for integrating identity and other external data sources.
16
+ - `utils/`: A collection of cross-cutting utilities for caching, logging, and dynamic content processing.
17
17
 
18
18
  Together, these components form a cohesive ecosystem, enabling developers to either build new agents from scratch using the `server` components or interact with existing agents using the `client` library, all while relying on the same underlying protocol and types.
19
19
 
20
20
  ## Files and Subdirectories Overview
21
21
  - **Direct files:**
22
- - `__init__.py`: Package initialization file.
23
- - `a2a_protocol.py`: Handles A2A topic construction and translation between A2A and ADK message formats.
24
- - `agent_registry.py`: A thread-safe registry for managing discovered agent cards.
25
- - `types.py`: Contains all Pydantic models for A2A protocol messages, tasks, and data structures.
22
+ - `__init__.py`: Package initialization file.
23
+ - `a2a_protocol.py`: Handles A2A topic construction and translation between A2A and ADK message formats.
24
+ - `agent_registry.py`: A thread-safe registry for managing discovered agent cards.
25
+ - `constants.py`: Common constants used across the system.
26
+ - `data_parts.py`: Pydantic models for structured data payloads used in A2A DataPart objects.
27
+ - `exceptions.py`: Custom exceptions for Solace Agent Mesh.
28
+ - `types.py`: Contains all Pydantic models for A2A protocol messages, tasks, and data structures.
26
29
  - **Subdirectories:**
27
- - `client/`: Provides a high-level client for discovering and communicating with remote A2A agents.
28
- - `middleware/`: A pluggable framework for configuration resolution and system extensibility.
29
- - `server/`: A complete A2A server implementation with JSON-RPC support and task management.
30
- - `services/`: Provides shared services like identity management using a factory pattern.
31
- - `utils/`: Contains common utility functions and an embedded expression processing system.
30
+ - `a2a/`: Comprehensive abstraction layer providing helper functions for creating, consuming, and translating A2A protocol objects.
31
+ - `a2a_spec/`: Complete JSON Schema specification for the A2A protocol.
32
+ - `client/`: Provides a high-level client for discovering and communicating with remote A2A agents.
33
+ - `middleware/`: A pluggable framework for configuration resolution and system extensibility.
34
+ - `server/`: A complete A2A server implementation with JSON-RPC support and task management.
35
+ - `services/`: Provides shared services like identity management using a factory pattern.
36
+ - `utils/`: Contains common utility functions and an embedded expression processing system.
32
37
 
33
38
  ## Developer API Reference
34
39
 
@@ -36,66 +41,132 @@ Together, these components form a cohesive ecosystem, enabling developers to eit
36
41
 
37
42
  #### a2a_protocol.py
38
43
  **Purpose:** Provides the core functions for constructing Solace topics according to the A2A specification and for translating messages between the A2A format and the Google ADK format.
39
- **Import:** `from common.a2a_protocol import get_agent_request_topic, translate_a2a_to_adk_content`
44
+ **Import:** `from solace_agent_mesh.common.a2a_protocol import get_agent_request_topic, translate_a2a_to_adk_content`
40
45
 
41
46
  **Classes/Functions/Constants:**
42
- * **Constants**:
43
- * `A2A_VERSION: str`: The current version of the A2A protocol (e.g., "v1").
44
- * `A2A_BASE_PATH: str`: The base path used in all A2A topics (e.g., "a2a/v1").
45
- * **Topic Construction Functions**:
46
- * `get_a2a_base_topic(namespace: str) -> str`: Returns the base topic prefix for all A2A communication.
47
- * `get_discovery_topic(namespace: str) -> str`: Returns the topic for agent card discovery.
48
- * `get_agent_request_topic(namespace: str, agent_name: str) -> str`: Returns the topic for sending requests to a specific agent.
49
- * `get_gateway_status_topic(namespace: str, gateway_id: str, task_id: str) -> str`: Returns the topic for an agent to publish status updates to a gateway.
50
- * `get_gateway_response_topic(namespace: str, gateway_id: str, task_id: str) -> str`: Returns the topic for an agent to publish final responses to a gateway.
51
- * `get_client_response_topic(namespace: str, client_id: str) -> str`: Returns the topic for publishing final responses to a specific client.
52
- * `get_client_status_topic(namespace: str, client_id: str, task_id: str) -> str`: Returns the topic for publishing status updates to a specific client.
53
- * ... and various functions for subscription topics (e.g., `get_gateway_status_subscription_topic`).
54
- * **Message Translation Functions**:
55
- * `translate_a2a_to_adk_content(a2a_message: A2AMessage, log_identifier: str) -> adk_types.Content`: Translates an A2A `Message` object into the Google ADK `Content` format.
56
- * `format_adk_event_as_a2a(...) -> Tuple[Optional[JSONRPCResponse], ...]`: Translates an ADK `Event` into an A2A `JSONRPCResponse` containing a `TaskStatusUpdateEvent`.
57
- * `format_and_route_adk_event(...) -> Tuple[Optional[Dict], Optional[str], ...]`: A higher-level wrapper that formats an ADK event and determines the correct Solace topic to publish it to.
47
+ - **Constants**:
48
+ - `A2A_VERSION: str`: The current version of the A2A protocol (e.g., "v1").
49
+ - `A2A_BASE_PATH: str`: The base path used in all A2A topics (e.g., "a2a/v1").
50
+ - **Topic Construction Functions**:
51
+ - `get_a2a_base_topic(namespace: str) -> str`: Returns the base topic prefix for all A2A communication.
52
+ - `get_discovery_topic(namespace: str) -> str`: Returns the topic for agent card discovery.
53
+ - `get_agent_request_topic(namespace: str, agent_name: str) -> str`: Returns the topic for sending requests to a specific agent.
54
+ - `get_gateway_status_topic(namespace: str, gateway_id: str, task_id: str) -> str`: Returns the topic for an agent to publish status updates to a gateway.
55
+ - `get_gateway_response_topic(namespace: str, gateway_id: str, task_id: str) -> str`: Returns the topic for an agent to publish final responses to a gateway.
56
+ - `get_client_response_topic(namespace: str, client_id: str) -> str`: Returns the topic for publishing final responses to a specific client.
57
+ - `get_client_status_topic(namespace: str, client_id: str, task_id: str) -> str`: Returns the topic for publishing status updates to a specific client.
58
+ - **Message Translation Functions**:
59
+ - `translate_a2a_to_adk_content(a2a_message: A2AMessage, log_identifier: str) -> adk_types.Content`: Translates an A2A `Message` object into the Google ADK `Content` format.
60
+ - `format_adk_event_as_a2a(...) -> Tuple[Optional[JSONRPCResponse], ...]`: Translates an ADK `Event` into an A2A `JSONRPCResponse` containing a `TaskStatusUpdateEvent`.
61
+ - `format_and_route_adk_event(...) -> Tuple[Optional[Dict], Optional[str], ...]`: A higher-level wrapper that formats an ADK event and determines the correct Solace topic to publish it to.
58
62
 
59
63
  #### agent_registry.py
60
64
  **Purpose:** Provides a simple, thread-safe, in-memory store for discovered `AgentCard` objects. This is useful for components that need to keep track of available agents in the network.
61
- **Import:** `from common.agent_registry import AgentRegistry`
65
+ **Import:** `from solace_agent_mesh.common.agent_registry import AgentRegistry`
62
66
 
63
67
  **Classes/Functions/Constants:**
64
- * **`AgentRegistry`**: A thread-safe class for storing and managing agent cards.
65
- * `add_or_update_agent(self, agent_card: AgentCard)`: Adds a new agent or updates an existing one.
66
- * `get_agent(self, agent_name: str) -> Optional[AgentCard]`: Retrieves an agent card by its unique name.
67
- * `get_agent_names(self) -> List[str]`: Returns a sorted list of all discovered agent names.
68
- * `clear(self)`: Clears all agents from the registry.
68
+ - **`AgentRegistry`**: A thread-safe class for storing and managing agent cards.
69
+ - `add_or_update_agent(self, agent_card: AgentCard)`: Adds a new agent or updates an existing one.
70
+ - `get_agent(self, agent_name: str) -> Optional[AgentCard]`: Retrieves an agent card by its unique name.
71
+ - `get_agent_names(self) -> List[str]`: Returns a sorted list of all discovered agent names.
72
+ - `clear(self)`: Clears all agents from the registry.
73
+
74
+ #### constants.py
75
+ **Purpose:** Defines common constants used throughout the Solace Agent Mesh system.
76
+ **Import:** `from solace_agent_mesh.common.constants import DEFAULT_COMMUNICATION_TIMEOUT`
77
+
78
+ **Classes/Functions/Constants:**
79
+ - `DEFAULT_COMMUNICATION_TIMEOUT: int`: Default timeout for communication operations (600 seconds / 10 minutes).
80
+
81
+ #### data_parts.py
82
+ **Purpose:** Defines Pydantic models for structured data payloads used in A2A DataPart objects, corresponding to JSON schemas for agent communication signals.
83
+ **Import:** `from solace_agent_mesh.common.data_parts import ToolInvocationStartData, LlmInvocationData`
84
+
85
+ **Classes/Functions/Constants:**
86
+ - **`ToolInvocationStartData`**: Data model for tool invocation start signals.
87
+ - `type: Literal["tool_invocation_start"]`: The constant type identifier.
88
+ - `tool_name: str`: The name of the tool being called.
89
+ - `tool_args: Dict[str, Any]`: The arguments passed to the tool.
90
+ - `function_call_id: str`: The ID from the LLM's function call.
91
+ - **`LlmInvocationData`**: Data model for LLM invocation signals.
92
+ - `type: Literal["llm_invocation"]`: The constant type identifier.
93
+ - `request: Dict[str, Any]`: A sanitized representation of the LlmRequest object.
94
+ - **`AgentProgressUpdateData`**: Data model for agent progress update signals.
95
+ - `type: Literal["agent_progress_update"]`: The constant type identifier.
96
+ - `status_text: str`: A human-readable progress message.
97
+ - **`ArtifactCreationProgressData`**: Data model for artifact creation progress signals.
98
+ - `type: Literal["artifact_creation_progress"]`: The constant type identifier.
99
+ - `filename: str`: The name of the artifact being created.
100
+ - `bytes_saved: int`: The number of bytes saved so far.
101
+ - `artifact_chunk: str`: The chunk of artifact data that was saved in this progress update.
102
+ - **`ToolResultData`**: Data model for tool execution result signals.
103
+ - `type: Literal["tool_result"]`: The constant type identifier.
104
+ - `tool_name: str`: The name of the tool that was called.
105
+ - `result_data: Any`: The data returned by the tool.
106
+ - `function_call_id: str`: The ID from the LLM's function call.
107
+
108
+ #### exceptions.py
109
+ **Purpose:** Defines custom exceptions specific to the Solace Agent Mesh system.
110
+ **Import:** `from solace_agent_mesh.common.exceptions import MessageSizeExceededError`
111
+
112
+ **Classes/Functions/Constants:**
113
+ - **`MessageSizeExceededError(Exception)`**: Raised when a message exceeds the maximum allowed size.
114
+ - `__init__(self, actual_size: int, max_size: int, message: str = None)`: Initialize with size information.
115
+ - `actual_size: int`: The actual size of the message in bytes.
116
+ - `max_size: int`: The maximum allowed size in bytes.
69
117
 
70
118
  #### types.py
71
119
  **Purpose:** Defines all the Pydantic data models that constitute the A2A protocol. These types ensure data consistency and provide validation across all components.
72
- **Import:** `from common.types import Message, Task, AgentCard, JSONRPCRequest, TaskState`
120
+ **Import:** `from solace_agent_mesh.common.types import Message, Task, AgentCard, JSONRPCRequest, TaskState`
73
121
 
74
122
  **Classes/Functions/Constants:**
75
- * **Core Data Structures**:
76
- * `Message`: Represents a message from a user or agent, containing a list of `Part` objects.
77
- * `Part`: A discriminated union of `TextPart`, `FilePart`, and `DataPart`.
78
- * `Task`: The central object representing a complete task, including its ID, status, history, and artifacts.
79
- * `TaskStatus`: Describes the current state of a task (e.g., `WORKING`, `COMPLETED`).
80
- * `TaskState(Enum)`: An enumeration of all possible task states.
81
- * `AgentCard`: A comprehensive description of an agent's identity, capabilities, and skills.
82
- * `Artifact`: Represents a task output, such as a generated file or structured data.
83
- * **JSON-RPC Structures**:
84
- * `JSONRPCRequest`: The base model for all JSON-RPC requests.
85
- * `JSONRPCResponse`: The base model for all JSON-RPC responses.
86
- * `SendTaskRequest`, `GetTaskRequest`, etc.: Specific request types inheriting from `JSONRPCRequest`.
87
- * **Error Structures**:
88
- * `JSONRPCError`: The base model for errors.
89
- * `InternalError`, `TaskNotFoundError`, etc.: Specific error types inheriting from `JSONRPCError`.
123
+ - **Core Data Structures**:
124
+ - `Message`: Represents a message from a user or agent, containing a list of `Part` objects.
125
+ - `Part`: A discriminated union of `TextPart`, `FilePart`, and `DataPart`.
126
+ - `Task`: The central object representing a complete task, including its ID, status, history, and artifacts.
127
+ - `TaskStatus`: Describes the current state of a task (e.g., `WORKING`, `COMPLETED`).
128
+ - `TaskState(Enum)`: An enumeration of all possible task states.
129
+ - `AgentCard`: A comprehensive description of an agent's identity, capabilities, and skills.
130
+ - `Artifact`: Represents a task output, such as a generated file or structured data.
131
+ - **JSON-RPC Structures**:
132
+ - `JSONRPCRequest`: The base model for all JSON-RPC requests.
133
+ - `JSONRPCResponse`: The base model for all JSON-RPC responses.
134
+ - `SendTaskRequest`, `GetTaskRequest`, etc.: Specific request types inheriting from `JSONRPCRequest`.
135
+ - **Error Structures**:
136
+ - `JSONRPCError`: The base model for errors.
137
+ - `InternalError`, `TaskNotFoundError`, etc.: Specific error types inheriting from `JSONRPCError`.
90
138
 
91
139
  ### Subdirectory APIs
92
140
 
141
+ #### a2a/
142
+ **Purpose:** Comprehensive abstraction layer providing helper functions for creating, consuming, and translating A2A protocol objects
143
+ **Key Exports:** Helper functions for messages, tasks, artifacts, events, and protocol operations
144
+ **Import Examples:**
145
+ ```python
146
+ from solace_agent_mesh.common.a2a import create_agent_text_message, create_initial_task, translate_a2a_to_adk_content
147
+ from solace_agent_mesh.common.a2a.message import create_text_part, get_text_from_message
148
+ from solace_agent_mesh.common.a2a.protocol import get_agent_request_topic, create_send_message_request
149
+ ```
150
+
151
+ #### a2a_spec/
152
+ **Purpose:** Contains the complete Agent-to-Agent (A2A) communication specification including JSON schema definitions
153
+ **Key Exports:** JSON Schema specifications for A2A protocol and agent communication signals
154
+ **Import Examples:**
155
+ ```python
156
+ import json
157
+ from jsonschema import validate
158
+
159
+ # Load main A2A schema
160
+ with open('solace_agent_mesh/common/a2a_spec/a2a.json') as f:
161
+ a2a_schema = json.load(f)
162
+ ```
163
+
93
164
  #### client/
94
165
  **Purpose:** Provides a high-level, asynchronous client library for discovering and interacting with remote A2A agents.
95
166
  **Key Exports:** `A2AClient`, `A2ACardResolver`
96
167
  **Import Examples:**
97
168
  ```python
98
- from common.client import A2AClient, A2ACardResolver
169
+ from solace_agent_mesh.common.client import A2AClient, A2ACardResolver
99
170
  ```
100
171
 
101
172
  #### middleware/
@@ -103,7 +174,7 @@ from common.client import A2AClient, A2ACardResolver
103
174
  **Key Exports:** `ConfigResolver`, `MiddlewareRegistry`
104
175
  **Import Examples:**
105
176
  ```python
106
- from common.middleware import ConfigResolver, MiddlewareRegistry
177
+ from solace_agent_mesh.common.middleware import ConfigResolver, MiddlewareRegistry
107
178
  ```
108
179
 
109
180
  #### server/
@@ -111,7 +182,7 @@ from common.middleware import ConfigResolver, MiddlewareRegistry
111
182
  **Key Exports:** `A2AServer`, `TaskManager`, `InMemoryTaskManager`
112
183
  **Import Examples:**
113
184
  ```python
114
- from common.server import A2AServer, TaskManager, InMemoryTaskManager
185
+ from solace_agent_mesh.common.server import A2AServer, TaskManager, InMemoryTaskManager
115
186
  ```
116
187
 
117
188
  #### services/
@@ -119,7 +190,7 @@ from common.server import A2AServer, TaskManager, InMemoryTaskManager
119
190
  **Key Exports:** `BaseIdentityService`, `create_identity_service`
120
191
  **Import Examples:**
121
192
  ```python
122
- from common.services.identity_service import create_identity_service, BaseIdentityService
193
+ from solace_agent_mesh.common.services.identity_service import create_identity_service, BaseIdentityService
123
194
  ```
124
195
 
125
196
  #### utils/
@@ -127,18 +198,69 @@ from common.services.identity_service import create_identity_service, BaseIdenti
127
198
  **Key Exports:** `InMemoryCache`, `is_text_based_mime_type`, `resolve_embeds_in_string`
128
199
  **Import Examples:**
129
200
  ```python
130
- from common.utils.in_memory_cache import InMemoryCache
131
- from common.utils import is_text_based_mime_type
132
- from common.utils.embeds import resolve_embeds_in_string
201
+ from solace_agent_mesh.common.utils.in_memory_cache import InMemoryCache
202
+ from solace_agent_mesh.common.utils import is_text_based_mime_type
203
+ from solace_agent_mesh.common.utils.embeds import resolve_embeds_recursively_in_string
133
204
  ```
134
205
 
135
206
  ## Complete Usage Guide
136
- These examples demonstrate how to use the components from the `common` directory to build and interact with A2A agents.
137
207
 
138
- ### 1. How to import and use classes from direct files
139
- This example shows basic usage of the protocol, types, and agent registry, which form the foundation of any A2A component.
208
+ ### 1. Basic A2A Protocol Usage
209
+ This example shows how to use the core protocol functions and types to build A2A communication.
140
210
 
141
211
  ```python
142
212
  import uuid
143
- from common.a2a_protocol import get_agent_request_topic, get_gateway_status_topic
144
- from common.types import AgentCard,
213
+ from datetime import datetime, timezone
214
+ from solace_agent_mesh.common.a2a_protocol import (
215
+ get_agent_request_topic,
216
+ get_gateway_status_topic,
217
+ translate_a2a_to_adk_content
218
+ )
219
+ from solace_agent_mesh.common.types import (
220
+ Message,
221
+ TextPart,
222
+ Task,
223
+ TaskStatus,
224
+ TaskState,
225
+ AgentCard
226
+ )
227
+ from solace_agent_mesh.common.agent_registry import AgentRegistry
228
+
229
+ # Create a message
230
+ message = Message(
231
+ role="user",
232
+ parts=[TextPart(text="Hello, can you help me analyze this document?")]
233
+ )
234
+
235
+ # Translate to ADK format for processing
236
+ adk_content = translate_a2a_to_adk_content(message, "[Example]")
237
+ print(f"ADK Content: {adk_content}")
238
+
239
+ # Generate topic names for communication
240
+ namespace = "my-company/ai-agents"
241
+ agent_name = "document-analyzer"
242
+ gateway_id = "gateway-001"
243
+ task_id = str(uuid.uuid4())
244
+
245
+ request_topic = get_agent_request_topic(namespace, agent_name)
246
+ status_topic = get_gateway_status_topic(namespace, gateway_id, task_id)
247
+
248
+ print(f"Request Topic: {request_topic}")
249
+ print(f"Status Topic: {status_topic}")
250
+
251
+ # Use agent registry to track discovered agents
252
+ registry = AgentRegistry()
253
+ agent_card = AgentCard(
254
+ name="document-analyzer",
255
+ display_name="Document Analyzer",
256
+ description="Analyzes and extracts information from documents",
257
+ url="https://agents.company.com/document-analyzer",
258
+ version="1.0.0",
259
+ capabilities={"streaming": True, "pushNotifications": False},
260
+ skills=[],
261
+ peer_agents={}
262
+ )
263
+
264
+ registry.add_or_update_agent(agent_
265
+
266
+ # content_hash: 1e02a8692a4f781b66ebf5b56ec8adedbbcfec3a02cc8f1cd02a22b95e057b14