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

Function parseCursorAssistantMessage

internal/loop/cursor_parser.go:191–213  ·  view source on GitHub ↗
(raw json.RawMessage)

Source from the content-addressed store, hash-verified

189}
190
191func 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
215func parseCursorToolCall(subtype string, raw json.RawMessage) *Event {
216 if raw == nil {

Callers 1

ParseLineCursorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected