/** * Manifest Validation for DomainLang. * * Provides schema validation and issue detection for model.yaml files. * This validation is triggered by the workspace manager when manifests are loaded. * * Validation includes: * - Required fields for publishable packages * - Dependency configuration correctness * - Path alias validation * - Version format validation * * @module */ import type { ModelManifest } from '../services/types.js'; /** * Severity levels for manifest diagnostics. */ export type ManifestSeverity = 'error' | 'warning' | 'info'; /** * A diagnostic issue found in model.yaml. */ export interface ManifestDiagnostic { /** Issue code for code action mapping */ readonly code: string; /** Error severity */ readonly severity: ManifestSeverity; /** Human-readable message */ readonly message: string; /** YAML path to the issue (e.g., "dependencies.core.version") */ readonly path: string; /** Optional hint for resolution */ readonly hint?: string; } /** * Result of manifest validation. */ export interface ManifestValidationResult { /** Whether the manifest is valid (no errors) */ readonly valid: boolean; /** All diagnostics found */ readonly diagnostics: ManifestDiagnostic[]; /** Count of errors only */ readonly errorCount: number; /** Count of warnings only */ readonly warningCount: number; } /** * Issue codes specific to manifest validation. * These extend the general IssueCodes for manifest-specific issues. */ export declare const ManifestIssueCodes: { readonly ModelMissingName: "manifest-model-missing-name"; readonly ModelMissingVersion: "manifest-model-missing-version"; readonly ModelInvalidVersion: "manifest-model-invalid-version"; readonly DependencyMissingRef: "manifest-dependency-missing-ref"; readonly DependencyInvalidRef: "manifest-dependency-invalid-ref"; readonly DependencyConflictingSourcePath: "manifest-dependency-conflicting-source-path"; readonly DependencyMissingSourceOrPath: "manifest-dependency-missing-source-or-path"; readonly DependencyInvalidSource: "manifest-dependency-invalid-source"; readonly DependencyAbsolutePath: "manifest-dependency-absolute-path"; readonly PathAliasMissingAtPrefix: "manifest-path-alias-missing-at-prefix"; readonly PathAliasAbsolutePath: "manifest-path-alias-absolute-path"; }; /** * Validates model.yaml manifests and reports issues. * * Usage: * ```typescript * const validator = new ManifestValidator(); * const result = validator.validate(manifest); * if (!result.valid) { * console.log(result.diagnostics); * } * ``` */ export declare class ManifestValidator { /** * Validates a parsed model.yaml manifest. * * @param manifest - The parsed manifest object * @param options - Optional validation options * @returns Validation result with diagnostics */ validate(manifest: ModelManifest, options?: { requirePublishable?: boolean; }): ManifestValidationResult; /** * Validates the model section of the manifest. */ private validateModelSection; /** * Validates the dependencies section of the manifest. */ private validateDependenciesSection; /** * Validates a single dependency entry. */ private validateDependency; /** * Validates a git-source based dependency. */ private validateSourceDependency; /** * Validates a path-based local dependency. */ private validatePathDependency; /** * Validates the paths section of the manifest. */ private validatePathsSection; /** * Normalizes a dependency to extended form. */ private normalizeDependency; /** * Checks if a version string is valid SemVer. */ private isValidSemVer; /** * Checks if a ref spec is valid (tag, branch, or commit SHA). */ private isValidRefSpec; /** * Checks if source is valid owner/repo format. */ private isValidSourceFormat; /** * Checks if a path is absolute. */ private isAbsolutePath; } /** * Validates a manifest and returns true if valid, false otherwise. * Use this for simple pass/fail checks. */ export declare function isManifestValid(manifest: ModelManifest): boolean; /** * Validates a manifest and returns all diagnostics. * Use this to display validation errors to users. */ export declare function validateManifest(manifest: ModelManifest, options?: { requirePublishable?: boolean; }): ManifestDiagnostic[];