| 189 | } |
| 190 | |
| 191 | func parseCursorAssistantMessage(raw json.RawMessage) *Event { |
| 192 | if raw == nil { |
| 193 | return nil |
| 194 | } |
| 195 | var msg cursorAssistantMessage |
| 196 | if err := json.Unmarshal(raw, &msg); err != nil { |
| 197 | return nil |
| 198 | } |
| 199 | for _, block := range msg.Content { |
| 200 | if block.Type != "text" { |
| 201 | continue |
| 202 | } |
| 203 | text := block.Text |
| 204 | if strings.Contains(text, "<chief-complete/>") { |
| 205 | return &Event{Type: EventComplete, Text: text} |
| 206 | } |
| 207 | if strings.Contains(text, "<chief-done/>") { |
| 208 | return &Event{Type: EventStoryDone, Text: text} |
| 209 | } |
| 210 | return &Event{Type: EventAssistantText, Text: text} |
| 211 | } |
| 212 | return nil |
| 213 | } |
| 214 | |
| 215 | func parseCursorToolCall(subtype string, raw json.RawMessage) *Event { |
| 216 | if raw == nil { |