/** Represents a single finding from a cloud scanner module */ export interface ScanFinding { /** Which scanner module produced this finding */ module: string; /** Resource identifier (e.g. instance ID, bucket name) */ resourceId: string; /** Resource type (e.g. "EC2 Instance", "S3 Bucket") */ resourceType: string; /** Region the resource lives in — set for every finding by the scan runner */ region?: string; /** Human-readable description of the issue */ issue: string; /** Severity: low, medium, high, critical */ severity: "low" | "medium" | "high" | "critical"; /** Estimated monthly cost savings in USD */ monthlySavingsUsd: number; /** Confidence level for the savings estimate */ savingsConfidence?: "high" | "medium" | "low"; /** Estimated monthly carbon reduction in kg CO2 */ monthlyCarbonSavingsKg: number; /** Recommended action to fix the issue */ recommendation: string; /** Optional: code diff or command to remediate */ remediation?: string; /** Additional metadata */ metadata?: Record; /** * Resource tags (AWS tags, GCP labels, ...), fetched best-effort via * ResourceGroupsTaggingAPI for supported AWS resource types. Absent when * the resource has no tags, tags couldn't be fetched, or the module/ * resource type isn't covered yet. */ tags?: Record; /** Safety information about the remediation */ remediationSafety?: { /** Whether the command is destructive (deletes/modifies resources) */ destructive: boolean; /** Warning message for destructive operations */ warning?: string; /** Backup command to run before remediation */ backupCommand?: string; /** Context variables to include in commands (profile, region, account) */ context?: { profile?: string; region?: string; accountId?: string; }; }; } /** Result of a full scan across all modules */ export interface ScanReport { /** Timestamp of the scan */ timestamp: string; /** Cloud provider name */ provider: string; /** Account/profile used */ account: string; /** Human-readable account alias or name, if available */ accountAlias?: string | null; /** Primary region scanned (first entry of `regions`) */ region: string; /** All regions covered by this scan */ regions?: string[]; /** All findings grouped by module */ findings: ScanFinding[]; /** Summary statistics */ summary: ScanSummary; /** Billing context from AWS Cost Explorer */ billing?: BillingSummary; } export interface ScanSummary { totalFindings: number; totalMonthlySavingsUsd: number; totalMonthlyCarbonSavingsKg: number; totalAnnualSavingsUsd: number; totalAnnualCarbonSavingsKg: number; moduleBreakdown: ModuleSummary[]; } export interface ModuleSummary { module: string; findingCount: number; monthlySavingsUsd: number; monthlyCarbonSavingsKg: number; } export interface BillingSummary { periodStart: string; periodEnd: string; monthlyCostUsd: number; annualCostUsd: number; monthlySavingsPercentage: number; annualSavingsPercentage: number; serviceCosts: ServiceCost[]; moduleCosts: ModuleCost[]; } export interface ServiceCost { service: string; monthlyCostUsd: number; } export interface ModuleCost { module: string; monthlyCostUsd: number; /** Confidence of module-to-cost mapping from Cost Explorer */ confidence: "high" | "medium" | "low"; } /** Real-world equivalents for carbon savings */ export interface CarbonEquivalent { description: string; value: string; }