MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / parseCursorToolCall

Function parseCursorToolCall

internal/loop/cursor_parser.go:215–232  ·  view source on GitHub ↗
(subtype string, raw json.RawMessage)

Source from the content-addressed store, hash-verified

213}
214
215func 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.
235func cursorToolCallNameAndInput(tc *cursorToolCall) (name string, input map[string]interface{}) {

Callers 1

ParseLineCursorFunction · 0.85

Calls 2

Tested by

no test coverage detected