(subtype string, raw json.RawMessage)
| 213 | } |
| 214 | |
| 215 | func parseCursorToolCall(subtype string, raw json.RawMessage) *Event { |
| 216 | if raw == nil { |
| 217 | return nil |
| 218 | } |
| 219 | var tc cursorToolCall |
| 220 | if err := json.Unmarshal(raw, &tc); err != nil { |
| 221 | return nil |
| 222 | } |
| 223 | toolName, toolInput := cursorToolCallNameAndInput(&tc) |
| 224 | switch subtype { |
| 225 | case "started": |
| 226 | return &Event{Type: EventToolStart, Tool: toolName, ToolInput: toolInput} |
| 227 | case "completed": |
| 228 | text := cursorToolCallResultSummary(&tc) |
| 229 | return &Event{Type: EventToolResult, Tool: toolName, Text: text} |
| 230 | } |
| 231 | return nil |
| 232 | } |
| 233 | |
| 234 | // cursorToolCallNameAndInput returns display name (PascalCase for TUI icons) and optional ToolInput for the log. |
| 235 | func cursorToolCallNameAndInput(tc *cursorToolCall) (name string, input map[string]interface{}) { |
no test coverage detected