(deps commandDeps)
| 752 | } |
| 753 | |
| 754 | func 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 | |
| 779 | func addWorkspaceFlag(cmd *cobra.Command) { |
| 780 | cmd.Flags().String(workspaceSkillSource, "", "Resolve the agent from a workspace id, name, or path") |
no test coverage detected