MCPcopy Create free account
hub / github.com/Facets-cloud/flow / renderAssistantRecord

Function renderAssistantRecord

internal/harness/claude/transcript.go:196–226  ·  view source on GitHub ↗
(w io.Writer, raw json.RawMessage, compact bool)

Source from the content-addressed store, hash-verified

194}
195
196func renderAssistantRecord(w io.Writer, raw json.RawMessage, compact bool) {
197 var msg jsonlMessage
198 if err := json.Unmarshal(raw, &msg); err != nil {
199 return
200 }
201
202 var blocks []contentBlock
203 if err := json.Unmarshal(msg.Content, &blocks); err != nil {
204 return
205 }
206
207 for _, b := range blocks {
208 switch b.Type {
209 case "thinking":
210 if compact {
211 continue
212 }
213 if b.Thinking != "" {
214 fmt.Fprintln(w, "─── Thinking ───")
215 fmt.Fprintln(w, b.Thinking)
216 }
217 case "text":
218 if b.Text != "" {
219 fmt.Fprintln(w, "─── Assistant ───")
220 fmt.Fprintln(w, b.Text)
221 }
222 case "tool_use":
223 renderToolUse(w, b)
224 }
225 }
226}
227
228func renderToolUse(w io.Writer, b contentBlock) {
229 summary := formatToolInput(b.Name, b.Input)

Callers 1

RenderJSONLFunction · 0.85

Calls 1

renderToolUseFunction · 0.85

Tested by

no test coverage detected