tpmjs/docs/diagrams/03-execution.d2

98 lines
2 KiB
Text

# Tool Execution Flow
# Purpose: Show how tools get executed
# Direction: Left → Right
direction: right
# ==============================================================================
# STYLES
# ==============================================================================
classes: {
input: {
style: {
fill: "#e3f2fd"
stroke: "#1976d2"
border-radius: 8
}
}
executor: {
style: {
fill: "#fce4ec"
stroke: "#c2185b"
border-radius: 8
}
}
custom: {
style: {
fill: "#fafafa"
stroke: "#9e9e9e"
stroke-dash: 5
border-radius: 8
}
}
output: {
style: {
fill: "#e8f5e9"
stroke: "#388e3c"
border-radius: 8
}
}
}
# ==============================================================================
# INPUT
# ==============================================================================
input: Input {
class: input
tool: Tool
payload: Payload
}
# ==============================================================================
# EXECUTORS
# ==============================================================================
executors: Executors {
class: executor
official: Official Executor {
direction: down
esm: esm.sh Import
deno: Deno Runtime
resolve: Resolution
}
custom: Custom/Community Executors {
class: custom
label: "Anyone can build\nand host their own"
}
}
# ==============================================================================
# OUTPUTS
# ==============================================================================
web_output: SSE Response {
class: output
}
mcp_output: JSON-RPC Response {
class: output
}
# ==============================================================================
# CONNECTIONS
# ==============================================================================
input -> executors
# Executor internal
executors.official.esm -> executors.official.deno
executors.official.deno -> executors.official.resolve
executors -> web_output
executors -> mcp_output