/** * Schema definition for generate-dockerfile tool */ import { z } from 'zod'; import { DOCKER_PLATFORMS, type DockerPlatform, type ToolNextAction } from '../shared/schemas.js'; import { ModuleInfo } from '../analyze-repo/schema.js'; import type { PolicyValidationResult } from '../../lib/policy-helpers.js'; export { DOCKER_PLATFORMS, type DockerPlatform }; export declare const generateDockerfileSchema: z.ZodObject<{ repositoryPath: z.ZodString; workspacePath: z.ZodOptional; modulePath: z.ZodOptional; language: z.ZodOptional; languageVersion: z.ZodOptional; framework: z.ZodOptional; environment: z.ZodOptional>; detectedDependencies: z.ZodOptional>; detectedEnvVars: z.ZodOptional; source: z.ZodString; required: z.ZodBoolean; defaultValue: z.ZodOptional; }, "strip", z.ZodTypeAny, { name: string; source: string; required: boolean; classification: "config" | "database" | "secret"; defaultValue?: string | undefined; }, { name: string; source: string; required: boolean; classification: "config" | "database" | "secret"; defaultValue?: string | undefined; }>, "many">>; targetPlatform: z.ZodDefault>; trafficLevel: z.ZodOptional>; criticalityTier: z.ZodOptional>; }, "strip", z.ZodTypeAny, { repositoryPath: string; targetPlatform: "linux/amd64" | "linux/arm64" | "linux/arm/v7" | "linux/arm/v6" | "linux/386" | "linux/ppc64le" | "linux/s390x" | "linux/riscv64" | "windows/amd64"; environment?: "development" | "staging" | "production" | "testing" | undefined; language?: string | undefined; languageVersion?: string | undefined; framework?: string | undefined; workspacePath?: string | undefined; modulePath?: string | undefined; detectedEnvVars?: { name: string; source: string; required: boolean; classification: "config" | "database" | "secret"; defaultValue?: string | undefined; }[] | undefined; detectedDependencies?: string[] | undefined; trafficLevel?: "high" | "medium" | "low" | undefined; criticalityTier?: "tier-1" | "tier-2" | "tier-3" | undefined; }, { repositoryPath: string; environment?: "development" | "staging" | "production" | "testing" | undefined; language?: string | undefined; languageVersion?: string | undefined; framework?: string | undefined; workspacePath?: string | undefined; modulePath?: string | undefined; detectedEnvVars?: { name: string; source: string; required: boolean; classification: "config" | "database" | "secret"; defaultValue?: string | undefined; }[] | undefined; detectedDependencies?: string[] | undefined; targetPlatform?: "linux/amd64" | "linux/arm64" | "linux/arm/v7" | "linux/arm/v6" | "linux/386" | "linux/ppc64le" | "linux/s390x" | "linux/riscv64" | "windows/amd64" | undefined; trafficLevel?: "high" | "medium" | "low" | undefined; criticalityTier?: "tier-1" | "tier-2" | "tier-3" | undefined; }>; export type GenerateDockerfileParams = z.infer; export interface DockerfileRequirement { id: string; category: string; recommendation: string; example?: string; severity?: 'high' | 'medium' | 'low'; tags?: string[]; matchScore: number; /** Indicates if this recommendation was injected by policy template */ policyDriven?: boolean; } /** * Base image recommendation with details */ export interface BaseImageRecommendation { /** Full image name (e.g., "node:20-alpine") */ image: string; /** Category of the image */ category: 'official' | 'distroless' | 'security' | 'size'; /** Reason for recommendation */ reason: string; /** Estimated size in MB (if known) */ size?: string | undefined; /** Security rating (if applicable) */ securityRating?: 'high' | 'medium' | 'low' | undefined; /** Tags applied to this recommendation */ tags?: string[] | undefined; /** Match score from knowledge base */ matchScore: number; } /** * Analysis of an existing Dockerfile */ export interface DockerfileAnalysis { /** Base images found in the Dockerfile */ baseImages: string[]; /** Whether the Dockerfile uses multi-stage builds */ isMultistage: boolean; /** Whether a HEALTHCHECK instruction exists */ hasHealthCheck: boolean; /** Whether a non-root USER is set */ hasNonRootUser: boolean; /** Total number of instructions */ instructionCount: number; /** Complexity estimate based on structure */ complexity: 'simple' | 'moderate' | 'complex'; /** Security posture summary */ securityPosture: 'good' | 'needs-improvement' | 'poor'; } /** * Guidance for enhancing an existing Dockerfile */ export interface EnhancementGuidance { /** Elements to preserve from the existing Dockerfile */ preserve: string[]; /** Areas that should be improved */ improve: string[]; /** Missing features that should be added */ addMissing: string[]; /** Recommended enhancement strategy */ strategy: 'minor-tweaks' | 'moderate-refactor' | 'major-overhaul'; } export interface DockerfilePlan { /** Next action directive - provides explicit guidance on what files to create/update */ nextAction: ToolNextAction; repositoryInfo: ModuleInfo; recommendations: { buildStrategy: { multistage: boolean; reason: string; }; /** Platform to use for building images (e.g., "linux/amd64", "linux/arm64") */ platform?: DockerPlatform; /** Default tag to apply to built images */ defaultTag?: string; baseImages: BaseImageRecommendation[]; securityConsiderations: DockerfileRequirement[]; optimizations: DockerfileRequirement[]; bestPractices: DockerfileRequirement[]; }; confidence: number; summary: string; /** Version label to include as a LABEL instruction in the generated Dockerfile */ attributionLabels?: { labels: Record; }; existingDockerfile?: { path: string; content: string; analysis: DockerfileAnalysis; guidance: EnhancementGuidance; }; policyValidation?: PolicyValidationResult; /** * @deprecated Use recommendations.baseImages, securityConsiderations, optimizations, and bestPractices instead */ knowledgeMatches?: DockerfileRequirement[]; } //# sourceMappingURL=schema.d.ts.map