From 05eb015683aec68b9924620c6410cf2dd907cdec Mon Sep 17 00:00:00 2001 From: paoloricciuti Date: Mon, 5 Jan 2026 10:40:05 +0100 Subject: [PATCH 1/2] fix: show tool input and output --- packages/ui/src/components/basic-tool.tsx | 38 +++++++++++++++++++-- packages/ui/src/components/message-part.css | 32 +++++++++++++++++ 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/basic-tool.tsx b/packages/ui/src/components/basic-tool.tsx index 67720955dcb..3d5c87012da 100644 --- a/packages/ui/src/components/basic-tool.tsx +++ b/packages/ui/src/components/basic-tool.tsx @@ -99,6 +99,40 @@ export function BasicTool(props: BasicToolProps) { ) } -export function GenericTool(props: { tool: string; hideDetails?: boolean }) { - return +export function GenericTool(props: { + tool: string + input?: Record + output?: string + hideDetails?: boolean + defaultOpen?: boolean + forceOpen?: boolean +}) { + const hasContent = () => (props.input && Object.keys(props.input).length > 0) || props.output + + return ( + + +
+ 0}> +
+
Input
+
{JSON.stringify(props.input, null, 2)}
+
+
+ +
+
Output
+
{props.output}
+
+
+
+
+
+ ) } diff --git a/packages/ui/src/components/message-part.css b/packages/ui/src/components/message-part.css index b154f981cc8..ea948b19da2 100644 --- a/packages/ui/src/components/message-part.css +++ b/packages/ui/src/components/message-part.css @@ -190,6 +190,38 @@ } } +[data-slot="generic-tool-section"] { + display: flex; + flex-direction: column; + gap: 4px; + width: 100%; + + &:not(:last-child) { + margin-bottom: 12px; + } + + [data-slot="generic-tool-label"] { + font-family: var(--font-family-sans); + font-size: var(--font-size-xs); + font-weight: var(--font-weight-medium); + color: var(--text-weak); + text-transform: uppercase; + letter-spacing: 0.05em; + } + + [data-slot="generic-tool-content"] { + font-family: var(--font-family-mono); + font-size: var(--font-size-xs); + line-height: var(--line-height-large); + color: var(--text-base); + white-space: pre-wrap; + word-break: break-word; + margin: 0; + padding: 0; + background: none; + } +} + [data-component="edit-trigger"], [data-component="write-trigger"] { display: flex; From 8361d3bc2e718364b81015cf01bb115fd4c95fa9 Mon Sep 17 00:00:00 2001 From: paoloricciuti Date: Mon, 5 Jan 2026 10:43:06 +0100 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20remove=20"puppa"=20=F0=9F=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/src/components/basic-tool.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/components/basic-tool.tsx b/packages/ui/src/components/basic-tool.tsx index 3d5c87012da..0284c98922b 100644 --- a/packages/ui/src/components/basic-tool.tsx +++ b/packages/ui/src/components/basic-tool.tsx @@ -112,7 +112,7 @@ export function GenericTool(props: { return (