@autobe/agent 0.18.0 → 0.19.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/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeAgent.js +5 -0
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeMockAgent.js +7 -2
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +14 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.d.ts +10 -0
- package/lib/agent/src/factory/consentFunctionCall.js +212 -0
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +71 -14
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +4 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +16 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +8 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +7 -7
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +24 -37
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +2 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +9 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +29 -9
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +1565 -1142
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +22 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +11 -15
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +32 -26
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +135 -124
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +371 -209
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +185 -179
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +35 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +11 -17
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +13 -4
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +6 -10
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +35 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +44 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +40 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +5 -5
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +278 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +12 -20
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +3 -3
- package/lib/agent/src/orchestrate/realize/internal/compile.js +9 -26
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +59 -42
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +17 -16
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -19
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeCoderApplication.js → IAutoBeRealizeCorrectApplication.js} +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +5 -1
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +95 -50
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +12 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +4 -4
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +119 -16
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/agent/src/orchestrate/{internal/IProgress.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
- package/lib/agent/src/utils/predicateStateMessage.d.ts +4 -0
- package/lib/agent/src/utils/predicateStateMessage.js +87 -0
- package/lib/agent/src/utils/predicateStateMessage.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/factory/consentFunctionCall.d.ts +10 -0
- package/lib/index.mjs +3036 -1648
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/orchestrate/realize/internal/compile.d.ts +3 -3
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/utils/predicateStateMessage.d.ts +4 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +14 -0
- package/src/AutoBeMockAgent.ts +9 -11
- package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
- package/src/context/AutoBeTokenUsageComponent.ts +20 -0
- package/src/factory/consentFunctionCall.ts +128 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeContext.ts +99 -14
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +11 -4
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +26 -4
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +19 -14
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +3 -3
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +8 -32
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -3
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +16 -16
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +1 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -10
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterface.ts +51 -12
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +126 -23
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +6 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +32 -27
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +49 -32
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +127 -33
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +67 -65
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +16 -16
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +62 -14
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +38 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +47 -14
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +18 -24
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +41 -0
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +9 -16
- package/src/orchestrate/prisma/orchestratePrisma.ts +15 -6
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -19
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +15 -9
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +1 -1
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +19 -23
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +4 -2
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +285 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -27
- package/src/orchestrate/realize/internal/compile.ts +28 -45
- package/src/orchestrate/realize/orchestrateRealize.ts +71 -67
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +3 -3
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +19 -15
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +23 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +19 -16
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +7 -0
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +110 -59
- package/src/orchestrate/test/orchestrateTest.ts +12 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +155 -19
- package/src/orchestrate/test/orchestrateTestWrite.ts +3 -3
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +6 -5
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
- package/src/utils/predicateStateMessage.ts +107 -0
- package/lib/agent/src/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/agent/src/orchestrate/internal/IProgress.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js +0 -213
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -5
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +0 -1
- package/lib/agent/src/utils/pipe.d.ts +0 -5
- package/lib/agent/src/utils/pipe.js +0 -14
- package/lib/agent/src/utils/pipe.js.map +0 -1
- package/lib/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/utils/pipe.d.ts +0 -5
- package/src/orchestrate/internal/IProgress.ts +0 -4
- package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +0 -358
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +0 -70
- package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +0 -2
- package/src/utils/pipe.ts +0 -39
- /package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/lib/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.ts → IAutoBeRealizeCorrectApplication.ts} +0 -0
package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export interface IAutoBeInterfaceGroupApplication {
|
|
|
4
4
|
* Generate logical groups for organizing API endpoint creation based on
|
|
5
5
|
* Prisma schema structure.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* structure, table prefixes) rather than arbitrary business domains.
|
|
9
|
-
*
|
|
10
|
-
* all requirements.
|
|
7
|
+
* DO: Derive groups from Prisma schema organization (namespaces, file
|
|
8
|
+
* structure, table prefixes) rather than arbitrary business domains.
|
|
9
|
+
* DO: Create new groups only when existing schema structure cannot adequately
|
|
10
|
+
* cover all requirements.
|
|
11
11
|
*
|
|
12
12
|
* @param props Properties containing the groups to be created for API
|
|
13
13
|
* organization
|
|
@@ -19,8 +19,8 @@ export declare namespace IAutoBeInterfaceGroupApplication {
|
|
|
19
19
|
/**
|
|
20
20
|
* Array of API endpoint groups for organizing development.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* DO: Organize groups around existing Prisma schema structure.
|
|
23
|
+
* DO: Provide complete coverage of all entities and requirements without
|
|
24
24
|
* overlap.
|
|
25
25
|
*/
|
|
26
26
|
groups: IGroup[] & tags.MinItems<1>;
|
|
@@ -31,10 +31,11 @@ export declare namespace IAutoBeInterfaceGroupApplication {
|
|
|
31
31
|
*
|
|
32
32
|
* **SCHEMA-BASED GROUP REQUIREMENTS:**
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* and
|
|
34
|
+
* DO: Derive groups from the Prisma schema structure rather than arbitrary
|
|
35
|
+
* business domain names.
|
|
36
|
+
*
|
|
37
|
+
* This ensures consistency with the underlying data model and prevents
|
|
38
|
+
* misalignment between API organization and database structure.
|
|
38
39
|
*
|
|
39
40
|
* **Primary Group Sources (in order of priority):**
|
|
40
41
|
*
|
|
@@ -48,12 +49,11 @@ export declare namespace IAutoBeInterfaceGroupApplication {
|
|
|
48
49
|
*
|
|
49
50
|
* **Group Creation Guidelines:**
|
|
50
51
|
*
|
|
51
|
-
* - Each group
|
|
52
|
+
* - Each group covers specific Prisma schema entities without overlap
|
|
52
53
|
* - Size groups appropriately for manageable endpoint generation cycles
|
|
53
54
|
* - Maintain clear boundaries based on schema organization
|
|
54
55
|
* - Ensure complete coverage of all database entities and requirements
|
|
55
|
-
* - Related database tables within the same schema area
|
|
56
|
-
* together
|
|
56
|
+
* - Related database tables within the same schema area are grouped together
|
|
57
57
|
*
|
|
58
58
|
* **When to Create Schema-Independent Groups:**
|
|
59
59
|
*
|
|
@@ -68,14 +68,14 @@ export declare namespace IAutoBeInterfaceGroupApplication {
|
|
|
68
68
|
* **Naming Standards:**
|
|
69
69
|
*
|
|
70
70
|
* - Use PascalCase format (e.g., "Shopping", "BBS", "UserManagement")
|
|
71
|
-
* - Names
|
|
71
|
+
* - Names directly reflect Prisma schema structure
|
|
72
72
|
* - Keep names concise and schema-derived
|
|
73
73
|
* - Avoid arbitrary business domain names
|
|
74
74
|
* - Maintain consistency with schema organization
|
|
75
75
|
*
|
|
76
76
|
* **Quality Requirements:**
|
|
77
77
|
*
|
|
78
|
-
* - Groups collectively
|
|
78
|
+
* - Groups collectively cover ALL entities and requirements
|
|
79
79
|
* - Each database entity belongs to exactly one group
|
|
80
80
|
* - Clear mapping to specific Prisma schema elements
|
|
81
81
|
* - Balance group sizes within schema constraints
|
|
@@ -85,7 +85,7 @@ export declare namespace IAutoBeInterfaceGroupApplication {
|
|
|
85
85
|
/**
|
|
86
86
|
* Unique identifier name derived from Prisma schema structure.
|
|
87
87
|
*
|
|
88
|
-
*
|
|
88
|
+
* DO: Correspond to schema namespaces, file names, table prefixes, or
|
|
89
89
|
* organizational annotations rather than arbitrary business domain names.
|
|
90
90
|
*/
|
|
91
91
|
name: string & tags.MinLength<1>;
|
package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare namespace IAutoBeInterfaceOperationApplication {
|
|
|
22
22
|
/**
|
|
23
23
|
* Array of API operations to generate.
|
|
24
24
|
*
|
|
25
|
-
* Each operation in this array
|
|
25
|
+
* Each operation in this array includes:
|
|
26
26
|
*
|
|
27
27
|
* - Specification: Detailed API specification with clear purpose and
|
|
28
28
|
* functionality
|
|
@@ -37,7 +37,7 @@ export declare namespace IAutoBeInterfaceOperationApplication {
|
|
|
37
37
|
* components.schemas
|
|
38
38
|
* - ResponseBody: With typeName referencing appropriate response type
|
|
39
39
|
*
|
|
40
|
-
* All operations
|
|
40
|
+
* All operations follow strict quality standards:
|
|
41
41
|
*
|
|
42
42
|
* 1. Detailed descriptions referencing Prisma schema comments
|
|
43
43
|
* 2. Accurate parameter definitions matching path parameters
|
|
@@ -64,11 +64,10 @@ export declare namespace IAutoBeInterfaceOperationApplication {
|
|
|
64
64
|
* reason and description fields, making it clear why the API was designed and
|
|
65
65
|
* how it should be used.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* content-type
|
|
70
|
-
*
|
|
71
|
-
* instead of binary data formats.
|
|
67
|
+
* DO: Use object types for all request bodies and responses. DO: Reference
|
|
68
|
+
* named types defined in the components section. DO: Use `application/json`
|
|
69
|
+
* as the content-type. DO: Use `string & tags.Format<"uri">` in the schema
|
|
70
|
+
* for file upload/download operations instead of binary data formats.
|
|
72
71
|
*
|
|
73
72
|
* In OpenAPI, this might represent:
|
|
74
73
|
*
|
|
@@ -85,7 +84,7 @@ export declare namespace IAutoBeInterfaceOperationApplication {
|
|
|
85
84
|
* }
|
|
86
85
|
* ```
|
|
87
86
|
*/
|
|
88
|
-
interface IOperation extends Omit<AutoBeOpenApi.IOperation, "authorizationRole"> {
|
|
87
|
+
interface IOperation extends Omit<AutoBeOpenApi.IOperation, "authorizationRole" | "authorizationType"> {
|
|
89
88
|
/**
|
|
90
89
|
* Authorization roles required to access this API operation.
|
|
91
90
|
*
|
|
@@ -93,16 +92,47 @@ export declare namespace IAutoBeInterfaceOperationApplication {
|
|
|
93
92
|
* endpoint. Multiple roles can be specified to allow different types of
|
|
94
93
|
* users to access the same endpoint.
|
|
95
94
|
*
|
|
95
|
+
* ## ⚠️ CRITICAL: Role Multiplication Effect
|
|
96
|
+
*
|
|
97
|
+
* **EACH ROLE IN THIS ARRAY GENERATES A SEPARATE ENDPOINT**
|
|
98
|
+
*
|
|
99
|
+
* - If you specify `["admin", "moderator", "member"]`, this creates 3
|
|
100
|
+
* separate endpoints
|
|
101
|
+
* - Total generated endpoints = operations × average roles.length
|
|
102
|
+
* - Example: 100 operations with 3 roles each = 300 actual endpoints
|
|
103
|
+
*
|
|
104
|
+
* ## 🔴 AVOID OVER-GENERATION
|
|
105
|
+
*
|
|
106
|
+
* **DO NOT create role-specific endpoints when a public endpoint would
|
|
107
|
+
* suffice:**
|
|
108
|
+
*
|
|
109
|
+
* - ❌ BAD: Separate GET endpoints for admin, member, moderator to view the
|
|
110
|
+
* same public data
|
|
111
|
+
* - ✅ GOOD: Single public endpoint `[]` with role-based filtering in business
|
|
112
|
+
* logic
|
|
113
|
+
*
|
|
114
|
+
* **DO NOT enumerate all possible roles when the Prisma schema uses a
|
|
115
|
+
* single User table:**
|
|
116
|
+
*
|
|
117
|
+
* - If Prisma has a User table with role/permission fields, you likely only
|
|
118
|
+
* need `["user"]`
|
|
119
|
+
* - Avoid listing `["admin", "seller", "buyer", "moderator", ...]`
|
|
120
|
+
* unnecessarily
|
|
121
|
+
* - The actual role checking happens in business logic, not at the endpoint
|
|
122
|
+
* level
|
|
123
|
+
*
|
|
96
124
|
* ## Naming Convention
|
|
97
125
|
*
|
|
98
|
-
*
|
|
126
|
+
* DO: Use camelCase for all role names.
|
|
99
127
|
*
|
|
100
128
|
* ## Important Guidelines
|
|
101
129
|
*
|
|
102
130
|
* - Set to empty array `[]` for public endpoints that require no
|
|
103
131
|
* authentication
|
|
104
132
|
* - Set to array with role strings for role-restricted endpoints
|
|
105
|
-
* -
|
|
133
|
+
* - **MINIMIZE the number of roles per endpoint to prevent explosion**
|
|
134
|
+
* - Consider if the endpoint can be public with role-based filtering instead
|
|
135
|
+
* - The role names match exactly with the user type/role defined in the
|
|
106
136
|
* database
|
|
107
137
|
* - This will be used by the Realize Agent to generate appropriate decorator
|
|
108
138
|
* and authorization logic in the provider functions
|
|
@@ -111,11 +141,26 @@ export declare namespace IAutoBeInterfaceOperationApplication {
|
|
|
111
141
|
*
|
|
112
142
|
* ## Examples
|
|
113
143
|
*
|
|
114
|
-
* - `[]` - Public endpoint, no authentication required
|
|
115
|
-
*
|
|
116
|
-
* - `["
|
|
144
|
+
* - `[]` - Public endpoint, no authentication required (PREFERRED for read
|
|
145
|
+
* operations)
|
|
146
|
+
* - `["user"]` - Any authenticated user can access (PREFERRED for
|
|
147
|
+
* user-specific operations)
|
|
148
|
+
* - `["admin"]` - Only admin users can access (USE SPARINGLY)
|
|
117
149
|
* - `["admin", "moderator"]` - Both admin and moderator users can access
|
|
118
|
-
*
|
|
150
|
+
* (AVOID if possible)
|
|
151
|
+
* - `["seller"]` - Only seller users can access (ONLY if Seller is a separate
|
|
152
|
+
* table)
|
|
153
|
+
*
|
|
154
|
+
* ## Best Practices
|
|
155
|
+
*
|
|
156
|
+
* 1. **Start with public `[]` for all read operations** unless sensitive data
|
|
157
|
+
* is involved
|
|
158
|
+
* 2. **Use single role `["user"]` for authenticated operations** and handle
|
|
159
|
+
* permissions in business logic
|
|
160
|
+
* 3. **Only use multiple roles when absolutely necessary** for different
|
|
161
|
+
* business logic paths
|
|
162
|
+
* 4. **Remember: Fewer roles = Fewer endpoints = Better performance and
|
|
163
|
+
* maintainability**
|
|
119
164
|
*
|
|
120
165
|
* Note: The actual authentication/authorization implementation will be
|
|
121
166
|
* handled by decorators at the controller level, and the provider function
|
|
@@ -91,6 +91,42 @@ export declare namespace IAutoBeInterfaceOperationsReviewApplication {
|
|
|
91
91
|
* operations unchanged. These operations are validated and ready for schema
|
|
92
92
|
* generation and subsequent implementation phases.
|
|
93
93
|
*/
|
|
94
|
-
content:
|
|
94
|
+
content: IOperation[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Operation of the Restful API.
|
|
98
|
+
*
|
|
99
|
+
* This interface defines a single API endpoint with its HTTP {@link method},
|
|
100
|
+
* {@link path}, {@link parameters path parameters},
|
|
101
|
+
* {@link requestBody request body}, and {@link responseBody} structure. It
|
|
102
|
+
* corresponds to an individual operation in the paths section of an OpenAPI
|
|
103
|
+
* document.
|
|
104
|
+
*
|
|
105
|
+
* Each operation requires a detailed explanation of its purpose through the
|
|
106
|
+
* reason and description fields, making it clear why the API was designed and
|
|
107
|
+
* how it should be used.
|
|
108
|
+
*
|
|
109
|
+
* All request bodies and responses for this operation must be object types
|
|
110
|
+
* and must reference named types defined in the components section. The
|
|
111
|
+
* content-type is always `application/json`. For file upload/download
|
|
112
|
+
* operations, use `string & tags.Format<"uri">` in the appropriate schema
|
|
113
|
+
* instead of binary data formats.
|
|
114
|
+
*
|
|
115
|
+
* In OpenAPI, this might represent:
|
|
116
|
+
*
|
|
117
|
+
* ```json
|
|
118
|
+
* {
|
|
119
|
+
* "/shoppings/customers/orders": {
|
|
120
|
+
* "post": {
|
|
121
|
+
* "description": "Create a new order application from shopping cart...",
|
|
122
|
+
* "parameters": [...],
|
|
123
|
+
* "requestBody": {...},
|
|
124
|
+
* "responses": {...}
|
|
125
|
+
* }
|
|
126
|
+
* }
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
interface IOperation extends Omit<AutoBeOpenApi.IOperation, "authorizationType"> {
|
|
95
131
|
}
|
|
96
132
|
}
|
package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts
CHANGED
|
@@ -13,10 +13,9 @@ export interface IAutoBeInterfaceSchemaApplication {
|
|
|
13
13
|
* creation. This ensures that the final OpenAPI document has complete type
|
|
14
14
|
* coverage for all operations.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* comments.
|
|
16
|
+
* DO: Follow established naming conventions (IEntityName,
|
|
17
|
+
* IEntityName.ICreate, etc.) DO: Document thoroughly with descriptions that
|
|
18
|
+
* reference the original Prisma schema comments.
|
|
20
19
|
*
|
|
21
20
|
* @param props Properties containing components to generate.
|
|
22
21
|
*/
|
|
@@ -24,6 +23,39 @@ export interface IAutoBeInterfaceSchemaApplication {
|
|
|
24
23
|
}
|
|
25
24
|
export declare namespace IAutoBeInterfaceSchemaApplication {
|
|
26
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;
|
|
27
59
|
/**
|
|
28
60
|
* Complete set of schema components for the OpenAPI specification.
|
|
29
61
|
*
|
|
@@ -31,23 +63,23 @@ export declare namespace IAutoBeInterfaceSchemaApplication {
|
|
|
31
63
|
* the system. It is the central repository of all named schema types that
|
|
32
64
|
* will be used throughout the API specification.
|
|
33
65
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* strictly prohibited.
|
|
66
|
+
* DO: Define all object types as named types in the components.schemas
|
|
67
|
+
* section. DO NOT: Use inline anonymous object definitions.
|
|
37
68
|
*
|
|
38
|
-
* This components object
|
|
69
|
+
* This components object includes:
|
|
39
70
|
*
|
|
40
71
|
* - Main entity types (IEntityName)
|
|
41
72
|
* - Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)
|
|
42
73
|
* - Container types (IPage<T> for pagination)
|
|
43
74
|
* - Enumeration types
|
|
44
75
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
76
|
+
* DO: Include detailed descriptions that reference the original Prisma
|
|
77
|
+
* schema comments and thoroughly document each property. DO: Use a $ref to
|
|
78
|
+
* a named type in the components.schemas section for every property that
|
|
79
|
+
* references an object.
|
|
80
|
+
*
|
|
81
|
+
* This applies to all objects in request bodies, response bodies, and
|
|
82
|
+
* properties that are objects or arrays of objects.
|
|
51
83
|
*
|
|
52
84
|
* Example structure:
|
|
53
85
|
*
|
package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts
CHANGED
|
@@ -30,19 +30,16 @@ export declare namespace IAutoBeInterfaceSchemasReviewApplication {
|
|
|
30
30
|
/**
|
|
31
31
|
* Issues and problems found during schema analysis.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* - Positive feedback about what's already correct
|
|
36
|
-
* - Compliments about well-structured schemas
|
|
37
|
-
* - Confirmation that certain aspects meet standards
|
|
33
|
+
* DO: Document only problems that need fixing.
|
|
34
|
+
* DO NOT: Include positive feedback, compliments, or confirmations
|
|
38
35
|
*
|
|
39
36
|
* Focus exclusively on issues organized by severity:
|
|
40
37
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* -
|
|
44
|
-
* -
|
|
45
|
-
* -
|
|
38
|
+
* Severity levels:
|
|
39
|
+
* - Security vulnerabilities (exposed passwords, missing auth boundaries)
|
|
40
|
+
* - Missing required variants, incorrect type mappings
|
|
41
|
+
* - Missing format specifications, incomplete relationships
|
|
42
|
+
* - Documentation improvements, style consistency
|
|
46
43
|
*
|
|
47
44
|
* Each issue must include the specific schema name and what needs to be
|
|
48
45
|
* fixed. If there are no issues at all, simply state: "No issues found."
|
|
@@ -66,21 +63,18 @@ export declare namespace IAutoBeInterfaceSchemasReviewApplication {
|
|
|
66
63
|
/**
|
|
67
64
|
* Final validated and enhanced schemas ready for production use.
|
|
68
65
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* -
|
|
72
|
-
* -
|
|
73
|
-
* -
|
|
74
|
-
* -
|
|
75
|
-
* - If entity names are wrong, MUST contain renamed correct versions
|
|
76
|
-
* - If schemas are missing variants, MUST include the created variants
|
|
77
|
-
*
|
|
78
|
-
* FORBIDDEN:
|
|
66
|
+
* DO:
|
|
67
|
+
* - Include valid OpenAPI schema definitions
|
|
68
|
+
* - Include all entities that were in the original input
|
|
69
|
+
* - Provide fixed versions if original schemas have issues
|
|
70
|
+
* - Rename entities correctly if names are wrong
|
|
71
|
+
* - Include created variants if schemas are missing them
|
|
79
72
|
*
|
|
80
|
-
*
|
|
81
|
-
* -
|
|
82
|
-
* -
|
|
83
|
-
* -
|
|
73
|
+
* DO NOT:
|
|
74
|
+
* - Return an empty object {} (this will delete all schemas)
|
|
75
|
+
* - Return undefined or null
|
|
76
|
+
* - Include explanations or excuses in schema descriptions
|
|
77
|
+
* - Leave broken schemas unfixed
|
|
84
78
|
*
|
|
85
79
|
* When original schemas are beyond repair, recreate them properly based on
|
|
86
80
|
* entity names and context. This field becomes the final schemas used by
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
import { IValidation } from "typia";
|
|
3
|
+
export declare const validateAuthorizationSchema: (props: {
|
|
4
|
+
errors: IValidation.IError[];
|
|
5
|
+
schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
6
|
+
path: string;
|
|
7
|
+
}) => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateAuthorizationSchema = void 0;
|
|
4
|
+
const validateAuthorizationSchema = (props) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
for (const [key, value] of Object.entries(props.schemas)) {
|
|
7
|
+
if (!key.endsWith(".IAuthorized"))
|
|
8
|
+
continue;
|
|
9
|
+
// Check if it's an object type
|
|
10
|
+
if (!isObjectSchema(value)) {
|
|
11
|
+
props.errors.push({
|
|
12
|
+
path: `${props.path}.${key}`,
|
|
13
|
+
expected: `AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema.IObject>`,
|
|
14
|
+
value: value,
|
|
15
|
+
description: `${key} must be an object type for authorization responses`,
|
|
16
|
+
});
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
// Check if token property exists
|
|
20
|
+
(_a = value.properties) !== null && _a !== void 0 ? _a : (value.properties = {});
|
|
21
|
+
value.properties["token"] = {
|
|
22
|
+
$ref: "#/components/schemas/IAuthorizationToken",
|
|
23
|
+
description: "JWT token information for authentication",
|
|
24
|
+
};
|
|
25
|
+
(_b = value.required) !== null && _b !== void 0 ? _b : (value.required = []);
|
|
26
|
+
if (value.required.includes("token") === false) {
|
|
27
|
+
value.required.push("token");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.validateAuthorizationSchema = validateAuthorizationSchema;
|
|
32
|
+
const isObjectSchema = (schema) => {
|
|
33
|
+
return "type" in schema && schema.type === "object";
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=validateAuthorizationSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateAuthorizationSchema.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/interface/utils/validateAuthorizationSchema.ts"],"names":[],"mappings":";;;AAGO,MAAM,2BAA2B,GAAG,CAAC,KAI3C,EAAQ,EAAE;;IACT,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC;YAAE,SAAS;QAE5C,+BAA+B;QAC/B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE;gBAC5B,QAAQ,EAAE,yEAAyE;gBACnF,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,GAAG,GAAG,qDAAqD;aACzE,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QAED,iCAAiC;QACjC,MAAA,KAAK,CAAC,UAAU,oCAAhB,KAAK,CAAC,UAAU,GAAK,EAAE,EAAC;QACxB,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG;YAC1B,IAAI,EAAE,0CAA0C;YAChD,WAAW,EAAE,0CAA0C;SACsB,CAAC;QAEhF,MAAA,KAAK,CAAC,QAAQ,oCAAd,KAAK,CAAC,QAAQ,GAAK,EAAE,EAAC;QACtB,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,KAAK,EAAE,CAAC;YAC/C,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AA/BW,QAAA,2BAA2B,+BA+BtC;AAEF,MAAM,cAAc,GAAG,CACrB,MAA4C,EACuC,EAAE;IACrF,OAAO,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformPrismaComponentsHistories = void 0;
|
|
4
|
+
const NamingConvention_1 = require("typia/lib/utils/NamingConvention");
|
|
4
5
|
const uuid_1 = require("uuid");
|
|
5
6
|
const transformPrismaComponentsHistories = (state, prefix = null) => {
|
|
6
7
|
if (state.analyze === null)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type: "systemMessage",
|
|
12
|
-
text: [
|
|
13
|
-
"Requirement analysis is not yet completed.",
|
|
14
|
-
"Don't call any tool function,",
|
|
15
|
-
"but say to process the requirement analysis.",
|
|
16
|
-
].join(" "),
|
|
17
|
-
},
|
|
18
|
-
];
|
|
8
|
+
// unreachable
|
|
9
|
+
throw new Error("Analyze state is not set.");
|
|
10
|
+
if (prefix)
|
|
11
|
+
prefix = NamingConvention_1.NamingConvention.snake(prefix);
|
|
19
12
|
return [
|
|
20
13
|
{
|
|
21
14
|
id: (0, uuid_1.v4)(),
|
|
22
15
|
created_at: new Date().toISOString(),
|
|
23
16
|
type: "systemMessage",
|
|
24
|
-
text: "# 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\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\ninterface IAutoBePrismaComponentApplication.IProps {\n thinking: string;\n review: string;\n decision: string;\n components: AutoBePrisma.IComponent[];\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_]*$`\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 */,
|
|
17
|
+
text: "# 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\ninterface IAutoBePrismaComponentApplication.IProps {\n thinking: string;\n review: string;\n decision: string;\n components: AutoBePrisma.IComponent[];\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_]*$`\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 */,
|
|
25
18
|
},
|
|
26
19
|
{
|
|
27
20
|
id: (0, uuid_1.v4)(),
|
|
@@ -43,13 +36,14 @@ const transformPrismaComponentsHistories = (state, prefix = null) => {
|
|
|
43
36
|
`* Prefix provided by the user: ${prefix}`,
|
|
44
37
|
"",
|
|
45
38
|
"The user wants all database schema (table) names to start with the prefix provided below.",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
39
|
+
"",
|
|
40
|
+
"DO: Use the provided prefix for all table names",
|
|
41
|
+
"DO: Place special-purpose prefixes like `mv` (for materialized views) before the given prefix",
|
|
42
|
+
"DO NOT: Apply prefix if it is `null`",
|
|
49
43
|
"",
|
|
50
44
|
"## Prefix Example",
|
|
51
45
|
"",
|
|
52
|
-
"If the prefix is `shopping`, then table names
|
|
46
|
+
"If the prefix is `shopping`, then table names are like:",
|
|
53
47
|
"",
|
|
54
48
|
"* `shopping_sales`",
|
|
55
49
|
"* `shopping_sale_options`",
|
package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,SAAwB,IAAI,EAG5B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,
|
|
1
|
+
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,uEAAoE;AACpE,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,SAAwB,IAAI,EAG5B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,cAAc;QACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,IAAI,MAAM;QAAE,MAAM,GAAG,mCAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpD,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,wkaAA6C;SAClD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACnC,KAAK;gBACL,WAAW;gBACX,EAAE;gBACF,kCAAkC,MAAM,EAAE;gBAC1C,EAAE;gBACF,2FAA2F;gBAC3F,EAAE;gBACF,iDAAiD;gBACjD,+FAA+F;gBAC/F,sCAAsC;gBACtC,EAAE;gBACF,mBAAmB;gBACnB,EAAE;gBACF,yDAAyD;gBACzD,EAAE;gBACF,oBAAoB;gBACpB,2BAA2B;gBAC3B,EAAE;gBACF,uIAAuI;gBACvI,cAAc;gBACd,EAAE;gBACF,6BAA6B;gBAC7B,EAAE;gBACF,EAAE;gBACF,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;oBAC5B,CAAC,CAAC;wBACE,uBAAuB;wBACvB,EAAE;wBACF,sEAAsE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;wBACvG,EAAE;wBACF,sDAAsD;wBACtD,uFAAuF;wBACvF,EAAE;wBACF,uCAAuC;wBACvC,EAAE;wBACF,KAAK,CAAC,OAAO,CAAC,KAAK;6BAChB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;6BACvD,IAAI,CAAC,IAAI,CAAC;wBACb,EAAE;qBACH,CAAC,IAAI,CAAC,IAAI,CAAC;oBACd,CAAC,CAAC,EAAE;aACP,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AA3EW,QAAA,kCAAkC,sCA2E7C"}
|