10000 feat!: support ui action result types by liady · Pull Request #6 · idosal/mcp-ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat!: support ui action result types #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liady
Copy link
Contributor
@liady liady commented May 28, 2025
edited
Loading

This WIP PR extends the possible results returned from a UI action, to these three types: 'tool' | 'prompt' | 'link'.

Each type has its own payload:

type UiActionType = 'tool' | 'prompt' | 'link';

type UiActionResultToolCall = {
  type: 'tool';
  payload: {
    toolName: string;
    params: Record<string, unknown>;
  };
};

type UiActionResultPrompt = {
  type: 'prompt';
  payload: {
    prompt: string;
  };
};

type UiActionResultLink = {
  type: 'link';
  payload: {
    url: string;
  };
};

type UiActionResult =
  | UiActionResultToolCall
  | UiActionResultPrompt
  | UiActionResultLink;

This PR also adds 3 new optional convenience callbacks to <HTMLResource>:

  • onUiActionResultToolCall?
  • onUiActionResultPrompt?
  • onUiActionResultLink?
    Each will be called when its corresponding action type will be returned. If no specific callback for this type will is provided, the generic onUiAction will be called.

@liady liady force-pushed the feat/support-action-result-types branch from 5b811e5 to 901a2e9 Compare May 28, 2025 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0