@@ -88,10 +88,21 @@ type ArtifactEntry struct {
8888 Size int64
8989}
9090
91+ // ArtifactStats holds counts by support status
92+ type ArtifactStats struct {
93+ Total int `json:"total"`
94+ Recommended int `json:"recommended"`
95+ Latest int `json:"latest"`
96+ Active int `json:"active"`
97+ Deprecated int `json:"deprecated"`
98+ EOL int `json:"eol"`
99+ }
100+
91101// ArtifactsResult holds paginated results with metadata
92102type ArtifactsResult struct {
93103 Data []ArtifactEntry
94104 Total int
105+ Stats ArtifactStats
95106 FilteredBy string
96107}
97108
@@ -420,6 +431,9 @@ func (s *ArtifactsService) GetArtifacts(query ArtifactsQuery) (*ArtifactsResult,
420431 // Store total count after filtering but before pagination
421432 totalFiltered := len (filtered )
422433
434+ // Calculate stats from filtered results (before pagination)
435+ stats := s .calculateStats (filtered )
436+
423437 // Apply sorting
424438 sorted := s .SortArtifacts (filtered , query .SortBy , query .SortOrder )
425439
@@ -432,6 +446,7 @@ func (s *ArtifactsService) GetArtifacts(query ArtifactsQuery) (*ArtifactsResult,
432446 return & ArtifactsResult {
433447 Data : paginated ,
434448 Total : totalFiltered ,
449+ Stats : stats ,
435450 }, nil
436451}
437452
@@ -469,6 +484,28 @@ func (s *ArtifactsService) generateFullVersion(version string, hash string) stri
469484 return fmt .Sprintf ("%s-%s" , version , hash )
470485}
471486
487+ // calculateStats calculates artifact counts by support status
488+ func (s * ArtifactsService ) calculateStats (artifacts []ArtifactEntry ) ArtifactStats {
489+ stats := ArtifactStats {
490+ Total : len (artifacts ),
491+ }
492+ for _ , artifact := range artifacts {
493+ switch artifact .SupportStatus {
494+ case Recommended :
495+ stats .Recommended ++
496+ case Latest :
497+ stats .Latest ++
498+ case Active :
499+ stats .Active ++
500+ case Deprecated :
501+ stats .Deprecated ++
502+ case EOL :
503+ stats .EOL ++
504+ }
505+ }
506+ return stats
507+ }
508+
472509func (s * ArtifactsService ) estimateSize (version string , platform string ) int64 {
473510 // Rough estimates in MB
474511 if platform == "windows" {
0 commit comments