MCPcopy Create free account
hub / github.com/compozy/agh / newSessionHistoryCommand

Function newSessionHistoryCommand

internal/cli/session.go:666–686  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

664}
665
666func 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
688func streamSessionEvents(cmd *cobra.Command, client DaemonClient, id string, query SessionEventQuery) error {
689 mode, err := resolveOutputFormat(cmd)

Callers 1

newSessionCommandFunction · 0.85

Calls 5

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
sessionHistoryBundleFunction · 0.85
SessionHistoryMethod · 0.65

Tested by

no test coverage detected