(cmd *cobra.Command, args []string)
| 106 | } |
| 107 | |
| 108 | func (f *debugFlags) runDebugToolsetsCommand(cmd *cobra.Command, args []string) (commandErr error) { |
| 109 | telemetry.TrackCommand(cmd.Context(), "debug", append([]string{"toolsets"}, args...)) |
| 110 | defer func() { // do not inline this defer so that commandErr is not resolved early |
| 111 | telemetry.TrackCommandError(cmd.Context(), "debug", append([]string{"toolsets"}, args...), commandErr) |
| 112 | }() |
| 113 | |
| 114 | ctx := cmd.Context() |
| 115 | |
| 116 | t, err := f.loadTeam(ctx, args[0]) |
| 117 | if err != nil { |
| 118 | return err |
| 119 | } |
| 120 | defer stopToolSets(ctx, t) |
| 121 | |
| 122 | out := cli.NewPrinter(cmd.OutOrStdout()) |
| 123 | |
| 124 | for _, name := range t.AgentNames() { |
| 125 | agent, err := t.Agent(name) |
| 126 | if err != nil { |
| 127 | slog.ErrorContext(ctx, "Failed to get agent", "name", name, "error", err) |
| 128 | continue |
| 129 | } |
| 130 | |
| 131 | agentTools, err := agent.Tools(ctx) |
| 132 | if err != nil { |
| 133 | slog.ErrorContext(ctx, "Failed to query tools", "name", agent.Name(), "error", err) |
| 134 | continue |
| 135 | } |
| 136 | |
| 137 | if len(agentTools) == 0 { |
| 138 | out.Printf("No tools for %s\n", agent.Name()) |
| 139 | continue |
| 140 | } |
| 141 | |
| 142 | out.Printf("%d tool(s) for %s:\n", len(agentTools), agent.Name()) |
| 143 | for _, tool := range agentTools { |
| 144 | out.Println(" +", tool.Name, "-", tool.Description) |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | return nil |
| 149 | } |
| 150 | |
| 151 | func (f *debugFlags) runDebugSkillsCommand(cmd *cobra.Command, args []string) (commandErr error) { |
| 152 | telemetry.TrackCommand(cmd.Context(), "debug", append([]string{"skills"}, args...)) |
nothing calls this directly
no test coverage detected