@autobe/agent
Version:
AI backend server code generator
65 lines • 2.81 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformInterfaceAssetHistories = void 0;
const uuid_1 = require("uuid");
const transformInterfaceAssetHistories = (state) => {
const analyze = state.analyze;
const prisma = state.prisma;
return [
{
id: (0, uuid_1.v4)(),
created_at: new Date().toISOString(),
type: "assistantMessage",
text: [
"Requirement analysis and Prisma DB schema generation are ready.",
"",
"Call the provided tool function to generate the OpenAPI document",
"referencing below requirement analysis and Prisma DB schema.",
"",
// User Request
`## User Request`,
"",
analyze.reason,
"",
// Requirement Analysis Report
`## Requirement Analysis Report`,
"",
"```json",
JSON.stringify(analyze.files),
"```",
].join("\n"),
},
{
id: (0, uuid_1.v4)(),
created_at: new Date().toISOString(),
type: "assistantMessage",
text: [
"Database schema and entity relationship diagrams are ready.",
"You should also look at this and consider logic including membership/login and token issuance.",
"You can use table's name to define role in operations.",
"",
"## Critical Schema Verification Instructions",
"",
"**IMPORTANT**: When generating API operations and descriptions:",
"1. ONLY reference fields that ACTUALLY EXIST in the Prisma schema below",
"2. NEVER assume common fields like `deleted_at`, `created_by`, `updated_by`, `is_deleted` exist",
"3. For DELETE operations:",
" - If schema HAS soft delete fields (e.g., `deleted_at`), describe soft delete behavior",
" - If schema LACKS soft delete fields, describe hard delete behavior",
"4. Verify EVERY field reference against the actual schema before including in descriptions",
"",
"## Prisma DB Schema",
"```json",
JSON.stringify(prisma.schemas),
"```",
"",
"## Entity Relationship Diagrams",
"```json",
JSON.stringify(prisma.compiled.diagrams),
"```",
].join("\n"),
},
];
};
exports.transformInterfaceAssetHistories = transformInterfaceAssetHistories;
//# sourceMappingURL=transformInterfaceAssetHistories.js.map