ChannelRendererInterface
Interface for channel-specific renderers. Each channel (Telegram, CLI, Web) has its own renderer that transforms ToolResult into the appropriate format for that channel.
ChannelRendererInterface::supports()
abstract public function supports(string $channel): boolCheck if this renderer supports the given channel.
Parameters
| Name | Type | Description |
|---|---|---|
| $channel | string |
ChannelRendererInterface::render()
abstract public function render(Milpa\ToolRuntime\ToolResult $result, ?Milpa\ToolRuntime\Contracts\ToolContext $ctx = null): ?mixedRender the ToolResult for the specific channel.
Parameters
| Name | Type | Description |
|---|---|---|
| $result | ToolResult | The structured result to render |
| $ctx | (ToolContext | null) | The execution context |
Returns
Channel-specific output (string, array, etc.)