@autobe/agent 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeAgent.js +8 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeMockAgent.js +10 -5
- 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/AutoBeContext.d.ts +1 -0
- 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 +213 -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 +79 -19
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +41 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -9
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +45 -31
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +25 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +8 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +15 -12
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +33 -44
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +10 -4
- 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 +45 -45
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +14 -14
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -30
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +24 -31
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +4 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +27 -26
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +13 -12
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +4 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +11 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +36 -29
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +31 -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 +1571 -1144
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +24 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +6 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +12 -14
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +103 -71
- 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 +147 -116
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +401 -233
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +362 -178
- 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 +97 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +75 -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 +60 -66
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +19 -30
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +38 -35
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +39 -26
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +15 -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 +7 -9
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +38 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +61 -10
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +68 -24
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +24 -21
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +59 -57
- 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 +17 -13
- 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 +287 -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 +46 -49
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +7 -0
- package/lib/agent/src/orchestrate/realize/internal/{compile.js → compileRealizeFiles.js} +12 -29
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +76 -45
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +15 -9
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +9 -7
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +25 -20
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +8 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +36 -27
- 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/{internal/IProgress.js → realize/structures/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/compile/completeTestCode.js +13 -10
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +17 -16
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +33 -32
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.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 +97 -49
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +3 -3
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +17 -4
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +18 -9
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +138 -23
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +17 -17
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +7 -6
- 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/{realize/structures/IAutoBeRealizeCoderApplication.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/agent/src/utils/executeCachedBatch.d.ts +1 -0
- package/lib/agent/src/utils/executeCachedBatch.js +23 -0
- package/lib/agent/src/utils/executeCachedBatch.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/AutoBeContext.d.ts +1 -0
- package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/factory/consentFunctionCall.d.ts +10 -0
- package/lib/index.mjs +4799 -2637
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +8 -3
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- 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/orchestrateInterfaceSchemasReview.d.ts +2 -5
- 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 +97 -14
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +75 -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/compileRealizeFiles.d.ts +7 -0
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +8 -6
- 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 +7 -6
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/utils/executeCachedBatch.d.ts +1 -0
- package/lib/utils/predicateStateMessage.d.ts +4 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +18 -3
- package/src/AutoBeMockAgent.ts +13 -15
- package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
- package/src/context/AutoBeContext.ts +1 -0
- package/src/context/AutoBeTokenUsageComponent.ts +20 -0
- package/src/factory/consentFunctionCall.ts +129 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeContext.ts +108 -20
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +53 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +13 -10
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +68 -47
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +33 -21
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +21 -10
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +18 -40
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +15 -8
- 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 +47 -47
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +14 -14
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +31 -30
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +20 -29
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +3 -3
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +23 -22
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +12 -11
- package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +11 -10
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +37 -30
- package/src/orchestrate/interface/orchestrateInterface.ts +53 -12
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +142 -32
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +13 -9
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +8 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +82 -74
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +51 -32
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +174 -56
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +149 -63
- 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 +101 -14
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +77 -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 +61 -66
- package/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.ts +19 -30
- package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +38 -35
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +36 -23
- package/src/orchestrate/prisma/orchestratePrisma.ts +17 -6
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +8 -19
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +3 -0
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +37 -18
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +25 -17
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +24 -21
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +57 -59
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +20 -14
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +294 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +62 -57
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +71 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +109 -86
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +22 -13
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -0
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +28 -24
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +0 -74
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +37 -28
- 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/compile/completeTestCode.ts +17 -13
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +17 -16
- package/src/orchestrate/test/histories/transformTestHistories.ts +35 -34
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +116 -60
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +3 -3
- package/src/orchestrate/test/orchestrateTest.ts +18 -8
- package/src/orchestrate/test/orchestrateTestCorrect.ts +34 -24
- package/src/orchestrate/test/orchestrateTestScenario.ts +179 -36
- package/src/orchestrate/test/orchestrateTestWrite.ts +18 -19
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +7 -6
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +2 -2
- package/src/utils/executeCachedBatch.ts +15 -0
- package/src/utils/predicateStateMessage.ts +107 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +0 -46
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +0 -1
- 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/internal/compile.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/internal/compile.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/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -4
- package/lib/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/orchestrate/realize/internal/compile.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/analyze/histories/transformAnalyzeReviewerHistories.ts +0 -53
- package/src/orchestrate/internal/IProgress.ts +0 -4
- package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
- package/src/orchestrate/realize/internal/compile.ts +0 -84
- 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
|
@@ -14,10 +14,9 @@ export interface IAutoBeInterfaceSchemaApplication {
|
|
|
14
14
|
* creation. This ensures that the final OpenAPI document has complete type
|
|
15
15
|
* coverage for all operations.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* comments.
|
|
17
|
+
* DO: Follow established naming conventions (IEntityName,
|
|
18
|
+
* IEntityName.ICreate, etc.) DO: Document thoroughly with descriptions that
|
|
19
|
+
* reference the original Prisma schema comments.
|
|
21
20
|
*
|
|
22
21
|
* @param props Properties containing components to generate.
|
|
23
22
|
*/
|
|
@@ -25,6 +24,40 @@ export interface IAutoBeInterfaceSchemaApplication {
|
|
|
25
24
|
}
|
|
26
25
|
export namespace IAutoBeInterfaceSchemaApplication {
|
|
27
26
|
export interface IProps {
|
|
27
|
+
/**
|
|
28
|
+
* TypeScript draft code for schema definitions.
|
|
29
|
+
*
|
|
30
|
+
* This property contains TypeScript interface definitions that serve as a
|
|
31
|
+
* preliminary draft before generating the final JSON schema components.
|
|
32
|
+
* The draft allows for initial design and validation of the schema structure
|
|
33
|
+
* using TypeScript's type system before converting to OpenAPI/JSON Schema format.
|
|
34
|
+
*
|
|
35
|
+
* The draft typically includes:
|
|
36
|
+
* - Entity interfaces matching the Prisma models
|
|
37
|
+
* - Operation-specific variants (ICreate, IUpdate, etc.)
|
|
38
|
+
* - Utility types and enumerations
|
|
39
|
+
* - Type relationships and constraints
|
|
40
|
+
*
|
|
41
|
+
* This TypeScript draft serves as the foundation for the subsequent schema
|
|
42
|
+
* generation, ensuring type safety and consistency. The final schemas in the
|
|
43
|
+
* `schemas` property should be derived from and validated against this draft.
|
|
44
|
+
*
|
|
45
|
+
* Example draft structure:
|
|
46
|
+
* ```typescript
|
|
47
|
+
* interface IUser {
|
|
48
|
+
* id: string;
|
|
49
|
+
* email: string;
|
|
50
|
+
* profile: IUserProfile;
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* namespace IUser {
|
|
54
|
+
* interface ICreate extends Omit<IUser, "id"> {}
|
|
55
|
+
* interface IUpdate extends Partial<ICreate> {}
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
draft: string;
|
|
60
|
+
|
|
28
61
|
/**
|
|
29
62
|
* Complete set of schema components for the OpenAPI specification.
|
|
30
63
|
*
|
|
@@ -32,23 +65,23 @@ export namespace IAutoBeInterfaceSchemaApplication {
|
|
|
32
65
|
* the system. It is the central repository of all named schema types that
|
|
33
66
|
* will be used throughout the API specification.
|
|
34
67
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* strictly prohibited.
|
|
68
|
+
* DO: Define all object types as named types in the components.schemas
|
|
69
|
+
* section. DO NOT: Use inline anonymous object definitions.
|
|
38
70
|
*
|
|
39
|
-
* This components object
|
|
71
|
+
* This components object includes:
|
|
40
72
|
*
|
|
41
73
|
* - Main entity types (IEntityName)
|
|
42
74
|
* - Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)
|
|
43
75
|
* - Container types (IPage<T> for pagination)
|
|
44
76
|
* - Enumeration types
|
|
45
77
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
78
|
+
* DO: Include detailed descriptions that reference the original Prisma
|
|
79
|
+
* schema comments and thoroughly document each property. DO: Use a $ref to
|
|
80
|
+
* a named type in the components.schemas section for every property that
|
|
81
|
+
* references an object.
|
|
82
|
+
*
|
|
83
|
+
* This applies to all objects in request bodies, response bodies, and
|
|
84
|
+
* properties that are objects or arrays of objects.
|
|
52
85
|
*
|
|
53
86
|
* Example structure:
|
|
54
87
|
*
|
|
@@ -32,19 +32,16 @@ export namespace IAutoBeInterfaceSchemasReviewApplication {
|
|
|
32
32
|
/**
|
|
33
33
|
* Issues and problems found during schema analysis.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* - Positive feedback about what's already correct
|
|
38
|
-
* - Compliments about well-structured schemas
|
|
39
|
-
* - Confirmation that certain aspects meet standards
|
|
35
|
+
* DO: Document only problems that need fixing.
|
|
36
|
+
* DO NOT: Include positive feedback, compliments, or confirmations
|
|
40
37
|
*
|
|
41
38
|
* Focus exclusively on issues organized by severity:
|
|
42
39
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* -
|
|
46
|
-
* -
|
|
47
|
-
* -
|
|
40
|
+
* Severity levels:
|
|
41
|
+
* - Security vulnerabilities (exposed passwords, missing auth boundaries)
|
|
42
|
+
* - Missing required variants, incorrect type mappings
|
|
43
|
+
* - Missing format specifications, incomplete relationships
|
|
44
|
+
* - Documentation improvements, style consistency
|
|
48
45
|
*
|
|
49
46
|
* Each issue must include the specific schema name and what needs to be
|
|
50
47
|
* fixed. If there are no issues at all, simply state: "No issues found."
|
|
@@ -70,21 +67,18 @@ export namespace IAutoBeInterfaceSchemasReviewApplication {
|
|
|
70
67
|
/**
|
|
71
68
|
* Final validated and enhanced schemas ready for production use.
|
|
72
69
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* -
|
|
76
|
-
* -
|
|
77
|
-
* -
|
|
78
|
-
* -
|
|
79
|
-
* - If entity names are wrong, MUST contain renamed correct versions
|
|
80
|
-
* - If schemas are missing variants, MUST include the created variants
|
|
81
|
-
*
|
|
82
|
-
* FORBIDDEN:
|
|
70
|
+
* DO:
|
|
71
|
+
* - Include valid OpenAPI schema definitions
|
|
72
|
+
* - Include all entities that were in the original input
|
|
73
|
+
* - Provide fixed versions if original schemas have issues
|
|
74
|
+
* - Rename entities correctly if names are wrong
|
|
75
|
+
* - Include created variants if schemas are missing them
|
|
83
76
|
*
|
|
84
|
-
*
|
|
85
|
-
* -
|
|
86
|
-
* -
|
|
87
|
-
* -
|
|
77
|
+
* DO NOT:
|
|
78
|
+
* - Return an empty object {} (this will delete all schemas)
|
|
79
|
+
* - Return undefined or null
|
|
80
|
+
* - Include explanations or excuses in schema descriptions
|
|
81
|
+
* - Leave broken schemas unfixed
|
|
88
82
|
*
|
|
89
83
|
* When original schemas are beyond repair, recreate them properly based on
|
|
90
84
|
* entity names and context. This field becomes the final schemas used by
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
import { IValidation } from "typia";
|
|
3
|
+
|
|
4
|
+
export const validateAuthorizationSchema = (props: {
|
|
5
|
+
errors: IValidation.IError[];
|
|
6
|
+
schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
7
|
+
path: string;
|
|
8
|
+
}): void => {
|
|
9
|
+
for (const [key, value] of Object.entries(props.schemas)) {
|
|
10
|
+
if (!key.endsWith(".IAuthorized")) continue;
|
|
11
|
+
|
|
12
|
+
// Check if it's an object type
|
|
13
|
+
if (!isObjectSchema(value)) {
|
|
14
|
+
props.errors.push({
|
|
15
|
+
path: `${props.path}.${key}`,
|
|
16
|
+
expected: `AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema.IObject>`,
|
|
17
|
+
value: value,
|
|
18
|
+
description: `${key} must be an object type for authorization responses`,
|
|
19
|
+
});
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Check if token property exists
|
|
24
|
+
value.properties ??= {};
|
|
25
|
+
value.properties["token"] = {
|
|
26
|
+
$ref: "#/components/schemas/IAuthorizationToken",
|
|
27
|
+
description: "JWT token information for authentication",
|
|
28
|
+
} as AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema.IReference>;
|
|
29
|
+
|
|
30
|
+
value.required ??= [];
|
|
31
|
+
if (value.required.includes("token") === false) {
|
|
32
|
+
value.required.push("token");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const isObjectSchema = (
|
|
38
|
+
schema: AutoBeOpenApi.IJsonSchemaDescriptive,
|
|
39
|
+
): schema is AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema.IObject> => {
|
|
40
|
+
return "type" in schema && schema.type === "object";
|
|
41
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import {
|
|
2
|
+
import { StringUtil } from "@autobe/utils";
|
|
3
|
+
import { NamingConvention } from "typia/lib/utils/NamingConvention";
|
|
4
|
+
import { v7 } from "uuid";
|
|
3
5
|
|
|
4
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
5
7
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
@@ -11,80 +13,73 @@ export const transformPrismaComponentsHistories = (
|
|
|
11
13
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
12
14
|
> => {
|
|
13
15
|
if (state.analyze === null)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
created_at: new Date().toISOString(),
|
|
18
|
-
type: "systemMessage",
|
|
19
|
-
text: [
|
|
20
|
-
"Requirement analysis is not yet completed.",
|
|
21
|
-
"Don't call any tool function,",
|
|
22
|
-
"but say to process the requirement analysis.",
|
|
23
|
-
].join(" "),
|
|
24
|
-
},
|
|
25
|
-
];
|
|
16
|
+
// unreachable
|
|
17
|
+
throw new Error("Analyze state is not set.");
|
|
18
|
+
if (prefix) prefix = NamingConvention.snake(prefix);
|
|
26
19
|
return [
|
|
27
20
|
{
|
|
28
|
-
id:
|
|
21
|
+
id: v7(),
|
|
29
22
|
created_at: new Date().toISOString(),
|
|
30
23
|
type: "systemMessage",
|
|
31
24
|
text: AutoBeSystemPromptConstant.PRISMA_COMPONENT,
|
|
32
25
|
},
|
|
33
26
|
{
|
|
34
|
-
id:
|
|
27
|
+
id: v7(),
|
|
35
28
|
created_at: new Date().toISOString(),
|
|
36
29
|
type: "assistantMessage",
|
|
37
|
-
text:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
JSON.stringify(state.analyze.files)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
30
|
+
text: StringUtil.trim`
|
|
31
|
+
Here is the requirement analysis report.
|
|
32
|
+
|
|
33
|
+
Call the provided tool function to generate Prisma DB schema
|
|
34
|
+
referencing below requirement analysis report.
|
|
35
|
+
|
|
36
|
+
## Requirement Analysis Report
|
|
37
|
+
|
|
38
|
+
\`\`\`json
|
|
39
|
+
${JSON.stringify(state.analyze.files)}
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
## Prefix
|
|
43
|
+
|
|
44
|
+
- Prefix provided by the user: ${prefix}
|
|
45
|
+
|
|
46
|
+
The user wants all database schema (table) names to start with the prefix provided below.
|
|
47
|
+
|
|
48
|
+
- DO: Use the provided prefix for all table names
|
|
49
|
+
- DO: Place special-purpose prefixes like \`mv\` (for materialized views) before the given prefix
|
|
50
|
+
- DO NOT: Apply prefix if it is \`null\`
|
|
51
|
+
|
|
52
|
+
## Prefix Example
|
|
53
|
+
|
|
54
|
+
If the prefix is \`shopping\`, then table names are like:
|
|
55
|
+
|
|
56
|
+
- \`shopping_sales\`
|
|
57
|
+
- \`shopping_sale_options\`
|
|
58
|
+
|
|
59
|
+
In cases where a table is created for performance optimization purposes
|
|
60
|
+
(e.g., materialized views), the \`mv_\` prefix must come first. For example:
|
|
61
|
+
|
|
62
|
+
- \`mv_shopping_daily_stats\`
|
|
63
|
+
|
|
64
|
+
${
|
|
65
|
+
state.analyze.roles.length > 0
|
|
66
|
+
? StringUtil.trim`
|
|
67
|
+
## User Role Handling
|
|
68
|
+
|
|
69
|
+
The Requirement Analysis Report contains the following user roles: ${state.analyze.roles.join(", ")}
|
|
70
|
+
|
|
71
|
+
**Do not normalize** user roles into a single table.
|
|
72
|
+
Instead, create separate tables for each distinct role mentioned in the requirements.
|
|
73
|
+
|
|
74
|
+
Create separate tables for each role:
|
|
75
|
+
|
|
76
|
+
${state.analyze.roles
|
|
77
|
+
.map((role) => `- ${prefix}_${role.name.toLowerCase()}`)
|
|
78
|
+
.join("\n")}
|
|
79
|
+
`
|
|
80
|
+
: ""
|
|
81
|
+
}
|
|
82
|
+
`,
|
|
88
83
|
},
|
|
89
84
|
];
|
|
90
85
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { IAutoBePrismaValidation } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
7
|
|
|
@@ -11,46 +12,34 @@ export const transformPrismaCorrectHistories = (
|
|
|
11
12
|
> => {
|
|
12
13
|
return [
|
|
13
14
|
{
|
|
14
|
-
id:
|
|
15
|
+
id: v7(),
|
|
15
16
|
created_at: new Date().toISOString(),
|
|
16
17
|
type: "systemMessage",
|
|
17
18
|
text: AutoBeSystemPromptConstant.PRISMA_CORRECT,
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
|
-
id:
|
|
21
|
+
id: v7(),
|
|
21
22
|
created_at: new Date().toISOString(),
|
|
22
23
|
type: "assistantMessage",
|
|
23
|
-
text:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
JSON.stringify(result.data)
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
text: StringUtil.trim`
|
|
25
|
+
Here is the Prisma application data what you made:
|
|
26
|
+
|
|
27
|
+
\`\`\`json
|
|
28
|
+
${JSON.stringify(result.data)}
|
|
29
|
+
\`\`\`
|
|
30
|
+
`,
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
|
-
id:
|
|
33
|
+
id: v7(),
|
|
33
34
|
created_at: new Date().toISOString(),
|
|
34
35
|
type: "assistantMessage",
|
|
35
|
-
text:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
JSON.stringify(result.errors)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: v4(),
|
|
45
|
-
created_at: new Date().toISOString(),
|
|
46
|
-
type: "systemMessage",
|
|
47
|
-
text: [
|
|
48
|
-
"Before fixing the schema files,",
|
|
49
|
-
"study about Prisma schema language",
|
|
50
|
-
"from the best practices and examples",
|
|
51
|
-
"",
|
|
52
|
-
AutoBeSystemPromptConstant.PRISMA_EXAMPLE,
|
|
53
|
-
].join("\n"),
|
|
36
|
+
text: StringUtil.trim`
|
|
37
|
+
Below are the list of errors what you have to fix:
|
|
38
|
+
|
|
39
|
+
\`\`\`json
|
|
40
|
+
${JSON.stringify(result.errors)}
|
|
41
|
+
\`\`\`
|
|
42
|
+
`,
|
|
54
43
|
},
|
|
55
44
|
];
|
|
56
45
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBePrisma } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
7
|
|
|
@@ -14,53 +15,55 @@ export const transformPrismaReviewHistories = (props: {
|
|
|
14
15
|
> => {
|
|
15
16
|
return [
|
|
16
17
|
{
|
|
17
|
-
id:
|
|
18
|
+
id: v7(),
|
|
18
19
|
created_at: new Date().toISOString(),
|
|
19
20
|
type: "systemMessage",
|
|
20
21
|
text: AutoBeSystemPromptConstant.PRISMA_SCHEMA,
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
|
-
id:
|
|
24
|
+
id: v7(),
|
|
24
25
|
created_at: new Date().toISOString(),
|
|
25
|
-
type: "
|
|
26
|
-
text:
|
|
27
|
-
"Here is the requirement analysis report given by the user:",
|
|
28
|
-
"",
|
|
29
|
-
"```json",
|
|
30
|
-
JSON.stringify(props.analysis),
|
|
31
|
-
"```",
|
|
32
|
-
"",
|
|
33
|
-
"Reading the requirement analysis report, you AI made below AST definition for the database design:",
|
|
34
|
-
"",
|
|
35
|
-
"```json",
|
|
36
|
-
JSON.stringify(props.application),
|
|
37
|
-
"```",
|
|
38
|
-
"",
|
|
39
|
-
"And here are the Prisma schema files generated (compiled) from the above AST:",
|
|
40
|
-
"",
|
|
41
|
-
"```prisma",
|
|
42
|
-
JSON.stringify(props.schemas),
|
|
43
|
-
"```",
|
|
44
|
-
].join("\n"),
|
|
26
|
+
type: "systemMessage",
|
|
27
|
+
text: AutoBeSystemPromptConstant.PRISMA_REVIEW,
|
|
45
28
|
},
|
|
46
29
|
{
|
|
47
|
-
id:
|
|
30
|
+
id: v7(),
|
|
48
31
|
created_at: new Date().toISOString(),
|
|
49
|
-
type: "
|
|
50
|
-
text:
|
|
32
|
+
type: "assistantMessage",
|
|
33
|
+
text: StringUtil.trim`
|
|
34
|
+
Here is the requirement analysis report given by the user:
|
|
35
|
+
|
|
36
|
+
\`\`\`json
|
|
37
|
+
${JSON.stringify(props.analysis)}
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
Reading the requirement analysis report, you AI made
|
|
41
|
+
below AST definition for the database design:
|
|
42
|
+
|
|
43
|
+
\`\`\`json
|
|
44
|
+
${JSON.stringify(props.application)}
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
And here are the Prisma schema files generated (compiled)
|
|
48
|
+
from the above AST:
|
|
49
|
+
|
|
50
|
+
\`\`\`json
|
|
51
|
+
${JSON.stringify(props.schemas)}
|
|
52
|
+
\`\`\`
|
|
53
|
+
`,
|
|
51
54
|
},
|
|
52
55
|
{
|
|
53
|
-
id:
|
|
56
|
+
id: v7(),
|
|
54
57
|
created_at: new Date().toISOString(),
|
|
55
58
|
type: "assistantMessage",
|
|
56
|
-
text:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
text: StringUtil.trim`
|
|
60
|
+
Now, please review the tables in the "${props.component.namespace}" namespace.
|
|
61
|
+
|
|
62
|
+
Focus your review exclusively on these tables.
|
|
63
|
+
|
|
64
|
+
**Tables in this namespace:**
|
|
65
|
+
${props.component.tables.map((table) => `- ${table}`).join("\n")}
|
|
66
|
+
`,
|
|
64
67
|
},
|
|
65
68
|
];
|
|
66
69
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBePrisma } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
7
|
|
|
@@ -13,42 +14,54 @@ export const transformPrismaSchemaHistories = (
|
|
|
13
14
|
> => {
|
|
14
15
|
return [
|
|
15
16
|
{
|
|
16
|
-
id:
|
|
17
|
+
id: v7(),
|
|
17
18
|
created_at: new Date().toISOString(),
|
|
18
19
|
type: "systemMessage",
|
|
19
20
|
text: AutoBeSystemPromptConstant.PRISMA_SCHEMA,
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
|
-
id:
|
|
23
|
+
id: v7(),
|
|
23
24
|
created_at: new Date().toISOString(),
|
|
24
25
|
type: "assistantMessage",
|
|
25
|
-
text:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
JSON.stringify(
|
|
30
|
-
|
|
26
|
+
text: StringUtil.trim`
|
|
27
|
+
Here is the requirement analysis report:
|
|
28
|
+
|
|
29
|
+
\`\`\`json
|
|
30
|
+
${JSON.stringify(requirementAnalysisReport)}
|
|
31
|
+
\`\`\`
|
|
32
|
+
`,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: v7(),
|
|
36
|
+
created_at: new Date().toISOString(),
|
|
37
|
+
type: "assistantMessage",
|
|
38
|
+
text: StringUtil.trim`
|
|
39
|
+
Here is the input data for generating Prisma DB schema.
|
|
40
|
+
|
|
41
|
+
\`\`\`json
|
|
42
|
+
${JSON.stringify({
|
|
31
43
|
targetComponent,
|
|
32
44
|
otherTables,
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
})}
|
|
46
|
+
\`\`\`
|
|
47
|
+
`,
|
|
36
48
|
},
|
|
37
49
|
{
|
|
38
|
-
id:
|
|
50
|
+
id: v7(),
|
|
39
51
|
created_at: new Date().toISOString(),
|
|
40
52
|
type: "systemMessage",
|
|
41
|
-
text:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
text: StringUtil.trim`
|
|
54
|
+
You've already taken a mistake that creating models from the other components.
|
|
55
|
+
|
|
56
|
+
Note that, you have to make models from the target component only. Never make
|
|
57
|
+
models from the other components. The other components' models are already made.
|
|
58
|
+
|
|
59
|
+
\`\`\`json
|
|
60
|
+
${JSON.stringify({
|
|
48
61
|
targetComponent,
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
})}
|
|
63
|
+
\`\`\`
|
|
64
|
+
`,
|
|
52
65
|
},
|
|
53
66
|
];
|
|
54
67
|
};
|
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
} from "@autobe/interface";
|
|
11
11
|
import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
|
|
12
12
|
import { ILlmSchema } from "@samchon/openapi";
|
|
13
|
+
import { v7 } from "uuid";
|
|
13
14
|
|
|
14
15
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
15
16
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
17
|
+
import { predicateStateMessage } from "../../utils/predicateStateMessage";
|
|
16
18
|
import { orchestratePrismaComponents } from "./orchestratePrismaComponent";
|
|
17
19
|
import { orchestratePrismaCorrect } from "./orchestratePrismaCorrect";
|
|
18
20
|
import { orchestratePrismaReview } from "./orchestratePrismaReview";
|
|
@@ -22,21 +24,29 @@ export const orchestratePrisma = async <Model extends ILlmSchema.Model>(
|
|
|
22
24
|
ctx: AutoBeContext<Model>,
|
|
23
25
|
props: IAutoBeApplicationProps,
|
|
24
26
|
): Promise<AutoBePrismaHistory | AutoBeAssistantMessageHistory> => {
|
|
27
|
+
// PREDICATION
|
|
25
28
|
const start: Date = new Date();
|
|
29
|
+
const predicate: string | null = predicateStateMessage(ctx.state(), "prisma");
|
|
30
|
+
if (predicate !== null)
|
|
31
|
+
return ctx.assistantMessage({
|
|
32
|
+
type: "assistantMessage",
|
|
33
|
+
id: v7(),
|
|
34
|
+
created_at: start.toISOString(),
|
|
35
|
+
text: predicate,
|
|
36
|
+
completed_at: new Date().toISOString(),
|
|
37
|
+
});
|
|
26
38
|
ctx.dispatch({
|
|
27
39
|
type: "prismaStart",
|
|
40
|
+
id: v7(),
|
|
28
41
|
created_at: start.toISOString(),
|
|
29
42
|
reason: props.reason,
|
|
30
43
|
step: ctx.state().analyze?.step ?? 0,
|
|
31
44
|
});
|
|
32
45
|
|
|
33
46
|
// COMPONENTS
|
|
34
|
-
const componentEvent:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (componentEvent.type === "assistantMessage")
|
|
38
|
-
return ctx.assistantMessage(componentEvent);
|
|
39
|
-
else ctx.dispatch(componentEvent);
|
|
47
|
+
const componentEvent: AutoBePrismaComponentsEvent =
|
|
48
|
+
await orchestratePrismaComponents(ctx);
|
|
49
|
+
ctx.dispatch(componentEvent);
|
|
40
50
|
|
|
41
51
|
// CONSTRUCT AST DATA
|
|
42
52
|
const schemaEvents: AutoBePrismaSchemasEvent[] =
|
|
@@ -84,6 +94,7 @@ export const orchestratePrisma = async <Model extends ILlmSchema.Model>(
|
|
|
84
94
|
// PROPAGATE
|
|
85
95
|
return ctx.dispatch({
|
|
86
96
|
type: "prismaComplete",
|
|
97
|
+
id: v7(),
|
|
87
98
|
result,
|
|
88
99
|
schemas: finalSchemas,
|
|
89
100
|
compiled: await compiler.prisma.compile({
|