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

Function newSessionInspectCommand

internal/cli/authored_context.go:754–777  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

752}
753
754func newSessionInspectCommand(deps commandDeps) *cobra.Command {
755 var includeEvents bool
756 cmd := &cobra.Command{
757 Use: "inspect <session-id>",
758 Short: "Inspect session health, wake audit, and policy correlation",
759 Example: " agh session inspect sess_123 --include-wake-events --json",
760 Args: exactOneNonBlankArg(),
761 RunE: func(cmd *cobra.Command, args []string) error {
762 client, err := clientFromDeps(deps)
763 if err != nil {
764 return err
765 }
766 record, err := client.InspectSession(cmd.Context(), args[0], SessionInspectQuery{
767 IncludeRecentWakeEvents: includeEvents,
768 })
769 if err != nil {
770 return err
771 }
772 return writeCommandOutput(cmd, sessionInspectBundle(record))
773 },
774 }
775 cmd.Flags().BoolVar(&includeEvents, "include-wake-events", false, "Include recent wake audit rows")
776 return cmd
777}
778
779func addWorkspaceFlag(cmd *cobra.Command) {
780 cmd.Flags().String(workspaceSkillSource, "", "Resolve the agent from a workspace id, name, or path")

Callers 1

newSessionCommandFunction · 0.85

Calls 5

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
sessionInspectBundleFunction · 0.85
InspectSessionMethod · 0.65

Tested by

no test coverage detected