How should an AI-powered Next.js API route validate execution options and command output contracts?