@autobe/agent
Version:
AI backend server code generator
27 lines (26 loc) • 1.82 kB
TypeScript
import { AutoBeOpenApi, AutoBeRealizeAuthorization, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
import { ILlmSchema } from "@samchon/openapi";
import { AutoBeContext } from "../../context/AutoBeContext";
import { RealizePlannerOutput } from "./orchestrateRealizePlanner";
import { IAutoBeRealizeCoderApplication } from "./structures/IAutoBeRealizeCoderApplication";
import { IAutoBeRealizeCompile } from "./structures/IAutoBeRealizeCompile";
import { FAILED } from "./structures/IAutoBeRealizeFailedSymbol";
/**
* Generates a TypeScript function implementation based on the given plan.
*
* This function transforms the plan (function name, input/output schema,
* constraints, and scenarios) into a complete TypeScript function as a string.
* It is responsible only for producing the code logic, and does not handle
* imports, exports, or formatting.
*
* Import statements are handled separately and will be injected automatically.
* Any unused imports will be removed by tooling (e.g. eslint).
*
* Type annotations should be omitted whenever possible to favor TypeScript's
* type inference, unless explicit types are critical to correctness.
*
* @param ctx - AutoBE execution context
* @param props - Planning result describing what function to generate
* @returns The generated function name and TypeScript code
*/
export declare const orchestrateRealizeCoder: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation, previousCodes: IAutoBeRealizeCompile.Success[], props: RealizePlannerOutput, previous: string | null, total: IAutoBeTypeScriptCompileResult.IDiagnostic[], diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[], authorization?: AutoBeRealizeAuthorization) => Promise<IAutoBeRealizeCoderApplication.RealizeCoderOutput | FAILED>;