/** * Schema definition for build-image-context tool * Provides context and recommendations for Docker image builds */ import { z } from 'zod'; /** * Input parameters for build context preparation */ export declare const buildImageSchema: z.ZodObject<{ path: z.ZodOptional; dockerfile: z.ZodOptional; dockerfilePath: z.ZodOptional; imageName: z.ZodOptional; tags: z.ZodOptional>; buildArgs: z.ZodOptional>; workspacePath: z.ZodOptional; platform: z.ZodDefault>; }, "strip", z.ZodTypeAny, { platform: "linux/amd64" | "linux/arm64" | "linux/arm/v7" | "linux/arm/v6" | "linux/386" | "linux/ppc64le" | "linux/s390x" | "linux/riscv64" | "windows/amd64"; path?: string | undefined; dockerfile?: string | undefined; tags?: string[] | undefined; workspacePath?: string | undefined; dockerfilePath?: string | undefined; imageName?: string | undefined; buildArgs?: Record | undefined; }, { path?: string | undefined; dockerfile?: string | undefined; tags?: string[] | undefined; platform?: "linux/amd64" | "linux/arm64" | "linux/arm/v7" | "linux/arm/v6" | "linux/386" | "linux/ppc64le" | "linux/s390x" | "linux/riscv64" | "windows/amd64" | undefined; workspacePath?: string | undefined; dockerfilePath?: string | undefined; imageName?: string | undefined; buildArgs?: Record | undefined; }>; export type BuildImageParams = z.infer; /** * Security warning with severity and remediation */ export interface SecurityWarning { /** Warning identifier */ id: string; /** Severity level */ severity: 'low' | 'medium' | 'high' | 'critical'; /** Human-readable message */ message: string; /** Line number in Dockerfile (if applicable) */ line?: number; /** Recommended fix */ remediation: string; } /** * BuildKit feature detection */ export interface BuildKitFeatures { /** Dockerfile uses --mount=type=cache */ cacheMount: boolean; /** Dockerfile uses --mount=type=secret */ secretMount: boolean; /** Dockerfile uses --mount=type=ssh */ sshMount: boolean; /** Multi-stage build detected */ multiStage: boolean; /** Number of build stages */ stageCount: number; /** Uses COPY --from for multi-stage */ copyFrom: boolean; /** Uses heredoc syntax (requires BuildKit) */ heredoc: boolean; } /** * Structured command for agent execution */ export interface BuildCommand { /** Full command string ready to execute */ command: string; /** Structured parts for programmatic use */ parts: { executable: 'docker'; subcommand: 'build' | 'buildx build'; flags: string[]; context: string; }; /** Environment variables to set */ environment: Record; } /** * Result of build context preparation */ export interface BuildImageResult { /** Natural language summary */ summary: string; /** Validated paths */ context: { /** Absolute path to build context directory */ buildContextPath: string; /** Absolute path to Dockerfile */ dockerfilePath: string; /** Relative path for -f flag */ dockerfileRelative: string; /** Whether .dockerignore exists */ hasDockerignore: boolean; }; /** Security analysis results */ securityAnalysis: { /** Structured warnings */ warnings: SecurityWarning[]; /** Overall risk assessment */ riskLevel: 'low' | 'medium' | 'high'; /** Actionable recommendations */ recommendations: string[]; }; /** Computed build configuration */ buildConfig: { /** Final tags to apply (computed from imageName + tags) */ finalTags: string[]; /** Merged build arguments (defaults + user provided) */ buildArgs: Record; /** Target platform */ platform: string; }; /** BuildKit feature analysis */ buildKitAnalysis: { /** Detected features */ features: BuildKitFeatures; /** Whether BuildKit is recommended */ recommended: boolean; /** Optimization recommendations */ recommendations: string[]; }; /** Dockerfile content analysis */ dockerfileAnalysis: { /** Base images used */ baseImages: string[]; /** Exposed ports */ exposedPorts: number[]; /** Final USER directive (if any) */ finalUser?: string; /** Has HEALTHCHECK */ hasHealthcheck: boolean; /** Estimated layer count */ layerCount: number; }; /** Agent execution instructions */ nextAction: { action: 'execute-build'; /** Pre-execution checklist */ preChecks: string[]; /** Primary build command */ buildCommand: BuildCommand; /** Alternative command if primary fails */ fallbackCommand?: BuildCommand; /** Post-build suggestions */ postBuildSteps: string[]; }; } //# sourceMappingURL=schema.d.ts.map