/** * LLM Result Formatters for VS Code Extension Integration * * Converts SDK result types into formatted strings optimized for * LLM consumption in VS Code's LanguageModelToolResult. * * Design principles: * - Structured but readable output * - Include actionable next steps * - Highlight key information * - Keep within reasonable token limits * * @example * ```typescript * import { resultFormatters } from 'containerization-assist-mcp/sdk'; * * const result = await analyzeRepo({ repositoryPath: '.' }); * if (result.ok) { * const formatted = resultFormatters.analyzeRepo(result.value); * // Use formatted string in LanguageModelToolResult * } * ``` */ import type { RepositoryAnalysis, DockerfilePlan, DockerfileFixPlan, BuildImageResult, ScanImageResult, TagImageResult, PushImageResult, ManifestPlan, ClusterPlan, VerifyDeploymentResult, OpsResult } from './types.js'; /** * Options for result formatting. */ export interface FormatterOptions { /** Include suggested next tool in output (default: true) */ includeSuggestedNext?: boolean; /** Maximum length for truncated fields (default: 1000) */ maxFieldLength?: number; /** Format as JSON instead of prose (default: false) */ asJson?: boolean; } /** * Format analyze-repo result for LLM consumption. */ export declare const formatAnalyzeRepoResult: (result: RepositoryAnalysis, options?: FormatterOptions) => string; /** * Format generate-dockerfile result for LLM consumption. */ export declare const formatGenerateDockerfileResult: (result: DockerfilePlan, options?: FormatterOptions) => string; /** * Format fix-dockerfile result for LLM consumption. */ export declare const formatFixDockerfileResult: (result: DockerfileFixPlan, options?: FormatterOptions) => string; /** * Format build-image result for LLM consumption. */ export declare const formatBuildImageResult: (result: BuildImageResult, options?: FormatterOptions) => string; /** * Format scan-image result for LLM consumption. */ export declare const formatScanImageResult: (result: ScanImageResult, options?: FormatterOptions) => string; /** * Format tag-image result for LLM consumption. */ export declare const formatTagImageResult: (result: TagImageResult, options?: FormatterOptions) => string; /** * Format push-image result for LLM consumption. */ export declare const formatPushImageResult: (result: PushImageResult, options?: FormatterOptions) => string; /** * Format generate-k8s-manifests result for LLM consumption. */ export declare const formatGenerateK8sManifestsResult: (result: ManifestPlan, options?: FormatterOptions) => string; /** * Format prepare-cluster result for LLM consumption. */ export declare const formatPrepareClusterResult: (result: ClusterPlan, options?: FormatterOptions) => string; /** * Format verify-deploy result for LLM consumption. */ export declare const formatVerifyDeployResult: (result: VerifyDeploymentResult, options?: FormatterOptions) => string; /** * Format ops result for LLM consumption. */ export declare const formatOpsResult: (result: OpsResult, options?: FormatterOptions) => string; /** * Type for a formatter function. */ type FormatterFunction = (result: T, options?: FormatterOptions) => string; /** * Registry of all available formatters with their expected result types. * * This interface ensures type safety when adding or modifying formatters. * TypeScript will error if a formatter is missing or has the wrong signature. */ interface FormatterRegistry { analyzeRepo: FormatterFunction; generateDockerfile: FormatterFunction; fixDockerfile: FormatterFunction; buildImageContext: FormatterFunction; scanImage: FormatterFunction; tagImage: FormatterFunction; pushImage: FormatterFunction; generateK8sManifests: FormatterFunction; prepareCluster: FormatterFunction; verifyDeploy: FormatterFunction; ops: FormatterFunction; } /** * All result formatters indexed by tool name. * * Uses `satisfies` to ensure type safety: * - TypeScript will error if a formatter is missing * - TypeScript will error if a formatter has the wrong signature * - TypeScript will error if a key is misspelled * * @example * ```typescript * import { resultFormatters } from 'containerization-assist-mcp/sdk'; * * const result = await analyzeRepo({ repositoryPath: '.' }); * if (result.ok) { * const formatted = resultFormatters.analyzeRepo(result.value); * } * ``` */ export declare const resultFormatters: { readonly analyzeRepo: (result: RepositoryAnalysis, options?: FormatterOptions) => string; readonly generateDockerfile: (result: DockerfilePlan, options?: FormatterOptions) => string; readonly fixDockerfile: (result: DockerfileFixPlan, options?: FormatterOptions) => string; readonly buildImageContext: (result: BuildImageResult, options?: FormatterOptions) => string; readonly scanImage: (result: ScanImageResult, options?: FormatterOptions) => string; readonly tagImage: (result: TagImageResult, options?: FormatterOptions) => string; readonly pushImage: (result: PushImageResult, options?: FormatterOptions) => string; readonly generateK8sManifests: (result: ManifestPlan, options?: FormatterOptions) => string; readonly prepareCluster: (result: ClusterPlan, options?: FormatterOptions) => string; readonly verifyDeploy: (result: VerifyDeploymentResult, options?: FormatterOptions) => string; readonly ops: (result: OpsResult, options?: FormatterOptions) => string; }; /** * Type for resultFormatters object keys. */ export type FormatterName = keyof typeof resultFormatters; /** * Export the registry type for consumers who need to extend or type-check formatters. */ export type { FormatterRegistry }; //# sourceMappingURL=formatters.d.ts.map