-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
-
-
-
+
+
+
-
+
+
-
+
+
-
+
+
-
-
+
+
+
+
+
-
+
+
-
+
+
+ {t("businessLogic.config.import.duplicateDescription")} +
+ {/* Auto unselect knowledge_base_search notice when embedding not configured */}+ {t( + "market.description", + "Discover and download pre-built intelligent agents" + )} +
++ {agentDetails.description} +
++ {t("market.install.model.description", "Select a model from your configured models to use for this agent.")} +
+ ++ {t("market.install.config.description", "Please configure the following required fields for this agent.")} +
+ ++ {t("market.install.mcp.description", "This agent requires the following MCP servers. Please install or configure them.")} +
+ + {loadingMcpServers ? ( ++ {agent.description} +
+ + {/* Tags */} + {agent.tags && agent.tags.length > 0 && ( +
+ {agentDetails?.duty_prompt || t("common.none", "None")}
+
+ )}
+
+ {agentDetails?.constraint_prompt || t("common.none", "None")}
+
+ )}
+
+ {agentDetails?.few_shots_prompt || t("common.none", "None")}
+
+ )}
+
+ {agentDetails?.business_description || t("common.none", "None")}
+
+ )}
+ {t("memoryManageModal.noMemory")}
-{t("memoryManageModal.noMemory")}
+
+const rehypeUnwrapMedia = () => { + return (tree: any) => { + visit(tree, "element", (node, index, parent) => { + // find
tags containing video or figure + if (node.tagName === "p" && node.children) { + const mediaChildIndex = node.children.findIndex( + (child: any) => + child.tagName === "video" || child.tagName === "figure" + ); + + if (mediaChildIndex !== -1) { + // extract media elements (video/figure) + const mediaChild = node.children.splice(mediaChildIndex, 1)[0]; + + // if
has other content after extraction, keep
; otherwise remove empty
+ if (node.children.length === 0) { + // replace original
node with media element + if (parent && index !== null) { + parent.children[index as number] = { + tagName: "div", + properties: { className: "markdown-media-container" }, + children: [mediaChild], + }; + } + } else { + // if
has other content after extraction, keep
; otherwise remove empty
+ if (parent && index !== null) {
+ parent.children.splice((index as number) + 1, 0, {
+ tagName: "div",
+ properties: { className: "markdown-media-container" },
+ children: [mediaChild],
+ });
+ }
+ }
+ }
+ }
+ });
+ };
+};
+
// Get background color for different tool signs
const getBackgroundColor = (toolSign: string) => {
switch (toolSign) {
@@ -381,6 +423,102 @@ const convertLatexDelimiters = (content: string): string => {
);
};
+// Video component with error handling - defined outside to prevent re-creation on each render
+interface VideoWithErrorHandlingProps {
+ src: string;
+ alt?: string | null;
+ props?: React.VideoHTMLAttributes setHasError(true)}
+ />
+ );
+}, (prevProps, nextProps) => {
+ // Custom comparison function to prevent unnecessary re-renders
+ return prevProps.src === nextProps.src &&
+ prevProps.alt === nextProps.alt;
+});
+
+ImageWithErrorHandling.displayName = "ImageWithErrorHandling";
+
export const MarkdownRenderer: React.FC
;
+ if (!src || typeof src !== "string") {
+ return null;
+ }
+
+ return