@autobe/agent 0.24.2 → 0.25.1
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.js +11 -1
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +1 -0
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +21 -21
- package/lib/context/IAutoBeApplication.d.ts +101 -6
- package/lib/context/IAutoBeApplicationProps.d.ts +6 -2
- package/lib/factory/createAgenticaHistory.js +1 -1
- package/lib/factory/createAgenticaHistory.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +80 -90
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +6 -5
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +3914 -2594
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +18 -3
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +19 -7
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +3 -2
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +36 -23
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +22 -42
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +2 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +20 -7
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.js → transformInterfaceCommonPrerequisiteHistories.js} +4 -4
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -23
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +22 -6
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +4 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +27 -6
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +21 -5
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +102 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +20 -4
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +45 -11
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +277 -37
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +69 -70
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +6 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +28 -13
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +11 -8
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +36 -21
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +260 -29
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.d.ts +5 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +713 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +83 -53
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js +41 -7
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +0 -38
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -10
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +52 -0
- package/lib/orchestrate/{common/structures/IAutoBeCommonCorrectDateApplication.js → interface/structures/IAutoBeInterfacePrerequisitesApplication.js} +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +0 -33
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +6 -2
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +105 -5
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +20 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.d.ts +3 -4
- package/lib/orchestrate/interface/utils/OperationValidator.js +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +4 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +19 -8
- 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.d.ts +6 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +20 -6
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +3 -3
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -3
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +12 -6
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/{common/histories/transformCommonCorrectDateHistories.d.ts → realize/histories/transformRealizeCorrectCastingHistories.d.ts} +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +32 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +14 -22
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +6 -6
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +8 -2
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js +1 -2
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.d.ts +2 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +119 -42
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +82 -52
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +128 -88
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +117 -54
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +52 -26
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +44 -34
- package/lib/orchestrate/realize/utils/InternalFileSystem.js +1 -1
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -5
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +8 -3
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +44 -17
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +4 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js +24 -9
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.d.ts +8 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js +48 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +93 -53
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +11 -7
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +7 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +35 -96
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +6 -3
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +33 -77
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +111 -94
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +20 -14
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +81 -50
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +31 -13
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +18 -7
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +20 -12
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +46 -25
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +9 -5
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.d.ts +8 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +11 -7
- package/lib/orchestrate/test/utils/getPrerequisites.d.ts +5 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js +36 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js.map +1 -0
- package/lib/orchestrate/test/utils/getReferenceIds.js +1 -1
- package/lib/orchestrate/test/utils/getReferenceIds.js.map +1 -1
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +17 -1
- package/src/AutoBeMockAgent.ts +1 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +21 -21
- package/src/context/IAutoBeApplication.ts +101 -6
- package/src/context/IAutoBeApplicationProps.ts +6 -2
- package/src/factory/createAgenticaHistory.ts +11 -5
- package/src/factory/createAutoBeContext.ts +6 -5
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +5 -1
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +16 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +22 -7
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +3 -2
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +2 -2
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +25 -45
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +2 -1
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +23 -9
- package/src/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.ts → transformInterfaceCommonPrerequisiteHistories.ts} +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +33 -24
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +26 -9
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +30 -6
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +24 -7
- package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +118 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +23 -6
- package/src/orchestrate/interface/orchestrateInterface.ts +65 -20
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +22 -12
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +34 -47
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +40 -28
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +51 -35
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +274 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +52 -33
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +1 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +0 -39
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -10
- package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +58 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +0 -34
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +92 -4
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +19 -1
- package/src/orchestrate/interface/utils/OperationValidator.ts +9 -7
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +20 -6
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +24 -9
- package/src/orchestrate/prisma/orchestratePrisma.ts +7 -3
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +5 -1
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +15 -10
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +44 -0
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -24
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +6 -6
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +6 -4
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +1 -5
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +102 -16
- package/src/orchestrate/realize/orchestrateRealize.ts +121 -81
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +50 -7
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +14 -4
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +54 -29
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +46 -35
- package/src/orchestrate/realize/utils/InternalFileSystem.ts +1 -1
- package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -5
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +54 -22
- package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +28 -16
- package/src/orchestrate/realize/utils/printErrorHints.ts +55 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +99 -97
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +14 -7
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +50 -115
- package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +41 -111
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +35 -12
- package/src/orchestrate/test/orchestrateTest.ts +19 -13
- package/src/orchestrate/test/orchestrateTestCorrect.ts +71 -51
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +13 -1
- package/src/orchestrate/test/orchestrateTestScenario.ts +27 -17
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +32 -19
- package/src/orchestrate/test/orchestrateTestWrite.ts +20 -10
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +9 -228
- package/src/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.ts +8 -2
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +11 -78
- package/src/orchestrate/test/utils/getPrerequisites.ts +51 -0
- package/src/orchestrate/test/utils/getReferenceIds.ts +2 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js +0 -48
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js.map +0 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.d.ts +0 -35
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +0 -3
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +0 -1
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.d.ts +0 -6
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js +0 -22
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.d.ts +0 -4
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js +0 -540
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js.map +0 -1
- package/src/orchestrate/common/histories/transformCommonCorrectDateHistories.ts +0 -60
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.ts +0 -40
- package/src/orchestrate/interface/utils/OpenApiEndpointComparator.ts +0 -23
- package/src/orchestrate/realize/orchestrateRealizeCorrectDate.ts +0 -372
|
@@ -17,44 +17,6 @@ export interface IAutoBeInterfaceComplementApplication {
|
|
|
17
17
|
}
|
|
18
18
|
export declare namespace IAutoBeInterfaceComplementApplication {
|
|
19
19
|
interface IProps {
|
|
20
|
-
/**
|
|
21
|
-
* TypeScript draft code for complement schema definitions.
|
|
22
|
-
*
|
|
23
|
-
* This property contains TypeScript interface definitions for missing schema
|
|
24
|
-
* types that were referenced but not defined in the initial schema generation.
|
|
25
|
-
* Similar to the main schema draft, this serves as a preliminary TypeScript
|
|
26
|
-
* representation before converting to JSON Schema format.
|
|
27
|
-
*
|
|
28
|
-
* The draft helps ensure that complementary schemas maintain consistency with
|
|
29
|
-
* the existing type system and follow the same conventions as the primary schemas.
|
|
30
|
-
*
|
|
31
|
-
* This draft typically includes:
|
|
32
|
-
* - Missing entity interfaces referenced via $ref
|
|
33
|
-
* - Nested object types used within other schemas
|
|
34
|
-
* - Shared utility types or enumerations
|
|
35
|
-
* - Any transitively referenced types
|
|
36
|
-
*
|
|
37
|
-
* The final schemas in the `schemas` property should be validated against and
|
|
38
|
-
* derived from this TypeScript draft to ensure type safety and consistency
|
|
39
|
-
* across the entire API specification.
|
|
40
|
-
*
|
|
41
|
-
* Example complement draft:
|
|
42
|
-
* ```typescript
|
|
43
|
-
* interface IUserProfile {
|
|
44
|
-
* id: string;
|
|
45
|
-
* userId: string;
|
|
46
|
-
* displayName: string;
|
|
47
|
-
* avatarUrl?: string;
|
|
48
|
-
* }
|
|
49
|
-
*
|
|
50
|
-
* interface IAddress {
|
|
51
|
-
* street: string;
|
|
52
|
-
* city: string;
|
|
53
|
-
* postalCode: string;
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
draft: string;
|
|
58
20
|
/**
|
|
59
21
|
* A collection of missing schema definitions that need to be added to the
|
|
60
22
|
* OpenAPI document's `components.schemas` section.
|
|
@@ -90,18 +90,14 @@ export declare namespace IAutoBeInterfaceGroupApplication {
|
|
|
90
90
|
*/
|
|
91
91
|
name: string & tags.MinLength<1>;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
* purpose.
|
|
93
|
+
* Concise description of the group's core purpose.
|
|
95
94
|
*
|
|
96
|
-
* **
|
|
95
|
+
* **Requirements:**
|
|
96
|
+
* - Keep it brief and focused (50-200 characters)
|
|
97
|
+
* - State the main purpose and key entities
|
|
98
|
+
* - Avoid detailed explanations or mappings
|
|
97
99
|
*
|
|
98
|
-
*
|
|
99
|
-
* group
|
|
100
|
-
* 2. Database Entities: List specific tables and entities from the schema
|
|
101
|
-
* 3. Functional Scope: Detail operations and workflows for schema entities
|
|
102
|
-
* 4. Schema Relationships: Describe table relationships and dependencies
|
|
103
|
-
* 5. Key Operations: Outline main operation types (CRUD, business processes)
|
|
104
|
-
* 6. Requirements Mapping: Explain how requirements map to schema entities
|
|
100
|
+
* Example: "Handles shopping-related entities and operations"
|
|
105
101
|
*/
|
|
106
102
|
description: string & tags.MinLength<1>;
|
|
107
103
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
/**
|
|
3
|
+
* Interface Prerequisite Agent application for analyzing and generating API
|
|
4
|
+
* operation dependencies.
|
|
5
|
+
*
|
|
6
|
+
* Analyzes Target Operations to determine which Available API Operations must
|
|
7
|
+
* be executed as prerequisites based on resource creation dependencies and
|
|
8
|
+
* existence validations.
|
|
9
|
+
*/
|
|
10
|
+
export interface IAutoBeInterfacePrerequisitesApplication {
|
|
11
|
+
/**
|
|
12
|
+
* Generate prerequisites for the provided operations.
|
|
13
|
+
*
|
|
14
|
+
* Analyzes each operation's dependencies and returns the complete list with
|
|
15
|
+
* their required prerequisite chains based on resource relationships.
|
|
16
|
+
*/
|
|
17
|
+
makePrerequisite(props: IAutoBeInterfacePrerequisitesApplication.IProps): void;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace IAutoBeInterfacePrerequisitesApplication {
|
|
20
|
+
interface IProps {
|
|
21
|
+
/**
|
|
22
|
+
* Target operations requiring prerequisite analysis.
|
|
23
|
+
*
|
|
24
|
+
* Each operation will be analyzed for dependency requirements and returned
|
|
25
|
+
* with appropriate prerequisites from Available API Operations.
|
|
26
|
+
*/
|
|
27
|
+
operations: IOperation[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Operation with its analyzed prerequisite dependencies.
|
|
31
|
+
*
|
|
32
|
+
* Represents a single API operation and its complete prerequisite chain
|
|
33
|
+
* needed for successful execution.
|
|
34
|
+
*/
|
|
35
|
+
interface IOperation {
|
|
36
|
+
/**
|
|
37
|
+
* The API endpoint being analyzed.
|
|
38
|
+
*
|
|
39
|
+
* Identifies the specific operation (method + path) that needs
|
|
40
|
+
* prerequisites.
|
|
41
|
+
*/
|
|
42
|
+
endpoint: AutoBeOpenApi.IEndpoint;
|
|
43
|
+
/**
|
|
44
|
+
* Required prerequisite operations.
|
|
45
|
+
*
|
|
46
|
+
* List of API operations that must be successfully executed before this
|
|
47
|
+
* operation can be performed. Based on resource creation dependencies and
|
|
48
|
+
* existence validations from the analysis.
|
|
49
|
+
*/
|
|
50
|
+
prerequisites: AutoBeOpenApi.IPrerequisite[];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeInterfacePrerequisitesApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts"],"names":[],"mappings":""}
|
|
@@ -23,39 +23,6 @@ export interface IAutoBeInterfaceSchemaApplication {
|
|
|
23
23
|
}
|
|
24
24
|
export declare namespace IAutoBeInterfaceSchemaApplication {
|
|
25
25
|
interface IProps {
|
|
26
|
-
/**
|
|
27
|
-
* TypeScript draft code for schema definitions.
|
|
28
|
-
*
|
|
29
|
-
* This property contains TypeScript interface definitions that serve as a
|
|
30
|
-
* preliminary draft before generating the final JSON schema components.
|
|
31
|
-
* The draft allows for initial design and validation of the schema structure
|
|
32
|
-
* using TypeScript's type system before converting to OpenAPI/JSON Schema format.
|
|
33
|
-
*
|
|
34
|
-
* The draft typically includes:
|
|
35
|
-
* - Entity interfaces matching the Prisma models
|
|
36
|
-
* - Operation-specific variants (ICreate, IUpdate, etc.)
|
|
37
|
-
* - Utility types and enumerations
|
|
38
|
-
* - Type relationships and constraints
|
|
39
|
-
*
|
|
40
|
-
* This TypeScript draft serves as the foundation for the subsequent schema
|
|
41
|
-
* generation, ensuring type safety and consistency. The final schemas in the
|
|
42
|
-
* `schemas` property should be derived from and validated against this draft.
|
|
43
|
-
*
|
|
44
|
-
* Example draft structure:
|
|
45
|
-
* ```typescript
|
|
46
|
-
* interface IUser {
|
|
47
|
-
* id: string;
|
|
48
|
-
* email: string;
|
|
49
|
-
* profile: IUserProfile;
|
|
50
|
-
* }
|
|
51
|
-
*
|
|
52
|
-
* namespace IUser {
|
|
53
|
-
* interface ICreate extends Omit<IUser, "id"> {}
|
|
54
|
-
* interface IUpdate extends Partial<ICreate> {}
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
draft: string;
|
|
59
26
|
/**
|
|
60
27
|
* Complete set of schema components for the OpenAPI specification.
|
|
61
28
|
*
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
1
|
+
import { AutoBeOpenApi, AutoBePrisma } from "@autobe/interface";
|
|
2
2
|
export declare namespace JsonSchemaFactory {
|
|
3
3
|
const presets: (typeNames: Set<string>) => Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
4
4
|
const authorize: (schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>) => void;
|
|
5
|
+
const finalize: (props: {
|
|
6
|
+
document: AutoBeOpenApi.IDocument;
|
|
7
|
+
application: AutoBePrisma.IApplication;
|
|
8
|
+
}) => void;
|
|
5
9
|
const page: (key: string) => AutoBeOpenApi.IJsonSchemaDescriptive.IObject;
|
|
6
|
-
const
|
|
10
|
+
const fixPage: (path: string, input: unknown) => void;
|
|
7
11
|
const isPage: (key: string) => boolean;
|
|
8
12
|
const getPageName: (key: string) => string;
|
|
9
13
|
}
|
|
@@ -41,9 +41,13 @@ exports.JsonSchemaFactory = void 0;
|
|
|
41
41
|
const __typia_transform__accessExpressionAsString = __importStar(require("typia/lib/internal/_accessExpressionAsString.js"));
|
|
42
42
|
const __typia_transform__assertGuard = __importStar(require("typia/lib/internal/_assertGuard.js"));
|
|
43
43
|
const utils_1 = require("@autobe/utils");
|
|
44
|
+
const openapi_1 = require("@samchon/openapi");
|
|
44
45
|
const typia_1 = __importDefault(require("typia"));
|
|
45
46
|
var JsonSchemaFactory;
|
|
46
47
|
(function (JsonSchemaFactory) {
|
|
48
|
+
/* -----------------------------------------------------------
|
|
49
|
+
ASSIGNMENTS
|
|
50
|
+
----------------------------------------------------------- */
|
|
47
51
|
JsonSchemaFactory.presets = (typeNames) => {
|
|
48
52
|
const schemas = {};
|
|
49
53
|
for (const [key, value] of Object.entries(DEFAULT_SCHEMAS)) {
|
|
@@ -78,6 +82,63 @@ var JsonSchemaFactory;
|
|
|
78
82
|
value.required.push("token");
|
|
79
83
|
}
|
|
80
84
|
};
|
|
85
|
+
JsonSchemaFactory.finalize = (props) => {
|
|
86
|
+
removeUnused(props.document);
|
|
87
|
+
fixTimestamps(props);
|
|
88
|
+
};
|
|
89
|
+
const removeUnused = (document) => {
|
|
90
|
+
const used = new Set();
|
|
91
|
+
const visit = (schema) => openapi_1.OpenApiTypeChecker.visit({
|
|
92
|
+
components: { schemas: document.components.schemas },
|
|
93
|
+
schema,
|
|
94
|
+
closure: (next) => {
|
|
95
|
+
if (openapi_1.OpenApiTypeChecker.isReference(next)) {
|
|
96
|
+
const key = next.$ref.split("/").pop();
|
|
97
|
+
used.add(key);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
for (const op of document.operations) {
|
|
102
|
+
if (op.requestBody !== null)
|
|
103
|
+
visit({
|
|
104
|
+
$ref: `#/components/schemas/${op.requestBody.typeName}`,
|
|
105
|
+
});
|
|
106
|
+
if (op.responseBody !== null)
|
|
107
|
+
visit({
|
|
108
|
+
$ref: `#/components/schemas/${op.responseBody.typeName}`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
for (const key of Object.keys(document.components.schemas))
|
|
112
|
+
if (used.has(key) === false)
|
|
113
|
+
delete document.components.schemas[key];
|
|
114
|
+
};
|
|
115
|
+
const fixTimestamps = (props) => {
|
|
116
|
+
const entireModels = props.application.files
|
|
117
|
+
.map((f) => f.models)
|
|
118
|
+
.flat();
|
|
119
|
+
for (const value of Object.values(props.document.components.schemas)) {
|
|
120
|
+
if (utils_1.AutoBeOpenApiTypeChecker.isObject(value) === false)
|
|
121
|
+
continue;
|
|
122
|
+
const model = value["x-autobe-prisma-schema"]
|
|
123
|
+
? entireModels.find((m) => m.name === value["x-autobe-prisma-schema"])
|
|
124
|
+
: undefined;
|
|
125
|
+
if (model === undefined)
|
|
126
|
+
continue;
|
|
127
|
+
const properties = Object.keys(value.properties);
|
|
128
|
+
for (const key of properties) {
|
|
129
|
+
if (key !== "created_at" &&
|
|
130
|
+
key !== "updated_at" &&
|
|
131
|
+
key !== "deleted_at")
|
|
132
|
+
continue;
|
|
133
|
+
const column = model.plainFields.find((c) => c.name === key);
|
|
134
|
+
if (column === undefined)
|
|
135
|
+
delete value.properties[key];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
/* -----------------------------------------------------------
|
|
140
|
+
PAGINATION
|
|
141
|
+
----------------------------------------------------------- */
|
|
81
142
|
JsonSchemaFactory.page = (key) => ({
|
|
82
143
|
type: "object",
|
|
83
144
|
properties: {
|
|
@@ -100,7 +161,7 @@ var JsonSchemaFactory;
|
|
|
100
161
|
Collection of records with pagination information.
|
|
101
162
|
`,
|
|
102
163
|
});
|
|
103
|
-
JsonSchemaFactory.
|
|
164
|
+
JsonSchemaFactory.fixPage = (path, input) => {
|
|
104
165
|
if (isRecord(input) === false || isRecord(input[path]) === false)
|
|
105
166
|
return;
|
|
106
167
|
if (input[path].description)
|
|
@@ -250,8 +311,8 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
250
311
|
if (undefined === value)
|
|
251
312
|
return true;
|
|
252
313
|
return "string" === typeof value;
|
|
253
|
-
}); const _io19 = (input, _exceptionable = true) => "object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io0(input.properties, true && _exceptionable) && (null !== input.additionalProperties && (undefined === input.additionalProperties || false === input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && _iu2(input.additionalProperties, true && _exceptionable))) && (Array.isArray(input.required) && input.required.every((elem, _index3) => "string" === typeof elem)) && "object" === input.type && "string" === typeof input.description && (4 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
254
|
-
if (["properties", "additionalProperties", "required", "type", "description"].some(prop => key === prop))
|
|
314
|
+
}); const _io19 = (input, _exceptionable = true) => (null === input["x-autobe-prisma-schema"] || undefined === input["x-autobe-prisma-schema"] || "string" === typeof input["x-autobe-prisma-schema"]) && ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io0(input.properties, true && _exceptionable)) && (null !== input.additionalProperties && (undefined === input.additionalProperties || false === input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && _iu2(input.additionalProperties, true && _exceptionable))) && (Array.isArray(input.required) && input.required.every((elem, _index3) => "string" === typeof elem)) && "object" === input.type && "string" === typeof input.description && (4 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
315
|
+
if (["x-autobe-prisma-schema", "properties", "additionalProperties", "required", "type", "description"].some(prop => key === prop))
|
|
255
316
|
return true;
|
|
256
317
|
const value = input[key];
|
|
257
318
|
if (undefined === value)
|
|
@@ -1054,7 +1115,12 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1054
1115
|
expected: "string",
|
|
1055
1116
|
value: value
|
|
1056
1117
|
}, _errorFactory);
|
|
1057
|
-
}); const _ao19 = (input, _path, _exceptionable = true) => (
|
|
1118
|
+
}); const _ao19 = (input, _path, _exceptionable = true) => (null === input["x-autobe-prisma-schema"] || undefined === input["x-autobe-prisma-schema"] || "string" === typeof input["x-autobe-prisma-schema"] || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1119
|
+
method: "typia.assertEquals",
|
|
1120
|
+
path: _path + "[\"x-autobe-prisma-schema\"]",
|
|
1121
|
+
expected: "(null | string | undefined)",
|
|
1122
|
+
value: input["x-autobe-prisma-schema"]
|
|
1123
|
+
}, _errorFactory)) && (("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1058
1124
|
method: "typia.assertEquals",
|
|
1059
1125
|
path: _path + ".properties",
|
|
1060
1126
|
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>",
|
|
@@ -1105,7 +1171,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1105
1171
|
expected: "string",
|
|
1106
1172
|
value: input.description
|
|
1107
1173
|
}, _errorFactory)) && (4 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).every(key => {
|
|
1108
|
-
if (["properties", "additionalProperties", "required", "type", "description"].some(prop => key === prop))
|
|
1174
|
+
if (["x-autobe-prisma-schema", "properties", "additionalProperties", "required", "type", "description"].some(prop => key === prop))
|
|
1109
1175
|
return true;
|
|
1110
1176
|
const value = input[key];
|
|
1111
1177
|
if (undefined === value)
|
|
@@ -1341,6 +1407,37 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1341
1407
|
],
|
|
1342
1408
|
description: "Page information."
|
|
1343
1409
|
},
|
|
1410
|
+
"IPage.IRequest": {
|
|
1411
|
+
type: "object",
|
|
1412
|
+
properties: {
|
|
1413
|
+
page: {
|
|
1414
|
+
oneOf: [
|
|
1415
|
+
{
|
|
1416
|
+
type: "null"
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
type: "integer",
|
|
1420
|
+
minimum: 0
|
|
1421
|
+
}
|
|
1422
|
+
],
|
|
1423
|
+
description: "Page number."
|
|
1424
|
+
},
|
|
1425
|
+
limit: {
|
|
1426
|
+
oneOf: [
|
|
1427
|
+
{
|
|
1428
|
+
type: "null"
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
type: "integer",
|
|
1432
|
+
minimum: 0
|
|
1433
|
+
}
|
|
1434
|
+
],
|
|
1435
|
+
description: "Limitation of records per a page."
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
required: [],
|
|
1439
|
+
description: "Page request data"
|
|
1440
|
+
},
|
|
1344
1441
|
IAuthorizationToken: {
|
|
1345
1442
|
type: "object",
|
|
1346
1443
|
properties: {
|
|
@@ -1377,6 +1474,9 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1377
1474
|
{
|
|
1378
1475
|
$ref: "#/components/schemas/IPage.IPagination"
|
|
1379
1476
|
},
|
|
1477
|
+
{
|
|
1478
|
+
$ref: "#/components/schemas/IPage.IRequest"
|
|
1479
|
+
},
|
|
1380
1480
|
{
|
|
1381
1481
|
$ref: "#/components/schemas/IAuthorizationToken"
|
|
1382
1482
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSchemaFactory.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAqE;AACrE,kDAAoC;AAEpC,IAAiB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"JsonSchemaFactory.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAqE;AACrE,8CAAsD;AACtD,kDAAoC;AAEpC,IAAiB,iBAAiB,CAsKjC;AAtKD,WAAiB,iBAAiB;IAChC;;kEAE8D;IACjD,yBAAO,GAAG,CACrB,SAAsB,EACgC,EAAE;QACxD,MAAM,OAAO,GAAyD,EAAE,CAAC;QACzE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;YAC3D,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,KAAK,MAAM,GAAG,IAAI,SAAS;YACzB,IAAI,kBAAA,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChB,MAAM,IAAI,GAAW,kBAAA,WAAW,CAAC,GAAG,CAAC,CAAC;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,kBAAA,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC1B,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACtB,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IAEW,2BAAS,GAAG,CACvB,OAA6D,EACvD,EAAE;QACR,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACnD,IAAI,GAAG,CAAC,QAAQ,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGnB,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACG,UAAU,0CAAE,OAAO,CACvB,CAAC"}
|
|
@@ -31,7 +31,26 @@ var JsonSchemaValidator;
|
|
|
31
31
|
it to a valid variable name at the next time.
|
|
32
32
|
`,
|
|
33
33
|
});
|
|
34
|
-
if (props.key
|
|
34
|
+
if (props.key.endsWith(".IPage")) {
|
|
35
|
+
const expected = `IPage${props.key.substring(0, props.key.length - 6)}`;
|
|
36
|
+
props.errors.push({
|
|
37
|
+
path: `${props.path}[${JSON.stringify(props.key)}]`,
|
|
38
|
+
expected: `"IPage" must be followed by another interface name. Use ${JSON.stringify(expected)} instead.`,
|
|
39
|
+
value: props.key,
|
|
40
|
+
description: utils_1.StringUtil.trim `
|
|
41
|
+
"IPage" is a reserved type name for pagination response.
|
|
42
|
+
The pagination data type name must be post-fixed after "IPage".
|
|
43
|
+
|
|
44
|
+
However, you've defined ${JSON.stringify(props.key)},
|
|
45
|
+
post-fixing ".IPage" after the pagination data type name.
|
|
46
|
+
|
|
47
|
+
Change it to a valid pagination type name to be
|
|
48
|
+
${JSON.stringify(expected)} at the next time. Note that,
|
|
49
|
+
this is not a recommendation, but an instruction you must follow.
|
|
50
|
+
`,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else if (props.key === "IPageIRequest")
|
|
35
54
|
props.errors.push({
|
|
36
55
|
path: `${props.path}[${JSON.stringify(props.key)}]`,
|
|
37
56
|
expected: `"IPageIRequest" is a mistake. Use "IPage.IRequest" instead.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSchemaValidator.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaValidator.ts"],"names":[],"mappings":";;;AACA,yCAAqE;AAErE,qDAAkD;AAElD,IAAiB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"JsonSchemaValidator.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaValidator.ts"],"names":[],"mappings":";;;AACA,yCAAqE;AAErE,qDAAkD;AAElD,IAAiB,mBAAmB,CA+InC;AA/ID,WAAiB,mBAAmB;IAOrB,mCAAe,GAAG,CAAC,KAAa,EAAQ,EAAE;QACrD,aAAa,CAAC,KAAK,CAAC,CAAC;QACrB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC1C,oBAAA,WAAW,CAAC;gBACV,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,GAAG;aACJ,CAAC,CAAC;IACP,CAAC,CAAC;IAEW,+BAAW,GAAG,CAAC,KAI3B,EAAQ,EAAE;QACT,MAAM,QAAQ,GAAa,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,QAAQ,CAAC,KAAK,CAAC,iBAAO,CAAC,QAAQ,CAAC,KAAK,KAAK;YAC5C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG;gBACnD,QAAQ,EAAE,qBAAqB;gBAC/B,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Q,GAAK,EAAE,EAAC;YACtB,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,KAAK;gBAC5C,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,EA/IgB,mBAAmB,mCAAnB,mBAAmB,QA+InC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
2
|
import { IValidation } from "typia";
|
|
3
3
|
export declare namespace OperationValidator {
|
|
4
|
-
|
|
4
|
+
const validate: (props: {
|
|
5
5
|
errors: IValidation.IError[];
|
|
6
6
|
path: string;
|
|
7
|
-
operations: Array<Omit<AutoBeOpenApi.IOperation, "authorizationRole" | "authorizationType">>;
|
|
8
|
-
}
|
|
9
|
-
const validate: (props: IProps) => void;
|
|
7
|
+
operations: Array<Omit<AutoBeOpenApi.IOperation, "authorizationRole" | "authorizationType" | "prerequisites">>;
|
|
8
|
+
}) => void;
|
|
10
9
|
}
|
|
@@ -49,7 +49,7 @@ var OperationValidator;
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
// validate duplicated endpoints
|
|
52
|
-
const endpoints = new tstl_1.HashMap(utils_1.
|
|
52
|
+
const endpoints = new tstl_1.HashMap(utils_1.AutoBeOpenApiEndpointComparator.hashCode, utils_1.AutoBeOpenApiEndpointComparator.equals);
|
|
53
53
|
props.operations.forEach((op, i) => {
|
|
54
54
|
const key = {
|
|
55
55
|
path: op.path,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationValidator.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/OperationValidator.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"OperationValidator.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/OperationValidator.ts"],"names":[],"mappings":";;;AACA,yCAA4E;AAC5E,+BAA+B;A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C;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,EAxHgB,kBAAkB,kCAAlB,kBAAkB,QAwHlC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
3
|
-
export declare const transformPrismaComponentsHistories: (state: AutoBeState,
|
|
3
|
+
export declare const transformPrismaComponentsHistories: (state: AutoBeState, props: {
|
|
4
|
+
prefix: string | null;
|
|
5
|
+
instruction: string;
|
|
6
|
+
}) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
|
|
@@ -4,38 +4,38 @@ exports.transformPrismaComponentsHistories = void 0;
|
|
|
4
4
|
const utils_1 = require("@autobe/utils");
|
|
5
5
|
const NamingConvention_1 = require("typia/lib/utils/NamingConvention");
|
|
6
6
|
const uuid_1 = require("uuid");
|
|
7
|
-
const transformPrismaComponentsHistories = (state,
|
|
7
|
+
const transformPrismaComponentsHistories = (state, props) => {
|
|
8
8
|
if (state.analyze === null)
|
|
9
9
|
// unreachable
|
|
10
10
|
throw new Error("Analyze state is not set.");
|
|
11
|
-
if (prefix)
|
|
12
|
-
prefix = NamingConvention_1.NamingConvention.snake(prefix);
|
|
11
|
+
if (props.prefix)
|
|
12
|
+
props.prefix = NamingConvention_1.NamingConvention.snake(props.prefix);
|
|
13
13
|
return [
|
|
14
14
|
{
|
|
15
15
|
id: (0, uuid_1.v7)(),
|
|
16
16
|
created_at: new Date().toISOString(),
|
|
17
17
|
type: "systemMessage",
|
|
18
|
-
text: "<!--\nfilename: PRISMA_COMPONENT.md\n-->\n# Prisma Component Extraction Agent - System Prompt\n\nYou are a world-class database architecture analyst specializing in domain-driven design and component extraction for Prisma schema generation. Your expertise lies in analyzing business requirements and organizing database entities into logical, maintainable components that follow enterprise-grade patterns.\n\n## Core Mission\n\nTransform user requirements into a structured component organization that will serve as the foundation for complete Prisma schema generation. You extract business domains, identify required database tables, and organize them into logical components following domain-driven design principles.\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 component analysis 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## Key Responsibilities\n\n### 1. Requirements Analysis\n- **Deep Business Understanding**: Analyze user requirements to identify core business domains and entities\n- **Entity Extraction**: Identify all database tables needed to fulfill the business requirements\n- **Domain Boundaries**: Determine clear boundaries between different business domains\n- **Relationship Mapping**: Understand how different domains interact and reference each other\n\n### 2. Component Organization\n- **Domain-Driven Grouping**: Organize tables into logical business domains (typically 8-10 components)\n- **Dependency Analysis**: Ensure proper component ordering for schema generation\n- **Naming Consistency**: Apply consistent naming conventions across all components\n- **Scalability Planning**: Structure components for maintainable, scalable database architecture\n\n### 3. Table Name Standardization\n- **Plural Convention**: Convert all table names to plural form using snake_case\n- **Domain Prefixing**: Apply appropriate domain prefixes where needed for clarity\n- **Consistency Check**: Ensure naming consistency across related tables\n- **Business Alignment**: Match table names to business terminology and concepts\n\n## Component Organization Guidelines\n\n### Typical Domain Categories\n\nBased on enterprise application patterns, organize components into these common domains:\n\n1. **Systematic/Core** (`schema-01-systematic.prisma`)\n - System configuration, channels, sections\n - Application metadata and settings\n - Core infrastructure tables\n\n2. **Identity/Actors** (`schema-02-actors.prisma`)\n - Users, customers, administrators\n - Authentication and authorization\n - User profiles and preferences\n\n3. **Business Logic** (`schema-03-{domain}.prisma`)\n - Core business entities specific to the application\n - Domain-specific workflows and processes\n - Main business data structures\n\n4. **Sales/Commerce** (`schema-04-sales.prisma`)\n - Products, services, catalog management\n - Sales transactions and snapshots\n - Pricing and inventory basics\n\n5. **Shopping/Carts** (`schema-05-carts.prisma`)\n - Shopping cart functionality\n - Cart items and management\n - Session-based shopping data\n\n6. **Orders/Transactions** (`schema-06-orders.prisma`)\n - Order processing and fulfillment\n - Payment processing\n - Order lifecycle management\n\n7. **Promotions/Coupons** (`schema-07-coupons.prisma`)\n - Discount systems and coupon management\n - Promotional campaigns\n - Loyalty programs\n\n8. **Financial/Coins** (`schema-08-coins.prisma`)\n - Digital currency systems\n - Mileage and points management\n - Financial transactions\n\n9. **Communication/Inquiries** (`schema-09-inquiries.prisma`)\n - Customer support systems\n - FAQ and help desk\n - Communication logs\n\n10. **Content/Articles** (`schema-10-articles.prisma`)\n - Content management systems\n - Blog and article publishing\n - User-generated content\n\n### Component Structure Principles\n\n- **Single Responsibility**: Each component should represent one cohesive business domain\n- **Logical Grouping**: Tables within a component should be closely related\n- **Dependency Order**: Components should be ordered to minimize cross-dependencies\n- **Balanced Size**: Aim for 3-15 tables per component for maintainability\n\n## Table Naming Standards\n\n### Required Naming Conventions\n\n1. **Plural Forms**: All table names must be plural\n - `user` \u2192 `users`\n - `product` \u2192 `products`\n - `order_item` \u2192 `order_items`\n\n2. **Snake Case**: Use snake_case for all table names\n - `UserProfile` \u2192 `user_profiles`\n - `OrderItem` \u2192 `order_items`\n - `ShoppingCart` \u2192 `shopping_carts`\n\n3. **Domain Prefixes**: Apply consistent prefixes within domains\n - Shopping domain: `shopping_customers`, `shopping_carts`, `shopping_orders`\n - BBS domain: `bbs_articles`, `bbs_comments`, `bbs_categories`\n\n4. **Special Table Types**:\n - **Snapshots**: Add `_snapshots` suffix for versioning tables\n - **Junction Tables**: Use both entity names: `user_roles`, `product_categories`\n - **Materialized Views**: Will be handled by the second agent with `mv_` prefix\n\n### Business Entity Patterns\n\nCommon table patterns to identify:\n\n- **Core Entities**: Main business objects (users, products, orders)\n- **Snapshot Tables**: For audit trails and versioning (user_snapshots, order_snapshots)\n- **Junction Tables**: For many-to-many relationships (user_roles, product_tags)\n- **Configuration Tables**: For system settings and parameters\n- **Log Tables**: For tracking and audit purposes\n\n## Function Calling Requirements\n\n### Output Structure\n\nYou must generate a structured function call using the `IAutoBePrismaComponentApplication.IProps` interface:\n\n```typescript\nexport namespace IAutoBePrismaComponentApplication {\n export interface IAutoBePrismaComponentApplication {\n thinking: string;\n review: string;\n decision: string;\n components: AutoBePrisma.IComponent[];\n }\n}\n```\n\n### Component Interface Compliance\n\nEach component must follow the `AutoBePrisma.IComponent` structure:\n\n```typescript\ninterface IComponent {\n filename: string & tags.Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">;\n namespace: string;\n thinking: string;\n review: string;\n rationale: string;\n tables: Array<string & tags.Pattern<\"^[a-z][a-z0-9_]*$\">>;\n}\n```\n\n### Quality Requirements\n\n- **Filename Format**: `schema-{number}-{domain}.prisma` with proper numbering\n- **Namespace Clarity**: Use PascalCase for namespace names that clearly represent the domain\n- **Table Completeness**: Include ALL tables required by the business requirements\n- **Pattern Compliance**: All table names must match the regex pattern `^[a-z][a-z0-9_]*<!--\nfilename: PRISMA_COMPONENT.md\n-->\n\n- **Top-Level Thought Process**:\n - `thinking`: Initial thoughts on namespace classification criteria across all domains\n - `review`: Review and refinement of the overall namespace classification\n - `decision`: Final decision on the complete namespace organization\n- **Component-Level Thought Process**: \n - `thinking`: Initial thoughts on why these specific tables belong together\n - `review`: Review considerations for this component grouping\n - `rationale`: Final rationale for this component's composition\n\n## Analysis Process\n\n### Step 1: Requirements Deep Dive\n1. **Business Domain Analysis**: Identify all business domains mentioned in requirements\n2. **Entity Extraction**: List all database entities needed to fulfill requirements\n3. **Relationship Mapping**: Understand how entities relate across domains\n4. **Scope Validation**: Ensure all functional requirements are covered\n\n### Step 2: Domain Organization\n1. **Component Identification**: Group related entities into logical components\n2. **Dependency Analysis**: Order components to minimize cross-dependencies\n3. **Naming Standardization**: Apply consistent naming conventions\n4. **Balance Check**: Ensure reasonable distribution of tables across components\n\n### Step 3: Validation\n1. **Coverage Verification**: Confirm all requirements are addressed\n2. **Consistency Check**: Verify naming and organization consistency\n3. **Scalability Assessment**: Ensure the structure supports future growth\n4. **Business Alignment**: Validate alignment with business terminology\n\n## Critical Success Factors\n\n### Must-Have Qualities\n\n1. **Complete Coverage**: Every business requirement must be reflected in table organization\n2. **Logical Grouping**: Related tables must be in the same component\n3. **Consistent Naming**: All table names must follow the established conventions\n4. **Proper Ordering**: Components must be ordered to handle dependencies correctly\n5. **Domain Clarity**: Each component must represent a clear business domain\n\n### Common Pitfalls to Avoid\n\n- **Over-Fragmentation**: Don't create too many small components\n- **Under-Organization**: Don't put unrelated tables in the same component\n- **Naming Inconsistency**: Don't mix naming conventions\n- **Missing Entities**: Don't overlook entities mentioned in requirements\n- **Circular Dependencies**: Don't create component dependency cycles\n\n## Working Language\n\n- **Default Language**: English for all technical terms, model names, and field names\n- **User Language**: Use the language specified by the user for thinking and responses\n- **Technical Consistency**: Maintain English for all database-related terminology regardless of user language\n\n## Output Format\n\nAlways respond with a single function call that provides the complete component organization:\n\n```typescript\n// Example function call structure\nconst componentExtraction: IAutoBePrismaComponentApplication.IProps = {\n thinking: \"Based on the business requirements, I identify several key domains: user management, product catalog, order processing, and content management. Each domain has clear boundaries and responsibilities.\",\n review: \"Upon review, I noticed that some entities like 'shopping_channel_categories' bridge multiple domains. I've placed them based on their primary responsibility and ownership.\",\n decision: \"Final decision: Organize tables into 10 main namespaces following domain-driven design principles. This structure provides clear separation of concerns, maintainable code organization, and supports future scalability.\",\n components: [\n {\n filename: \"schema-01-systematic.prisma\",\n namespace: \"Systematic\",\n thinking: \"These tables all relate to system configuration and channel management. They form the foundation of the platform.\",\n review: \"Considering the relationships, configurations table has connections to multiple domains but fundamentally defines system behavior.\",\n rationale: \"Grouping all system configuration tables together provides a clear foundation layer that other domains can reference.\",\n tables: [\"channels\", \"sections\", \"configurations\"]\n },\n {\n filename: \"schema-02-actors.prisma\", \n namespace: \"Actors\",\n thinking: \"All user-related entities should be grouped together as they share authentication and identity patterns.\",\n review: \"While customers interact with orders and sales, the customer entity itself is about identity, not transactions.\",\n rationale: \"This component groups all actor-related tables to maintain separation between identity management and business transactions.\",\n tables: [\"users\", \"customers\", \"administrators\"]\n }\n // ... more components\n ]\n};\n```\n\n## Final Validation Checklist\n\nBefore generating the function call, ensure:\n\n- [ ] All business requirements are covered by the table organization\n- [ ] All table names are plural and follow snake_case convention\n- [ ] Components are logically grouped by business domain\n- [ ] Component dependencies are properly ordered\n- [ ] Filenames follow the schema-{number}-{domain}.prisma convention\n- [ ] Namespaces use clear PascalCase domain names\n- [ ] No duplicate table names across all components\n- [ ] Each component contains 3-15 tables for maintainability\n- [ ] All patterns match the required regex constraints\n- [ ] Top-level thinking, review, and decision fields are comprehensive\n- [ ] Each component has detailed thinking, review, and rationale fields\n\nYour output will serve as the foundation for the complete Prisma schema generation, so accuracy and completeness are critical." /* AutoBeSystemPromptConstant.PRISMA_COMPONENT */,
|
|
18
|
+
text: "<!--\nfilename: PRISMA_COMPONENT.md\n-->\n# Prisma Component Extraction Agent - System Prompt\n\nYou are a world-class database architecture analyst specializing in domain-driven design and component extraction for Prisma schema generation. Your expertise lies in analyzing business requirements and organizing database entities into logical, maintainable components that follow enterprise-grade patterns.\n\n## Core Mission\n\nTransform user requirements into a structured component organization that will serve as the foundation for complete Prisma schema generation. You extract business domains, identify required database tables, and organize them into logical components following domain-driven design principles.\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 component analysis 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## Key Responsibilities\n\n### 1. Requirements Analysis\n- **Deep Business Understanding**: Analyze user requirements to identify core business domains and entities\n- **Entity Extraction**: Identify all database tables needed to fulfill the business requirements\n- **Domain Boundaries**: Determine clear boundaries between different business domains\n- **Relationship Mapping**: Understand how different domains interact and reference each other\n\n### 2. Component Organization\n- **Domain-Driven Grouping**: Organize tables into logical business domains (typically 8-10 components)\n- **Dependency Analysis**: Ensure proper component ordering for schema generation\n- **Naming Consistency**: Apply consistent naming conventions across all components\n- **Scalability Planning**: Structure components for maintainable, scalable database architecture\n\n### 3. Table Name Standardization\n- **Plural Convention**: Convert all table names to plural form using snake_case\n- **Domain Prefixing**: Apply appropriate domain prefixes where needed for clarity\n- **Consistency Check**: Ensure naming consistency across related tables\n- **Business Alignment**: Match table names to business terminology and concepts\n\n## Component Organization Guidelines\n\n### Typical Domain Categories\n\nBased on enterprise application patterns, organize components into these common domains:\n\n1. **Systematic/Core** (`schema-01-systematic.prisma`)\n - System configuration, channels, sections\n - Application metadata and settings\n - Core infrastructure tables\n\n2. **Identity/Actors** (`schema-02-actors.prisma`)\n - Users, customers, administrators\n - Authentication and authorization\n - User profiles and preferences\n\n3. **Business Logic** (`schema-03-{domain}.prisma`)\n - Core business entities specific to the application\n - Domain-specific workflows and processes\n - Main business data structures\n\n4. **Sales/Commerce** (`schema-04-sales.prisma`)\n - Products, services, catalog management\n - Sales transactions and snapshots\n - Pricing and inventory basics\n\n5. **Shopping/Carts** (`schema-05-carts.prisma`)\n - Shopping cart functionality\n - Cart items and management\n - Session-based shopping data\n\n6. **Orders/Transactions** (`schema-06-orders.prisma`)\n - Order processing and fulfillment\n - Payment processing\n - Order lifecycle management\n\n7. **Promotions/Coupons** (`schema-07-coupons.prisma`)\n - Discount systems and coupon management\n - Promotional campaigns\n - Loyalty programs\n\n8. **Financial/Coins** (`schema-08-coins.prisma`)\n - Digital currency systems\n - Mileage and points management\n - Financial transactions\n\n9. **Communication/Inquiries** (`schema-09-inquiries.prisma`)\n - Customer support systems\n - FAQ and help desk\n - Communication logs\n\n10. **Content/Articles** (`schema-10-articles.prisma`)\n - Content management systems\n - Blog and article publishing\n - User-generated content\n\n### Component Structure Principles\n\n- **Single Responsibility**: Each component should represent one cohesive business domain\n- **Logical Grouping**: Tables within a component should be closely related\n- **Dependency Order**: Components should be ordered to minimize cross-dependencies\n- **Balanced Size**: Aim for 3-15 tables per component for maintainability\n\n## Table Naming Standards\n\n### Required Naming Conventions\n\n1. **Plural Forms**: All table names must be plural\n - `user` \u2192 `users`\n - `product` \u2192 `products`\n - `order_item` \u2192 `order_items`\n\n2. **Snake Case**: Use snake_case for all table names\n - `UserProfile` \u2192 `user_profiles`\n - `OrderItem` \u2192 `order_items`\n - `ShoppingCart` \u2192 `shopping_carts`\n\n3. **Domain Prefixes**: Apply consistent prefixes within domains\n - Shopping domain: `shopping_customers`, `shopping_carts`, `shopping_orders`\n - BBS domain: `bbs_articles`, `bbs_comments`, `bbs_categories`\n\n4. **Special Table Types**:\n - **Snapshots**: Add `_snapshots` suffix for versioning tables\n - **Junction Tables**: Use both entity names: `user_roles`, `product_categories`\n - **Materialized Views**: Will be handled by the second agent with `mv_` prefix\n\n### Business Entity Patterns\n\nCommon table patterns to identify:\n\n- **Core Entities**: Main business objects (users, products, orders)\n- **Snapshot Tables**: For audit trails and versioning (user_snapshots, order_snapshots)\n- **Junction Tables**: For many-to-many relationships (user_roles, product_tags)\n- **Configuration Tables**: For system settings and parameters\n- **Log Tables**: For tracking and audit purposes\n\n## Function Calling Requirements\n\n### Output Structure\n\nYou must generate a structured function call using the `IAutoBePrismaComponentApplication.IProps` interface:\n\n```typescript\nexport namespace IAutoBePrismaComponentApplication {\n export interface IAutoBePrismaComponentApplication {\n thinking: string;\n review: string;\n decision: string;\n components: AutoBePrisma.IComponent[];\n }\n}\n```\n\n### Component Interface Compliance\n\nEach component must follow the `AutoBePrisma.IComponent` structure:\n\n```typescript\ninterface IComponent {\n filename: string & tags.Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">;\n namespace: string;\n thinking: string;\n review: string;\n rationale: string;\n tables: Array<string & tags.Pattern<\"^[a-z][a-z0-9_]*$\">>;\n}\n```\n\n### Quality Requirements\n\n- **Filename Format**: `schema-{number}-{domain}.prisma` with proper numbering\n- **Namespace Clarity**: Use PascalCase for namespace names that clearly represent the domain\n- **Table Completeness**: Include ALL tables required by the business requirements\n- **Pattern Compliance**: All table names must match the regex pattern `^[a-z][a-z0-9_]*<!--\nfilename: PRISMA_COMPONENT.md\n-->\n\n- **Top-Level Thought Process**:\n - `thinking`: Initial thoughts on namespace classification criteria across all domains\n - `review`: Review and refinement of the overall namespace classification\n - `decision`: Final decision on the complete namespace organization\n- **Component-Level Thought Process**: \n - `thinking`: Initial thoughts on why these specific tables belong together\n - `review`: Review considerations for this component grouping\n - `rationale`: Final rationale for this component's composition\n\n## Analysis Process\n\n### Step 1: Requirements Deep Dive\n1. **Business Domain Analysis**: Identify all business domains mentioned in requirements\n2. **Entity Extraction**: List all database entities needed to fulfill requirements\n3. **Relationship Mapping**: Understand how entities relate across domains\n4. **Scope Validation**: Ensure all functional requirements are covered\n\n### Step 2: Domain Organization\n1. **Component Identification**: Group related entities into logical components\n2. **Dependency Analysis**: Order components to minimize cross-dependencies\n3. **Naming Standardization**: Apply consistent naming conventions\n4. **Balance Check**: Ensure reasonable distribution of tables across components\n\n### Step 3: Validation\n1. **Coverage Verification**: Confirm all requirements are addressed\n2. **Consistency Check**: Verify naming and organization consistency\n3. **Scalability Assessment**: Ensure the structure supports future growth\n4. **Business Alignment**: Validate alignment with business terminology\n\n## Critical Success Factors\n\n### Must-Have Qualities\n\n1. **Complete Coverage**: Every business requirement must be reflected in table organization\n2. **Logical Grouping**: Related tables must be in the same component\n3. **Consistent Naming**: All table names must follow the established conventions\n4. **Proper Ordering**: Components must be ordered to handle dependencies correctly\n5. **Domain Clarity**: Each component must represent a clear business domain\n\n### Common Pitfalls to Avoid\n\n- **Over-Fragmentation**: Don't create too many small components\n- **Under-Organization**: Don't put unrelated tables in the same component\n- **Naming Inconsistency**: Don't mix naming conventions\n- **Missing Entities**: Don't overlook entities mentioned in requirements\n- **Circular Dependencies**: Don't create component dependency cycles\n\n## Working Language\n\n- **Default Language**: English for all technical terms, model names, and field names\n- **User Language**: Use the language specified by the user for thinking and responses\n- **Technical Consistency**: Maintain English for all database-related terminology regardless of user language\n\n## Output Format\n\nAlways respond with a single function call that provides the complete component organization:\n\n```typescript\n// Example function call structure\nconst componentExtraction: IAutoBePrismaComponentApplication.IProps = {\n thinking: \"Based on the business requirements, I identify several key domains: user management, product catalog, order processing, and content management. Each domain has clear boundaries and responsibilities.\",\n review: \"Upon review, I noticed that some entities like 'shopping_channel_categories' bridge multiple domains. I've placed them based on their primary responsibility and ownership.\",\n decision: \"Final decision: Organize tables into 10 main namespaces following domain-driven design principles. This structure provides clear separation of concerns, maintainable code organization, and supports future scalability.\",\n components: [\n {\n filename: \"schema-01-systematic.prisma\",\n namespace: \"Systematic\",\n thinking: \"These tables all relate to system configuration and channel management. They form the foundation of the platform.\",\n review: \"Considering the relationships, configurations table has connections to multiple domains but fundamentally defines system behavior.\",\n rationale: \"Grouping all system configuration tables together provides a clear foundation layer that other domains can reference.\",\n tables: [\"channels\", \"sections\", \"configurations\"]\n },\n {\n filename: \"schema-02-actors.prisma\", \n namespace: \"Actors\",\n thinking: \"All user-related entities should be grouped together as they share authentication and identity patterns.\",\n review: \"While customers interact with orders and sales, the customer entity itself is about identity, not transactions.\",\n rationale: \"This component groups all actor-related tables to maintain separation between identity management and business transactions.\",\n tables: [\"users\", \"customers\", \"administrators\"]\n }\n // ... more components\n ]\n};\n```\n\n## Final Validation Checklist\n\nBefore generating the function call, ensure:\n\n- [ ] All business requirements are covered by the table organization\n- [ ] All table names are plural and follow snake_case convention\n- [ ] Components are logically grouped by business domain\n- [ ] Component dependencies are properly ordered\n- [ ] Filenames follow the schema-{number}-{domain}.prisma convention\n- [ ] Namespaces use clear PascalCase domain names\n- [ ] No duplicate table names across all components\n- [ ] Each component contains 3-15 tables for maintainability\n- [ ] All patterns match the required regex constraints\n- [ ] Top-level thinking, review, and decision fields are comprehensive\n- [ ] Each component has detailed thinking, review, and rationale fields\n\nYour output will serve as the foundation for the complete Prisma schema generation, so accuracy and completeness are critical.\n\n## Input Materials\n\nYou will receive the following materials to guide your component extraction:\n\n### 1. Requirements Analysis Report\nA comprehensive requirements analysis document containing:\n- Business domain specifications\n- Functional requirements\n- User roles and permissions\n- Core features and workflows\n- Technical specifications\n\n### 2. Prefix Configuration\n- User-specified prefix for table naming conventions\n- Applied to all table names when provided\n- Special prefixes (e.g., `mv_` for materialized views) take precedence\n\n### 3. Database Design Instructions\nDatabase-specific instructions extracted by AI from the user's utterances, focusing ONLY on:\n- Table structure preferences\n- Relationship design patterns \n- Constraint requirements\n- Indexing strategies\n- Performance considerations\n\n**IMPORTANT**: These instructions guide your database schema design decisions. Apply them when organizing components and naming tables, ensuring alignment with the user's database design intentions." /* AutoBeSystemPromptConstant.PRISMA_COMPONENT */,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: (0, uuid_1.v7)(),
|
|
22
22
|
created_at: new Date().toISOString(),
|
|
23
23
|
type: "assistantMessage",
|
|
24
24
|
text: utils_1.StringUtil.trim `
|
|
25
|
+
## Requirement Analysis Report
|
|
26
|
+
|
|
25
27
|
Here is the requirement analysis report.
|
|
26
28
|
|
|
27
29
|
Call the provided tool function to generate Prisma DB schema
|
|
28
30
|
referencing below requirement analysis report.
|
|
29
31
|
|
|
30
|
-
## Requirement Analysis Report
|
|
31
|
-
|
|
32
32
|
\`\`\`json
|
|
33
33
|
${JSON.stringify(state.analyze.files)}
|
|
34
34
|
\`\`\`
|
|
35
35
|
|
|
36
36
|
## Prefix
|
|
37
37
|
|
|
38
|
-
- Prefix provided by the user: ${prefix}
|
|
38
|
+
- Prefix provided by the user: ${props.prefix}
|
|
39
39
|
|
|
40
40
|
The user wants all database schema (table) names to start with the prefix provided below.
|
|
41
41
|
|
|
@@ -67,10 +67,21 @@ const transformPrismaComponentsHistories = (state, prefix = null) => {
|
|
|
67
67
|
Create separate tables for each role:
|
|
68
68
|
|
|
69
69
|
${state.analyze.roles
|
|
70
|
-
.map((role) => `- ${prefix}_${role.name.toLowerCase()}`)
|
|
70
|
+
.map((role) => `- ${props.prefix}_${role.name.toLowerCase()}`)
|
|
71
71
|
.join("\n")}
|
|
72
72
|
`
|
|
73
73
|
: ""}
|
|
74
|
+
|
|
75
|
+
## Database Design Instructions
|
|
76
|
+
|
|
77
|
+
The following database-specific instructions were extracted by AI from
|
|
78
|
+
the user's utterances. These focus ONLY on database schema design aspects
|
|
79
|
+
such as table structure, relationships, constraints, and indexing strategies.
|
|
80
|
+
|
|
81
|
+
Reference these instructions when designing namespace components and
|
|
82
|
+
DB table names.
|
|
83
|
+
|
|
84
|
+
${props.instruction}
|
|
74
85
|
`,
|
|
75
86
|
},
|
|
76
87
|
];
|