MCPcopy Create free account
hub / github.com/block/buzz / getResultText

Function getResultText

desktop/src/features/agents/ui/agentSessionFileEditDiff.ts:68–83  ·  view source on GitHub ↗
(result: string)

Source from the content-addressed store, hash-verified

66}
67
68function getResultText(result: string): string {
69 const parsed = parseToolResultValue(result);
70 if (typeof parsed === "string") {
71 return parsed;
72 }
73
74 const record = asRecord(parsed);
75 const output = [
76 getToolString(record, ["stdout", "output", "text"]),
77 getToolString(record, ["stderr"]),
78 ]
79 .filter((value): value is string => value != null)
80 .join("\n");
81
82 return output || result;
83}
84
85function getDiffPath(text: string): string | null {
86 for (const line of text.split(/\r?\n/)) {

Callers 1

buildFileEditDiffFunction · 0.70

Calls 3

parseToolResultValueFunction · 0.90
asRecordFunction · 0.90
getToolStringFunction · 0.90

Tested by

no test coverage detected