Motivation
The reason I am opening this issue is because I wanted to see the nice ApplyPatch output, but for proposed changes that haven't yet been committed. I investigated using a custom-tool for this purpose, only to discover that the output cannot be rendered in the same format as ApplyPatch.
Problem
OpenCode currently hardcodes rich TUI rendering by tool id (for example, apply_patch), so custom tools cannot render rich components even if they return structured data.
Custom tools fall back to generic text output, and HTML/JSX from tools is not a safe or supported path.
Goal
Enable custom tools to return typed render metadata (starting with diff.v1) so the TUI can render rich diffs without requiring built-in tool ids.
Progress
I have already gone ahead and created the necessary changes and tested it with a working custom tool. All tests are passing. Also added new tests for the implemented and changed functionality.
Question
I wanted to find out if this is something that the team would like to investigate, and if so, I would be glad to start on the process of submitting. Otherwise if this is not something the team is interested in, please go ahead and close this ticket.
Motivation
The reason I am opening this issue is because I wanted to see the nice ApplyPatch output, but for proposed changes that haven't yet been committed. I investigated using a custom-tool for this purpose, only to discover that the output cannot be rendered in the same format as ApplyPatch.
Problem
OpenCode currently hardcodes rich TUI rendering by tool id (for example,
apply_patch), so custom tools cannot render rich components even if they return structured data.Custom tools fall back to generic text output, and HTML/JSX from tools is not a safe or supported path.
Goal
Enable custom tools to return typed render metadata (starting with
diff.v1) so the TUI can render rich diffs without requiring built-in tool ids.Progress
I have already gone ahead and created the necessary changes and tested it with a working custom tool. All tests are passing. Also added new tests for the implemented and changed functionality.
Question
I wanted to find out if this is something that the team would like to investigate, and if so, I would be glad to start on the process of submitting. Otherwise if this is not something the team is interested in, please go ahead and close this ticket.