@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
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
OpenApi,
|
|
8
8
|
} from "@samchon/openapi";
|
|
9
9
|
import typia from "typia";
|
|
10
|
-
import {
|
|
10
|
+
import { v7 } from "uuid";
|
|
11
11
|
|
|
12
12
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
13
13
|
import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
|
|
@@ -18,7 +18,7 @@ export function transformTestWriteHistories(
|
|
|
18
18
|
): Array<IAgenticaHistoryJson.ISystemMessage> {
|
|
19
19
|
return [
|
|
20
20
|
{
|
|
21
|
-
id:
|
|
21
|
+
id: v7(),
|
|
22
22
|
created_at: new Date().toISOString(),
|
|
23
23
|
type: "systemMessage",
|
|
24
24
|
text: AutoBeSystemPromptConstant.TEST_WRITE.replace(
|
|
@@ -27,7 +27,7 @@ export function transformTestWriteHistories(
|
|
|
27
27
|
).replaceAll("{{FUNCTION_NAME}}", scenario.functionName),
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
id:
|
|
30
|
+
id: v7(),
|
|
31
31
|
created_at: new Date().toISOString(),
|
|
32
32
|
type: "systemMessage",
|
|
33
33
|
text: StringUtil.trim`
|
|
@@ -8,10 +8,11 @@ import {
|
|
|
8
8
|
IAutoBeTypeScriptCompileResult,
|
|
9
9
|
} from "@autobe/interface";
|
|
10
10
|
import { ILlmSchema } from "@samchon/openapi";
|
|
11
|
-
import {
|
|
11
|
+
import { v7 } from "uuid";
|
|
12
12
|
|
|
13
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
14
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
15
|
+
import { predicateStateMessage } from "../../utils/predicateStateMessage";
|
|
15
16
|
import { orchestrateTestCorrect } from "./orchestrateTestCorrect";
|
|
16
17
|
import { orchestrateTestScenario } from "./orchestrateTestScenario";
|
|
17
18
|
import { orchestrateTestWrite } from "./orchestrateTestWrite";
|
|
@@ -22,19 +23,31 @@ export const orchestrateTest =
|
|
|
22
23
|
async (
|
|
23
24
|
props: IAutoBeApplicationProps,
|
|
24
25
|
): Promise<AutoBeAssistantMessageHistory | AutoBeTestHistory> => {
|
|
26
|
+
// PREDICATION
|
|
25
27
|
const start: Date = new Date();
|
|
28
|
+
const predicate: string | null = predicateStateMessage(ctx.state(), "test");
|
|
29
|
+
if (predicate !== null)
|
|
30
|
+
return ctx.assistantMessage({
|
|
31
|
+
type: "assistantMessage",
|
|
32
|
+
id: v7(),
|
|
33
|
+
created_at: start.toISOString(),
|
|
34
|
+
text: predicate,
|
|
35
|
+
completed_at: new Date().toISOString(),
|
|
36
|
+
});
|
|
26
37
|
ctx.dispatch({
|
|
27
38
|
type: "testStart",
|
|
39
|
+
id: v7(),
|
|
28
40
|
created_at: start.toISOString(),
|
|
29
41
|
reason: props.reason,
|
|
30
42
|
step: ctx.state().analyze?.step ?? 0,
|
|
31
43
|
});
|
|
32
44
|
|
|
45
|
+
// CHECK OPERATIONS
|
|
33
46
|
const operations: AutoBeOpenApi.IOperation[] =
|
|
34
47
|
ctx.state().interface?.document.operations ?? [];
|
|
35
48
|
if (operations.length === 0)
|
|
36
49
|
return ctx.assistantMessage({
|
|
37
|
-
id:
|
|
50
|
+
id: v7(),
|
|
38
51
|
type: "assistantMessage",
|
|
39
52
|
created_at: start.toISOString(),
|
|
40
53
|
completed_at: new Date().toISOString(),
|
|
@@ -51,14 +64,10 @@ export const orchestrateTest =
|
|
|
51
64
|
ctx,
|
|
52
65
|
scenarios,
|
|
53
66
|
);
|
|
54
|
-
|
|
55
67
|
const corrects: AutoBeTestValidateEvent[] = await orchestrateTestCorrect(
|
|
56
68
|
ctx,
|
|
57
69
|
written,
|
|
58
70
|
);
|
|
59
|
-
const success: AutoBeTestValidateEvent[] = corrects.filter(
|
|
60
|
-
(c) => c.result.type === "success",
|
|
61
|
-
);
|
|
62
71
|
|
|
63
72
|
// DO COMPILE
|
|
64
73
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
@@ -70,13 +79,14 @@ export const orchestrateTest =
|
|
|
70
79
|
dbms: "sqlite",
|
|
71
80
|
}),
|
|
72
81
|
).filter(([key]) => key.endsWith(".ts")),
|
|
73
|
-
...
|
|
82
|
+
...corrects.map((s) => [s.file.location, s.file.content]),
|
|
74
83
|
]),
|
|
75
84
|
});
|
|
76
85
|
return ctx.dispatch({
|
|
77
86
|
type: "testComplete",
|
|
87
|
+
id: v7(),
|
|
78
88
|
created_at: new Date().toISOString(),
|
|
79
|
-
files:
|
|
89
|
+
files: corrects.map((s) => s.file),
|
|
80
90
|
compiled,
|
|
81
91
|
step: ctx.state().interface?.step ?? 0,
|
|
82
92
|
elapsed: new Date().getTime() - start.getTime(),
|
|
@@ -4,12 +4,15 @@ import {
|
|
|
4
4
|
IAutoBeCompiler,
|
|
5
5
|
IAutoBeTypeScriptCompileResult,
|
|
6
6
|
} from "@autobe/interface";
|
|
7
|
+
import { StringUtil } from "@autobe/utils";
|
|
7
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
9
|
import { IPointer } from "tstl";
|
|
9
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
10
12
|
|
|
11
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
15
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
13
16
|
import { completeTestCode } from "./compile/completeTestCode";
|
|
14
17
|
import { transformTestCorrectHistories } from "./histories/transformTestCorrectHistories";
|
|
15
18
|
import { IAutoBeTestCorrectApplication } from "./structures/IAutoBeTestCorrectApplication";
|
|
@@ -22,31 +25,32 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
|
|
|
22
25
|
writeResult: IAutoBeTestWriteResult[],
|
|
23
26
|
life: number = 4,
|
|
24
27
|
): Promise<AutoBeTestValidateEvent[]> => {
|
|
25
|
-
const result: Array<AutoBeTestValidateEvent | null> =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
scenario: w.scenario,
|
|
31
|
-
location: w.event.location,
|
|
32
|
-
script: w.event.final,
|
|
33
|
-
});
|
|
34
|
-
return predicate(
|
|
35
|
-
ctx,
|
|
36
|
-
{
|
|
28
|
+
const result: Array<AutoBeTestValidateEvent | null> =
|
|
29
|
+
await executeCachedBatch(
|
|
30
|
+
writeResult.map((w) => async () => {
|
|
31
|
+
try {
|
|
32
|
+
const event: AutoBeTestValidateEvent = await compile(ctx, {
|
|
37
33
|
artifacts: w.artifacts,
|
|
38
34
|
scenario: w.scenario,
|
|
39
35
|
location: w.event.location,
|
|
40
36
|
script: w.event.final,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
});
|
|
38
|
+
return await predicate(
|
|
39
|
+
ctx,
|
|
40
|
+
{
|
|
41
|
+
artifacts: w.artifacts,
|
|
42
|
+
scenario: w.scenario,
|
|
43
|
+
location: w.event.location,
|
|
44
|
+
script: w.event.final,
|
|
45
|
+
},
|
|
46
|
+
event,
|
|
47
|
+
life,
|
|
48
|
+
);
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
50
54
|
return result.filter((r) => r !== null);
|
|
51
55
|
};
|
|
52
56
|
|
|
@@ -64,6 +68,7 @@ const compile = async <Model extends ILlmSchema.Model>(
|
|
|
64
68
|
});
|
|
65
69
|
return {
|
|
66
70
|
type: "testValidate",
|
|
71
|
+
id: v7(),
|
|
67
72
|
file: {
|
|
68
73
|
scenario: func.scenario,
|
|
69
74
|
location: func.location,
|
|
@@ -83,7 +88,7 @@ const predicate = async <Model extends ILlmSchema.Model>(
|
|
|
83
88
|
): Promise<AutoBeTestValidateEvent> => {
|
|
84
89
|
if (event.result.type === "failure") ctx.dispatch(event);
|
|
85
90
|
return event.result.type === "failure"
|
|
86
|
-
? correct(ctx, content, event, life - 1)
|
|
91
|
+
? await correct(ctx, content, event, life - 1)
|
|
87
92
|
: event;
|
|
88
93
|
};
|
|
89
94
|
|
|
@@ -110,8 +115,12 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
110
115
|
},
|
|
111
116
|
}),
|
|
112
117
|
enforceFunctionCall: true,
|
|
113
|
-
message:
|
|
114
|
-
|
|
118
|
+
message: StringUtil.trim`
|
|
119
|
+
Fix the AutoBeTest.IFunction data to resolve the compilation error.
|
|
120
|
+
|
|
121
|
+
You don't need to explain me anything, but just fix it immediately
|
|
122
|
+
without any hesitation, explanation, and questions.
|
|
123
|
+
`,
|
|
115
124
|
});
|
|
116
125
|
if (pointer.value === null) throw new Error("Failed to modify test code.");
|
|
117
126
|
|
|
@@ -120,6 +129,7 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
120
129
|
|
|
121
130
|
ctx.dispatch({
|
|
122
131
|
type: "testCorrect",
|
|
132
|
+
id: v7(),
|
|
123
133
|
created_at: new Date().toISOString(),
|
|
124
134
|
file: validate.file,
|
|
125
135
|
result: validate.result,
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
AutoBeInterfaceAuthorization,
|
|
4
|
+
AutoBeOpenApi,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
6
|
+
AutoBeTestScenario,
|
|
7
|
+
} from "@autobe/interface";
|
|
8
|
+
import { AutoBeEndpointComparator, MapUtil, StringUtil } from "@autobe/utils";
|
|
4
9
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
5
10
|
import { HashMap, IPointer, Pair } from "tstl";
|
|
6
11
|
import typia from "typia";
|
|
12
|
+
import { v7 } from "uuid";
|
|
7
13
|
|
|
8
14
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
15
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
10
16
|
import { divideArray } from "../../utils/divideArray";
|
|
11
|
-
import {
|
|
17
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
12
18
|
import { transformTestScenarioHistories } from "./histories/transformTestScenarioHistories";
|
|
13
19
|
import { IAutoBeTestScenarioApplication } from "./structures/IAutoBeTestScenarioApplication";
|
|
20
|
+
import { IAutoBeTestScenarioAuthorizationRole } from "./structures/IAutoBeTestScenarioAuthorizationRole";
|
|
14
21
|
|
|
15
22
|
export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
16
23
|
ctx: AutoBeContext<Model>,
|
|
@@ -38,6 +45,7 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
38
45
|
AutoBeEndpointComparator.hashCode,
|
|
39
46
|
AutoBeEndpointComparator.equals,
|
|
40
47
|
);
|
|
48
|
+
|
|
41
49
|
const endpointNotFound: string = [
|
|
42
50
|
`You have to select one of the endpoints below`,
|
|
43
51
|
"",
|
|
@@ -46,7 +54,7 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
46
54
|
...operations.map((op) => `\`${op.method}\` | \`${op.path}\``).join("\n"),
|
|
47
55
|
].join("\n");
|
|
48
56
|
|
|
49
|
-
const progress:
|
|
57
|
+
const progress: AutoBeProgressEventBase = {
|
|
50
58
|
total: operations.length,
|
|
51
59
|
completed: 0,
|
|
52
60
|
};
|
|
@@ -58,18 +66,18 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
58
66
|
array: include,
|
|
59
67
|
capacity: 5,
|
|
60
68
|
});
|
|
61
|
-
await
|
|
62
|
-
matrix.map(async (
|
|
69
|
+
await executeCachedBatch(
|
|
70
|
+
matrix.map((include) => async (promptCacheKey) => {
|
|
63
71
|
exclude.push(
|
|
64
|
-
...(await divideAndConquer(
|
|
65
|
-
ctx,
|
|
72
|
+
...(await divideAndConquer(ctx, {
|
|
66
73
|
dict,
|
|
67
74
|
endpointNotFound,
|
|
68
|
-
operations,
|
|
75
|
+
entire: operations,
|
|
69
76
|
include,
|
|
70
|
-
exclude.map((x) => x.endpoint),
|
|
77
|
+
exclude: exclude.map((x) => x.endpoint),
|
|
71
78
|
progress,
|
|
72
|
-
|
|
79
|
+
promptCacheKey,
|
|
80
|
+
})),
|
|
73
81
|
);
|
|
74
82
|
}),
|
|
75
83
|
);
|
|
@@ -100,34 +108,49 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
100
108
|
|
|
101
109
|
const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
102
110
|
ctx: AutoBeContext<Model>,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
props: {
|
|
112
|
+
dict: HashMap<AutoBeOpenApi.IEndpoint, AutoBeOpenApi.IOperation>;
|
|
113
|
+
endpointNotFound: string;
|
|
114
|
+
entire: AutoBeOpenApi.IOperation[];
|
|
115
|
+
include: AutoBeOpenApi.IOperation[];
|
|
116
|
+
exclude: AutoBeOpenApi.IEndpoint[];
|
|
117
|
+
progress: AutoBeProgressEventBase;
|
|
118
|
+
promptCacheKey: string;
|
|
119
|
+
},
|
|
120
|
+
): Promise<IAutoBeTestScenarioApplication.IScenarioGroup[]> => {
|
|
110
121
|
const pointer: IPointer<IAutoBeTestScenarioApplication.IScenarioGroup[]> = {
|
|
111
122
|
value: [],
|
|
112
123
|
};
|
|
124
|
+
|
|
125
|
+
const authorizations: AutoBeInterfaceAuthorization[] =
|
|
126
|
+
ctx.state().interface?.authorizations ?? [];
|
|
127
|
+
|
|
113
128
|
const { tokenUsage } = await ctx.conversate({
|
|
114
129
|
source: "testScenarios",
|
|
115
|
-
histories: transformTestScenarioHistories(
|
|
130
|
+
histories: transformTestScenarioHistories(
|
|
131
|
+
ctx.state(),
|
|
132
|
+
props.entire,
|
|
133
|
+
props.include,
|
|
134
|
+
props.exclude,
|
|
135
|
+
),
|
|
116
136
|
controller: createController({
|
|
117
137
|
model: ctx.model,
|
|
118
|
-
endpointNotFound,
|
|
119
|
-
dict,
|
|
138
|
+
endpointNotFound: props.endpointNotFound,
|
|
139
|
+
dict: props.dict,
|
|
140
|
+
authorizations,
|
|
120
141
|
build: (next) => {
|
|
121
142
|
pointer.value ??= [];
|
|
122
143
|
pointer.value.push(...next.scenarioGroups);
|
|
123
144
|
},
|
|
124
145
|
}),
|
|
125
146
|
enforceFunctionCall: true,
|
|
147
|
+
promptCacheKey: props.promptCacheKey,
|
|
126
148
|
message: `Create e2e test scenarios.`,
|
|
127
149
|
});
|
|
128
150
|
if (pointer.value.length === 0) return [];
|
|
129
151
|
ctx.dispatch({
|
|
130
152
|
type: "testScenarios",
|
|
153
|
+
id: v7(),
|
|
131
154
|
tokenUsage,
|
|
132
155
|
scenarios: pointer.value
|
|
133
156
|
.map((v) =>
|
|
@@ -142,8 +165,8 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
142
165
|
),
|
|
143
166
|
)
|
|
144
167
|
.flat(),
|
|
145
|
-
completed: ++progress.completed,
|
|
146
|
-
total: progress.total,
|
|
168
|
+
completed: ++props.progress.completed,
|
|
169
|
+
total: props.progress.total,
|
|
147
170
|
step: ctx.state().interface?.step ?? 0,
|
|
148
171
|
created_at: new Date().toISOString(),
|
|
149
172
|
});
|
|
@@ -154,6 +177,7 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
154
177
|
model: Model;
|
|
155
178
|
endpointNotFound: string;
|
|
156
179
|
dict: HashMap<AutoBeOpenApi.IEndpoint, AutoBeOpenApi.IOperation>;
|
|
180
|
+
authorizations: AutoBeInterfaceAuthorization[];
|
|
157
181
|
build: (next: IAutoBeTestScenarioApplication.IProps) => void;
|
|
158
182
|
}): IAgenticaController.IClass<Model> {
|
|
159
183
|
assertSchemaModel(props.model);
|
|
@@ -166,19 +190,8 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
166
190
|
if (result.success === false) return result;
|
|
167
191
|
|
|
168
192
|
// merge to unique scenario groups
|
|
169
|
-
const scenarioGroups: IAutoBeTestScenarioApplication.IScenarioGroup[] =
|
|
170
|
-
|
|
171
|
-
const created = scenarioGroups.find(
|
|
172
|
-
(el) =>
|
|
173
|
-
el.endpoint.method === sg.endpoint.method &&
|
|
174
|
-
el.endpoint.path === sg.endpoint.path,
|
|
175
|
-
);
|
|
176
|
-
if (created) {
|
|
177
|
-
created.scenarios.push(...sg.scenarios);
|
|
178
|
-
} else {
|
|
179
|
-
scenarioGroups.push(sg);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
193
|
+
const scenarioGroups: IAutoBeTestScenarioApplication.IScenarioGroup[] =
|
|
194
|
+
uniqueScenarioGroups(result.data.scenarioGroups);
|
|
182
195
|
|
|
183
196
|
// validate endpoints
|
|
184
197
|
const errors: IValidation.IError[] = [];
|
|
@@ -202,6 +215,125 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
202
215
|
});
|
|
203
216
|
});
|
|
204
217
|
});
|
|
218
|
+
|
|
219
|
+
// Authentication Correction
|
|
220
|
+
const entireRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
|
|
221
|
+
new Map();
|
|
222
|
+
for (const authorization of props.authorizations) {
|
|
223
|
+
for (const op of authorization.operations) {
|
|
224
|
+
if (op.authorizationType === null) continue;
|
|
225
|
+
const value: IAutoBeTestScenarioAuthorizationRole = MapUtil.take(
|
|
226
|
+
entireRoles,
|
|
227
|
+
authorization.role,
|
|
228
|
+
() => ({
|
|
229
|
+
name: authorization.role,
|
|
230
|
+
join: null,
|
|
231
|
+
login: null,
|
|
232
|
+
}),
|
|
233
|
+
);
|
|
234
|
+
if (op.authorizationType === "join") value.join = op;
|
|
235
|
+
else if (op.authorizationType === "login") value.login = op;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
scenarioGroups.forEach((group) => {
|
|
240
|
+
if (props.dict.has(group.endpoint) === false) return;
|
|
241
|
+
|
|
242
|
+
const operation: AutoBeOpenApi.IOperation = props.dict.get(
|
|
243
|
+
group.endpoint,
|
|
244
|
+
);
|
|
245
|
+
group.scenarios.forEach((scenario) => {
|
|
246
|
+
// gathere authorization roles
|
|
247
|
+
const localRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
|
|
248
|
+
new Map();
|
|
249
|
+
const add = (operation: AutoBeOpenApi.IOperation) => {
|
|
250
|
+
const role: string | null = operation.authorizationRole;
|
|
251
|
+
if (role === null) return;
|
|
252
|
+
MapUtil.take(localRoles, role, () => ({
|
|
253
|
+
name: role,
|
|
254
|
+
join: null,
|
|
255
|
+
login: null,
|
|
256
|
+
}));
|
|
257
|
+
};
|
|
258
|
+
add(operation);
|
|
259
|
+
scenario.dependencies.forEach((d) => {
|
|
260
|
+
if (props.dict.has(d.endpoint) === false) return;
|
|
261
|
+
const depOperation: AutoBeOpenApi.IOperation = props.dict.get(
|
|
262
|
+
d.endpoint,
|
|
263
|
+
);
|
|
264
|
+
add(depOperation);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// Single role case - add join operation
|
|
268
|
+
if (localRoles.size === 1) {
|
|
269
|
+
const role: IAutoBeTestScenarioAuthorizationRole = localRoles
|
|
270
|
+
.values()
|
|
271
|
+
.next().value!;
|
|
272
|
+
if (role.join === null) {
|
|
273
|
+
const joinOperation: AutoBeOpenApi.IOperation | null =
|
|
274
|
+
entireRoles.get(role.name)?.join ?? null;
|
|
275
|
+
if (joinOperation === null) throw new Error("Unreachable code");
|
|
276
|
+
|
|
277
|
+
scenario.dependencies.push({
|
|
278
|
+
endpoint: {
|
|
279
|
+
method: joinOperation.method,
|
|
280
|
+
path: joinOperation.path,
|
|
281
|
+
},
|
|
282
|
+
purpose: StringUtil.trim`
|
|
283
|
+
Essential authentication prerequisite:
|
|
284
|
+
This join operation (${joinOperation.method} ${joinOperation.path}) must be executed before any operations requiring '${role.name}' role authorization.
|
|
285
|
+
It establishes the necessary user account and authentication context for the '${role.name}' role, enabling subsequent API calls that depend on this specific authorization level.
|
|
286
|
+
Without this join operation, the main scenario endpoint and its dependencies will fail due to insufficient authentication credentials.
|
|
287
|
+
`,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Multiple roles case - add both join and login operations
|
|
293
|
+
if (localRoles.size > 1) {
|
|
294
|
+
for (const role of localRoles.values()) {
|
|
295
|
+
if (role.join === null) {
|
|
296
|
+
const joinOperation: AutoBeOpenApi.IOperation | null =
|
|
297
|
+
entireRoles.get(role.name)?.join ?? null;
|
|
298
|
+
if (joinOperation === null) throw new Error("Unreachable code");
|
|
299
|
+
|
|
300
|
+
scenario.dependencies.push({
|
|
301
|
+
endpoint: {
|
|
302
|
+
path: joinOperation.path,
|
|
303
|
+
method: joinOperation.method,
|
|
304
|
+
},
|
|
305
|
+
purpose: StringUtil.trim`
|
|
306
|
+
Multi-actor authentication setup:
|
|
307
|
+
This join operation (${joinOperation.method} ${joinOperation.path}) is required to establish a '${role.name}' role user account in the system.
|
|
308
|
+
This scenario involves multiple authorization roles, requiring separate user accounts for each role to properly test cross-role interactions and authorization boundaries.
|
|
309
|
+
The join operation creates the foundational user identity that will be used throughout the test scenario for '${role.name}' specific operations.
|
|
310
|
+
This join operation is required for the '${role.name}' role authentication.
|
|
311
|
+
`,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
if (role.login === null) {
|
|
315
|
+
const loginOperation: AutoBeOpenApi.IOperation | null =
|
|
316
|
+
entireRoles.get(role.name)?.login ?? null;
|
|
317
|
+
if (loginOperation === null) throw new Error("Unreachable code");
|
|
318
|
+
|
|
319
|
+
scenario.dependencies.push({
|
|
320
|
+
endpoint: {
|
|
321
|
+
path: loginOperation.path,
|
|
322
|
+
method: loginOperation.method,
|
|
323
|
+
},
|
|
324
|
+
purpose: StringUtil.trim`
|
|
325
|
+
Role switching authentication:
|
|
326
|
+
This login operation (${loginOperation.method} ${loginOperation.path}) enables dynamic user role switching during test execution for the '${role.name}' role.
|
|
327
|
+
In scenarios with multiple actors, the test agent needs to authenticate as different users to simulate real-world multi-user interactions.
|
|
328
|
+
This login operation ensures proper session management and authorization context switching, allowing the test to validate permissions, access controls, and business logic that span across different user roles within a single test scenario.
|
|
329
|
+
This login operation may be required for user role swapping between multiple actors.
|
|
330
|
+
`,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
});
|
|
205
337
|
return errors.length === 0
|
|
206
338
|
? {
|
|
207
339
|
success: true,
|
|
@@ -234,6 +366,17 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
234
366
|
};
|
|
235
367
|
}
|
|
236
368
|
|
|
369
|
+
const uniqueScenarioGroups = (
|
|
370
|
+
groups: IAutoBeTestScenarioApplication.IScenarioGroup[],
|
|
371
|
+
): IAutoBeTestScenarioApplication.IScenarioGroup[] =>
|
|
372
|
+
new HashMap(
|
|
373
|
+
groups.map((g) => new Pair(g.endpoint, g)),
|
|
374
|
+
AutoBeEndpointComparator.hashCode,
|
|
375
|
+
AutoBeEndpointComparator.equals,
|
|
376
|
+
)
|
|
377
|
+
.toJSON()
|
|
378
|
+
.map((it) => it.second);
|
|
379
|
+
|
|
237
380
|
const collection = {
|
|
238
381
|
chatgpt: (validate: Validator) =>
|
|
239
382
|
typia.llm.application<IAutoBeTestScenarioApplication, "chatgpt">({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import {
|
|
3
|
+
AutoBeProgressEventBase,
|
|
3
4
|
AutoBeTestScenario,
|
|
4
5
|
AutoBeTestWriteEvent,
|
|
5
6
|
IAutoBeCompiler,
|
|
@@ -7,10 +8,11 @@ import {
|
|
|
7
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
9
|
import { IPointer } from "tstl";
|
|
9
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
10
12
|
|
|
11
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
13
|
-
import {
|
|
15
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
14
16
|
import { completeTestCode } from "./compile/completeTestCode";
|
|
15
17
|
import { getTestScenarioArtifacts } from "./compile/getTestScenarioArtifacts";
|
|
16
18
|
import { transformTestWriteHistories } from "./histories/transformTestWriteHistories";
|
|
@@ -22,26 +24,26 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
|
|
|
22
24
|
ctx: AutoBeContext<Model>,
|
|
23
25
|
scenarios: AutoBeTestScenario[],
|
|
24
26
|
): Promise<IAutoBeTestWriteResult[]> {
|
|
25
|
-
const progress:
|
|
27
|
+
const progress: AutoBeProgressEventBase = {
|
|
26
28
|
total: scenarios.length,
|
|
27
29
|
completed: 0,
|
|
28
30
|
};
|
|
29
|
-
const result: Array<IAutoBeTestWriteResult | null> = await
|
|
31
|
+
const result: Array<IAutoBeTestWriteResult | null> = await executeCachedBatch(
|
|
30
32
|
/**
|
|
31
33
|
* Generate test code for each scenario. Maps through plans array to create
|
|
32
34
|
* individual test code implementations. Each scenario is processed to
|
|
33
35
|
* generate corresponding test code and progress events.
|
|
34
36
|
*/
|
|
35
|
-
scenarios.map(async (
|
|
37
|
+
scenarios.map((scenario) => async (promptCacheKey) => {
|
|
36
38
|
try {
|
|
37
39
|
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
38
40
|
await getTestScenarioArtifacts(ctx, scenario);
|
|
39
|
-
const event: AutoBeTestWriteEvent = await process(
|
|
40
|
-
ctx,
|
|
41
|
+
const event: AutoBeTestWriteEvent = await process(ctx, {
|
|
41
42
|
scenario,
|
|
42
43
|
artifacts,
|
|
43
44
|
progress,
|
|
44
|
-
|
|
45
|
+
promptCacheKey,
|
|
46
|
+
});
|
|
45
47
|
ctx.dispatch(event);
|
|
46
48
|
return {
|
|
47
49
|
scenario,
|
|
@@ -56,21 +58,16 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
|
|
|
56
58
|
return result.filter((r) => r !== null);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
/**
|
|
60
|
-
* Process function that generates test code for each individual scenario. Takes
|
|
61
|
-
* the AutoBeContext and scenario information as input and uses MicroAgentica to
|
|
62
|
-
* generate appropriate test code through LLM interaction.
|
|
63
|
-
*
|
|
64
|
-
* @param ctx - The AutoBeContext containing model, vendor and configuration
|
|
65
|
-
* @param scenario - The test scenario information to generate code for
|
|
66
|
-
* @param artifacts - The artifacts containing the reference files and schemas
|
|
67
|
-
*/
|
|
68
61
|
async function process<Model extends ILlmSchema.Model>(
|
|
69
62
|
ctx: AutoBeContext<Model>,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
props: {
|
|
64
|
+
scenario: AutoBeTestScenario;
|
|
65
|
+
artifacts: IAutoBeTestScenarioArtifacts;
|
|
66
|
+
progress: AutoBeProgressEventBase;
|
|
67
|
+
promptCacheKey: string;
|
|
68
|
+
},
|
|
73
69
|
): Promise<AutoBeTestWriteEvent> {
|
|
70
|
+
const { scenario, artifacts, progress, promptCacheKey } = props;
|
|
74
71
|
const pointer: IPointer<IAutoBeTestWriteApplication.IProps | null> = {
|
|
75
72
|
value: null,
|
|
76
73
|
};
|
|
@@ -85,6 +82,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
85
82
|
},
|
|
86
83
|
}),
|
|
87
84
|
enforceFunctionCall: true,
|
|
85
|
+
promptCacheKey,
|
|
88
86
|
message: "Create e2e test functions.",
|
|
89
87
|
});
|
|
90
88
|
if (pointer.value === null) throw new Error("Failed to create test code.");
|
|
@@ -93,6 +91,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
93
91
|
pointer.value.final = await compiler.typescript.beautify(pointer.value.final);
|
|
94
92
|
return {
|
|
95
93
|
type: "testWrite",
|
|
94
|
+
id: v7(),
|
|
96
95
|
created_at: new Date().toISOString(),
|
|
97
96
|
location: `test/features/api/${pointer.value.domain}/${scenario.functionName}.ts`,
|
|
98
97
|
...pointer.value,
|
|
@@ -31,7 +31,7 @@ export namespace IAutoBeTestCorrectApplication {
|
|
|
31
31
|
* AI analyzes the original test scenario, business requirements, and
|
|
32
32
|
* intended functionality without being influenced by compilation errors.
|
|
33
33
|
* This clean analysis establishes a clear understanding of what the test
|
|
34
|
-
*
|
|
34
|
+
* accomplishes, the expected business workflow, and the correct API
|
|
35
35
|
* integration patterns.
|
|
36
36
|
*
|
|
37
37
|
* This step ensures that error correction doesn't lose sight of the
|
|
@@ -70,17 +70,18 @@ export namespace IAutoBeTestCorrectApplication {
|
|
|
70
70
|
* AI generates the first corrected version of the test code based on error
|
|
71
71
|
* analysis and correction strategies. This draft addresses all identified
|
|
72
72
|
* compilation errors while preserving the original business logic and test
|
|
73
|
-
* workflow. The code
|
|
74
|
-
*
|
|
73
|
+
* workflow. The code is compilation-error-free and follows all established
|
|
74
|
+
* conventions.
|
|
75
75
|
*
|
|
76
76
|
* The implementation incorporates lessons learned from error analysis to
|
|
77
77
|
* produce properly typed, syntactically correct code that maintains the
|
|
78
78
|
* intended test functionality. All type safety requirements and framework
|
|
79
|
-
* conventions
|
|
79
|
+
* conventions are followed in this corrected implementation.
|
|
80
80
|
*
|
|
81
81
|
* Workflow: Error correction → TypeScript implementation → Functional
|
|
82
|
-
* preservation
|
|
83
|
-
*
|
|
82
|
+
* preservation
|
|
83
|
+
*
|
|
84
|
+
* DO: Resolve all compilation errors while maintaining original test intent
|
|
84
85
|
*/
|
|
85
86
|
draft: string;
|
|
86
87
|
|
|
@@ -63,7 +63,7 @@ export namespace IAutoBeTestScenarioApplication {
|
|
|
63
63
|
*
|
|
64
64
|
* ## Naming Convention
|
|
65
65
|
*
|
|
66
|
-
*
|
|
66
|
+
* DO: Use snake_case naming convention.
|
|
67
67
|
*
|
|
68
68
|
* - Must start with `test_api_` prefix (mandatory requirement)
|
|
69
69
|
* - ALWAYS start with business feature, NOT action verbs
|