mirror of
https://github.com/langgenius/dify.git
synced 2025-11-24 00:42:41 +00:00
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: crazywoola <427733928@qq.com>
23 lines
801 B
TypeScript
23 lines
801 B
TypeScript
/**
|
|
* MCP (Model Context Protocol) utility functions
|
|
*/
|
|
|
|
/**
|
|
* Determines if the MCP icon should be used based on the icon source
|
|
* @param src - The icon source, can be a string URL or an object with content and background
|
|
* @returns true if the MCP icon should be used (when it's an emoji object with 🔗 content)
|
|
*/
|
|
export const shouldUseMcpIcon = (src: any): boolean => {
|
|
return typeof src === 'object' && src?.content === '🔗'
|
|
}
|
|
|
|
/**
|
|
* Checks if an app icon should use the MCP icon
|
|
* @param iconType - The type of icon ('emoji' | 'image')
|
|
* @param icon - The icon content (emoji or file ID)
|
|
* @returns true if the MCP icon should be used
|
|
*/
|
|
export const shouldUseMcpIconForAppIcon = (iconType: string, icon: string): boolean => {
|
|
return iconType === 'emoji' && icon === '🔗'
|
|
}
|