@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
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AgenticaAssistantMessageHistory,
|
|
3
|
-
IAgenticaController,
|
|
4
|
-
} from "@agentica/core";
|
|
5
|
-
import { AutoBeAssistantMessageHistory } from "@autobe/interface";
|
|
1
|
+
import { IAgenticaController } from "@agentica/core";
|
|
6
2
|
import { AutoBePrismaComponentsEvent } from "@autobe/interface/src/events/AutoBePrismaComponentsEvent";
|
|
7
3
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
4
|
import { IPointer } from "tstl";
|
|
9
5
|
import typia from "typia";
|
|
10
|
-
import {
|
|
6
|
+
import { v7 } from "uuid";
|
|
11
7
|
|
|
12
8
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
13
9
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -18,14 +14,14 @@ export async function orchestratePrismaComponents<
|
|
|
18
14
|
Model extends ILlmSchema.Model,
|
|
19
15
|
>(
|
|
20
16
|
ctx: AutoBeContext<Model>,
|
|
21
|
-
message: string = "
|
|
22
|
-
): Promise<
|
|
17
|
+
message: string = "Design database from the given requirement analysis documents.",
|
|
18
|
+
): Promise<AutoBePrismaComponentsEvent> {
|
|
23
19
|
const start: Date = new Date();
|
|
24
20
|
const pointer: IPointer<IAutoBePrismaComponentApplication.IProps | null> = {
|
|
25
21
|
value: null,
|
|
26
22
|
};
|
|
27
23
|
const prefix: string | null = ctx.state().analyze?.prefix ?? null;
|
|
28
|
-
const {
|
|
24
|
+
const { tokenUsage } = await ctx.conversate({
|
|
29
25
|
source: "prismaComponents",
|
|
30
26
|
histories: transformPrismaComponentsHistories(ctx.state(), prefix),
|
|
31
27
|
controller: createController({
|
|
@@ -34,21 +30,14 @@ export async function orchestratePrismaComponents<
|
|
|
34
30
|
pointer.value = next;
|
|
35
31
|
},
|
|
36
32
|
}),
|
|
37
|
-
enforceFunctionCall:
|
|
33
|
+
enforceFunctionCall: true,
|
|
38
34
|
message,
|
|
39
35
|
});
|
|
40
|
-
if (
|
|
41
|
-
return {
|
|
42
|
-
...(histories.at(-1)! as AgenticaAssistantMessageHistory),
|
|
43
|
-
created_at: start.toISOString(),
|
|
44
|
-
completed_at: new Date().toISOString(),
|
|
45
|
-
id: v4(),
|
|
46
|
-
} satisfies AutoBeAssistantMessageHistory;
|
|
47
|
-
else if (pointer.value === null) {
|
|
36
|
+
if (pointer.value === null)
|
|
48
37
|
throw new Error("Failed to extract files and tables."); // unreachable
|
|
49
|
-
}
|
|
50
38
|
return {
|
|
51
39
|
type: "prismaComponents",
|
|
40
|
+
id: v7(),
|
|
52
41
|
created_at: start.toISOString(),
|
|
53
42
|
thinking: pointer.value.thinking,
|
|
54
43
|
review: pointer.value.review,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
9
9
|
import { IPointer } from "tstl";
|
|
10
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
11
12
|
|
|
12
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
13
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -49,6 +50,7 @@ async function iterate<Model extends ILlmSchema.Model>(
|
|
|
49
50
|
);
|
|
50
51
|
ctx.dispatch({
|
|
51
52
|
type: "prismaValidate",
|
|
53
|
+
id: v7(),
|
|
52
54
|
result,
|
|
53
55
|
schemas,
|
|
54
56
|
compiled: await compiler.prisma.compile({
|
|
@@ -144,6 +146,7 @@ async function execute<Model extends ILlmSchema.Model>(
|
|
|
144
146
|
};
|
|
145
147
|
ctx.dispatch({
|
|
146
148
|
type: "prismaCorrect",
|
|
149
|
+
id: v7(),
|
|
147
150
|
failure,
|
|
148
151
|
planning: pointer.value.planning,
|
|
149
152
|
correction: correction,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
|
-
import { AutoBePrisma } from "@autobe/interface";
|
|
2
|
+
import { AutoBePrisma, AutoBeProgressEventBase } from "@autobe/interface";
|
|
3
3
|
import { AutoBePrismaReviewEvent } from "@autobe/interface/src/events/AutoBePrismaReviewEvent";
|
|
4
4
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
5
5
|
import { IPointer } from "tstl";
|
|
6
6
|
import typia from "typia";
|
|
7
|
+
import { v7 } from "uuid";
|
|
7
8
|
|
|
8
9
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
10
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
10
|
-
import {
|
|
11
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
11
12
|
import { transformPrismaReviewHistories } from "./histories/transformPrismaReviewHistories";
|
|
12
13
|
import { IAutoBePrismaReviewApplication } from "./structures/IAutoBePrismaReviewApplication";
|
|
13
14
|
|
|
@@ -17,23 +18,39 @@ export async function orchestratePrismaReview<Model extends ILlmSchema.Model>(
|
|
|
17
18
|
schemas: Record<string, string>,
|
|
18
19
|
componentList: AutoBePrisma.IComponent[],
|
|
19
20
|
): Promise<AutoBePrismaReviewEvent[]> {
|
|
20
|
-
const progress:
|
|
21
|
+
const progress: AutoBeProgressEventBase = {
|
|
21
22
|
completed: 0,
|
|
22
23
|
total: componentList.length,
|
|
23
24
|
};
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
return (
|
|
26
|
+
await executeCachedBatch(
|
|
27
|
+
componentList.map((component) => async (promptCacheKey) => {
|
|
28
|
+
try {
|
|
29
|
+
return await step(ctx, {
|
|
30
|
+
application,
|
|
31
|
+
schemas,
|
|
32
|
+
component,
|
|
33
|
+
progress,
|
|
34
|
+
promptCacheKey,
|
|
35
|
+
});
|
|
36
|
+
} catch {
|
|
37
|
+
++progress.completed;
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
)
|
|
42
|
+
).filter((v) => v !== null);
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
async function step<Model extends ILlmSchema.Model>(
|
|
32
46
|
ctx: AutoBeContext<Model>,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
props: {
|
|
48
|
+
application: AutoBePrisma.IApplication;
|
|
49
|
+
schemas: Record<string, string>;
|
|
50
|
+
component: AutoBePrisma.IComponent;
|
|
51
|
+
progress: AutoBeProgressEventBase;
|
|
52
|
+
promptCacheKey: string;
|
|
53
|
+
},
|
|
37
54
|
): Promise<AutoBePrismaReviewEvent> {
|
|
38
55
|
const start: Date = new Date();
|
|
39
56
|
const pointer: IPointer<IAutoBePrismaReviewApplication.IProps | null> = {
|
|
@@ -49,9 +66,9 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
49
66
|
.reduce((acc, cur) => {
|
|
50
67
|
return Object.assign(acc, cur);
|
|
51
68
|
}, {}) ?? {},
|
|
52
|
-
application,
|
|
53
|
-
schemas,
|
|
54
|
-
component,
|
|
69
|
+
application: props.application,
|
|
70
|
+
schemas: props.schemas,
|
|
71
|
+
component: props.component,
|
|
55
72
|
}),
|
|
56
73
|
controller: createController(ctx, {
|
|
57
74
|
build: (next) => {
|
|
@@ -59,6 +76,7 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
59
76
|
},
|
|
60
77
|
}),
|
|
61
78
|
enforceFunctionCall: true,
|
|
79
|
+
promptCacheKey: props.promptCacheKey,
|
|
62
80
|
message: "Please review the Prisma schema file.",
|
|
63
81
|
});
|
|
64
82
|
if (pointer.value === null)
|
|
@@ -66,14 +84,15 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
66
84
|
|
|
67
85
|
const event: AutoBePrismaReviewEvent = {
|
|
68
86
|
type: "prismaReview",
|
|
87
|
+
id: v7(),
|
|
69
88
|
created_at: start.toISOString(),
|
|
70
|
-
filename: component.filename,
|
|
89
|
+
filename: props.component.filename,
|
|
71
90
|
review: pointer.value.review,
|
|
72
91
|
plan: pointer.value.plan,
|
|
73
92
|
modifications: pointer.value.modifications,
|
|
74
93
|
tokenUsage,
|
|
75
|
-
completed: ++progress.completed,
|
|
76
|
-
total: progress.total,
|
|
94
|
+
completed: ++props.progress.completed,
|
|
95
|
+
total: props.progress.total,
|
|
77
96
|
step: ctx.state().analyze?.step ?? 0,
|
|
78
97
|
};
|
|
79
98
|
ctx.dispatch(event);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import { AutoBePrisma } from "@autobe/interface";
|
|
3
3
|
import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
|
|
4
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
5
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
5
6
|
import { IPointer } from "tstl";
|
|
6
7
|
import typia from "typia";
|
|
8
|
+
import { v7 } from "uuid";
|
|
7
9
|
|
|
8
10
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
11
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
12
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
10
13
|
import { transformPrismaSchemaHistories } from "./histories/transformPrismaSchemaHistories";
|
|
11
14
|
import { IAutoBePrismaSchemaApplication } from "./structures/IAutoBePrismaSchemaApplication";
|
|
12
15
|
|
|
@@ -19,8 +22,8 @@ export async function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(
|
|
|
19
22
|
.map((c) => c.tables.length)
|
|
20
23
|
.reduce((x, y) => x + y, 0);
|
|
21
24
|
const completed: IPointer<number> = { value: 0 };
|
|
22
|
-
return await
|
|
23
|
-
componentList.map(async (
|
|
25
|
+
return await executeCachedBatch(
|
|
26
|
+
componentList.map((component) => async (promptCacheKey) => {
|
|
24
27
|
const otherTables: string[] = componentList
|
|
25
28
|
.filter((y) => component !== y)
|
|
26
29
|
.map((c) => c.tables)
|
|
@@ -31,6 +34,7 @@ export async function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(
|
|
|
31
34
|
start,
|
|
32
35
|
total,
|
|
33
36
|
completed,
|
|
37
|
+
promptCacheKey,
|
|
34
38
|
});
|
|
35
39
|
ctx.dispatch(event);
|
|
36
40
|
return event;
|
|
@@ -46,6 +50,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
46
50
|
start: Date;
|
|
47
51
|
total: number;
|
|
48
52
|
completed: IPointer<number>;
|
|
53
|
+
promptCacheKey: string;
|
|
49
54
|
},
|
|
50
55
|
): Promise<AutoBePrismaSchemasEvent> {
|
|
51
56
|
const pointer: IPointer<IAutoBePrismaSchemaApplication.IProps | null> = {
|
|
@@ -71,12 +76,14 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
71
76
|
},
|
|
72
77
|
}),
|
|
73
78
|
enforceFunctionCall: true,
|
|
79
|
+
promptCacheKey: props.promptCacheKey,
|
|
74
80
|
message: "Make prisma schema file please",
|
|
75
81
|
});
|
|
76
82
|
if (pointer.value === null)
|
|
77
83
|
throw new Error("Unreachable code: Prisma Schema not generated");
|
|
78
84
|
return {
|
|
79
85
|
type: "prismaSchemas",
|
|
86
|
+
id: v7(),
|
|
80
87
|
created_at: props.start.toISOString(),
|
|
81
88
|
plan: pointer.value.plan,
|
|
82
89
|
models: pointer.value.models,
|
|
@@ -118,6 +125,7 @@ function createController<Model extends ILlmSchema.Model>(
|
|
|
118
125
|
|
|
119
126
|
ctx.dispatch({
|
|
120
127
|
type: "prismaInsufficient",
|
|
128
|
+
id: v7(),
|
|
121
129
|
created_at: new Date().toISOString(),
|
|
122
130
|
component: props.targetComponent,
|
|
123
131
|
actual,
|
|
@@ -131,26 +139,26 @@ function createController<Model extends ILlmSchema.Model>(
|
|
|
131
139
|
path: "$input.models",
|
|
132
140
|
value: result.data.models,
|
|
133
141
|
expected: `Array<AutoBePrisma.IModel>`,
|
|
134
|
-
description:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
JSON.stringify({
|
|
142
|
+
description: StringUtil.trim`
|
|
143
|
+
You missed some tables from the current domain's component.
|
|
144
|
+
|
|
145
|
+
Look at the following details to fix the schemas. Never forget to
|
|
146
|
+
compose the \`missed\` tables at the next function calling.
|
|
147
|
+
|
|
148
|
+
- filename: current domain's filename
|
|
149
|
+
- namespace: current domain's namespace
|
|
150
|
+
- expected: expected tables in the current domain
|
|
151
|
+
- actual: actual tables you made
|
|
152
|
+
- missed: tables you have missed, and you have to compose again
|
|
153
|
+
|
|
154
|
+
${JSON.stringify({
|
|
147
155
|
filename: props.targetComponent.filename,
|
|
148
156
|
namespace: props.targetComponent.namespace,
|
|
149
157
|
expected,
|
|
150
158
|
actual,
|
|
151
159
|
missed,
|
|
152
|
-
})
|
|
153
|
-
|
|
160
|
+
})}
|
|
161
|
+
`,
|
|
154
162
|
},
|
|
155
163
|
],
|
|
156
164
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeAnalyzeRole } from "@autobe/interface";
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
3
4
|
import { ILlmSchema } from "@samchon/openapi";
|
|
4
|
-
import {
|
|
5
|
+
import { v7 } from "uuid";
|
|
5
6
|
|
|
6
7
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
8
|
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
@@ -16,33 +17,35 @@ export const transformRealizeAuthorizationHistories = <
|
|
|
16
17
|
> => {
|
|
17
18
|
return [
|
|
18
19
|
{
|
|
19
|
-
id:
|
|
20
|
+
id: v7(),
|
|
20
21
|
created_at: new Date().toISOString(),
|
|
21
22
|
type: "systemMessage",
|
|
22
23
|
text: AutoBeSystemPromptConstant.REALIZE_AUTHORIZATION,
|
|
23
24
|
},
|
|
24
25
|
{
|
|
25
|
-
id:
|
|
26
|
+
id: v7(),
|
|
26
27
|
created_at: new Date().toISOString(),
|
|
27
28
|
type: "systemMessage",
|
|
28
|
-
text:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
JSON.stringify(role)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
text: StringUtil.trim`
|
|
30
|
+
## Role
|
|
31
|
+
\`\`\`json
|
|
32
|
+
${JSON.stringify(role)}
|
|
33
|
+
\`\`\`
|
|
34
|
+
|
|
35
|
+
## Prisma Schema
|
|
36
|
+
|
|
37
|
+
\`\`\`json
|
|
38
|
+
${JSON.stringify(ctx.state().prisma?.schemas)}
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
## Component Naming Convention
|
|
42
|
+
|
|
43
|
+
Please follow this naming convention for the authorization components:
|
|
44
|
+
|
|
45
|
+
- Provider Name: ${role.name}Authorize (e.g. ${role.name}Authorize)
|
|
46
|
+
- Decorator Name: ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Auth (e.g. ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Auth)
|
|
47
|
+
- Payload Name: ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Payload (e.g. ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Payload)
|
|
48
|
+
`,
|
|
46
49
|
},
|
|
47
50
|
];
|
|
48
51
|
};
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
AutoBeRealizeAuthorization,
|
|
4
4
|
IAutoBeTypeScriptCompileResult,
|
|
5
5
|
} from "@autobe/interface";
|
|
6
|
+
import { StringUtil } from "@autobe/utils";
|
|
6
7
|
import { ILlmSchema } from "@samchon/openapi";
|
|
7
|
-
import {
|
|
8
|
+
import { v7 } from "uuid";
|
|
8
9
|
|
|
9
10
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
10
11
|
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
@@ -21,77 +22,74 @@ export const transformRealizeAuthorizationCorrectHistories = <
|
|
|
21
22
|
> => {
|
|
22
23
|
return [
|
|
23
24
|
{
|
|
24
|
-
id:
|
|
25
|
+
id: v7(),
|
|
25
26
|
created_at: new Date().toISOString(),
|
|
26
27
|
type: "systemMessage",
|
|
27
28
|
text: AutoBeSystemPromptConstant.REALIZE_AUTHORIZATION,
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
|
-
id:
|
|
31
|
+
id: v7(),
|
|
31
32
|
created_at: new Date().toISOString(),
|
|
32
33
|
type: "systemMessage",
|
|
33
34
|
text: AutoBeSystemPromptConstant.REALIZE_AUTHORIZATION_CORRECT,
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
|
-
id:
|
|
37
|
+
id: v7(),
|
|
37
38
|
created_at: new Date().toISOString(),
|
|
38
39
|
type: "assistantMessage",
|
|
39
|
-
text:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
"## File Paths",
|
|
73
|
-
"",
|
|
74
|
-
Object.keys(templateFiles)
|
|
40
|
+
text: StringUtil.trim`
|
|
41
|
+
## Generated TypeScript Code
|
|
42
|
+
|
|
43
|
+
\`\`\`json
|
|
44
|
+
${JSON.stringify({
|
|
45
|
+
provider: {
|
|
46
|
+
location: auth.provider.location,
|
|
47
|
+
name: auth.provider.name,
|
|
48
|
+
content: auth.provider.content,
|
|
49
|
+
},
|
|
50
|
+
decorator: {
|
|
51
|
+
location: auth.decorator.location,
|
|
52
|
+
name: auth.decorator.name,
|
|
53
|
+
content: auth.decorator.content,
|
|
54
|
+
},
|
|
55
|
+
payload: {
|
|
56
|
+
location: auth.payload.location,
|
|
57
|
+
name: auth.payload.name,
|
|
58
|
+
content: auth.payload.content,
|
|
59
|
+
},
|
|
60
|
+
} satisfies Omit<AutoBeRealizeAuthorization, "role">)}
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
## Prisma Schema
|
|
64
|
+
|
|
65
|
+
\`\`\`json
|
|
66
|
+
${JSON.stringify(ctx.state().prisma?.schemas)}
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
## File Paths
|
|
70
|
+
|
|
71
|
+
${Object.keys(templateFiles)
|
|
75
72
|
.map((path) => `- ${path}`)
|
|
76
|
-
.join("\n")
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
JSON.stringify(diagnostics
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
73
|
+
.join("\n")}
|
|
74
|
+
|
|
75
|
+
## Compile Errors
|
|
76
|
+
|
|
77
|
+
Fix the compilation error in the provided code.
|
|
78
|
+
|
|
79
|
+
\`\`\`json
|
|
80
|
+
${JSON.stringify(diagnostics)}
|
|
81
|
+
\`\`\`
|
|
82
|
+
|
|
83
|
+
## Component Naming Convention
|
|
84
|
+
|
|
85
|
+
If the name of the component is not correct, please correct it.
|
|
86
|
+
|
|
87
|
+
Please follow this naming convention for the authorization components:
|
|
88
|
+
|
|
89
|
+
- Provider Name: ${auth.role.name.toLowerCase()}Authorize (e.g. ${auth.role.name.toLowerCase()}Authorize)
|
|
90
|
+
- Decorator Name: ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Auth (e.g. ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Auth)
|
|
91
|
+
- Payload Name: ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Payload (e.g. ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Payload)
|
|
92
|
+
`,
|
|
95
93
|
},
|
|
96
94
|
];
|
|
97
95
|
};
|
|
@@ -3,8 +3,10 @@ import {
|
|
|
3
3
|
AutoBeRealizeAuthorization,
|
|
4
4
|
IAutoBeTypeScriptCompileResult,
|
|
5
5
|
} from "@autobe/interface";
|
|
6
|
-
import {
|
|
6
|
+
import { StringUtil } from "@autobe/utils";
|
|
7
|
+
import { v7 } from "uuid";
|
|
7
8
|
|
|
9
|
+
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
8
10
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
9
11
|
import { IAutoBeTestScenarioArtifacts } from "../../test/structures/IAutoBeTestScenarioArtifacts";
|
|
10
12
|
import { IAutoBeRealizeScenarioApplication } from "../structures/IAutoBeRealizeScenarioApplication";
|
|
@@ -15,6 +17,7 @@ export function transformRealizeCorrectHistories(props: {
|
|
|
15
17
|
scenario: IAutoBeRealizeScenarioApplication.IProps;
|
|
16
18
|
artifacts: IAutoBeTestScenarioArtifacts;
|
|
17
19
|
authorization: AutoBeRealizeAuthorization | null;
|
|
20
|
+
totalAuthorizations: AutoBeRealizeAuthorization[];
|
|
18
21
|
code: string;
|
|
19
22
|
diagnostic: IAutoBeTypeScriptCompileResult.IDiagnostic;
|
|
20
23
|
}): Array<
|
|
@@ -23,24 +26,27 @@ export function transformRealizeCorrectHistories(props: {
|
|
|
23
26
|
return [
|
|
24
27
|
...transformRealizeWriteHistories(props),
|
|
25
28
|
{
|
|
26
|
-
id:
|
|
29
|
+
id: v7(),
|
|
27
30
|
type: "assistantMessage",
|
|
28
|
-
text:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
text: StringUtil.trim`
|
|
32
|
+
Below is the code you made before. It's also something to review.
|
|
33
|
+
|
|
34
|
+
\`\`\`typescript
|
|
35
|
+
${props.code}
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
The code has a compilation error:
|
|
39
|
+
|
|
40
|
+
\`\`\`json
|
|
41
|
+
${JSON.stringify(props.diagnostic)}
|
|
42
|
+
\`\`\`
|
|
43
|
+
`,
|
|
38
44
|
created_at: new Date().toISOString(),
|
|
39
45
|
},
|
|
40
46
|
{
|
|
41
|
-
id:
|
|
47
|
+
id: v7(),
|
|
42
48
|
type: "systemMessage",
|
|
43
|
-
text:
|
|
49
|
+
text: AutoBeSystemPromptConstant.REALIZE_CORRECT,
|
|
44
50
|
created_at: new Date().toISOString(),
|
|
45
51
|
},
|
|
46
52
|
];
|