(cmd *cobra.Command, client DaemonClient, id string, message string)
| 639 | } |
| 640 | |
| 641 | func streamPromptEventsJSONL(cmd *cobra.Command, client DaemonClient, id string, message string) error { |
| 642 | return client.StreamPromptSession(cmd.Context(), id, message, func(event SSEEvent) error { |
| 643 | if len(event.Data) == 0 || strings.TrimSpace(string(event.Data)) == "[DONE]" { |
| 644 | return nil |
| 645 | } |
| 646 | |
| 647 | var payload any |
| 648 | if err := json.Unmarshal(event.Data, &payload); err != nil { |
| 649 | return fmt.Errorf("cli: decode prompt event: %w", err) |
| 650 | } |
| 651 | return writeJSONLine(cmd, payload) |
| 652 | }) |
| 653 | } |
| 654 | |
| 655 | func writeSessionEventsOutput(cmd *cobra.Command, events []SessionEventRecord) error { |
| 656 | mode, err := resolveOutputFormat(cmd) |
no test coverage detected