/**
 * cli:scaffold-controller — validate.ts
 */
import { ScaffoldControllerInputSchema, type ScaffoldControllerInput, type ValidationResult } from './types.js'

export function validateStructure(raw: unknown): ValidationResult {
  const result = ScaffoldControllerInputSchema.safeParse(raw)
  if (result.success) return { valid: true, errors: [], warnings: [] }
  return { valid: false, errors: result.error.issues.map(i => `[${i.path.join('.')}] ${i.message}`), warnings: [] }
}

export function validate(raw: unknown): ValidationResult {
  return validateStructure(raw)
}
