diff --git a/internal/api/user/list_prompts.go b/internal/api/user/list_prompts.go index 56112382..96c0e081 100644 --- a/internal/api/user/list_prompts.go +++ b/internal/api/user/list_prompts.go @@ -18,33 +18,49 @@ var defaultPrompts = []*userv1.Prompt{ // CreatedAt: timestamppb.New(time.Time{}), // UpdatedAt: timestamppb.New(time.Time{}), // Title: "Enhance Academic Writing (Powered by XtraGPT)", - // Content: "Suggest context-aware academic paper writing enhancements for selected text.", + // Content: "Suggest context-aware academic paper writing enhancements for the selected text.", // IsUserPrompt: false, // }, { Id: "2", CreatedAt: timestamppb.New(time.Time{}), UpdatedAt: timestamppb.New(time.Time{}), - Title: "Review (Powered by XtraMCP)", - Content: "Review my paper and identify issues", + Title: "Search Relevant Papers (Powered by XtraMCP)", + Content: "First, understand my paper and extract the key ideas into an optimized query to find papers that are relevant to my work. Then search for relevant papers to read.\n\nOptional Args:\ntop_k: 10\nStart Date: None (e.g. 2018-12-31)\nEnd Date: None (e.g. 2025-12-31)", IsUserPrompt: false, }, { Id: "3", CreatedAt: timestamppb.New(time.Time{}), UpdatedAt: timestamppb.New(time.Time{}), - Title: "Find Relevant Papers (Powered by XtraMCP)", - Content: "Find me relevant papers to read", + Title: "Paper Review (Powered by XtraMCP)", + Content: "Call review_paper and evaluate my paper.\n\nOptional Args:\nTarget Venue: None (e.g. ICML, NeurIPS, CVPR)\nSeverity Level (blocker | major | minor | nit): Major\nSpecific Sections (default: entire paper): None (e.g. Abstract, Results,
)", + IsUserPrompt: false, + }, + { + Id: "4", + CreatedAt: timestamppb.New(time.Time{}), + UpdatedAt: timestamppb.New(time.Time{}), + Title: "Verify Citations (Powered by XtraMCP)", + Content: "Call verify_citations to check the validity of all citations in my paper and identify any potential issues such as incorrect formatting, missing information, or inaccurate references.", + IsUserPrompt: false, + }, + { + Id: "5", + CreatedAt: timestamppb.New(time.Time{}), + UpdatedAt: timestamppb.New(time.Time{}), + Title: "Deep Research (Powered by XtraMCP)", + Content: "First, understand my paper and extract the key ideas into an optimized query. Do deep research and compare my paper against others.", + IsUserPrompt: false, + }, + { + Id: "6", + CreatedAt: timestamppb.New(time.Time{}), + UpdatedAt: timestamppb.New(time.Time{}), + Title: "Online Research (Powered by XtraMCP)", + Content: "Understand my paper and run online search to find the latest papers related to my work.", IsUserPrompt: false, }, - // { - // Id: "4", - // CreatedAt: timestamppb.New(time.Time{}), - // UpdatedAt: timestamppb.New(time.Time{}), - // Title: "Deep Research (Powered by XtraMCP)", - // Content: "Do deep research and compare my papers against others", - // IsUserPrompt: false, - // }, } func (s *UserServer) ListPrompts( diff --git a/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/review-paper.tsx b/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/review-paper.tsx index 3710f592..fc7651d0 100644 --- a/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/review-paper.tsx +++ b/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/review-paper.tsx @@ -4,12 +4,43 @@ import MarkdownComponent from "../../../markdown"; import { useState } from "react"; import { XtraMcpToolCardProps, parseXtraMcpToolResult, CollapseArrowButton, CollapseWrapper } from "./utils/common"; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const formatArray = (arr: any): string => { - if (Array.isArray(arr)) { - return arr.join(", "); - } - return String(arr); +// Helper function to render severity levels with strikethrough +const renderSeverityLevels = (threshold: string) => { + const levels = ['nit', 'minor', 'major', 'blocker']; + const thresholdIndex = levels.indexOf(threshold.toLowerCase()); + + return ( +
+ {levels.map((level, index) => ( + + + {level} + + {index < levels.length - 1 && |} + + ))} +
+ ); +}; + +const renderSections = (sections: Array) => { + return ( + + {sections.map((section, index) => ( + + + {section} + + {index < sections.length - 1 && ", "} + + ))} + + ); }; export const ReviewPaperCard = ({ functionName, message, preparing, animated }: XtraMcpToolCardProps) => { @@ -46,17 +77,11 @@ export const ReviewPaperCard = ({ functionName, message, preparing, animated }: return (
{/* Header with Error label and arrow button */} -
setIsMetadataCollapsed(!isMetadataCollapsed)} - > +
setIsMetadataCollapsed(!isMetadataCollapsed)}>

{functionName}

Error - +
@@ -78,15 +103,9 @@ export const ReviewPaperCard = ({ functionName, message, preparing, animated }: {/* COMPACT TOOL CARD - Just title + metadata dropdown */}
{/* Header with arrow button */} -
setIsMetadataCollapsed(!isMetadataCollapsed)} - > +
setIsMetadataCollapsed(!isMetadataCollapsed)}>

{functionName}

- +
{/* Metadata dropdown - INSIDE the tool card */} @@ -104,19 +123,17 @@ export const ReviewPaperCard = ({ functionName, message, preparing, animated }: {/* Custom metadata rendering */} {result.metadata.target_venue !== undefined && (
- Checked for: " - {result.metadata.target_venue || "General review"}" + Checked for: "{result.metadata.target_venue || "General review"}"
)} {result.metadata.severity_threshold && (
- Filtered: "{result.metadata.severity_threshold}" and above + Filtered: {renderSeverityLevels(result.metadata.severity_threshold)}
)} - {result.metadata.sections_to_review && ( + {result.metadata.sections_reviewed && (
- Sections reviewed:{" "} - {formatArray(result.metadata.sections_to_review)} + Sections reviewed: {renderSections(result.metadata.sections_reviewed)}
)}
@@ -126,7 +143,9 @@ export const ReviewPaperCard = ({ functionName, message, preparing, animated }: {/* CONTENT - OUTSIDE/BELOW the tool card, always visible */}
- {result.content} + + {result.content} +
); @@ -140,4 +159,4 @@ export const ReviewPaperCard = ({ functionName, message, preparing, animated }:
); -}; +}; \ No newline at end of file diff --git a/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/verify-citations.tsx b/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/verify-citations.tsx index 4f858be9..710cf17f 100644 --- a/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/verify-citations.tsx +++ b/webapp/_webapp/src/components/message-entry-container/tools/xtramcp/verify-citations.tsx @@ -86,14 +86,31 @@ export const VerifyCitationsCard = ({ functionName, message, preparing, animated
{/* Custom metadata rendering */} - {result.metadata.bibliography_file && ( -
- Bib source file:{" "} - - {result.metadata.bibliography_file} - -
- )} + {result.metadata.bibliography_files && (() => { + const files = result.metadata.bibliography_files; + const isArray = Array.isArray(files); + return ( +
+ Bib Source File{isArray && files.length > 1 ? 's' : ''}:{" "} + {isArray ? ( + + {files.map((file, index) => ( + + + {file} + + {index < files.length - 1 && ", "} + + ))} + + ) : ( + + {files} + + )} +
+ ); + })()} {result.metadata.total_citations !== undefined && (
Total Citations: {result.metadata.total_citations}