OLS-2722: olsToolUIs initial support#1576
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@iNecas: This pull request references OLS-2722 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
| import type { OlsToolUIComponent } from '../types'; | ||
|
|
||
| type ToolUIExtensionProperties = { | ||
| /** Id of the component (as refferrenced by the mcp tool) */ |
There was a problem hiding this comment.
| /** Id of the component (as refferrenced by the mcp tool) */ | |
| /** ID of the component (as referenced by the MCP tool) */ |
| export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: toolUIElement }) => { | ||
| const ToolComponent = toolUIElement; | ||
| return <ToolComponent tool={tool} />; | ||
| }; |
There was a problem hiding this comment.
| export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: toolUIElement }) => { | |
| const ToolComponent = toolUIElement; | |
| return <ToolComponent tool={tool} />; | |
| }; | |
| export const OlsToolUI: React.FC<OlsToolUIProps> = ({ tool, toolUIComponent: ToolComponent }) => { | |
| return <ToolComponent tool={tool} />; | |
| }; |
|
Also, we should add a brief description of how to use this extension to the README |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Allow callers to immediately submit the prompt when opening OLS by passing submitImmediately: true Made-with: Cursor
Allows plugins to define 'ols.tool-ui' extensions to map the tools
to react components to be rendered when the tool gets called.
Sample extensions registration:
```json
{
"type": "ols.tool-ui",
"properties": {
"id": "my-obs/my-tool",
"component": {
"$codeRef": "MyToolUI"
}
}
}
```
The ToolUI implemntation receives the tool details in it's argument:
```ts
type MyTool = {
name: 'my-tool';
args: object,
// ...
};
export const MyToolUI React.FC<{ tool: MyTool }> = ({ tool }) => {
// component implementation
}
```
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I've rebased and fixed an issue where we were visualizing the tool calls in failed state as well. I will proceed with final cleanup and will switch to non-draft state for final review after that. |
|
@iNecas Probably also a good idea to wrap the OlsToolUIs in an |

Allows plugins to define 'ols.tool-ui' extensions to map the tools to react components to be rendered when the tool gets called.
Sample extensions registration:
{ "type": "ols.tool-ui", "properties": { "id": "my-obs/my-tool", "component": { "$codeRef": "MyToolUI" } } }The ToolUI implemntation receives the tool details in it's argument:
Depends on openshift/lightspeed-service#2779
This allows monitoring-plugin to define a UI for obs-mcp tools

Related changes leveraging this feature: