Tool Call Card Alignment
Nucleic-Session: FFDE42E0-22AB-4478-B2E2-FF69B2753CEE Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -199,6 +199,19 @@ struct RunFinishedRow: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension JSONValue {
|
extension JSONValue {
|
||||||
|
/// Human-readable tool-result text: a plain string, the joined text of an MCP content array,
|
||||||
|
/// or the canonical JSON as a last resort. Mirrors the Mac's `TranscriptRow.resultText`, so an
|
||||||
|
/// answered-question card and a git-commit card read the result the same way on both platforms.
|
||||||
|
var resultText: String {
|
||||||
|
if let string = stringValue { return string }
|
||||||
|
if let array = arrayValue {
|
||||||
|
let texts = array.compactMap { $0["text"]?.stringValue }
|
||||||
|
if !texts.isEmpty { return texts.joined(separator: "\n") }
|
||||||
|
}
|
||||||
|
let canonical = canonicalString()
|
||||||
|
return canonical == "null" ? "" : canonical
|
||||||
|
}
|
||||||
|
|
||||||
/// A one-line gist of a tool input/result for the collapsed row.
|
/// A one-line gist of a tool input/result for the collapsed row.
|
||||||
var compactSummary: String {
|
var compactSummary: String {
|
||||||
switch self {
|
switch self {
|
||||||
|
|||||||
Reference in New Issue
Block a user