"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformInterfaceAssetHistories = void 0;
const utils_1 = require("@autobe/utils");
const uuid_1 = require("uuid");
const transformInterfaceAssetHistories = (state) => {
    const analyze = state.analyze;
    const prisma = state.prisma;
    return [
        {
            id: (0, uuid_1.v7)(),
            created_at: new Date().toISOString(),
            type: "assistantMessage",
            text: utils_1.StringUtil.trim `
        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

        ${analyze.instruction}

        ## Requirement Analysis Report

        \`\`\`json
        ${JSON.stringify(analyze.files)}
        \`\`\`
      `,
        },
        {
            id: (0, uuid_1.v7)(),
            created_at: new Date().toISOString(),
            type: "assistantMessage",
            text: utils_1.StringUtil.trim `
        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)}
        \`\`\`
      `,
        },
    ];
};
exports.transformInterfaceAssetHistories = transformInterfaceAssetHistories;
//# sourceMappingURL=transformInterfaceAssetHistories.js.map