/** * Validation Module for AI Agent Input * * Provides structured validation with error codes that AI agents can parse * and use to fix their output. * * @module validation */ import { ManifestJSON } from '../json/types'; /** * Validation error with structured information for AI parsing */ export interface ValidationError { /** Error code for programmatic handling */ code: string; /** JSON path to the error location */ path: string; /** Human-readable error message */ message: string; /** Suggestion for how to fix the error */ suggestion?: string; } /** * Validation result */ export interface ValidationResult { /** Whether the manifest is valid */ valid: boolean; /** Validation errors (blocking) */ errors: ValidationError[]; /** Validation warnings (non-blocking) */ warnings: ValidationError[]; } export declare const ValidationCodes: { readonly INVALID_ENTITY_NAME: "INVALID_ENTITY_NAME"; readonly DUPLICATE_ENTITY: "DUPLICATE_ENTITY"; readonly MISSING_ENTITY_FIELDS: "MISSING_ENTITY_FIELDS"; readonly INVALID_FIELD_TYPE: "INVALID_FIELD_TYPE"; readonly INVALID_FIELD_NAME: "INVALID_FIELD_NAME"; readonly RELATION_TARGET_NOT_FOUND: "RELATION_TARGET_NOT_FOUND"; readonly INVALID_RELATION_TYPE: "INVALID_RELATION_TYPE"; readonly DATABASE_REQUIRED: "DATABASE_REQUIRED"; readonly INVALID_DATABASE_TYPE: "INVALID_DATABASE_TYPE"; readonly SQLITE_REQUIRES_FILE: "SQLITE_REQUIRES_FILE"; readonly POSTGRES_REQUIRES_URL: "POSTGRES_REQUIRES_URL"; readonly AUTH_REQUIRED_FOR_PROTECTED: "AUTH_REQUIRED_FOR_PROTECTED"; readonly INVALID_PROVIDER: "INVALID_PROVIDER"; readonly INVALID_MODE: "INVALID_MODE"; readonly INVALID_PROTECTED_VALUE: "INVALID_PROTECTED_VALUE"; readonly EXTERNAL_SOURCE_INVALID: "EXTERNAL_SOURCE_INVALID"; }; /** * Validate a JSON manifest * * @param manifest - JSON manifest to validate * @returns Validation result with errors and warnings * * @example * ```typescript * const result = validateManifest({ * entities: [{ name: 'User', fields: { email: { type: 'text' } } }], * database: { type: 'sqlite', file: './app.db' } * }) * * if (!result.valid) { * console.log('Errors:', result.errors) * } * ``` */ export declare function validateManifest(manifest: ManifestJSON): ValidationResult; //# sourceMappingURL=index.d.ts.map