@@ -4,7 +4,7 @@ import type { ToolUseResult } from "@/types/protocol";
44
55// ── MCP renderers (extracted) ──
66import { JiraIssueList , JiraIssueDetail , JiraProjectList , JiraTransitions } from "./mcp-renderers/jira" ;
7- import { ConfluenceSearchResults , ConfluenceSpaces } from "./mcp-renderers/confluence" ;
7+ import { ConfluenceSearchResults , ConfluenceSpaces , ConfluencePageDescendants , ConfluenceCreatedPage , ConfluenceUpdatedPage , ConfluencePageList } from "./mcp-renderers/confluence" ;
88import { RovoSearchResults , RovoFetchResult , AtlassianResourcesList } from "./mcp-renderers/atlassian" ;
99import { Context7LibraryList , Context7DocsResult } from "./mcp-renderers/context7" ;
1010
@@ -50,6 +50,15 @@ function extractMcpData(result: ToolUseResult): unknown {
5050 }
5151 }
5252
53+ // Fallback: normalizeToolResult puts MCP text into stdout when tool_use_result is empty
54+ if ( typeof result . stdout === "string" && result . stdout ) {
55+ try {
56+ return JSON . parse ( result . stdout ) ;
57+ } catch {
58+ return null ;
59+ }
60+ }
61+
5362 return null ;
5463}
5564
@@ -67,6 +76,8 @@ function extractMcpText(result: ToolUseResult): string | null {
6776 const items = result as Array < { type ?: string ; text ?: string } > ;
6877 return items . filter ( ( c ) => c . type === "text" && c . text ) . map ( ( c ) => c . text ) . join ( "" ) || null ;
6978 }
79+ // Fallback: normalizeToolResult puts MCP text into stdout when tool_use_result is empty
80+ if ( typeof result . stdout === "string" && result . stdout ) return result . stdout ;
7081 return null ;
7182}
7283
@@ -83,6 +94,10 @@ const MCP_RENDERERS: Record<string, McpRenderer> = {
8394 // Confluence
8495 "mcp__Atlassian__searchConfluenceUsingCql" : ConfluenceSearchResults ,
8596 "mcp__Atlassian__getConfluenceSpaces" : ConfluenceSpaces ,
97+ "mcp__Atlassian__getConfluencePageDescendants" : ConfluencePageDescendants ,
98+ "mcp__Atlassian__createConfluencePage" : ConfluenceCreatedPage ,
99+ "mcp__Atlassian__updateConfluencePage" : ConfluenceUpdatedPage ,
100+ "mcp__Atlassian__getPagesInConfluenceSpace" : ConfluencePageList ,
86101 // Rovo Search
87102 "mcp__Atlassian__search" : RovoSearchResults ,
88103 "mcp__Atlassian__fetch" : RovoFetchResult ,
@@ -103,6 +118,10 @@ const MCP_PATTERN_RENDERERS: Array<{ pattern: RegExp; renderer: McpRenderer }> =
103118 { pattern : / A t l a s s i a n [ / _ ] + g e t T r a n s i t i o n s F o r J i r a I s s u e $ / , renderer : JiraTransitions } ,
104119 { pattern : / A t l a s s i a n [ / _ ] + s e a r c h C o n f l u e n c e U s i n g C q l $ / , renderer : ConfluenceSearchResults } ,
105120 { pattern : / A t l a s s i a n [ / _ ] + g e t C o n f l u e n c e S p a c e s $ / , renderer : ConfluenceSpaces } ,
121+ { pattern : / A t l a s s i a n [ / _ ] + g e t C o n f l u e n c e P a g e D e s c e n d a n t s $ / , renderer : ConfluencePageDescendants } ,
122+ { pattern : / A t l a s s i a n [ / _ ] + c r e a t e C o n f l u e n c e P a g e $ / , renderer : ConfluenceCreatedPage } ,
123+ { pattern : / A t l a s s i a n [ / _ ] + u p d a t e C o n f l u e n c e P a g e $ / , renderer : ConfluenceUpdatedPage } ,
124+ { pattern : / A t l a s s i a n [ / _ ] + g e t P a g e s I n C o n f l u e n c e S p a c e $ / , renderer : ConfluencePageList } ,
106125 { pattern : / A t l a s s i a n [ / _ ] + s e a r c h $ / , renderer : RovoSearchResults } ,
107126 { pattern : / A t l a s s i a n [ / _ ] + f e t c h $ / , renderer : RovoFetchResult } ,
108127 { pattern : / A t l a s s i a n [ / _ ] + g e t A c c e s s i b l e A t l a s s i a n R e s o u r c e s $ / , renderer : AtlassianResourcesList } ,
@@ -140,6 +159,20 @@ export function getMcpCompactSummary(toolName: string, toolInput: Record<string,
140159 if ( / s e a r c h C o n f l u e n c e U s i n g C q l / . test ( toolName ) ) {
141160 return String ( toolInput . cql ?? "" ) . slice ( 0 , 80 ) ;
142161 }
162+ if ( / g e t C o n f l u e n c e P a g e D e s c e n d a n t s / . test ( toolName ) ) {
163+ return `page ${ toolInput . pageId ?? "" } ` ;
164+ }
165+ if ( / c r e a t e C o n f l u e n c e P a g e / . test ( toolName ) ) {
166+ return String ( toolInput . title ?? "" ) . slice ( 0 , 80 ) ;
167+ }
168+ if ( / u p d a t e C o n f l u e n c e P a g e / . test ( toolName ) ) {
169+ return toolInput . versionMessage
170+ ? String ( toolInput . versionMessage ) . slice ( 0 , 80 )
171+ : `page ${ toolInput . pageId ?? "" } ` ;
172+ }
173+ if ( / g e t P a g e s I n C o n f l u e n c e S p a c e / . test ( toolName ) ) {
174+ return toolInput . title ? `"${ toolInput . title } "` : `space ${ toolInput . spaceId ?? "" } ` ;
175+ }
143176 if ( / A t l a s s i a n [ / _ ] + s e a r c h $ / . test ( toolName ) ) {
144177 return String ( toolInput . query ?? "" ) . slice ( 0 , 80 ) ;
145178 }
@@ -174,7 +207,7 @@ export const McpToolContent = memo(function McpToolContent({ message }: { messag
174207
175208 return (
176209 < div className = "text-xs" >
177- { renderer ( { data, toolInput : message . toolInput ?? { } , rawText } ) }
210+ { renderer ( { data : data ?? { } , toolInput : message . toolInput ?? { } , rawText } ) }
178211 </ div >
179212 ) ;
180213} ) ;
0 commit comments