fix: render a tool result's structuredContent in the Tools screen (#1908)
A tool declaring an `outputSchema` returns its real payload in `structuredContent`; the `content[]` blocks usually only summarize it. v1 rendered that payload as its own inspectable JSON section — v2's ToolResultPanel only ever walked `result.content`, so the payload was dropped with no label, section, or hint that it existed. Adds a `StructuredOutputPanel` group: a collapsible "Structured Output" box (bordered like the existing "Resource Links" box) rendering the payload as pretty-printed, syntax-highlighted, copyable JSON, bounded so a large payload scrolls within itself. ToolResultPanel renders it below the content blocks — and also when `content` is empty (where "No results yet" was simply wrong) and below the alert on an error result, so it is never silently dropped. Adds a `list_items` test-server preset (nested payload, the issue's repro shape) and a `structured-output-http.json` showcase config, documented in the README. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SW1p8E2uiyyLx4RKwrwSrt
This commit is contained in:
parent
a09f2dcf1d
commit
6f47eaa143
1 changed files with 465 additions and 9 deletions
|
|
@ -34,6 +34,7 @@ import {
|
|||
createGetAnnotatedMessageTool,
|
||||
createGetTempTool,
|
||||
createGetTempExtraTool,
|
||||
createListItemsTool,
|
||||
createAddResourceTool,
|
||||
createRemoveResourceTool,
|
||||
createAddToolTool,
|
||||
|
|
@ -158,6 +159,8 @@ function resolveToolPreset(
|
|||
return createGetTempTool();
|
||||
case "get_temp_extra":
|
||||
return createGetTempExtraTool();
|
||||
case "list_items":
|
||||
return createListItemsTool();
|
||||
case "add_resource":
|
||||
return createAddResourceTool();
|
||||
case "remove_resource":
|
||||
|
|
|
|||
Loading…
Reference in a new issue