@autobe/agent
Version:
AI backend server code generator
23 lines (22 loc) • 1.16 kB
TypeScript
import { AutoBePhase } from "@autobe/interface";
import { AutoBeState } from "../context/AutoBeState";
/**
* Validates pipeline state before executing a phase, returning user-friendly
* error message if prerequisites are missing or outdated.
*
* Enforces the waterfall dependency structure: each phase requires all previous
* phases to be completed with matching step counters. When requirements change
* (analyze step increments), downstream phases become invalid through step
* mismatch, and this function generates clear messages guiding users to
* regenerate affected phases.
*
* This is the gatekeeper preventing users from executing phases out of order or
* with stale dependencies, ensuring generated artifacts always reflect current
* requirements. Without this validation, users could generate API
* implementations based on outdated database schemas, causing subtle bugs.
*
* @param state Current pipeline state
* @param future Phase attempting to execute
* @returns Error message if validation fails, null if valid to proceed
*/
export declare const predicateStateMessage: (state: AutoBeState, future: AutoBePhase) => string | null;