agentsml-impl 0.2.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.
- agentsml_impl/__init__.py +3 -0
- agentsml_impl/cli.py +472 -0
- agentsml_impl/compiler/__init__.py +1 -0
- agentsml_impl/compiler/capabilities.py +330 -0
- agentsml_impl/compiler/conditions.py +177 -0
- agentsml_impl/compiler/diagnostics.py +112 -0
- agentsml_impl/compiler/durations.py +31 -0
- agentsml_impl/compiler/expressions.py +123 -0
- agentsml_impl/compiler/identifiers.py +60 -0
- agentsml_impl/compiler/ir.py +391 -0
- agentsml_impl/compiler/limits.py +28 -0
- agentsml_impl/compiler/loader.py +83 -0
- agentsml_impl/compiler/naming.py +87 -0
- agentsml_impl/compiler/planner.py +79 -0
- agentsml_impl/compiler/render.py +90 -0
- agentsml_impl/compiler/schema_validation.py +121 -0
- agentsml_impl/compiler/semantic_validation.py +424 -0
- agentsml_impl/protocols/__init__.py +1 -0
- agentsml_impl/runtime/__init__.py +1 -0
- agentsml_impl/runtime/events.py +59 -0
- agentsml_impl/runtime/json_schema.py +138 -0
- agentsml_impl/runtime/tools.py +145 -0
- agentsml_impl/schemas/agentsml.schema.json +406 -0
- agentsml_impl/schemas/v0.1/agentsml.schema.json +628 -0
- agentsml_impl/schemas/v0.2/agentsml.schema.json +363 -0
- agentsml_impl/schemas/v0.3/agentsml.schema.json +406 -0
- agentsml_impl/targets/__init__.py +1 -0
- agentsml_impl/targets/a2a/__init__.py +0 -0
- agentsml_impl/targets/a2a/adapter.py +94 -0
- agentsml_impl/targets/a2a/capabilities.yaml +25 -0
- agentsml_impl/targets/ag2/__init__.py +0 -0
- agentsml_impl/targets/ag2/adapter.py +655 -0
- agentsml_impl/targets/ag2/capabilities.yaml +37 -0
- agentsml_impl/targets/ag_ui/__init__.py +0 -0
- agentsml_impl/targets/ag_ui/adapter.py +123 -0
- agentsml_impl/targets/ag_ui/capabilities.yaml +25 -0
- agentsml_impl/targets/agno/__init__.py +0 -0
- agentsml_impl/targets/agno/adapter.py +191 -0
- agentsml_impl/targets/agno/capabilities.yaml +26 -0
- agentsml_impl/targets/ap2/__init__.py +0 -0
- agentsml_impl/targets/ap2/adapter.py +84 -0
- agentsml_impl/targets/ap2/capabilities.yaml +25 -0
- agentsml_impl/targets/base.py +157 -0
- agentsml_impl/targets/bedrock_agentcore/__init__.py +0 -0
- agentsml_impl/targets/bedrock_agentcore/adapter.py +592 -0
- agentsml_impl/targets/bedrock_agentcore/capabilities.yaml +26 -0
- agentsml_impl/targets/claude_agent_sdk/__init__.py +0 -0
- agentsml_impl/targets/claude_agent_sdk/adapter.py +178 -0
- agentsml_impl/targets/claude_agent_sdk/capabilities.yaml +26 -0
- agentsml_impl/targets/crewai/__init__.py +0 -0
- agentsml_impl/targets/crewai/adapter.py +441 -0
- agentsml_impl/targets/crewai/capabilities.yaml +30 -0
- agentsml_impl/targets/databricks/__init__.py +0 -0
- agentsml_impl/targets/databricks/adapter.py +427 -0
- agentsml_impl/targets/databricks/capabilities.yaml +26 -0
- agentsml_impl/targets/flowise/__init__.py +0 -0
- agentsml_impl/targets/flowise/adapter.py +71 -0
- agentsml_impl/targets/flowise/capabilities.yaml +26 -0
- agentsml_impl/targets/google_adk/__init__.py +0 -0
- agentsml_impl/targets/google_adk/adapter.py +589 -0
- agentsml_impl/targets/google_adk/capabilities.yaml +36 -0
- agentsml_impl/targets/langchain/__init__.py +1 -0
- agentsml_impl/targets/langchain/adapter.py +351 -0
- agentsml_impl/targets/langchain/capabilities.yaml +30 -0
- agentsml_impl/targets/langflow/__init__.py +0 -0
- agentsml_impl/targets/langflow/adapter.py +147 -0
- agentsml_impl/targets/langflow/capabilities.yaml +26 -0
- agentsml_impl/targets/langgraph/__init__.py +0 -0
- agentsml_impl/targets/langgraph/adapter.py +911 -0
- agentsml_impl/targets/langgraph/capabilities.yaml +33 -0
- agentsml_impl/targets/llamaindex/__init__.py +1 -0
- agentsml_impl/targets/llamaindex/adapter.py +406 -0
- agentsml_impl/targets/llamaindex/capabilities.yaml +31 -0
- agentsml_impl/targets/lyzr/__init__.py +0 -0
- agentsml_impl/targets/lyzr/adapter.py +146 -0
- agentsml_impl/targets/lyzr/capabilities.yaml +26 -0
- agentsml_impl/targets/mastra/__init__.py +0 -0
- agentsml_impl/targets/mastra/adapter.py +635 -0
- agentsml_impl/targets/mastra/capabilities.yaml +32 -0
- agentsml_impl/targets/mcp_server/__init__.py +0 -0
- agentsml_impl/targets/mcp_server/adapter.py +141 -0
- agentsml_impl/targets/mcp_server/capabilities.yaml +25 -0
- agentsml_impl/targets/microsoft_agent_framework/__init__.py +0 -0
- agentsml_impl/targets/microsoft_agent_framework/adapter.py +563 -0
- agentsml_impl/targets/microsoft_agent_framework/capabilities.yaml +26 -0
- agentsml_impl/targets/n8n/__init__.py +0 -0
- agentsml_impl/targets/n8n/adapter.py +139 -0
- agentsml_impl/targets/n8n/capabilities.yaml +26 -0
- agentsml_impl/targets/openai_agents/__init__.py +0 -0
- agentsml_impl/targets/openai_agents/adapter.py +175 -0
- agentsml_impl/targets/openai_agents/capabilities.yaml +27 -0
- agentsml_impl/targets/pydantic_ai/__init__.py +0 -0
- agentsml_impl/targets/pydantic_ai/adapter.py +922 -0
- agentsml_impl/targets/pydantic_ai/capabilities.yaml +37 -0
- agentsml_impl/targets/registry.py +290 -0
- agentsml_impl/targets/relevance_ai/__init__.py +0 -0
- agentsml_impl/targets/relevance_ai/adapter.py +66 -0
- agentsml_impl/targets/relevance_ai/capabilities.yaml +26 -0
- agentsml_impl/targets/smolagents/__init__.py +0 -0
- agentsml_impl/targets/smolagents/adapter.py +210 -0
- agentsml_impl/targets/smolagents/capabilities.yaml +27 -0
- agentsml_impl/targets/snowflake_cortex/__init__.py +0 -0
- agentsml_impl/targets/snowflake_cortex/adapter.py +167 -0
- agentsml_impl/targets/snowflake_cortex/capabilities.yaml +26 -0
- agentsml_impl/targets/spring_ai/__init__.py +1 -0
- agentsml_impl/targets/spring_ai/adapter.py +626 -0
- agentsml_impl/targets/spring_ai/capabilities.yaml +31 -0
- agentsml_impl/targets/strands_agents/__init__.py +1 -0
- agentsml_impl/targets/strands_agents/adapter.py +309 -0
- agentsml_impl/targets/strands_agents/capabilities.yaml +29 -0
- agentsml_impl/targets/support_matrix.py +91 -0
- agentsml_impl/targets/ucp/__init__.py +0 -0
- agentsml_impl/targets/ucp/adapter.py +86 -0
- agentsml_impl/targets/ucp/capabilities.yaml +25 -0
- agentsml_impl/targets/vercel_ai/__init__.py +1 -0
- agentsml_impl/targets/vercel_ai/adapter.py +349 -0
- agentsml_impl/targets/vercel_ai/capabilities.yaml +30 -0
- agentsml_impl/targets/vertex_agent_engine/__init__.py +0 -0
- agentsml_impl/targets/vertex_agent_engine/adapter.py +407 -0
- agentsml_impl/targets/vertex_agent_engine/capabilities.yaml +26 -0
- agentsml_impl/targets/zapier_agents/__init__.py +0 -0
- agentsml_impl/targets/zapier_agents/adapter.py +106 -0
- agentsml_impl/targets/zapier_agents/capabilities.yaml +26 -0
- agentsml_impl-0.2.0.dist-info/METADATA +109 -0
- agentsml_impl-0.2.0.dist-info/RECORD +129 -0
- agentsml_impl-0.2.0.dist-info/WHEEL +5 -0
- agentsml_impl-0.2.0.dist-info/entry_points.txt +3 -0
- agentsml_impl-0.2.0.dist-info/licenses/LICENSE +28 -0
- agentsml_impl-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentsml.org/schemas/agentsml-0.3.schema.json",
|
|
4
|
+
"title": "AgentsML",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["agentsml", "kind", "metadata"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"agentsml": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": ["0.1", "0.2", "0.3"]
|
|
12
|
+
},
|
|
13
|
+
"kind": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"const": "AgentSystem"
|
|
16
|
+
},
|
|
17
|
+
"metadata": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": ["name"],
|
|
20
|
+
"additionalProperties": true,
|
|
21
|
+
"properties": {
|
|
22
|
+
"name": { "type": "string", "minLength": 1 },
|
|
23
|
+
"version": { "type": "string" },
|
|
24
|
+
"description": { "type": "string" },
|
|
25
|
+
"tags": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": { "type": "string" }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"profiles": {
|
|
32
|
+
"oneOf": [
|
|
33
|
+
{
|
|
34
|
+
"type": "array",
|
|
35
|
+
"items": { "type": "string" }
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"properties": {
|
|
41
|
+
"required": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": { "type": "string" }
|
|
44
|
+
},
|
|
45
|
+
"optional": {
|
|
46
|
+
"type": "array",
|
|
47
|
+
"items": { "type": "string" }
|
|
48
|
+
},
|
|
49
|
+
"extensions": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": { "type": "string" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"models": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": { "$ref": "#/$defs/model" }
|
|
60
|
+
},
|
|
61
|
+
"tools": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": { "$ref": "#/$defs/tool" }
|
|
64
|
+
},
|
|
65
|
+
"resources": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"additionalProperties": { "$ref": "#/$defs/resource" }
|
|
68
|
+
},
|
|
69
|
+
"prompts": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": { "$ref": "#/$defs/prompt" }
|
|
72
|
+
},
|
|
73
|
+
"agents": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": { "$ref": "#/$defs/agent" }
|
|
76
|
+
},
|
|
77
|
+
"workflows": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"additionalProperties": { "$ref": "#/$defs/workflow" }
|
|
80
|
+
},
|
|
81
|
+
"schemas": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"additionalProperties": { "type": "object" }
|
|
84
|
+
},
|
|
85
|
+
"policies": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"additionalProperties": { "$ref": "#/$defs/policy" }
|
|
88
|
+
},
|
|
89
|
+
"deployments": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"additionalProperties": { "type": "object" }
|
|
92
|
+
},
|
|
93
|
+
"events": {
|
|
94
|
+
"$ref": "#/$defs/events_config"
|
|
95
|
+
},
|
|
96
|
+
"mcp_servers": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": { "$ref": "#/$defs/mcp_server" }
|
|
99
|
+
},
|
|
100
|
+
"a2a_agents": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": { "$ref": "#/$defs/a2a_agent" }
|
|
103
|
+
},
|
|
104
|
+
"a2a_server": {
|
|
105
|
+
"$ref": "#/$defs/a2a_server"
|
|
106
|
+
},
|
|
107
|
+
"ui": {
|
|
108
|
+
"$ref": "#/$defs/ui"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"$defs": {
|
|
112
|
+
"model": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": ["provider", "name"],
|
|
115
|
+
"additionalProperties": true,
|
|
116
|
+
"properties": {
|
|
117
|
+
"provider": { "type": "string" },
|
|
118
|
+
"name": { "type": "string" },
|
|
119
|
+
"version": { "type": "string" },
|
|
120
|
+
"parameters": { "type": "object" },
|
|
121
|
+
"fallbacks": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"items": { "type": "string" }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"tool": {
|
|
128
|
+
"type": "object",
|
|
129
|
+
"required": ["description", "source"],
|
|
130
|
+
"additionalProperties": true,
|
|
131
|
+
"properties": {
|
|
132
|
+
"description": { "type": "string" },
|
|
133
|
+
"source": { "type": "string" },
|
|
134
|
+
"input_schema": { "type": "object" },
|
|
135
|
+
"output_schema": { "type": "object" },
|
|
136
|
+
"auth": { "type": "object" },
|
|
137
|
+
"permissions": { "type": "object" },
|
|
138
|
+
"side_effect": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"enum": ["read", "write", "delete", "payment", "browser", "external", "unknown"]
|
|
141
|
+
},
|
|
142
|
+
"timeout": { "type": ["number", "string"] },
|
|
143
|
+
"error_policy": { "type": "object" },
|
|
144
|
+
"needs_approval": { "type": "boolean" },
|
|
145
|
+
"approval_mode": { "type": "string", "enum": ["always", "once_per_session", "per_arguments"], "default": "always" }
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"resource": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"additionalProperties": true,
|
|
151
|
+
"properties": {
|
|
152
|
+
"description": { "type": "string" },
|
|
153
|
+
"source": { "type": "string" },
|
|
154
|
+
"schema": { "type": "object" },
|
|
155
|
+
"auth": { "type": "object" },
|
|
156
|
+
"permissions": { "type": "object" }
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"prompt": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"required": ["template"],
|
|
162
|
+
"additionalProperties": true,
|
|
163
|
+
"properties": {
|
|
164
|
+
"description": { "type": "string" },
|
|
165
|
+
"template": { "type": "string" },
|
|
166
|
+
"input_schema": { "type": "object" },
|
|
167
|
+
"metadata": { "type": "object" }
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"agent": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"required": ["model", "instructions"],
|
|
173
|
+
"additionalProperties": true,
|
|
174
|
+
"properties": {
|
|
175
|
+
"description": { "type": "string" },
|
|
176
|
+
"role": { "type": "string" },
|
|
177
|
+
"model": { "type": "string" },
|
|
178
|
+
"instructions": { "type": "string" },
|
|
179
|
+
"tools": {
|
|
180
|
+
"type": "array",
|
|
181
|
+
"items": { "type": "string" }
|
|
182
|
+
},
|
|
183
|
+
"resources": {
|
|
184
|
+
"type": "array",
|
|
185
|
+
"items": { "type": "string" }
|
|
186
|
+
},
|
|
187
|
+
"prompts": {
|
|
188
|
+
"type": "array",
|
|
189
|
+
"items": { "type": "string" }
|
|
190
|
+
},
|
|
191
|
+
"memory": { "type": "object" },
|
|
192
|
+
"knowledge": { "type": "object" },
|
|
193
|
+
"output_schema": { "type": "object" },
|
|
194
|
+
"reasoning": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"additionalProperties": false,
|
|
197
|
+
"properties": {
|
|
198
|
+
"effort": { "type": "string", "enum": ["off", "low", "medium", "high"] },
|
|
199
|
+
"budget_tokens": { "type": "integer", "minimum": 0 },
|
|
200
|
+
"expose_trace": { "type": "boolean" }
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"policies": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"items": { "type": "string" }
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"workflow": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"required": ["steps"],
|
|
212
|
+
"additionalProperties": true,
|
|
213
|
+
"properties": {
|
|
214
|
+
"description": { "type": "string" },
|
|
215
|
+
"input_schema": { "type": "object" },
|
|
216
|
+
"output_schema": { "type": "object" },
|
|
217
|
+
"state": { "type": "object" },
|
|
218
|
+
"steps": {
|
|
219
|
+
"type": "array",
|
|
220
|
+
"items": { "$ref": "#/$defs/step" }
|
|
221
|
+
},
|
|
222
|
+
"edges": {
|
|
223
|
+
"type": "array",
|
|
224
|
+
"items": { "$ref": "#/$defs/edge" }
|
|
225
|
+
},
|
|
226
|
+
"events": { "type": "array" },
|
|
227
|
+
"error_policy": { "type": "object" }
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"step": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"required": ["id"],
|
|
233
|
+
"additionalProperties": true,
|
|
234
|
+
"properties": {
|
|
235
|
+
"id": { "type": "string" },
|
|
236
|
+
"agent": { "type": "string" },
|
|
237
|
+
"tool": { "type": "string" },
|
|
238
|
+
"workflow": { "type": "string" },
|
|
239
|
+
"a2a_agent": { "type": "string" },
|
|
240
|
+
"skill": { "type": "string" },
|
|
241
|
+
"input": {},
|
|
242
|
+
"output": {},
|
|
243
|
+
"condition": {},
|
|
244
|
+
"depends_on": {
|
|
245
|
+
"type": "array",
|
|
246
|
+
"items": { "type": "string" }
|
|
247
|
+
},
|
|
248
|
+
"join": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"enum": ["wait_all", "wait_any"]
|
|
251
|
+
},
|
|
252
|
+
"parallel": {
|
|
253
|
+
"oneOf": [
|
|
254
|
+
{ "type": "boolean" },
|
|
255
|
+
{
|
|
256
|
+
"type": "array",
|
|
257
|
+
"items": { "type": "string" }
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"retry": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"additionalProperties": false,
|
|
264
|
+
"properties": {
|
|
265
|
+
"max_attempts": { "type": "integer", "minimum": 1 },
|
|
266
|
+
"backoff": { "type": "string", "enum": ["none", "linear", "exponential"] },
|
|
267
|
+
"initial_interval": { "type": ["string", "number"] },
|
|
268
|
+
"max_interval": { "type": ["string", "number"] },
|
|
269
|
+
"on_timeout": { "type": "string", "enum": ["error", "return_to_model", "fallback"], "default": "error" }
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"timeout": { "type": ["number", "string"] },
|
|
273
|
+
"fallback": {
|
|
274
|
+
"type": "object",
|
|
275
|
+
"description": "Draft 0.3. Value or model used when retry.on_timeout is 'fallback'. At least one of output or model is required.",
|
|
276
|
+
"additionalProperties": false,
|
|
277
|
+
"properties": {
|
|
278
|
+
"output": { "description": "Static JSON value returned as the step output." },
|
|
279
|
+
"model": { "type": "string", "description": "Key of a declared model used to re-run the step." }
|
|
280
|
+
},
|
|
281
|
+
"anyOf": [ { "required": ["output"] }, { "required": ["model"] } ]
|
|
282
|
+
},
|
|
283
|
+
"approval": {
|
|
284
|
+
"oneOf": [
|
|
285
|
+
{ "type": "string" },
|
|
286
|
+
{
|
|
287
|
+
"type": "object",
|
|
288
|
+
"properties": {
|
|
289
|
+
"required": { "type": "boolean" },
|
|
290
|
+
"approvers": { "type": "array", "items": { "type": "string" } },
|
|
291
|
+
"timeout": { "type": ["string", "number"] }
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
"events": {
|
|
297
|
+
"type": "array",
|
|
298
|
+
"items": {
|
|
299
|
+
"oneOf": [
|
|
300
|
+
{ "type": "string" },
|
|
301
|
+
{ "type": "object" }
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"edge": {
|
|
308
|
+
"type": "object",
|
|
309
|
+
"required": ["from", "to"],
|
|
310
|
+
"additionalProperties": true,
|
|
311
|
+
"properties": {
|
|
312
|
+
"from": { "type": "string" },
|
|
313
|
+
"to": { "type": "string" },
|
|
314
|
+
"condition": {},
|
|
315
|
+
"label": { "type": "string" }
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"policy": {
|
|
319
|
+
"type": "object",
|
|
320
|
+
"additionalProperties": true,
|
|
321
|
+
"properties": {
|
|
322
|
+
"description": { "type": "string" },
|
|
323
|
+
"applies_to": {
|
|
324
|
+
"type": "array",
|
|
325
|
+
"items": { "type": "string" }
|
|
326
|
+
},
|
|
327
|
+
"permissions": { "type": "object" },
|
|
328
|
+
"guardrails": { "type": "object" },
|
|
329
|
+
"approval": { "type": "object" },
|
|
330
|
+
"audit": { "type": "object" }
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"events_config": {
|
|
334
|
+
"type": "object",
|
|
335
|
+
"additionalProperties": true,
|
|
336
|
+
"properties": {
|
|
337
|
+
"emit": {
|
|
338
|
+
"type": "array",
|
|
339
|
+
"items": { "type": "string" }
|
|
340
|
+
},
|
|
341
|
+
"export": { "type": "object" },
|
|
342
|
+
"redaction": { "type": "object" }
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
"mcp_server": {
|
|
346
|
+
"type": "object",
|
|
347
|
+
"additionalProperties": true,
|
|
348
|
+
"properties": {
|
|
349
|
+
"description": { "type": "string" },
|
|
350
|
+
"transport": {
|
|
351
|
+
"type": "string",
|
|
352
|
+
"enum": ["stdio", "streamable_http", "sse", "http", "websocket"]
|
|
353
|
+
},
|
|
354
|
+
"command": { "type": "string" },
|
|
355
|
+
"args": {
|
|
356
|
+
"type": "array",
|
|
357
|
+
"items": { "type": "string" }
|
|
358
|
+
},
|
|
359
|
+
"url": { "type": "string" },
|
|
360
|
+
"capabilities": {
|
|
361
|
+
"type": "array",
|
|
362
|
+
"items": { "type": "string" }
|
|
363
|
+
},
|
|
364
|
+
"auth": { "type": "object" }
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"a2a_agent": {
|
|
368
|
+
"type": "object",
|
|
369
|
+
"additionalProperties": true,
|
|
370
|
+
"properties": {
|
|
371
|
+
"description": { "type": "string" },
|
|
372
|
+
"agent_card_url": { "type": "string" },
|
|
373
|
+
"skills": {
|
|
374
|
+
"type": "array",
|
|
375
|
+
"items": { "type": "string" }
|
|
376
|
+
},
|
|
377
|
+
"auth": { "type": "object" }
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
"a2a_server": {
|
|
381
|
+
"type": "object",
|
|
382
|
+
"additionalProperties": true,
|
|
383
|
+
"properties": {
|
|
384
|
+
"name": { "type": "string" },
|
|
385
|
+
"description": { "type": "string" },
|
|
386
|
+
"version": { "type": "string" },
|
|
387
|
+
"skills": {
|
|
388
|
+
"type": "array",
|
|
389
|
+
"items": { "type": "object" }
|
|
390
|
+
},
|
|
391
|
+
"auth": { "type": "object" }
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"ui": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"additionalProperties": true,
|
|
397
|
+
"properties": {
|
|
398
|
+
"protocol": { "type": "string" },
|
|
399
|
+
"transport": { "type": "string" },
|
|
400
|
+
"session_model": { "type": "string" },
|
|
401
|
+
"events": { "$ref": "#/$defs/events_config" },
|
|
402
|
+
"state_schema": { "type": "object" }
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Targets package."""
|
|
File without changes
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"""A2A target adapter — Level 1 code generation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from copy import deepcopy
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import json
|
|
7
|
+
|
|
8
|
+
from agentsml_impl.compiler.ir import AgentSystemIR
|
|
9
|
+
from agentsml_impl.compiler.diagnostics import DiagnosticSet
|
|
10
|
+
from agentsml_impl.compiler.planner import GenerationPlan
|
|
11
|
+
from agentsml_impl.compiler.render import write_file
|
|
12
|
+
from agentsml_impl.targets.base import TargetAdapter, GenerationResult
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Adapter(TargetAdapter):
|
|
16
|
+
@property
|
|
17
|
+
def name(self) -> str:
|
|
18
|
+
return "a2a"
|
|
19
|
+
|
|
20
|
+
def analyze(self, ir: AgentSystemIR, diagnostics: DiagnosticSet) -> None:
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
def generate(self, ir: AgentSystemIR, plan: GenerationPlan,
|
|
24
|
+
out_dir: Path, diagnostics: DiagnosticSet) -> GenerationResult:
|
|
25
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
26
|
+
|
|
27
|
+
files: list[str] = []
|
|
28
|
+
files += _write_agent_card(ir, plan, out_dir)
|
|
29
|
+
files += _write_readme(ir, plan, out_dir)
|
|
30
|
+
|
|
31
|
+
return GenerationResult(
|
|
32
|
+
target=self.name, out_dir=out_dir, files_written=files, success=True
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _write_agent_card(ir: AgentSystemIR, plan: GenerationPlan, out_dir: Path) -> list[str]:
|
|
37
|
+
# Find primary workflow or primary agent
|
|
38
|
+
primary_workflow = ir.workflows.get(plan.main_workflow_key)
|
|
39
|
+
server_cfg = ir.a2a_server or {}
|
|
40
|
+
|
|
41
|
+
agent_card = {
|
|
42
|
+
"@context": "https://agentsml.org/a2a/v1",
|
|
43
|
+
"type": "AgentCard",
|
|
44
|
+
"id": f"did:web:example.com:{plan.package_name}",
|
|
45
|
+
"name": server_cfg.get("name") or plan.project_name,
|
|
46
|
+
"description": (
|
|
47
|
+
server_cfg.get("description")
|
|
48
|
+
or ir.metadata.description
|
|
49
|
+
or "An AgentsML A2A generated agent."
|
|
50
|
+
),
|
|
51
|
+
"endpoints": [
|
|
52
|
+
{
|
|
53
|
+
"type": "https://agentsml.org/a2a/invoke",
|
|
54
|
+
"url": "https://api.example.com/v1/invoke",
|
|
55
|
+
"auth": "Bearer"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
if server_cfg.get("version") or ir.metadata.version:
|
|
60
|
+
agent_card["version"] = server_cfg.get("version") or ir.metadata.version
|
|
61
|
+
|
|
62
|
+
# If the workflow defines input schema, expose it
|
|
63
|
+
if primary_workflow and primary_workflow.input_schema:
|
|
64
|
+
agent_card["input_schema"] = primary_workflow.input_schema
|
|
65
|
+
if primary_workflow and primary_workflow.output_schema:
|
|
66
|
+
agent_card["output_schema"] = primary_workflow.output_schema
|
|
67
|
+
if server_cfg.get("skills"):
|
|
68
|
+
skills = []
|
|
69
|
+
for skill in server_cfg["skills"]:
|
|
70
|
+
skill_card = deepcopy(skill)
|
|
71
|
+
if primary_workflow and primary_workflow.input_schema:
|
|
72
|
+
skill_card.setdefault("input_schema", primary_workflow.input_schema)
|
|
73
|
+
if primary_workflow and primary_workflow.output_schema:
|
|
74
|
+
skill_card.setdefault("output_schema", primary_workflow.output_schema)
|
|
75
|
+
skills.append(skill_card)
|
|
76
|
+
agent_card["skills"] = skills
|
|
77
|
+
|
|
78
|
+
rel = "agent-card.json"
|
|
79
|
+
write_file(out_dir, rel, json.dumps(agent_card, indent=2))
|
|
80
|
+
return [rel]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _write_readme(ir: AgentSystemIR, plan: GenerationPlan, out_dir: Path) -> list[str]:
|
|
84
|
+
c = f"""\
|
|
85
|
+
# {plan.project_name} — A2A Export
|
|
86
|
+
|
|
87
|
+
Generated by `agentsml-impl`.
|
|
88
|
+
|
|
89
|
+
## Agent Card
|
|
90
|
+
The `agent-card.json` file is a standard A2A descriptor for your system.
|
|
91
|
+
You can host this at `/.well-known/agent-card.json` to allow other A2A-compliant agents to discover your agent's interface.
|
|
92
|
+
"""
|
|
93
|
+
write_file(out_dir, "README.md", c)
|
|
94
|
+
return ["README.md"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
target: a2a
|
|
2
|
+
kind: protocol
|
|
3
|
+
language: json
|
|
4
|
+
status: implemented
|
|
5
|
+
level: 1
|
|
6
|
+
version_tested: "1.0.0"
|
|
7
|
+
supports:
|
|
8
|
+
agents: native
|
|
9
|
+
tools: unsupported
|
|
10
|
+
workflows: native
|
|
11
|
+
graph_edges: unsupported
|
|
12
|
+
graph_conditions: unsupported
|
|
13
|
+
cycles: unsupported
|
|
14
|
+
parallel: unsupported
|
|
15
|
+
human_approval: unsupported
|
|
16
|
+
mcp: unsupported
|
|
17
|
+
a2a: native
|
|
18
|
+
ag_ui: unsupported
|
|
19
|
+
structured_output: unsupported
|
|
20
|
+
observability: unsupported
|
|
21
|
+
artifacts:
|
|
22
|
+
- json_export
|
|
23
|
+
- readme
|
|
24
|
+
notes: >
|
|
25
|
+
Generates an A2A Agent Card.
|
|
File without changes
|