(deps commandDeps)
| 664 | } |
| 665 | |
| 666 | func newSessionHistoryCommand(deps commandDeps) *cobra.Command { |
| 667 | return &cobra.Command{ |
| 668 | Use: sessionHistoryIDValue, |
| 669 | Short: "Show session history grouped by turn", |
| 670 | Example: ` # Show replayable turn history for one session |
| 671 | agh session history sess_1234`, |
| 672 | Args: exactOneNonBlankArg(), |
| 673 | RunE: func(cmd *cobra.Command, args []string) error { |
| 674 | client, err := clientFromDeps(deps) |
| 675 | if err != nil { |
| 676 | return err |
| 677 | } |
| 678 | |
| 679 | history, err := client.SessionHistory(cmd.Context(), args[0], SessionEventQuery{}) |
| 680 | if err != nil { |
| 681 | return err |
| 682 | } |
| 683 | return writeCommandOutput(cmd, sessionHistoryBundle(history)) |
| 684 | }, |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | func streamSessionEvents(cmd *cobra.Command, client DaemonClient, id string, query SessionEventQuery) error { |
| 689 | mode, err := resolveOutputFormat(cmd) |
no test coverage detected