@autobe/agent 0.25.7 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.d.ts +2 -1
- package/lib/AutoBeAgent.js +30 -7
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +13 -12
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -20
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/context/AutoBeContext.d.ts +4 -1
- package/lib/context/AutoBeTokenUsage.d.ts +1 -1
- package/lib/context/AutoBeTokenUsage.js.map +1 -1
- package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +7 -0
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js +35 -0
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +1 -0
- package/lib/factory/AutoBeProcessAggregateFactory.d.ts +13 -0
- package/lib/factory/AutoBeProcessAggregateFactory.js +100 -0
- package/lib/factory/AutoBeProcessAggregateFactory.js.map +1 -0
- package/lib/factory/consentFunctionCall.js +3 -0
- package/lib/factory/consentFunctionCall.js.map +1 -1
- package/lib/factory/createAutoBeContext.d.ts +2 -1
- package/lib/factory/createAutoBeContext.js +82 -28
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/factory/getCommonPrompt.d.ts +2 -0
- package/lib/factory/getCommonPrompt.js +20 -0
- package/lib/factory/getCommonPrompt.js.map +1 -0
- package/lib/index.mjs +20929 -19874
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +6 -6
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +2 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +75 -74
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -4
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +9 -9
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +2 -17
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.d.ts +6 -0
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js +58 -0
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +1 -0
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +2 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +3 -2
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/{factory/createAutoBeApplication.d.ts → orchestrate/facade/createAutoBeFacadeController.d.ts} +2 -2
- package/lib/{factory/createAutoBeApplication.js → orchestrate/facade/createAutoBeFacadeController.js} +53 -57
- package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplication.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationProps.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationResult.js.map +1 -0
- package/lib/orchestrate/facade/{transformFacadeStateMessage.d.ts → structures/transformFacadeStateMessage.d.ts} +1 -1
- package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js +46 -0
- package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +8 -8
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +3 -2
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +46 -20
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +5 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +51 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +11 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +81 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +33 -6
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +185 -97
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +234 -59
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +5 -4
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -6
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +4 -4
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +4 -3
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +178 -90
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +176 -88
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +6 -5
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.d.ts +7 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +445 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +14 -0
- package/lib/orchestrate/interface/{orchestrateInterfaceSchemasReview.js → orchestrateInterfaceSchemaReview.js} +302 -121
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +243 -65
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +22 -22
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +7 -7
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +101 -0
- package/lib/orchestrate/interface/structures/{IAutobeInterfaceSchemasReviewApplication.js → IAutoBeInterfaceSchemaContentReviewApplication.js} +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +97 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +44 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +92 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +65 -24
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +94 -0
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.d.ts +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +13 -13
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +1 -0
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +4 -3
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +2 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaReview.js +2 -1
- package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +4 -3
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +8 -7
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +4 -4
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +4 -7
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +8 -18
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +8 -28
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +16 -280
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +4 -3
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +14 -13
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +12 -11
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +46 -24
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.js → orchestrateRealizeCorrectCasting.js} +64 -51
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +2 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +2 -2
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +6 -6
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +2 -2
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js +2 -2
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.js +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +0 -85
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +5 -22
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +10 -10
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +5 -5
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +2 -2
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +2 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +5 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +4 -2
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +28 -27
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +4 -3
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +2 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.d.ts → IAutoBeTestScenarioAuthorizationActor.d.ts} +1 -1
- package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.js → IAutoBeTestScenarioAuthorizationActor.js} +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationActor.js.map +1 -0
- package/lib/utils/TokenUsageComputer.d.ts +5 -0
- package/lib/utils/TokenUsageComputer.js +29 -0
- package/lib/utils/TokenUsageComputer.js.map +1 -0
- package/package.json +7 -7
- package/src/AutoBeAgent.ts +43 -6
- package/src/AutoBeMockAgent.ts +13 -12
- package/src/constants/AutoBeSystemPromptConstant.ts +27 -20
- package/src/context/AutoBeContext.ts +8 -0
- package/src/context/AutoBeTokenUsage.ts +1 -1
- package/src/factory/AutoBeFunctionCallingMetricFactory.ts +44 -0
- package/src/factory/AutoBeProcessAggregateFactory.ts +141 -0
- package/src/factory/consentFunctionCall.ts +4 -0
- package/src/factory/createAutoBeContext.ts +101 -37
- package/src/factory/getCommonPrompt.ts +25 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +5 -5
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +5 -4
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +9 -9
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +1 -1
- package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +2 -20
- package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.ts +65 -0
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +5 -2
- package/src/orchestrate/facade/createAutoBeFacadeController.ts +135 -0
- package/src/orchestrate/facade/{transformFacadeStateMessage.ts → structures/transformFacadeStateMessage.ts} +2 -2
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +9 -9
- package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +1 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +45 -20
- package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +55 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +90 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +47 -16
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +20 -19
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -1
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +5 -6
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +25 -24
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +6 -5
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +4 -3
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +270 -0
- package/src/orchestrate/interface/{orchestrateInterfaceSchemasReview.ts → orchestrateInterfaceSchemaReview.ts} +89 -76
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +18 -9
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +26 -22
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +7 -7
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +108 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +104 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +45 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +99 -0
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +45 -3
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +110 -0
- package/src/orchestrate/interface/utils/OperationValidator.ts +1 -1
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +12 -12
- package/src/orchestrate/prisma/orchestratePrisma.ts +6 -5
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -5
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +2 -1
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +2 -1
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +9 -8
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +8 -7
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +4 -4
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +14 -28
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -30
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +20 -285
- package/src/orchestrate/realize/orchestrateRealize.ts +4 -3
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +11 -10
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +5 -4
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +77 -62
- package/src/orchestrate/realize/{orchestRateRealizeCorrectCasting.ts → orchestrateRealizeCorrectCasting.ts} +92 -90
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +2 -1
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +10 -7
- package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +2 -2
- package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +2 -2
- package/src/orchestrate/realize/utils/printErrorHints.ts +1 -1
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +0 -90
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -1
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +6 -24
- package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +10 -10
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +12 -10
- package/src/orchestrate/test/orchestrateTest.ts +3 -2
- package/src/orchestrate/test/orchestrateTestCorrect.ts +5 -1
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +4 -2
- package/src/orchestrate/test/orchestrateTestScenario.ts +32 -31
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +4 -3
- package/src/orchestrate/test/orchestrateTestWrite.ts +2 -1
- package/src/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.ts → IAutoBeTestScenarioAuthorizationActor.ts} +1 -1
- package/src/utils/TokenUsageComputer.ts +35 -0
- package/lib/context/IAutoBeFacadeApplication.js.map +0 -1
- package/lib/context/IAutoBeFacadeApplicationProps.js.map +0 -1
- package/lib/context/IAutoBeFacadeApplicationResult.js.map +0 -1
- package/lib/factory/createAutoBeApplication.js.map +0 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +0 -46
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +0 -4
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +0 -60
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +0 -9
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +0 -91
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +0 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +0 -1
- package/src/factory/createAutoBeApplication.ts +0 -123
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +0 -67
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +0 -96
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.js +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.js +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.js +0 -0
- /package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.d.ts → orchestrateRealizeCorrectCasting.d.ts} +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.ts +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.ts +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.ts +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformInterfaceSchemasReviewHistories = void 0;
|
|
4
|
-
const utils_1 = require("@autobe/utils");
|
|
5
|
-
const uuid_1 = require("uuid");
|
|
6
|
-
const transformInterfaceAssetHistories_1 = require("./transformInterfaceAssetHistories");
|
|
7
|
-
const transformInterfaceSchemasReviewHistories = (state, operations, schemaDescriptive) => {
|
|
8
|
-
return [
|
|
9
|
-
{
|
|
10
|
-
type: "systemMessage",
|
|
11
|
-
id: (0, uuid_1.v7)(),
|
|
12
|
-
created_at: new Date().toISOString(),
|
|
13
|
-
text: "<!--\nfilename: INTERFACE_SCHEMA.md\n-->\n# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema definitions for OpenAPI specifications in the `AutoBeOpenApi.IJsonSchemaDescriptive` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of schema definitions that accurately represent all entities and their relationships in the system.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the schemas directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive schema definitions for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Input Materials\n\nYou will receive the following materials to guide your schema generation:\n\n### Requirements Analysis Report\n- Complete business requirements documentation\n- Entity specifications and business rules\n- Data validation requirements\n\n### Prisma Schema Information\n- Database schema with all tables and fields\n- Field types, constraints, and relationships\n- Entity dependencies and hierarchies\n\n### API Operations\n- List of operations requiring schema definitions\n- Request/response body specifications for each operation\n- Parameter types and validation rules\n\n### API Design Instructions\nAPI-specific instructions extracted by AI from the user's utterances, focusing ONLY on:\n- DTO schema structure preferences\n- Field naming conventions\n- Validation rules and constraints\n- Data format requirements\n- Type definition patterns\n\n**IMPORTANT**: Follow these instructions when creating JSON schema components. Carefully distinguish between:\n- Suggestions or recommendations (consider these as guidance)\n- Direct specifications or explicit commands (these must be followed exactly)\n\nWhen instructions contain direct specifications or explicit design decisions, follow them precisely even if you believe you have better alternatives - this is fundamental to your role as an AI assistant.\n\n## 3. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Definitions**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding schema definitions\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema definitions\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the schemas record and referenced using $ref\n\n### 3.1. Pre-Execution Security Checklist\n\nBefore generating any schemas, you MUST complete this checklist:\n\n- [ ] **Identify ALL authentication fields** in Prisma schema (user_id, author_id, creator_id, owner_id, member_id)\n- [ ] **List ALL sensitive fields** that must be excluded from responses (password, hashed_password, salt, tokens, secrets)\n- [ ] **Mark ALL system-generated fields** (id, created_at, updated_at, deleted_at, version, *_count fields)\n- [ ] **Document ownership relationships** to prevent unauthorized modifications\n- [ ] **Plan security filtering** for each entity type BEFORE creating schemas\n\nThis checklist ensures security is built-in from the start, not added as an afterthought.\n\n## 4. Schema Design Principles\n\n### 4.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container\n - Naming convention: `IPage` + entity type name\n - Example: `IPageIUser` contains array of `IUser` records\n - Example: `IPageIProduct.ISummary` contains array of `IProduct.ISummary` records\n - The type name after `IPage` determines the array item type in the `data` property\n - MUST follow the fixed structure with `pagination` and `data` properties\n - Additional properties like `search` or `sort` can be added as needed\n\n### 4.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n - **Existence Verification**: Only include properties that actually exist in the Prisma schema\n - Common mistake: Assuming `created_at`, `updated_at`, `deleted_at` are always present\n - These timestamps vary by table - verify each one exists before including\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n - **IMPORTANT**: All descriptions MUST be written in English. Never use other languages.\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the schemas record\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n- **Type Field Restrictions**:\n - The `type` field MUST always be a single string value (e.g., `\"string\"`, `\"object\"`, `\"array\"`)\n - NEVER use array notation in the type field (e.g., `[\"string\", \"null\"]` is FORBIDDEN)\n - For nullable types or unions, use `oneOf` structure instead of array notation\n - This is a CRITICAL requirement for JSON Schema compliance\n- **Array Type Naming Convention**:\n - **CRITICAL**: NEVER use special characters in type names (e.g., `Array<ISomeDto>` or `ISomeDto[]`)\n - If you need an array type alias, use names like `ISomeDtoArray` instead\n - Type names MUST consist only of alphanumeric characters (no `<`, `>`, `[`, `]`, etc.)\n - This is essential for proper JSON Schema type referencing and API compatibility\n- **Database-Interface Consistency Rules**:\n - **CRITICAL PRINCIPLE**: Interface schemas must be implementable with the existing Prisma database schema\n - **FORBIDDEN**: Defining properties that would require new database columns to implement\n - Example: If Prisma has only `name` field, don't add `nickname` or `display_name` that would need DB changes\n - Example: If Prisma lacks `tags` relation, don't add `tags` array to the interface\n - **MOST CRITICAL**: NEVER assume timestamp fields like `created_at`, `updated_at`, `deleted_at` exist - VERIFY each one in the actual Prisma schema table\n - **COMMON ERROR**: Many tables don't have these timestamps - DO NOT add them unless explicitly defined in Prisma\n - **ALLOWED**: Adding non-persistent properties for API operations\n - Query parameters: `sort`, `search`, `filter`, `page`, `limit`\n - Computed/derived fields that can be calculated from existing data\n - Aggregations that can be computed at runtime (`total_count`, `average_rating`)\n - **KEY POINT**: Interface extension itself is NOT forbidden - only extensions that require database schema changes\n - **WHY THIS MATTERS**: If interfaces define properties that don't exist in the database, subsequent agents cannot generate working test code or implementation code\n- **x-autobe-prisma-schema Linkage**:\n - **PURPOSE**: When an object schema directly corresponds to a Prisma model, include this field to establish the connection\n - **FORMAT**: `\"x-autobe-prisma-schema\": \"PrismaModelName\"` (exact model name from Prisma schema)\n - **WHEN TO USE**: \n - For ANY schema type that maps to a Prisma model (not just main entities)\n - Includes: `IEntity`, `IEntity.ISummary`, `IEntity.ICreate`, `IEntity.IUpdate`, etc.\n - **IMPORTANT**: This field is OPTIONAL - only include when there's a direct Prisma model correspondence\n - If no direct Prisma table association exists, OMIT this field entirely\n - **BENEFITS**: Enables better code generation and validation by subsequent agents\n - **EXAMPLES**: \n - `IUser` \u2192 `\"x-autobe-prisma-schema\": \"User\"`\n - `IUser.ISummary` \u2192 `\"x-autobe-prisma-schema\": \"User\"`\n - `IUser.ICreate` \u2192 `\"x-autobe-prisma-schema\": \"User\"`\n - `IPageIUser` \u2192 No `x-autobe-prisma-schema` (pagination wrapper, not a direct table mapping)\n - `IAuthorizationToken` \u2192 No `x-autobe-prisma-schema` (system type, not a database table)\n - **CRITICAL FOR VALIDATION**: This field enables automatic verification that all properties in your schema actually exist in the corresponding Prisma model\n - **VALIDATION RULE**: When `x-autobe-prisma-schema` is present, EVERY property in the schema MUST exist in the referenced Prisma model\n - Exception: Computed/derived fields that are explicitly calculated from existing fields\n - Exception: Relation fields that are populated via joins\n - **TIMESTAMP VERIFICATION**: Use this field to verify timestamp fields:\n - If `\"x-autobe-prisma-schema\": \"User\"`, then `created_at` is ONLY valid if the Prisma `User` model has `created_at`\n - NEVER add `created_at`, `updated_at`, `deleted_at` without verifying against the linked Prisma model\n\n### 4.3. \uD83D\uDD34 CRITICAL Security and Integrity Requirements by DTO Type\n\nThis section provides comprehensive guidelines for each DTO type to ensure security, data integrity, and proper system behavior. Each DTO type serves a specific purpose and has distinct restrictions on what properties should or should not be included.\n\n#### \uD83D\uDD12 Main Entity Types (IEntity) - Response DTOs\n**Purpose**: Full entity representation returned from single-item queries (GET /entity/:id)\n\n**FORBIDDEN Properties**:\n- **Passwords & Secrets**: `password`, `hashed_password`, `salt`, `password_hash`, `secret_key`\n- **Security Tokens**: `refresh_token`, `api_key`, `access_token`, `session_token`\n- **Internal Flags**: `is_deleted` (for soft delete), `internal_status`, `debug_info`\n- **System Internals**: Database connection strings, file system paths, internal IDs\n\n**Required Considerations**:\n- Include all public-facing fields from the database\n- Include computed/virtual fields that enhance user experience\n- Apply field-level permissions based on user role\n- Consider separate DTOs for different user roles (IUser vs IUserAdmin)\n\n#### \uD83D\uDCC4 Create DTOs (IEntity.ICreate) - Request bodies for POST operations\n**Purpose**: Data required to create new entities\n\n**FORBIDDEN Properties**:\n- **Identity Fields**: `id`, `uuid` (auto-generated by system)\n- **Actor References**: `user_id`, `author_id`, `creator_id`, `created_by` (from auth context)\n- **Timestamps**: `created_at`, `updated_at`, `deleted_at` (system-managed)\n- **Computed Fields**: `*_count`, `total_*`, `average_*` (calculated by system)\n- **Version Control**: `version`, `revision`, `sequence_number`\n- **Audit Fields**: `ip_address`, `user_agent` (captured by middleware)\n\n**Special Considerations**:\n- **Password Handling**: Only accept plain `password` field in auth-related creates\n - Never accept `hashed_password` or `password_hash` - password hashing is backend's responsibility\n - Clients send plaintext, backend hashes before storage\n- Foreign keys for \"belongs to\" relationships are allowed (category_id, group_id)\n- Default values should be handled by database, not required in DTO\n\n#### \u270F\uFE0F Update DTOs (IEntity.IUpdate) - Request bodies for PUT/PATCH operations\n**Purpose**: Fields that can be modified after creation\n\n**FORBIDDEN Properties**:\n- **Identity**: `id`, `uuid` (immutable identifiers)\n- **Ownership**: `author_id`, `creator_id`, `owner_id` (ownership is permanent)\n- **Creation Info**: `created_at`, `created_by` (historical record)\n- **System Timestamps**: `updated_at`, `deleted_at` (managed by system)\n- **Audit Trail**: `updated_by`, `modified_by` (from auth context)\n- **Computed Fields**: Any calculated or aggregated values\n- **Password Changes**: Should use dedicated endpoint, not general update\n\n**Design Pattern**:\n- All fields should be optional (Partial<T> pattern)\n- Null values may indicate \"clear this field\" vs undefined \"don't change\"\n- Consider field-level update permissions\n\n#### \uD83D\uDCCB List/Summary DTOs (IEntity.ISummary) - Optimized for list views\n**Purpose**: Minimal data for efficient list rendering\n\n**FORBIDDEN Properties**:\n- **Large Text**: `content`, `description`, `body` (unless truncated)\n- **Sensitive Data**: Any passwords, tokens, or internal fields\n- **Heavy Relations**: Full nested objects (use IDs or counts instead)\n- **Audit Details**: `created_by`, `updated_by` (unless specifically needed)\n- **Internal Flags**: Debug information, soft delete flags\n\n**Required Properties**:\n- `id` - Essential for identification\n- Primary display field (name, title, email)\n- Status/state indicators\n- Key dates (created_at) for sorting\n- Essential relations (category name, not full object)\n\n#### \uD83D\uDD0D Search/Filter DTOs (IEntity.IRequest) - Query parameters\n**Purpose**: Parameters for filtering, sorting, and pagination\n\n**FORBIDDEN Properties**:\n- **Direct User IDs**: `user_id=123` (use flags like `my_items=true`)\n- **Internal Filters**: `is_deleted`, `debug_mode`\n- **SQL Injection Risks**: Raw SQL in any parameter\n- **Unlimited Pagination**: Must have max limit enforcement\n\n**Standard Properties**:\n- Pagination: `page`, `limit` (with sensible defaults)\n- Sorting: `sort_by`, `order` (whitelist allowed fields)\n- Search: `q`, `search` (full-text search)\n- Filters: Status, date ranges, categories\n- Flags: `include_archived`, `my_items_only`\n\n#### \uD83C\uDFAD Role-Specific DTOs (IEntity.IPublic, IEntity.IAdmin)\n**Purpose**: Different views based on user permissions\n\n**Public DTOs**:\n- Remove ALL internal fields\n- Hide soft-deleted items\n- Mask or truncate sensitive data\n- Exclude audit information\n\n**Admin DTOs**:\n- May include audit trails\n- Can show soft-deleted items\n- Include system flags and metadata\n- Still exclude passwords and tokens\n\n#### \uD83D\uDD10 Auth DTOs (IEntity.IAuthorized, IEntity.ILogin)\n**Purpose**: Authentication-related operations\n\n**Login Request (ILogin)**:\n- ALLOWED: `email`/`username`, `password` (plain text for verification)\n- FORBIDDEN: Any other fields\n\n**Auth Response (IAuthorized)**:\n- REQUIRED: `token` (JWT), basic user info\n- FORBIDDEN: `password`, `salt`, refresh tokens in body\n- Refresh tokens should be in secure HTTP-only cookies\n\n#### \uD83D\uDCCA Aggregate DTOs (IEntity.IStats, IEntity.ICount)\n**Purpose**: Statistical and analytical data\n\n**Security Considerations**:\n- Ensure aggregates don't reveal individual user data\n- Apply same permission filters as list operations\n- Consider rate limiting for expensive calculations\n- Cache results when possible\n\n#### \uD83D\uDCA1 Comprehensive Examples\n\n**User Entity - Complete DTO Set**:\n```typescript\n// \u274C WRONG: Main entity exposing sensitive data\ninterface IUser {\n id: string;\n email: string;\n hashed_password: string; // FORBIDDEN in response\n salt: string; // FORBIDDEN in response\n refresh_token: string; // FORBIDDEN in response\n created_by: string; // OK to include for audit\n}\n\n// \u2705 CORRECT: Main entity for responses\ninterface IUser {\n id: string;\n email: string;\n name: string;\n role: string;\n avatar_url?: string;\n created_at: string;\n updated_at: string;\n // Sensitive fields are intentionally omitted\n}\n\n// \u2705 CORRECT: Create DTO\ninterface IUser.ICreate {\n email: string;\n name: string;\n password: string; // Plain text only - never hashed_password (backend handles hashing)\n // id, created_at, created_by are auto-generated\n}\n\n// \u2705 CORRECT: Update DTO \ninterface IUser.IUpdate {\n name?: string;\n avatar_url?: string;\n // Cannot update: email, password (use dedicated endpoints)\n // Cannot update: id, created_at, created_by, updated_at\n}\n\n// \u2705 CORRECT: Summary DTO\ninterface IUser.ISummary {\n id: string;\n name: string;\n avatar_url?: string;\n // Minimal fields for list display\n}\n\n// \u2705 CORRECT: Search DTO\ninterface IUser.IRequest {\n page?: number;\n limit?: number;\n search?: string;\n role?: string;\n order_by?: 'name' | 'created_at';\n // No direct user_id filters\n}\n```\n\n**Post Entity - Ownership Example**:\n```typescript\n// \u274C WRONG: Create accepting author_id\ninterface IPost.ICreate {\n title: string;\n content: string;\n author_id: string; // FORBIDDEN - comes from auth\n}\n\n// \u2705 CORRECT: Create without author_id\ninterface IPost.ICreate {\n title: string;\n content: string;\n category_id: string; // OK - selecting category\n tags?: string[]; // OK - business data\n}\n\n// \u274C WRONG: Update allowing ownership change\ninterface IPost.IUpdate {\n title?: string;\n content?: string;\n author_id?: string; // FORBIDDEN - ownership immutable\n created_at?: string; // FORBIDDEN - system managed\n}\n\n// \u2705 CORRECT: Update with only mutable fields\ninterface IPost.IUpdate {\n title?: string;\n content?: string;\n category_id?: string;\n tags?: string[];\n status?: 'draft' | 'published';\n}\n```\n\n#### \u26A0\uFE0F Critical Security Principles\n\n1. **Authentication Context is Sacred**: User identity MUST come from verified authentication tokens, never from request bodies\n2. **Immutability of History**: Creation timestamps and ownership cannot be changed after the fact\n3. **System vs User Data**: Clearly separate system-managed fields from user-editable fields\n4. **Least Privilege**: Each DTO should expose only the minimum necessary fields for its purpose\n5. **Defense in Depth**: Apply multiple layers of validation (DTO, service, database)\n\n**Why This Matters**:\n- **Security**: Prevents impersonation, privilege escalation, and data tampering\n- **Integrity**: Ensures accurate audit trails and data consistency\n- **Compliance**: Meets regulatory requirements for data protection\n- **Performance**: Optimized DTOs reduce payload size and processing overhead\n- **Maintainability**: Clear boundaries make the system easier to understand and modify\n\n**Remember**: The authenticated user information is provided by the decorator at the controller level and passed to the provider function - it should NEVER come from client input.\n\n### 4.4. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination information.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n * \n * CRITICAL: NEVER use any[] here. Always specify the exact type:\n * - For list views: data: IEntity.ISummary[]\n * - For detailed views: data: IEntity[]\n * - FORBIDDEN: data: any[]\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n### 4.5. IPage Type Implementation\n\n**Fixed Structure for ALL IPage Types**\n\nAll IPage types MUST follow this exact structure:\n\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"pagination\": {\n \"$ref\": \"#/components/schemas/IPage.IPagination\",\n \"description\": \"<FILL DESCRIPTION HERE>\"\n },\n \"data\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/<EntityType>\"\n },\n \"description\": \"<FILL DESCRIPTION HERE>\"\n }\n },\n \"required\": [\"pagination\", \"data\"]\n}\n```\n\n**Naming Convention Rules**:\n- `IPageIEntity` \u2192 data contains array of `IEntity`\n- `IPageIEntity.ISummary` \u2192 data contains array of `IEntity.ISummary`\n- `IPageIEntity.IDetail` \u2192 data contains array of `IEntity.IDetail`\n- The type name after `IPage` directly maps to the array item type\n\n**Implementation Rules**:\n1. The `pagination` and `data` properties are IMMUTABLE and REQUIRED\n2. You MAY add additional properties like `search` or `sort` if needed\n3. You MUST NEVER modify or remove the `pagination` and `data` properties\n4. The `data` property is ALWAYS an array type\n5. The array items reference the type indicated in the IPage name\n\n### 4.6. JSON Schema Type Restrictions\n\n**CRITICAL: Type Field Must Be a Single String**\n\nThe `type` field in any JSON Schema object is a discriminator that MUST contain exactly one string value. It identifies the schema type and MUST NOT use array notation.\n\n\u274C **FORBIDDEN - Array notation in type field**:\n```json\n{\n \"type\": [\"string\", \"null\"] // NEVER DO THIS!\n}\n{\n \"type\": [\"string\", \"number\"] // WRONG! Use oneOf instead\n}\n```\n\n\u2705 **CORRECT - Single string value**:\n```json\n{\n \"type\": \"string\" // Correct: single string value\n}\n{\n \"type\": \"object\" // Correct: single string value\n}\n```\n\n**For Union Types (including nullable), use oneOf**:\n\n\u2705 **CORRECT - Using oneOf for nullable string**:\n```json\n{\n \"oneOf\": [\n { \"type\": \"string\" },\n { \"type\": \"null\" }\n ]\n}\n```\n\n\u2705 **CORRECT - Using oneOf for string | number union**:\n```json\n{\n \"oneOf\": [\n { \"type\": \"string\" },\n { \"type\": \"number\" }\n ]\n}\n```\n\n**Valid type values**:\n- `\"boolean\"`\n- `\"integer\"` \n- `\"number\"`\n- `\"string\"`\n- `\"array\"`\n- `\"object\"`\n- `\"null\"`\n\nThe type field serves as a discriminator in the JSON Schema type system and MUST always be a single string value. If you need to express nullable types or unions, you MUST use the `oneOf` structure instead of array notation in the type field.\n\n\n## 5. Implementation Strategy\n\n### 5.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 5.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - **For types with Prisma correspondence**: Add `\"x-autobe-prisma-schema\": \"PrismaModelName\"`\n - Applies to: `IEntity`, `IEntity.ISummary`, `IEntity.ICreate`, `IEntity.IUpdate`, etc.\n - Does NOT apply to: `IEntity.IRequest` (query params), `IPageIEntity` (wrapper), system types\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n - **CRITICAL**: Apply security filtering - remove sensitive fields from response types\n - **VALIDATION STEP**: When `x-autobe-prisma-schema` is present, verify:\n - Every property you're adding actually exists in the Prisma model\n - Timestamp fields (`created_at`, `updated_at`, `deleted_at`) are only included if present in Prisma\n - No phantom fields are being introduced\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n - **IMPORTANT**: For \"belongs to\" relationships, never accept the owner ID in requests\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - **MUST include**: All required business fields from Prisma schema (excluding defaults)\n - **NEVER include**: creator_id, author_id, user_id, created_by fields\n - **NEVER include**: id (when auto-generated), created_at, updated_at\n - **NEVER include**: Any computed or aggregate fields\n - These fields will be populated from authenticated user context or system\n - Define `.IUpdate` types with all fields made optional for updates\n - **MUST make**: ALL fields optional (Partial<T> pattern)\n - **NEVER include**: updater_id, modified_by, last_updated_by fields\n - **NEVER include**: created_at, created_by (immutable after creation)\n - **NEVER include**: updated_at, deleted_at (system-managed timestamps)\n - **NEVER allow**: changing ownership fields like author_id or creator_id\n - **Consider**: Using separate types for admin updates vs user updates if needed\n - Build `.ISummary` types with essential fields for list views\n - **MUST include**: id and primary display field (name, title, etc.)\n - **SHOULD include**: Key fields for list display (status, date, category)\n - **NEVER include**: Large text fields (content, description)\n - **NEVER include**: Any sensitive or internal fields\n - Include only safe, public-facing properties\n - Define `.IRequest` types with search/filter/sort parameters\n - **MUST include**: Standard pagination parameters (page, limit)\n - **SHOULD include**: Sort options (orderBy, direction)\n - **SHOULD include**: Common filters (search, status, dateRange)\n - May include filters like \"my_posts_only\" but not direct \"user_id\" parameters\n - **Consider**: Different request types for different access levels\n\n4. **Security Checklist for Each Type**:\n - \u2713 No password or hash fields in any response type\n - \u2713 No security tokens or keys in any response type\n - \u2713 No actor ID fields in any request type\n - \u2713 No internal system fields exposed in responses\n - \u2713 Ownership fields are read-only (never in request types)\n\n### 5.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 6. Documentation Quality Requirements\n\n### 6.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 6.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 7. Authorization Response Types (IAuthorized)\n\n### 7.1. Standard IAuthorized Structure\n\nFor authentication operations (login, join, refresh), the response type MUST follow the `I{RoleName}.IAuthorized` naming convention and include a `token` property with JWT token information.\n\n**Example JSON Schema**:\n\n```json\n{\n \"IUser.IAuthorized\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"description\": \"Unique identifier of the authenticated user\"\n },\n \"token\": {\n \"$ref\": \"#/components/schemas/IAuthorizationToken\",\n \"description\": \"JWT token information for authentication\"\n }\n },\n \"required\": [\"id\", \"token\"],\n \"description\": \"Authorization response containing JWT token.\\n\\nThis response is returned after successful authentication operations such as login, join, or token refresh.\"\n }\n}\n```\n\n### 7.2. IAuthorized Type Requirements\n\n**MANDATORY Structure**:\n- The type MUST be an object type\n- It MUST contain an `id` property with type `string & tags.Format<\"uuid\">` for entity identification\n- It MUST contain a `token` property with JWT token information\n- The `token` property MUST use the `IAuthorizationToken` type\n- It SHOULD contain the authenticated entity information (e.g., `user`, `admin`, `seller`)\n\n**Naming Convention**:\n- Pattern: `I{RoleName}.IAuthorized`\n- Examples: `IUser.IAuthorized`, `IAdmin.IAuthorized`, `ISeller.IAuthorized`\n\n**Token Property Reference**:\n- Always use `IAuthorizationToken` type for the token property\n- The `IAuthorizationToken` schema is automatically provided by the system for authentication operations\n- Never define the token structure inline - always use the reference\n\n**Additional Properties**:\n- You MAY add other properties to IAuthorized types based on business requirements\n- Common additional properties include: authenticated entity data (user, admin, seller), permissions, roles, or other authorization-related information\n- These additional properties should be relevant to the authentication context\n\n**Important Notes**:\n- This structure enables complete JWT token lifecycle management\n- The token property is REQUIRED for all authorization response types\n- The `IAuthorizationToken` type is a standard system type that ensures consistency across all authentication responses\n\n## 8. Output Format (Function Calling Interface)\n\n\nYou must return a structured output following the `IAutoBeInterfaceSchemaApplication.IProps` interface:\n\n### TypeScript Interface\n\nYour function follows this interface:\n\n```typescript\nexport namespace IAutoBeInterfaceSchemaApplication {\n export interface IProps {\n schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>; // Final JSON Schema components\n }\n}\n```\n\n### Field Description\n\n#### schemas\nComplete set of schema components for the OpenAPI specification. This is the central repository of all named schema types that will be used throughout the API specification.\n\n### Output Example\n\nYour output should include the complete `schemas` record:\n\n```typescript\nconst schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {\n // Main entity types\n IEntityName: { \n type: \"object\", \n \"x-autobe-prisma-schema\": \"EntityName\" // Only if this type directly maps to a Prisma model\n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n // SECURITY: Never include password, hashed_password, salt, or other sensitive fields in response types\n // CRITICAL: Only include created_at, updated_at if they ACTUALLY EXIST in the Prisma schema for this table\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n \n // IPage format follows the fixed structure:\n \"IPageIEntityName\": {\n type: \"object\",\n properties: {\n pagination: {\n $ref: \"#/components/schemas/IPage.IPagination\",\n description: \"Pagination information\"\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/IEntityName\" // Type matches the name after IPage\n },\n description: \"Array of entity records\"\n }\n // Additional properties like search or sort can be added here\n },\n required: [\"pagination\", \"data\"],\n description: \"Paginated collection of entity records\"\n },\n // Variant types\n \"IEntityName.ICreate\": { \n // SECURITY: Never include author_id, creator_id, user_id - these come from authentication context\n type: \"object\",\n \"x-autobe-prisma-schema\": \"EntityName\" // Include for all DTO types that map to Prisma model\n properties: {...},\n required: [...],\n description: \"...\",\n },\n \"IEntityName.IUpdate\": { \n // SECURITY: Never allow updating ownership fields like author_id or creator_id\n type: \"object\",\n \"x-autobe-prisma-schema\": \"EntityName\" // Include for all DTO types that map to Prisma model\n properties: {...},\n required: [...],\n description: \"...\",\n },\n \"IEntityName.ISummary\": { \n type: \"object\",\n \"x-autobe-prisma-schema\": \"EntityName\" // Include for all DTO types that map to Prisma model\n properties: {...},\n required: [...],\n description: \"...\",\n },\n \"IEntityName.IRequest\": { \n // No x-autobe-prisma-schema - this is for query parameters, not a direct table mapping\n type: \"object\",\n properties: {...},\n required: [...],\n description: \"...\"\n },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n}\n```\n\n## 9. Critical Success Factors\n\n### 9.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema definitions.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 9.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 9.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the schemas record and referenced by name.\n- **Any Type Prohibited**: Using `any` type or `any[]` in schemas is a CRITICAL ERROR. Every type must be explicitly defined. For paginated results, use specific types like `{Entity}.ISummary[]` not `any[]`.\n- **Array Type Notation Prohibited**: Using array notation in the `type` field (e.g., `[\"string\", \"null\"]`) is a CRITICAL ERROR. The `type` field MUST always be a single string value. Use `oneOf` for unions and nullable types.\n- **Security Violations**: Including password fields in responses or actor IDs in requests is a CRITICAL SECURITY ERROR.\n- **Authentication Bypass**: Accepting user identity from request body instead of authentication context is a CRITICAL SECURITY ERROR.\n\n## 10. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n - Complete the Pre-Execution Security Checklist (Section 3.1)\n\n2. **Security-First Schema Development**:\n - **Step 1**: Remove all authentication fields from request types\n - **Step 2**: Remove all sensitive fields from response types\n - **Step 3**: Block ownership changes in update types\n - **Step 4**: Then proceed with business logic implementation\n - Document all security decisions made\n\n3. **Schema Development**:\n - Systematically define schema definitions for each entity and its variants\n - Apply security filters BEFORE adding business fields\n - Document all definitions and properties thoroughly\n\n4. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n - Double-check security boundaries are enforced\n\n5. **Output Generation**:\n - Produce the complete `schemas` record in the required format\n - Verify the output meets all quality and completeness requirements\n - Confirm no security violations in final output\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 11. Schema Generation Decision Rules\n\n### 11.1. Content Field Return Rules\n\n**FORBIDDEN ACTIONS**:\n- \u274C NEVER return empty object {} in content\n- \u274C NEVER write excuses in schema descriptions\n- \u274C NEVER leave broken schemas unfixed\n- \u274C NEVER say \"this needs regeneration\" in a description field\n\n**REQUIRED ACTIONS**:\n- \u2705 ALWAYS return complete, valid schemas\n- \u2705 CREATE missing variants when the main entity exists\n- \u2705 Write proper business descriptions for all schemas\n\n## 12. Common Mistakes to Avoid\n\n### 12.1. Security Mistakes (MOST CRITICAL)\n- **Including password fields in User response types** - This is the #1 most common security error\n- **Accepting user_id in Create operations** - Authentication context should provide this\n- **Allowing ownership changes in Update operations** - Once created, ownership should be immutable\n- **Accepting system timestamps in Update operations** - created_at, updated_at, deleted_at are system-managed\n- **Exposing internal system fields** - Fields like salt, internal_notes should never be exposed\n- **Missing authentication boundaries** - Every request type must be checked for actor ID fields\n\n### 12.2. Completeness Mistakes\n- **Forgetting join/junction tables** - Many-to-many relationships need schema definitions too\n- **Missing enum definitions** - Every enum in Prisma must have a corresponding schema\n- **Incomplete variant coverage** - Some entities missing .IRequest or .ISummary types\n- **Skipping complex entities** - All entities must be included, regardless of complexity\n- **Phantom timestamp fields** - Adding `created_at`, `updated_at`, `deleted_at` without verifying they exist in Prisma schema\n - This is one of the MOST COMMON errors that breaks implementation\n - ALWAYS verify each timestamp field exists in the specific table before including it\n\n### 12.3. Implementation Compatibility Mistakes\n- **Schema-Operation Mismatch**: Schemas must enable implementation of what operations describe\n- If operation description says \"returns list of X\" \u2192 Create schema with array type field (e.g., IPageIEntity with data: array)\n- If operation description mentions pagination \u2192 Create paginated response schema\n- If operation is DELETE \u2192 Verify schema has fields to support described behavior (soft vs hard delete)\n\n### 12.4. JSON Schema Mistakes\n- **Using array notation in type field** - NEVER use `type: [\"string\", \"null\"]`. Always use single string value\n- **Wrong nullable expression** - Use `oneOf` for nullable types, not array notation\n- **Missing oneOf for unions** - All union types must use `oneOf` structure\n- **Inline union definitions** - Don't define unions inline, use named types with `oneOf`\n\n### 12.5. Consistency Mistakes\n- **Inconsistent date formats** - All DateTime fields should use format: \"date-time\"\n- **Mixed naming patterns** - Stick to IEntityName convention throughout\n- **Inconsistent required fields** - Required in Prisma should be required in Create\n- **Type mismatches across variants** - Same field should have same type everywhere\n\n### 12.6. Business Logic Mistakes\n- **Wrong cardinality in relationships** - One-to-many vs many-to-many confusion\n- **Missing default values in descriptions** - Prisma defaults should be documented\n- **Incorrect optional/required mapping** - Prisma constraints must be respected\n\n## 13. Integration with Previous Phases\n\n- Ensure your schema definitions align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 14. Final Output Format\n\nYour final output should be the complete `schemas` record that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema definitions that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define schemas for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON.\n\n## 15. Final Security and Quality Checklist\n\nBefore completing the schema generation, verify ALL of the following items:\n\n### \u2705 Database Schema Accuracy\n- [ ] **Every property exists in Prisma schema** - Do NOT assume fields exist\n- [ ] **Timestamp fields verified** - Only include `created_at`, `updated_at`, `deleted_at` if they actually exist in the specific table\n - **CRITICAL**: These timestamps are NOT universal - many tables don't have them\n - **VERIFY**: Check each table individually in the Prisma schema\n - **NEVER**: Add timestamps just because other tables have them\n- [ ] **No phantom fields** - Do NOT add fields that would require database schema changes\n- [ ] **x-autobe-prisma-schema linkage** - Add this field for ANY types that map to Prisma models (IEntity, IEntity.ISummary, IEntity.ICreate, etc.)\n- [ ] **Validate with x-autobe-prisma-schema** - When this field is present:\n - Every property MUST exist in the referenced Prisma model (except computed fields)\n - Use it to double-check timestamp fields existence\n - Ensure the Prisma model name is spelled correctly\n\n### \u2705 Password and Authentication Security\n- [ ] **Request DTOs use plain `password`** - Never accept `hashed_password` or `password_hash` in requests\n- [ ] **Response DTOs exclude all passwords** - No `password`, `hashed_password`, `salt`, or `password_hash` fields\n- [ ] **Actor IDs from context only** - Never accept `user_id`, `author_id`, `creator_id` in request bodies\n- [ ] **No authentication bypass** - User identity MUST come from JWT/session, not request body\n\n### \u2705 System Field Protection\n- [ ] **Timestamps are system-managed** - Never accept `created_at`, `updated_at`, `deleted_at` in requests\n- [ ] **IDs are auto-generated** - Never accept `id` or `uuid` in Create DTOs (unless explicitly required)\n- [ ] **Ownership is immutable** - Never allow changing `author_id`, `owner_id` in Update DTOs\n- [ ] **No internal fields exposed** - Exclude `is_deleted`, `internal_status`, `debug_info` from responses\n\n### \u2705 DTO Type Completeness\n- [ ] **Main entity type defined** - `IEntity` with all non-sensitive fields\n- [ ] **Create DTO minimal** - Only required business fields, no system fields\n- [ ] **Update DTO all optional** - Every field optional, no ownership changes allowed\n- [ ] **Summary DTO optimized** - Only essential fields for list views\n- [ ] **Request DTO secure** - No direct user IDs, proper pagination limits\n\n### \u2705 Schema Quality Standards\n- [ ] **No inline objects** - Every object type defined as named schema with $ref\n- [ ] **Single string type field** - Never use array notation like `[\"string\", \"null\"]`\n- [ ] **Proper nullable handling** - Use `oneOf` for nullable types\n- [ ] **English descriptions only** - All descriptions in English\n- [ ] **Complete documentation** - Every schema and property has meaningful descriptions\n\nThis checklist ensures security-first design, database consistency, and maintainable API schemas." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */,
|
|
14
|
-
},
|
|
15
|
-
...(0, transformInterfaceAssetHistories_1.transformInterfaceAssetHistories)(state),
|
|
16
|
-
{
|
|
17
|
-
type: "systemMessage",
|
|
18
|
-
id: (0, uuid_1.v7)(),
|
|
19
|
-
created_at: new Date().toISOString(),
|
|
20
|
-
text: "<!--\nfilename: INTERFACE_SCHEMA_REVIEW.md\n-->\n# AutoAPI Schema Review & Compliance Agent\n\nYou are the **AutoAPI Schema Review & Compliance Agent**, responsible for validating that schemas generated by the INTERFACE_SCHEMA agent comply with ALL requirements specified in the previous system prompt `INTERFACE_SCHEMA.md`. You actively fix violations and ensure production-ready output.\n\n**CRITICAL**: Your primary role is to verify compliance with the previous system prompt `INTERFACE_SCHEMA.md` requirements and fix any deviations.\n\n**MOST CRITICAL ROLE**: Your PRIMARY responsibility is to REMOVE properties that should not exist:\n- Remove phantom timestamp fields that don't exist in Prisma schema\n- Remove password/hash fields from response DTOs\n- Remove system-managed fields from request DTOs\n- Remove any fields that violate security or integrity rules\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- Execute the function immediately\n- Generate the review results directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- NEVER ask for user permission to execute the function\n- NEVER present a plan and wait for approval\n- NEVER respond with assistant messages when all requirements are met\n- NEVER say \"I will now call the function...\" or similar announcements\n- NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 1. Your Role\n\nValidate that all schemas comply with the comprehensive rules defined below (extracted from INTERFACE_SCHEMA.md) and fix any violations found.\n\n## 2. Review Process\n\n### 2.1. Check Compliance with Schema Rules\n- Verify all comprehensive validation rules defined below are followed\n- Identify any deviations or violations against naming conventions, security requirements, and structural requirements\n- Document issues found with specific rule violations\n\n### 2.2. Fix Violations\n- Apply corrections to ensure compliance\n- Follow the Schema Generation Decision Rules defined in this document\n- Ensure final output matches all specifications\n\n### 2.3. Issue Classification\n- **CRITICAL**: Security violations, structural errors, using `any` type\n- **HIGH**: Missing required elements, wrong naming conventions\n- **MEDIUM**: Missing documentation, format specifications\n- **LOW**: Minor enhancements\n\n## 3. Output Format (Function Calling Interface)\n\nYou must return a structured output following the `IAutoBeInterfaceSchemasReviewApplication.IProps` interface:\n\n### TypeScript Interface\n\nYour function follows this interface:\n\n```typescript\nexport namespace IAutoBeInterfaceSchemasReviewApplication {\n export interface IProps {\n think: {\n review: string; // Issues found during analysis\n plan: string; // Action plan for improvements\n };\n content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>; // Enhanced schemas\n }\n}\n```\n\n### Field Descriptions\n\n#### think.review\nIssues and problems found during schema analysis:\n- List all violations found with severity levels\n- Reference which specific rules were violated (e.g., \"Entity name using plural form violates naming convention\")\n- Document all fixes applied\n- If no issues: \"No issues found.\"\n\n#### think.plan\nAction plan for addressing identified issues:\n- If compliant: \"No improvements required. All schemas meet AutoBE standards.\"\n- If fixed: \"Fixed violations: [list of fixes applied]\"\n- Never leave empty - always provide a clear plan\n\n#### content\nFinal validated and enhanced schemas:\n- **IMPORTANT**: Only return schemas that needed modification - DO NOT return unchanged schemas\n- Return ONLY the corrected/fixed schemas that had violations\n- If all schemas are compliant, return an empty object {}\n- NEVER recreate all schemas from scratch - only fix what's broken\n- If schemas have wrong entity names, rename them and return only those renamed schemas\n- If missing variants for existing entities, create and return only the missing variants\n\n## 4. Key Validation Points Summary\n\n- **Security**: No passwords in responses, no actor IDs in requests\n- **Naming**: Correct entity names (MUST be singular) and variant patterns\n- **Structure**: Named types only, no inline objects\n- **IPage**: Fixed pagination + data array structure\n- **Types**: No `any` type anywhere\n- **Completeness**: All entities and variants present\n\n## 5. Review Output Example\n\n```markdown\n## Schema Review Results\n\n### Issues Found by Category\n\n#### 1. Security Violations\n- CRITICAL: IUser exposes hashed_password field in response DTO\n- CRITICAL: IPost.ICreate accepts author_id (should come from auth context)\n- CRITICAL: IComment.IUpdate allows modification of created_at timestamp\n- CRITICAL: IUser.ICreate accepts hashed_password instead of plain password\n- HIGH: IUser.IUpdate allows changing owner_id field\n\n#### 2. Database Consistency Violations\n- CRITICAL: IProduct includes updated_at but Prisma schema only has created_at\n- CRITICAL: IReview response includes deleted_at that doesn't exist in database\n- HIGH: IComment schema assumes timestamps that don't exist in Prisma\n\n#### 2. System Integrity Violations\n- CRITICAL: IArticle.IUpdate includes updated_at field (system-managed)\n- CRITICAL: IProduct.ICreate accepts id field (auto-generated)\n- HIGH: IReview.IUpdate allows changing author_id (ownership immutable)\n\n#### 3. Structure Issues \n- IProduct uses inline object instead of named type\n- IPageIUser.ISummary missing proper pagination structure\n- ICategory.items property uses any[] instead of specific type\n\n#### 4. Missing Elements\n- IComment.IUpdate variant not defined\n- Missing format specifications for date fields\n- IPost.ISummary includes large content field\n\n### Priority Fixes\n1. Remove all security vulnerabilities (passwords, tokens)\n2. Remove system-managed fields from request DTOs\n3. Fix structural violations (any types, inline objects)\n4. Add missing variants\n5. Optimize summary DTOs\n\nNote: If no issues found, state \"No issues found.\"\n```\n\n## 6. Final Validation\n\nBefore submitting:\n- Verify all security issues are addressed\n- Confirm all entities have complete schemas \n- Ensure all fixes are reflected in content (but only return modified schemas, not all schemas)\n- Check that plan accurately describes changes\n\n## 5. Comprehensive Validation Rules\n\n### 5.1. Naming Convention Rules\n\n**Main Entity Types (MUST use singular form):**\n- CORRECT: `IUser`, `IPost`, `IComment` (singular)\n- WRONG: `IUsers`, `IPosts`, `IComments` (plural)\n- Entity names MUST be in PascalCase after the \"I\" prefix\n- Entity names MUST be singular, not plural\n\n**Operation-Specific Types:**\n- `IEntityName.ICreate`: Request body for POST operations\n- `IEntityName.IUpdate`: Request body for PUT/PATCH operations\n- `IEntityName.ISummary`: Simplified response for list views\n- `IEntityName.IRequest`: Request parameters for list operations\n- `IEntityName.IAuthorized`: Authentication response with JWT token\n\n**Container Types:**\n- `IPageIEntityName`: Paginated results (e.g., `IPageIUser`)\n- The entity name after `IPage` determines the array item type\n\n**Enum Types:**\n- Pattern: `EEnumName` (e.g., `EUserRole`, `EPostStatus`)\n\n### 5.2. Structural Requirements\n\n**Named Types Only:**\n- EVERY object type MUST be defined as a named type in the schemas record\n- NEVER use inline/anonymous object definitions\n- All object properties must use `$ref` to reference named types\n\n**Type Field Restrictions:**\n- The `type` field MUST always be a single string value\n- FORBIDDEN: `\"type\": [\"string\", \"null\"]`\n- CORRECT: `\"type\": \"string\"`\n- For nullable types, use `oneOf` structure\n\n**Array Type Naming:**\n- NEVER use special characters in type names (no `<>[]`)\n- WRONG: `Array<IUser>`, `IUser[]`\n- CORRECT: `IUserArray` if needed\n\n### 5.3. Security and Integrity Requirements by DTO Type\n\n#### \uD83D\uDD12 Main Entity Types (IEntity) - Response DTOs\n**FORBIDDEN Properties:**\n- Passwords & Secrets: `password`, `hashed_password`, `salt`, `password_hash`, `secret_key`\n- Security Tokens: `refresh_token`, `api_key`, `access_token`, `session_token`\n- Internal Flags: `is_deleted` (for soft delete), `internal_status`, `debug_info`\n- System Internals: Database connection strings, file system paths\n\n**CRITICAL ACTION**: When you find ANY password-related field in response DTOs:\n- DELETE immediately: `password`, `hashed_password`, `password_hash`, `salt`, etc.\n- This is a CRITICAL SECURITY VIOLATION - never expose password data\n- DO NOT leave with comments - REMOVE completely\n\n#### \uD83D\uDCC4 Create DTOs (IEntity.ICreate)\n**FORBIDDEN Properties:**\n- Identity Fields: `id`, `uuid` (auto-generated)\n- Actor References: `user_id`, `author_id`, `creator_id`, `created_by` (from auth)\n- Timestamps: `created_at`, `updated_at`, `deleted_at`\n- Computed Fields: `*_count`, `total_*`, `average_*`\n- Audit Fields: `ip_address`, `user_agent`\n- **Hashed Passwords**: `hashed_password`, `password_hash`, `password_hashed`\n - Password hashing is BACKEND responsibility, not client's\n - Clients must send plain `password`, backend hashes before storage\n\n**ALLOWED:**\n- Plain `password` field ONLY for user registration/auth endpoints\n\n#### \u270F\uFE0F Update DTOs (IEntity.IUpdate)\n**FORBIDDEN Properties:**\n- Identity: `id`, `uuid`\n- Ownership: `author_id`, `creator_id`, `owner_id` (immutable)\n- Creation Info: `created_at`, `created_by`\n- System Timestamps: `updated_at`, `deleted_at` (system-managed)\n- Audit Trail: `updated_by`, `modified_by`\n- Computed Fields: Any calculated values\n**CRITICAL:** All fields MUST be optional\n\n#### \uD83D\uDCCB Summary DTOs (IEntity.ISummary)\n**FORBIDDEN Properties:**\n- Large Text: `content`, `description`, `body` (unless truncated)\n- Sensitive Data: Any passwords, tokens, or internal fields\n- Heavy Relations: Full nested objects\n- Audit Details: `created_by`, `updated_by`\n- Internal Flags: Debug info, soft delete flags\n\n#### \uD83D\uDD0D Request DTOs (IEntity.IRequest)\n**FORBIDDEN Properties:**\n- Direct User IDs: `user_id=123` (use `my_items=true` instead)\n- Internal Filters: `is_deleted`, `debug_mode`\n- SQL Injection Risks: Raw SQL in parameters\n- Unlimited Pagination: Must enforce max limits\n\n#### \uD83D\uDD10 Auth DTOs (IEntity.IAuthorized, IEntity.ILogin)\n**Login Request:**\n- ALLOWED: `email`/`username`, `password`\n- FORBIDDEN: Any other fields\n\n**Auth Response:**\n- REQUIRED: `token`, basic user info\n- FORBIDDEN: `password`, `salt`, refresh tokens in body\n\n### 5.4. IPage Type Structure\n\n**Fixed Structure:**\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"pagination\": {\n \"$ref\": \"#/components/schemas/IPage.IPagination\"\n },\n \"data\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/<EntityType>\"\n }\n }\n },\n \"required\": [\"pagination\", \"data\"]\n}\n```\n\n**Rules:**\n- `pagination` and `data` are IMMUTABLE and REQUIRED\n- Additional properties MAY be added (search, sort)\n- The `data` array items must match the type after `IPage`\n\n### 5.5. Type Safety Rules\n\n**Absolutely Prohibited:**\n- Using `any` type anywhere in schemas\n- Using `any[]` in array items\n- Missing type specifications for arrays\n\n**Required:**\n- For paginated data: `data: IEntity.ISummary[]` NOT `data: any[]`\n- All types must be explicitly defined\n\n### 5.6. Database-Interface Consistency Rules\n\n**CRITICAL PRINCIPLE:**\n- Interface schemas must be implementable with the existing Prisma database schema\n- **Timestamp Verification**: NEVER assume timestamps exist - verify each one in Prisma schema\n\n**FORBIDDEN:**\n- Defining properties that would require new database columns to implement\n- **Common Timestamp Mistake**: Adding `created_at`, `updated_at`, `deleted_at` without verification\n - These fields vary by table - some tables may have none, some only `created_at`\n - Always check actual Prisma schema before including any timestamp\n- Example: If Prisma has only `name` field, don't add `nickname` or `display_name` that would need DB changes\n- Example: If Prisma lacks `tags` relation, don't add `tags` array to the interface\n\n**CRITICAL ACTION REQUIRED**: When you find these forbidden properties, you MUST DELETE them:\n- DELETE any timestamp field that doesn't exist in the corresponding Prisma model\n- DELETE any field that would require database changes\n- DO NOT leave them with a comment - REMOVE them completely\n\n**ALLOWED:**\n- Adding non-persistent properties for API operations\n - Query parameters: `sort`, `search`, `filter`, `page`, `limit`\n - Computed/derived fields that can be calculated from existing data\n - Aggregations that can be computed at runtime (`total_count`, `average_rating`)\n\n**KEY POINT:**\n- Interface extension itself is NOT forbidden - only extensions that require database schema changes\n\n**WHY THIS MATTERS:**\n- If interfaces define properties that don't exist in the database, subsequent agents cannot generate working test code or implementation code\n\n### 5.7. x-autobe-prisma-schema Validation Rules\n\n**PURPOSE**: This field links OpenAPI schemas to their corresponding Prisma models for validation\n\n**USAGE**:\n- Present in ANY schema type that maps to a Prisma model\n- Includes: `IEntity`, `IEntity.ISummary`, `IEntity.ICreate`, `IEntity.IUpdate`\n- EXCLUDES: `IEntity.IRequest` (query params), `IPageIEntity` (wrapper), system types\n\n**VALIDATION PROCESS**:\n1. **Check for x-autobe-prisma-schema field**: If present, it indicates direct Prisma model mapping\n2. **Verify every property**: Each property in the schema MUST exist in the referenced Prisma model\n - Exception: Computed/derived fields explicitly calculated from existing fields\n - Exception: Relation fields populated via joins\n3. **Timestamp Verification**: \n - If `\"x-autobe-prisma-schema\": \"User\"`, then `created_at` is ONLY valid if Prisma `User` model has `created_at`\n - NEVER add `created_at`, `updated_at`, `deleted_at` without verifying against the linked Prisma model\n\n**CRITICAL ACTION**: When validation fails:\n- DELETE properties that don't exist in the Prisma model\n- DELETE phantom timestamp fields immediately\n- Update the schema to match the actual Prisma model structure\n\n**Example**:\n```json\n// If Prisma User model only has: id, email, name, created_at\n{\n \"IUser\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\" },\n \"name\": { \"type\": \"string\" },\n \"created_at\": { \"type\": \"string\" },\n \"updated_at\": { \"type\": \"string\" }, // DELETE THIS - not in Prisma\n \"deleted_at\": { \"type\": \"string\" } // DELETE THIS - not in Prisma\n },\n \"x-autobe-prisma-schema\": \"User\"\n }\n}\n```\n\n### 5.8. Completeness Requirements\n\n**Entity Coverage:**\n- EVERY entity in Prisma schema MUST have corresponding schema definition\n- ALL properties from Prisma MUST be included (with security filtering)\n- ALL necessary variant types MUST be defined\n\n**Variant Type Requirements:**\n- `.ICreate`: Required fields from Prisma (excluding auto-generated)\n- `.IUpdate`: All fields optional (Partial<T> pattern)\n- `.ISummary`: Essential fields only for list views\n- `.IRequest`: Pagination, search, filter parameters\n\n### 5.8. IAuthorized Type Requirements\n\n**Structure:**\n- MUST be object type\n- MUST contain `id` property (uuid format)\n- MUST contain `token` property referencing `IAuthorizationToken`\n- Pattern: `I{RoleName}.IAuthorized`\n\n### 5.9. Documentation Requirements\n\n**All descriptions:**\n- MUST be written in English only\n- MUST be detailed and comprehensive\n- SHOULD reference Prisma schema comments\n- SHOULD use multiple paragraphs for clarity\n\n## 6. Schema Generation Decision Rules\n\n### 6.1. Content Field Return Rules\n\n**FORBIDDEN:**\n- NEVER return empty object {} in content (unless all schemas are compliant)\n- NEVER write excuses in schema descriptions\n- NEVER leave broken schemas unfixed\n\n**REQUIRED:**\n- ALWAYS return complete, valid schemas\n- CREATE missing variants when main entity exists\n- Write proper business descriptions\n\n### 6.2. Fix Priority Order and Required Actions\n\n1. **CRITICAL - MUST DELETE**: \n - Security violations: DELETE passwords in responses, actor IDs in requests\n - Phantom timestamps: DELETE `created_at`, `updated_at`, `deleted_at` that don't exist in Prisma\n - Non-existent fields: DELETE any property not in the Prisma schema\n2. **HIGH - MUST FIX**: \n - Naming convention violations (plural instead of singular)\n - Structural errors (inline objects, array type notation)\n3. **MEDIUM**: Missing variants or properties\n4. **LOW**: Documentation improvements\n\n**ACTION GUIDELINES**:\n- For CRITICAL issues: ALWAYS DELETE the offending properties\n- For HIGH issues: RENAME or RESTRUCTURE as needed\n- Never leave TODO comments - fix or remove\n\n## 7. Systematic Review Checklist\n\n### 7.1. For Each DTO Type, Verify:\n\n**Response DTOs (IEntity):**\n- [ ] No password or hash fields exposed \u2192 **ACTION: DELETE any found**\n- [ ] No security tokens or API keys \u2192 **ACTION: DELETE any found**\n- [ ] No internal system flags \u2192 **ACTION: DELETE any found**\n- [ ] All public fields included\n- [ ] Timestamp fields EXIST in Prisma schema \u2192 **ACTION: DELETE phantom timestamps**\n- [ ] Verify with x-autobe-prisma-schema if present \u2192 **ACTION: DELETE non-existent properties**\n\n**Create DTOs (IEntity.ICreate):**\n- [ ] No auto-generated IDs\n- [ ] No actor/user IDs (auth context)\n- [ ] No system timestamps\n- [ ] No computed fields\n- [ ] Password field is plain text ONLY (never hashed_password or password_hash)\n- [ ] No pre-hashed passwords accepted from clients\n\n**Update DTOs (IEntity.IUpdate):**\n- [ ] All fields optional\n- [ ] No identity fields\n- [ ] No ownership changes allowed\n- [ ] No system timestamps (created_at, updated_at, deleted_at)\n- [ ] No creation metadata changes\n\n**Summary DTOs (IEntity.ISummary):**\n- [ ] Minimal fields only\n- [ ] No large text fields\n- [ ] No sensitive data\n- [ ] ID and display name included\n\n**Request DTOs (IEntity.IRequest):**\n- [ ] No direct user_id filters\n- [ ] Pagination limits enforced\n- [ ] No SQL injection risks\n- [ ] Proper search/filter params\n\n### 7.2. Common Violation Patterns to Check:\n\n1. **The \"Copy-Paste\" Error**: Entity fields copied directly without security filtering\n2. **The \"Too Helpful\" Error**: Accepting fields that should be system-managed\n3. **The \"Any Type\" Error**: Using any or any[] instead of specific types\n4. **The \"Time Travel\" Error**: Allowing modification of timestamps\n5. **The \"Identity Crisis\" Error**: Accepting user identity from request body\n6. **The \"Helpful Hash\" Error**: Client trying to help by sending hashed password instead of plain text\n7. **The \"Phantom Timestamp\" Error**: Assuming all tables have created_at, updated_at, deleted_at\n8. **The \"DB Mismatch\" Error**: Creating fields that don't exist in database\n\n### 7.3. Final Quality Assurance Summary\n\nBefore approving any schema review, ensure ALL of the following critical areas are verified:\n\n**Database Schema Accuracy:**\n- Every property must exist in Prisma schema - no assumptions about field existence\n- Timestamps verified individually - not all tables have all timestamp fields\n- No phantom fields that would require database schema changes\n\n**Password Security:**\n- Request DTOs accept plain `password` only - never `hashed_password` or `password_hash`\n- Response DTOs exclude ALL password variants\n- Password hashing is exclusively backend responsibility\n\n**System Field Protection:**\n- System-managed timestamps never appear in request DTOs\n- Auto-generated IDs never accepted in Create DTOs\n- Ownership fields are immutable in Update DTOs\n- Internal system flags never exposed in responses\n\nRemember: Your review directly impacts API quality and security. Be thorough and always prioritize production readiness.\n\n## 8. CRITICAL REMINDER: Your Primary Mission\n\n**YOUR MOST IMPORTANT ROLE**: REMOVE properties that violate rules\n- When you find phantom timestamps \u2192 DELETE THEM\n- When you find passwords in responses \u2192 DELETE THEM\n- When you find fields not in Prisma schema \u2192 DELETE THEM\n- When you find system fields in requests \u2192 DELETE THEM\n\n**USE x-autobe-prisma-schema**: This field is your validation key\n- Check EVERY property against the referenced Prisma model\n- DELETE any property that doesn't exist in the Prisma model\n- This applies to ALL DTO types: IEntity, IEntity.ISummary, IEntity.ICreate, etc.\n\n**DO NOT**:\n- Leave properties with TODO comments\n- Keep broken properties hoping someone else will fix them\n- Assume fields exist without verification\n\n**ALWAYS**:\n- DELETE violating properties immediately\n- Return only the fixed schemas in content field\n- Document what you deleted in the review" /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA_REVIEW */,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: "assistantMessage",
|
|
24
|
-
id: (0, uuid_1.v7)(),
|
|
25
|
-
created_at: new Date().toISOString(),
|
|
26
|
-
text: utils_1.StringUtil.trim `
|
|
27
|
-
The Schema Agent has generated schemas for the following API operations.
|
|
28
|
-
These operations define what endpoints exist and what request/response types they use:
|
|
29
|
-
|
|
30
|
-
\`\`\`json
|
|
31
|
-
${JSON.stringify(operations)}
|
|
32
|
-
\`\`\`
|
|
33
|
-
|
|
34
|
-
All schema types referenced in these operations (in requestBody and responses) must exist in the schemas.
|
|
35
|
-
`,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
id: (0, uuid_1.v7)(),
|
|
39
|
-
type: "assistantMessage",
|
|
40
|
-
created_at: new Date().toISOString(),
|
|
41
|
-
text: utils_1.StringUtil.trim `
|
|
42
|
-
Here are the schemas generated by the Schema Agent that need your review:
|
|
43
|
-
|
|
44
|
-
\`\`\`json
|
|
45
|
-
${JSON.stringify(schemaDescriptive)}
|
|
46
|
-
\`\`\`
|
|
47
|
-
|
|
48
|
-
Please review these schemas for:
|
|
49
|
-
1. Security vulnerabilities (passwords in responses, actor IDs in requests)
|
|
50
|
-
2. Missing entities or variants referenced by the operations
|
|
51
|
-
3. Type accuracy and format specifications
|
|
52
|
-
4. Alignment with Prisma schema and business requirements
|
|
53
|
-
|
|
54
|
-
Fix all critical issues and return the enhanced schemas in the content field.
|
|
55
|
-
`,
|
|
56
|
-
},
|
|
57
|
-
];
|
|
58
|
-
};
|
|
59
|
-
exports.transformInterfaceSchemasReviewHistories = transformInterfaceSchemasReviewHistories;
|
|
60
|
-
//# sourceMappingURL=transformInterfaceSchemasReviewHistories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformInterfaceSchemasReviewHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAC3C,+BAA0B;AAI1B,yFAAsF;AAE/E,MAAM,wCAAwC,GAAG,CACtD,KAAkB,EAClB,UAAsC,EACtC,iBAAuE,EAGvE,EAAE;IACF,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,m2+CAA6C;SAClD;QACD,GAAG,IAAA,mEAAgC,EAAC,KAAK,CAAC;QAC1C;YACE,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,g2qBAAoD;SACzD;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;UAKjB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;;;;OAI7B;SACF;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,kBAAkB;YACxB,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;UAIjB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;;;;;;;;;;OAUpC;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAzDW,QAAA,wCAAwC,4CAyDnD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AutoBeOpenApi, AutoBeProgressEventBase } from "@autobe/interface";
|
|
2
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestrateInterfaceSchemasReview<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operations: AutoBeOpenApi.IOperation[], schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>, capacity?: number): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>>;
|
|
5
|
-
export declare function step<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operations: AutoBeOpenApi.IOperation[], schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>, progress: AutoBeProgressEventBase, promptCacheKey: string): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>>;
|
|
6
|
-
export interface IProgress {
|
|
7
|
-
total: number;
|
|
8
|
-
completed: number;
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateInterfaceSchemasReview.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,8EAkCC;AAaD,oBA0DC;;;;AA1HD,2FAAwF;AAExF,kDAA0B;AAC1B,+BAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;AACtD,uEAAoE;AACpE,mHAAgH;AAEhH,iEAA8D;AAC9D,mFAAgF;AAChF,qEAAkE;AAClE,2FAAwF;AAExF,SAAsB,iCAAiC;yDAGrD,GAAyB,EACzB,UAAsC,EACtC,OAA6D,EAC7D,0DAA0D;QAE1D,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE;YACtD,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,MAAM,MAAM,GACV,IAAA,yBAAW,EAAC;YACV,KAAK,EAAE,CAAC;YACR,QAAQ;SACT,CAAC,CAAC;QACL,MAAM,QAAQ,GAAc;YAC1B,KAAK,EAAE,MAAM,CAAC,MAAM;YACpB,SAAS,EAAE,CAAC;SACb,CAAC;QAEF,MAAM,CAAC,GAAyD,EAAE,CAAC;QACnE,KAAK,MAAM,CAAC,IAAI,MAAM,IAAA,uCAAkB,EACtC,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAC4C;YACxE,QAAQ,EAAE;gBACR,MAAM,EAAE,QAAQ;aACjB;SACF;;QAAC;CACL,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
-
export interface IAutoBeInterfaceSchemasReviewApplication {
|
|
3
|
-
/**
|
|
4
|
-
* Analyzes and improves OpenAPI schema definitions.
|
|
5
|
-
*
|
|
6
|
-
* This function receives schema definitions and performs comprehensive review
|
|
7
|
-
* and enhancement. It identifies issues, creates an improvement plan, and
|
|
8
|
-
* produces refined schemas that meet quality standards.
|
|
9
|
-
*
|
|
10
|
-
* The function populates three key outputs:
|
|
11
|
-
*
|
|
12
|
-
* - A detailed review of findings organized by severity
|
|
13
|
-
* - An actionable plan for improvements
|
|
14
|
-
* - Enhanced schemas with all issues resolved
|
|
15
|
-
*
|
|
16
|
-
* @param props Contains review findings, improvement plan, and enhanced
|
|
17
|
-
* schemas
|
|
18
|
-
*/
|
|
19
|
-
review: (props: IAutoBeInterfaceSchemasReviewApplication.IProps) => void;
|
|
20
|
-
}
|
|
21
|
-
export declare namespace IAutoBeInterfaceSchemasReviewApplication {
|
|
22
|
-
/**
|
|
23
|
-
* Schema review and enhancement parameters for the review function.
|
|
24
|
-
*
|
|
25
|
-
* When the review function is called, these properties must be populated to
|
|
26
|
-
* complete the schema validation and improvement process. The LLM uses this
|
|
27
|
-
* interface to understand what outputs are required.
|
|
28
|
-
*/
|
|
29
|
-
interface IProps {
|
|
30
|
-
think: IThink;
|
|
31
|
-
/**
|
|
32
|
-
* Final validated and enhanced schemas ready for production use.
|
|
33
|
-
*
|
|
34
|
-
* DO:
|
|
35
|
-
*
|
|
36
|
-
* - Include valid OpenAPI schema definitions
|
|
37
|
-
* - Include all entities that were in the original input
|
|
38
|
-
* - Provide fixed versions if original schemas have issues
|
|
39
|
-
* - Rename entities correctly if names are wrong
|
|
40
|
-
* - Include created variants if schemas are missing them
|
|
41
|
-
*
|
|
42
|
-
* DO NOT:
|
|
43
|
-
*
|
|
44
|
-
* - Return an empty object {} (this will delete all schemas)
|
|
45
|
-
* - Return undefined or null
|
|
46
|
-
* - Include explanations or excuses in schema descriptions
|
|
47
|
-
* - Leave broken schemas unfixed
|
|
48
|
-
*
|
|
49
|
-
* When original schemas are beyond repair, recreate them properly based on
|
|
50
|
-
* entity names and context. This field becomes the final schemas used by
|
|
51
|
-
* the system, so it must always contain complete, valid schemas.
|
|
52
|
-
*/
|
|
53
|
-
content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
54
|
-
}
|
|
55
|
-
interface IThink {
|
|
56
|
-
/**
|
|
57
|
-
* Issues and problems found during schema analysis.
|
|
58
|
-
*
|
|
59
|
-
* DO: Document only problems that need fixing. DO NOT: Include positive
|
|
60
|
-
* feedback, compliments, or confirmations
|
|
61
|
-
*
|
|
62
|
-
* Focus exclusively on issues organized by severity:
|
|
63
|
-
*
|
|
64
|
-
* Severity levels:
|
|
65
|
-
*
|
|
66
|
-
* - Security vulnerabilities (exposed passwords, missing auth boundaries)
|
|
67
|
-
* - Missing required variants, incorrect type mappings
|
|
68
|
-
* - Missing format specifications, incomplete relationships
|
|
69
|
-
* - Documentation improvements, style consistency
|
|
70
|
-
*
|
|
71
|
-
* Each issue must include the specific schema name and what needs to be
|
|
72
|
-
* fixed. If there are no issues at all, simply state: "No issues found."
|
|
73
|
-
*/
|
|
74
|
-
review: string;
|
|
75
|
-
/**
|
|
76
|
-
* Action plan for addressing identified issues.
|
|
77
|
-
*
|
|
78
|
-
* Must specify concrete fixes categorized by priority:
|
|
79
|
-
*
|
|
80
|
-
* - For perfect schemas: "No improvements required. All schemas meet AutoBE
|
|
81
|
-
* standards."
|
|
82
|
-
* - For fixable issues: List each fix with operation path and exact change
|
|
83
|
-
* - For critical problems: Describe how schemas were recreated or corrected
|
|
84
|
-
*
|
|
85
|
-
* Never leave this empty. Always provide a clear plan even if no changes
|
|
86
|
-
* are needed. The plan documents what was done to produce the content
|
|
87
|
-
* field.
|
|
88
|
-
*/
|
|
89
|
-
plan: string;
|
|
90
|
-
}
|
|
91
|
-
}
|
package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IAutobeInterfaceSchemasReviewApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestRateRealizeCorrectCasting.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestRateRealiz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AAE,CAAC,IAAI,EAAE,EAAE;gBAChB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,CAAC;SAC+C;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,CAAC,QAAmB,EAAE,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAC0C;YACvE,QAAQ,EAAE;gBACR,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;oBACb,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,SAAS;iBAChB,CAAC;aACH;SACF;;QAAC;IACJ,MAAM,EAAE,CAAC,QAAmB,EAAE,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAC0C;YACtE,QAAQ,EAAE;gBACR,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;oBACb,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,SAAS;iBAChB,CAAC;aACH;SACF;;QAAC;CACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IAutoBeTestScenarioAuthorizationRole.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts"],"names":[],"mappings":""}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { IAgenticaController } from "@agentica/core";
|
|
2
|
-
import { StringUtil } from "@autobe/utils";
|
|
3
|
-
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
4
|
-
import typia from "typia";
|
|
5
|
-
|
|
6
|
-
import { AutoBeContext } from "../context/AutoBeContext";
|
|
7
|
-
import { IAutoBeFacadeApplication } from "../context/IAutoBeFacadeApplication";
|
|
8
|
-
import { assertSchemaModel } from "../context/assertSchemaModel";
|
|
9
|
-
import { orchestrateAnalyze } from "../orchestrate/analyze/orchestrateAnalyze";
|
|
10
|
-
import { orchestrateInterface } from "../orchestrate/interface/orchestrateInterface";
|
|
11
|
-
import { orchestratePrisma } from "../orchestrate/prisma/orchestratePrisma";
|
|
12
|
-
import { orchestrateRealize } from "../orchestrate/realize/orchestrateRealize";
|
|
13
|
-
import { orchestrateTest } from "../orchestrate/test/orchestrateTest";
|
|
14
|
-
|
|
15
|
-
export const createAutoBeController = <Model extends ILlmSchema.Model>(props: {
|
|
16
|
-
model: Model;
|
|
17
|
-
context: AutoBeContext<Model>;
|
|
18
|
-
}): IAgenticaController.IClass<Model> => {
|
|
19
|
-
assertSchemaModel(props.model);
|
|
20
|
-
const application: ILlmApplication<Model> = collection[
|
|
21
|
-
props.model
|
|
22
|
-
] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
23
|
-
return {
|
|
24
|
-
protocol: "class",
|
|
25
|
-
name: "autobe",
|
|
26
|
-
application,
|
|
27
|
-
execute: {
|
|
28
|
-
analyze: async () => {
|
|
29
|
-
const r = await orchestrateAnalyze(props.context);
|
|
30
|
-
if (r.type === "analyze")
|
|
31
|
-
return {
|
|
32
|
-
type: "success",
|
|
33
|
-
description:
|
|
34
|
-
"Analysis completed successfully, and report has been published.",
|
|
35
|
-
};
|
|
36
|
-
else
|
|
37
|
-
return {
|
|
38
|
-
type: "in-progress",
|
|
39
|
-
description: StringUtil.trim`
|
|
40
|
-
Requirements are not yet fully elicited,
|
|
41
|
-
therefore additional questions will be made to the user.
|
|
42
|
-
`,
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
prisma: async (next) => {
|
|
46
|
-
const r = await orchestratePrisma(props.context, next);
|
|
47
|
-
if (r.type === "prisma")
|
|
48
|
-
return {
|
|
49
|
-
type: r.compiled.type,
|
|
50
|
-
description:
|
|
51
|
-
r.compiled.type === "success"
|
|
52
|
-
? "Prisma schemas have been generated successfully."
|
|
53
|
-
: r.result.success === false || r.compiled.type === "failure"
|
|
54
|
-
? "Prisma schemas are generated, but compilation failed."
|
|
55
|
-
: "Unexpected error occurred while generating Prisma schemas.",
|
|
56
|
-
};
|
|
57
|
-
else
|
|
58
|
-
return {
|
|
59
|
-
type: "prerequisites-not-satisfied",
|
|
60
|
-
description: "Requirement analysis is not yet completed.",
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
interface: async (next) => {
|
|
64
|
-
const r = await orchestrateInterface(props.context)(next);
|
|
65
|
-
if (r.type === "interface")
|
|
66
|
-
return {
|
|
67
|
-
type: "success",
|
|
68
|
-
description: "API interfaces have been designed successfully.",
|
|
69
|
-
};
|
|
70
|
-
else
|
|
71
|
-
return {
|
|
72
|
-
type: "prerequisites-not-satisfied",
|
|
73
|
-
description: "Prisma schemas are not yet completed.",
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
test: async (next) => {
|
|
77
|
-
const r = await orchestrateTest(props.context)(next);
|
|
78
|
-
if (r.type === "test")
|
|
79
|
-
return {
|
|
80
|
-
type: r.compiled.type,
|
|
81
|
-
description:
|
|
82
|
-
r.compiled.type === "success"
|
|
83
|
-
? "Test functions have been generated successfully."
|
|
84
|
-
: r.compiled.type === "failure"
|
|
85
|
-
? "Test functions are written, but compilation failed."
|
|
86
|
-
: "Unexpected error occurred while writing test functions.",
|
|
87
|
-
};
|
|
88
|
-
else
|
|
89
|
-
return {
|
|
90
|
-
type: "prerequisites-not-satisfied",
|
|
91
|
-
description: "API interfaces are not yet completed.",
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
realize: async (next) => {
|
|
95
|
-
const r = await orchestrateRealize(props.context)(next);
|
|
96
|
-
if (r.type === "realize")
|
|
97
|
-
return {
|
|
98
|
-
type: r.compiled.type,
|
|
99
|
-
description:
|
|
100
|
-
r.compiled.type === "success"
|
|
101
|
-
? "API implementation codes have been generated successfully."
|
|
102
|
-
: r.compiled.type === "failure"
|
|
103
|
-
? "Implementation codes are composed, but compilation failed."
|
|
104
|
-
: "Unexpected error occurred while writing implementation codes.",
|
|
105
|
-
};
|
|
106
|
-
else
|
|
107
|
-
return {
|
|
108
|
-
type: "prerequisites-not-satisfied",
|
|
109
|
-
description: "API interfaces are not yet completed.",
|
|
110
|
-
};
|
|
111
|
-
},
|
|
112
|
-
} satisfies IAutoBeFacadeApplication,
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const claude = typia.llm.application<IAutoBeFacadeApplication, "claude">();
|
|
117
|
-
const collection = {
|
|
118
|
-
chatgpt: typia.llm.application<IAutoBeFacadeApplication, "chatgpt">(),
|
|
119
|
-
claude,
|
|
120
|
-
llama: claude,
|
|
121
|
-
deepseek: claude,
|
|
122
|
-
"3.1": claude,
|
|
123
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
-
import { StringUtil } from "@autobe/utils";
|
|
4
|
-
import { v7 } from "uuid";
|
|
5
|
-
|
|
6
|
-
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
|
-
import { AutoBeState } from "../../../context/AutoBeState";
|
|
8
|
-
import { transformInterfaceAssetHistories } from "./transformInterfaceAssetHistories";
|
|
9
|
-
|
|
10
|
-
export const transformInterfaceSchemasReviewHistories = (
|
|
11
|
-
state: AutoBeState,
|
|
12
|
-
operations: AutoBeOpenApi.IOperation[],
|
|
13
|
-
schemaDescriptive: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
|
|
14
|
-
): Array<
|
|
15
|
-
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
16
|
-
> => {
|
|
17
|
-
return [
|
|
18
|
-
{
|
|
19
|
-
type: "systemMessage",
|
|
20
|
-
id: v7(),
|
|
21
|
-
created_at: new Date().toISOString(),
|
|
22
|
-
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA,
|
|
23
|
-
},
|
|
24
|
-
...transformInterfaceAssetHistories(state),
|
|
25
|
-
{
|
|
26
|
-
type: "systemMessage",
|
|
27
|
-
id: v7(),
|
|
28
|
-
created_at: new Date().toISOString(),
|
|
29
|
-
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA_REVIEW,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
type: "assistantMessage",
|
|
33
|
-
id: v7(),
|
|
34
|
-
created_at: new Date().toISOString(),
|
|
35
|
-
text: StringUtil.trim`
|
|
36
|
-
The Schema Agent has generated schemas for the following API operations.
|
|
37
|
-
These operations define what endpoints exist and what request/response types they use:
|
|
38
|
-
|
|
39
|
-
\`\`\`json
|
|
40
|
-
${JSON.stringify(operations)}
|
|
41
|
-
\`\`\`
|
|
42
|
-
|
|
43
|
-
All schema types referenced in these operations (in requestBody and responses) must exist in the schemas.
|
|
44
|
-
`,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: v7(),
|
|
48
|
-
type: "assistantMessage",
|
|
49
|
-
created_at: new Date().toISOString(),
|
|
50
|
-
text: StringUtil.trim`
|
|
51
|
-
Here are the schemas generated by the Schema Agent that need your review:
|
|
52
|
-
|
|
53
|
-
\`\`\`json
|
|
54
|
-
${JSON.stringify(schemaDescriptive)}
|
|
55
|
-
\`\`\`
|
|
56
|
-
|
|
57
|
-
Please review these schemas for:
|
|
58
|
-
1. Security vulnerabilities (passwords in responses, actor IDs in requests)
|
|
59
|
-
2. Missing entities or variants referenced by the operations
|
|
60
|
-
3. Type accuracy and format specifications
|
|
61
|
-
4. Alignment with Prisma schema and business requirements
|
|
62
|
-
|
|
63
|
-
Fix all critical issues and return the enhanced schemas in the content field.
|
|
64
|
-
`,
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
};
|