import type { AnalyzeResourceFn } from '../helpers/analyzeResource/analyzeResource'; import type { AnalyzeResourcesBatchFn } from '../helpers/analyzeResourcesBatch/analyzeResourcesBatch'; import { FileBasedCache } from '../helpers/cache/fileBasedCache'; import type { RedactResourcesFn } from '../helpers/redactResources/redactResources'; import type { CloudFormationResource, AnalysisResult as ImportedAnalysisResult, Issue, SingleResourceAnalysis } from '../types/analysis.types'; import type { ErrorHandler } from './types/cli.types'; interface ConcurrencyConfig { maxConcurrent: number; retryAttempts: number; retryDelay: number; timeoutMs: number; } /** * Replace the plaintext logical ID inside a relationship summary entry * (`"MyTable (Table)"`) with a deterministic hash of that ID, preserving * the trailing `(TypeShort)` suffix so the AI still has resource-type * context. Used to scrub user-chosen naming out of dependency lists * before they're sent to the AI service. */ export declare const redactRelationshipEntry: (entry: string, stackName: string) => string; export interface CreateResourceAnalyzerParams { analyzeResource: AnalyzeResourceFn; redactionMapping: Record; aggregatedResult: Record; errorHandler: ErrorHandler; config: ConcurrencyConfig; authToken: string; fingerprint: string; stackName: string; analysisCache: FileBasedCache; /** Original resources (for relationship context) */ originalResources: Record; /** Pre-computed relationships between resources */ relationships: Record; /** Resolved Bedrock model ID — forwarded to backend per request. */ aiModelId?: string; } export interface ResourceAnalyzerParams { redactedId: string; redactedResources: Record; findingsByResource: Map; progressTracker?: { startJob: (jobId: string, resourceId: string) => void; updateJobStatus: (jobId: string, resourceId: string, status: string, attempt: number) => void; completeJob: (jobId: string, resourceId: string) => void; failJob: (jobId: string, resourceId: string, error: string) => void; timeoutJob: (jobId: string, resourceId: string) => void; }; } export interface CreateResourceHandlerParams { analyzeResource: AnalyzeResourceFn; redactResources: RedactResourcesFn; config?: ConcurrencyConfig; /** * Optional batch client. When supplied AND `aiBatchSize > 1` is passed * to the handler, the orchestrator chunks resources into batches and * calls this client instead of `analyzeResource` per resource. Falls * back to per-resource path on batch errors. */ analyzeResourcesBatch?: AnalyzeResourcesBatchFn; } export interface ResourceHandlerParams { stackName: string; resources: Record; authToken: string; existingFindingsMap: Issue[]; pathToLogicalId: Record; fingerprint: string; noCache?: boolean; cacheConfig?: { enabled: boolean; ttl: number; maxSize: number; }; /** * Resolved Bedrock model ID for AI insights. Forwarded to the backend * which routes the analysis through the chosen model. `undefined` = * backend picks its tier default. */ aiModelId?: string; /** * If > 1, group resources into batches of this size and call the * batched `/analyze/batch` endpoint. Defaults to 1 (per-resource * path). Clamped to the backend's max of 10. */ aiBatchSize?: number; } export declare const createResourceHandler: ({ analyzeResource, analyzeResourcesBatch, redactResources, config, }: CreateResourceHandlerParams) => ({ stackName, resources, authToken, existingFindingsMap, pathToLogicalId, fingerprint, noCache, cacheConfig, aiModelId, aiBatchSize, }: ResourceHandlerParams) => Promise; export {};