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,145 @@
|
|
|
1
|
+
"""RUNTIME-002: Tool wrapper helper — generate Python tool stubs from ToolIR."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from agentsml_impl.compiler.ir import ToolIR
|
|
5
|
+
from agentsml_impl.compiler.diagnostics import DiagCode, DiagnosticSet
|
|
6
|
+
from agentsml_impl.compiler.naming import snake_identifier, unique_identifiers
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def generate_tool_stub(
|
|
10
|
+
tool: ToolIR,
|
|
11
|
+
diagnostics: DiagnosticSet,
|
|
12
|
+
framework: str = "generic",
|
|
13
|
+
generated_name: str | None = None,
|
|
14
|
+
) -> str:
|
|
15
|
+
"""Generate a Python function stub for a tool."""
|
|
16
|
+
lines: list[str] = []
|
|
17
|
+
|
|
18
|
+
# Emit unsafe side effect diagnostic
|
|
19
|
+
if tool.has_dangerous_side_effect():
|
|
20
|
+
has_approval = (
|
|
21
|
+
tool.permissions is not None
|
|
22
|
+
and tool.permissions.get("approval") not in (None, "not_required", "never")
|
|
23
|
+
)
|
|
24
|
+
if not has_approval:
|
|
25
|
+
diagnostics.add_warning(
|
|
26
|
+
DiagCode.UNSAFE_SIDE_EFFECT,
|
|
27
|
+
f"Tool '{tool.key}' has side_effect '{tool.side_effect}' — ensure an approval gate is enforced.",
|
|
28
|
+
path=f"tools.{tool.key}",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# Build function signature from input_schema
|
|
32
|
+
params = _params_from_schema(tool.input_schema)
|
|
33
|
+
return_type = _return_type_from_schema(tool.output_schema)
|
|
34
|
+
|
|
35
|
+
function_name = generated_name or snake_identifier(tool.key, prefix="tool")
|
|
36
|
+
lines.append(f"def {function_name}({params}) -> {return_type}:")
|
|
37
|
+
lines.append(f' """{tool.description}')
|
|
38
|
+
if framework == "smolagents" and tool.input_schema and tool.input_schema.get("properties"):
|
|
39
|
+
lines.append("")
|
|
40
|
+
lines.append(" Args:")
|
|
41
|
+
for prop_name, prop_spec in tool.input_schema["properties"].items():
|
|
42
|
+
desc = prop_spec.get("description", f"The {prop_name} parameter") if isinstance(prop_spec, dict) else f"The {prop_name} parameter"
|
|
43
|
+
lines.append(f" {prop_name}: {desc}")
|
|
44
|
+
if tool.side_effect:
|
|
45
|
+
lines.append(f" side_effect: {tool.side_effect}")
|
|
46
|
+
if tool.source == "mcp.tool":
|
|
47
|
+
lines.append(f" mcp_server: {tool.mcp_server or 'UNBOUND'}")
|
|
48
|
+
lines.append(f" mcp_tool_name: {tool.mcp_tool_name or tool.key}")
|
|
49
|
+
lines.append(' """')
|
|
50
|
+
|
|
51
|
+
if tool.source == "local.function":
|
|
52
|
+
lines.append(" # TODO: implement this tool")
|
|
53
|
+
lines.append(" raise NotImplementedError")
|
|
54
|
+
elif tool.source == "mcp.tool":
|
|
55
|
+
lines.append(f" # MCP tool — calls {tool.mcp_server or 'UNBOUND'} / {tool.mcp_tool_name or tool.key}")
|
|
56
|
+
lines.append(" # Configured via mcp_servers in AgentsML; handled by framework MCP client")
|
|
57
|
+
lines.append(" raise NotImplementedError")
|
|
58
|
+
elif tool.source == "openapi.operation":
|
|
59
|
+
lines.append(" # OpenAPI tool — generated client required")
|
|
60
|
+
lines.append(" raise NotImplementedError")
|
|
61
|
+
else:
|
|
62
|
+
lines.append(" raise NotImplementedError")
|
|
63
|
+
|
|
64
|
+
return "\n".join(lines)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def generate_tools_module(
|
|
68
|
+
tools: dict[str, ToolIR],
|
|
69
|
+
diagnostics: DiagnosticSet,
|
|
70
|
+
framework: str = "generic",
|
|
71
|
+
decorator: str = "",
|
|
72
|
+
) -> str:
|
|
73
|
+
"""Generate a complete tools.py source from a dict of tools."""
|
|
74
|
+
lines = [
|
|
75
|
+
'"""Auto-generated tool stubs from AgentsML tool definitions."""',
|
|
76
|
+
"from __future__ import annotations",
|
|
77
|
+
"from typing import Any",
|
|
78
|
+
"",
|
|
79
|
+
]
|
|
80
|
+
if decorator:
|
|
81
|
+
lines.append(f"# Decorator: {decorator}")
|
|
82
|
+
lines.append("")
|
|
83
|
+
|
|
84
|
+
stubs = []
|
|
85
|
+
tool_names = unique_identifiers(
|
|
86
|
+
tools,
|
|
87
|
+
lambda value: snake_identifier(value, prefix="tool"),
|
|
88
|
+
)
|
|
89
|
+
for tool in tools.values():
|
|
90
|
+
stub = generate_tool_stub(tool, diagnostics, framework, tool_names[tool.key])
|
|
91
|
+
if decorator:
|
|
92
|
+
stubs.append(f"@{decorator}\n{stub}")
|
|
93
|
+
else:
|
|
94
|
+
stubs.append(stub)
|
|
95
|
+
|
|
96
|
+
lines.extend("\n\n".join(stubs).splitlines() if stubs else ["# No tools defined"])
|
|
97
|
+
return "\n".join(lines) + "\n"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _params_from_schema(schema: dict | None) -> str:
|
|
101
|
+
if not schema or schema.get("type") != "object":
|
|
102
|
+
return "**kwargs: Any"
|
|
103
|
+
props = schema.get("properties", {})
|
|
104
|
+
required = set(schema.get("required", []))
|
|
105
|
+
param_names = unique_identifiers(
|
|
106
|
+
props,
|
|
107
|
+
lambda value: snake_identifier(value, prefix="arg"),
|
|
108
|
+
)
|
|
109
|
+
req_params = []
|
|
110
|
+
opt_params = []
|
|
111
|
+
for raw_name, prop_schema in props.items():
|
|
112
|
+
name = param_names[raw_name]
|
|
113
|
+
py_type = _simple_py_type(prop_schema)
|
|
114
|
+
if raw_name in required:
|
|
115
|
+
req_params.append(f"{name}: {py_type}")
|
|
116
|
+
else:
|
|
117
|
+
opt_params.append(f"{name}: {py_type} = None")
|
|
118
|
+
|
|
119
|
+
params = req_params + opt_params
|
|
120
|
+
return ", ".join(params) if params else "**kwargs: Any"
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def _return_type_from_schema(schema: dict | None) -> str:
|
|
124
|
+
if not schema:
|
|
125
|
+
return "Any"
|
|
126
|
+
t = schema.get("type")
|
|
127
|
+
if t == "object":
|
|
128
|
+
return "dict[str, Any]"
|
|
129
|
+
if t == "array":
|
|
130
|
+
return "list[Any]"
|
|
131
|
+
if t == "string":
|
|
132
|
+
return "str"
|
|
133
|
+
if t in ("integer",):
|
|
134
|
+
return "int"
|
|
135
|
+
if t in ("number",):
|
|
136
|
+
return "float"
|
|
137
|
+
if t == "boolean":
|
|
138
|
+
return "bool"
|
|
139
|
+
return "Any"
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _simple_py_type(schema: dict) -> str:
|
|
143
|
+
t = schema.get("type", "Any")
|
|
144
|
+
return {"string": "str", "integer": "int", "number": "float",
|
|
145
|
+
"boolean": "bool", "array": "list", "object": "dict"}.get(t, "Any")
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentsml.org/schemas/agentsml.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": true,
|
|
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
|
+
}
|