@autobe/agent 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeAgent.js +5 -0
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeMockAgent.js +7 -2
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +14 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.d.ts +10 -0
- package/lib/agent/src/factory/consentFunctionCall.js +212 -0
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +71 -14
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +4 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +16 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +8 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +7 -7
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +24 -37
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +2 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +9 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +29 -9
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +1565 -1142
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +22 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +11 -15
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +32 -26
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +135 -124
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +371 -209
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +185 -179
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +35 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +11 -17
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +13 -4
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +6 -10
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +35 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +44 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +40 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +5 -5
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +278 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +12 -20
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +3 -3
- package/lib/agent/src/orchestrate/realize/internal/compile.js +9 -26
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +59 -42
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +17 -16
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -19
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeCoderApplication.js → IAutoBeRealizeCorrectApplication.js} +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +5 -1
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +95 -50
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +12 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +4 -4
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +119 -16
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/agent/src/orchestrate/{internal/IProgress.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
- package/lib/agent/src/utils/predicateStateMessage.d.ts +4 -0
- package/lib/agent/src/utils/predicateStateMessage.js +87 -0
- package/lib/agent/src/utils/predicateStateMessage.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/factory/consentFunctionCall.d.ts +10 -0
- package/lib/index.mjs +3036 -1648
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/orchestrate/realize/internal/compile.d.ts +3 -3
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/utils/predicateStateMessage.d.ts +4 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +14 -0
- package/src/AutoBeMockAgent.ts +9 -11
- package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
- package/src/context/AutoBeTokenUsageComponent.ts +20 -0
- package/src/factory/consentFunctionCall.ts +128 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeContext.ts +99 -14
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +11 -4
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +26 -4
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +19 -14
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +3 -3
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +8 -32
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -3
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +16 -16
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +1 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -10
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterface.ts +51 -12
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +126 -23
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +6 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +32 -27
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +49 -32
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +127 -33
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +67 -65
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +16 -16
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +62 -14
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +38 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +47 -14
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +18 -24
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +41 -0
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +9 -16
- package/src/orchestrate/prisma/orchestratePrisma.ts +15 -6
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -19
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +15 -9
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +1 -1
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +19 -23
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +4 -2
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +285 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -27
- package/src/orchestrate/realize/internal/compile.ts +28 -45
- package/src/orchestrate/realize/orchestrateRealize.ts +71 -67
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +3 -3
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +19 -15
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +23 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +19 -16
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +7 -0
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +110 -59
- package/src/orchestrate/test/orchestrateTest.ts +12 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +155 -19
- package/src/orchestrate/test/orchestrateTestWrite.ts +3 -3
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +6 -5
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
- package/src/utils/predicateStateMessage.ts +107 -0
- package/lib/agent/src/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/agent/src/orchestrate/internal/IProgress.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js +0 -213
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -5
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +0 -1
- package/lib/agent/src/utils/pipe.d.ts +0 -5
- package/lib/agent/src/utils/pipe.js +0 -14
- package/lib/agent/src/utils/pipe.js.map +0 -1
- package/lib/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/utils/pipe.d.ts +0 -5
- package/src/orchestrate/internal/IProgress.ts +0 -4
- package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +0 -358
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +0 -70
- package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +0 -2
- package/src/utils/pipe.ts +0 -39
- /package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/lib/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.ts → IAutoBeRealizeCorrectApplication.ts} +0 -0
|
@@ -1,70 +1,121 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
import { AutoBeInterfaceAuthorization, AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
+
import { MapUtil } from "@autobe/utils";
|
|
3
4
|
import { v4 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
|
+
import { AutoBeState } from "../../../context/AutoBeState";
|
|
8
|
+
import { IAutoBeTestScenarioAuthorizationRole } from "../structures/IAutoBeTestScenarioAuthorizationRole";
|
|
6
9
|
|
|
7
10
|
export const transformTestScenarioHistories = (
|
|
11
|
+
state: AutoBeState,
|
|
8
12
|
entire: AutoBeOpenApi.IOperation[],
|
|
9
13
|
include: AutoBeOpenApi.IOperation[],
|
|
10
14
|
exclude: Pick<AutoBeOpenApi.IOperation, "method" | "path">[],
|
|
11
15
|
): Array<
|
|
12
16
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
13
|
-
> =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
17
|
+
> => {
|
|
18
|
+
const authorizations: AutoBeInterfaceAuthorization[] =
|
|
19
|
+
state.interface?.authorizations ?? [];
|
|
20
|
+
|
|
21
|
+
const authorizationRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
|
|
22
|
+
new Map();
|
|
23
|
+
|
|
24
|
+
for (const authorization of authorizations) {
|
|
25
|
+
for (const op of authorization.operations) {
|
|
26
|
+
if (op.authorizationType === null) continue;
|
|
27
|
+
const value: IAutoBeTestScenarioAuthorizationRole = MapUtil.take(
|
|
28
|
+
authorizationRoles,
|
|
29
|
+
authorization.role,
|
|
30
|
+
() => ({
|
|
31
|
+
name: authorization.role,
|
|
32
|
+
join: null,
|
|
33
|
+
login: null,
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
if (op.authorizationType === "join") value.join = op;
|
|
37
|
+
else if (op.authorizationType === "login") value.login = op;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
id: v4(),
|
|
44
|
+
created_at: new Date().toISOString(),
|
|
45
|
+
type: "systemMessage",
|
|
46
|
+
text: AutoBeSystemPromptConstant.TEST_SCENARIO,
|
|
47
|
+
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
48
|
+
{
|
|
49
|
+
id: v4(),
|
|
50
|
+
created_at: new Date().toISOString(),
|
|
51
|
+
type: "systemMessage",
|
|
52
|
+
text: [
|
|
53
|
+
"# Operations",
|
|
54
|
+
"",
|
|
55
|
+
"Below are the full operations. Please refer to this.",
|
|
56
|
+
"Your role is to draft all test cases for each given Operation.",
|
|
57
|
+
"It is also permissible to write multiple test codes on a single endpoint.",
|
|
58
|
+
"However, rather than meaningless tests, business logic tests should be written and an E2E test situation should be assumed.",
|
|
59
|
+
"",
|
|
60
|
+
"Please carefully analyze each operation to identify all dependencies required for testing.",
|
|
61
|
+
"For example, if you want to test liking and then deleting a post,",
|
|
62
|
+
"you might think to test post creation, liking, and unlike operations.",
|
|
63
|
+
"However, even if not explicitly mentioned, user registration or login are essential prerequisites.",
|
|
64
|
+
"Pay close attention to IDs and related values in the API,",
|
|
65
|
+
"and ensure you identify all dependencies between endpoints.",
|
|
66
|
+
"",
|
|
67
|
+
"```json",
|
|
68
|
+
JSON.stringify(
|
|
69
|
+
entire.map((el) => ({
|
|
70
|
+
...el,
|
|
71
|
+
specification: undefined,
|
|
72
|
+
})),
|
|
73
|
+
),
|
|
74
|
+
"```",
|
|
75
|
+
].join("\n"),
|
|
76
|
+
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
77
|
+
{
|
|
78
|
+
id: v4(),
|
|
79
|
+
created_at: new Date().toISOString(),
|
|
80
|
+
type: "systemMessage",
|
|
81
|
+
text: [
|
|
82
|
+
"# Included in Test Plan",
|
|
83
|
+
"",
|
|
84
|
+
"Below are the endpoints that have been included in the test plan.",
|
|
85
|
+
"Each endpoint shows its authentication requirements and related authentication APIs.",
|
|
86
|
+
"When testing endpoints that require authentication, ensure you include the corresponding join/login operations in your test scenario to establish proper authentication context.",
|
|
87
|
+
"",
|
|
88
|
+
include
|
|
89
|
+
.map((el, i) => {
|
|
90
|
+
const roles = Array.from(authorizationRoles.values()).filter(
|
|
91
|
+
(role) => role.name === el.authorizationRole,
|
|
92
|
+
);
|
|
93
|
+
return [
|
|
94
|
+
`## ${i + 1}. ${el.method.toUpperCase()} ${el.path}`,
|
|
95
|
+
"",
|
|
96
|
+
"Related Authentication APIs:",
|
|
97
|
+
"",
|
|
98
|
+
roles.length > 0
|
|
99
|
+
? roles.map((role) => {
|
|
100
|
+
return [
|
|
101
|
+
`- ${role.join?.method.toUpperCase()}: ${role.join?.path}`,
|
|
102
|
+
`- ${role.login?.method.toUpperCase()}: ${role.login?.path}`,
|
|
103
|
+
].join("\n");
|
|
104
|
+
})
|
|
105
|
+
: "- None",
|
|
106
|
+
];
|
|
107
|
+
})
|
|
108
|
+
.join("\n"),
|
|
109
|
+
"",
|
|
110
|
+
"# Excluded from Test Plan",
|
|
111
|
+
"",
|
|
112
|
+
"These are the endpoints that have already been used in test codes generated as part of a plan group.",
|
|
113
|
+
"These endpoints do not need to be tested again.",
|
|
114
|
+
"However, it is allowed to reference or depend on these endpoints when writing test codes for other purposes.",
|
|
115
|
+
exclude
|
|
116
|
+
.map((el) => `- ${el.method.toUpperCase()}: ${el.path}`)
|
|
117
|
+
.join("\n"),
|
|
118
|
+
].join("\n"),
|
|
119
|
+
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
120
|
+
];
|
|
121
|
+
};
|
|
@@ -12,6 +12,7 @@ import { v4 } 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,7 +23,17 @@ 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: v4(),
|
|
33
|
+
created_at: start.toISOString(),
|
|
34
|
+
text: predicate,
|
|
35
|
+
completed_at: new Date().toISOString(),
|
|
36
|
+
});
|
|
26
37
|
ctx.dispatch({
|
|
27
38
|
type: "testStart",
|
|
28
39
|
created_at: start.toISOString(),
|
|
@@ -30,6 +41,7 @@ export const orchestrateTest =
|
|
|
30
41
|
step: ctx.state().analyze?.step ?? 0,
|
|
31
42
|
});
|
|
32
43
|
|
|
44
|
+
// CHECK OPERATIONS
|
|
33
45
|
const operations: AutoBeOpenApi.IOperation[] =
|
|
34
46
|
ctx.state().interface?.document.operations ?? [];
|
|
35
47
|
if (operations.length === 0)
|
|
@@ -1,6 +1,11 @@
|
|
|
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";
|
|
@@ -8,9 +13,9 @@ import typia from "typia";
|
|
|
8
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
10
15
|
import { divideArray } from "../../utils/divideArray";
|
|
11
|
-
import { IProgress } from "../internal/IProgress";
|
|
12
16
|
import { transformTestScenarioHistories } from "./histories/transformTestScenarioHistories";
|
|
13
17
|
import { IAutoBeTestScenarioApplication } from "./structures/IAutoBeTestScenarioApplication";
|
|
18
|
+
import { IAutoBeTestScenarioAuthorizationRole } from "./structures/IAutoBeTestScenarioAuthorizationRole";
|
|
14
19
|
|
|
15
20
|
export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
16
21
|
ctx: AutoBeContext<Model>,
|
|
@@ -38,6 +43,7 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
38
43
|
AutoBeEndpointComparator.hashCode,
|
|
39
44
|
AutoBeEndpointComparator.equals,
|
|
40
45
|
);
|
|
46
|
+
|
|
41
47
|
const endpointNotFound: string = [
|
|
42
48
|
`You have to select one of the endpoints below`,
|
|
43
49
|
"",
|
|
@@ -46,7 +52,7 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
46
52
|
...operations.map((op) => `\`${op.method}\` | \`${op.path}\``).join("\n"),
|
|
47
53
|
].join("\n");
|
|
48
54
|
|
|
49
|
-
const progress:
|
|
55
|
+
const progress: AutoBeProgressEventBase = {
|
|
50
56
|
total: operations.length,
|
|
51
57
|
completed: 0,
|
|
52
58
|
};
|
|
@@ -105,18 +111,28 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
105
111
|
entire: AutoBeOpenApi.IOperation[],
|
|
106
112
|
include: AutoBeOpenApi.IOperation[],
|
|
107
113
|
exclude: AutoBeOpenApi.IEndpoint[],
|
|
108
|
-
progress:
|
|
114
|
+
progress: AutoBeProgressEventBase,
|
|
109
115
|
) => {
|
|
110
116
|
const pointer: IPointer<IAutoBeTestScenarioApplication.IScenarioGroup[]> = {
|
|
111
117
|
value: [],
|
|
112
118
|
};
|
|
119
|
+
|
|
120
|
+
const authorizations: AutoBeInterfaceAuthorization[] =
|
|
121
|
+
ctx.state().interface?.authorizations ?? [];
|
|
122
|
+
|
|
113
123
|
const { tokenUsage } = await ctx.conversate({
|
|
114
124
|
source: "testScenarios",
|
|
115
|
-
histories: transformTestScenarioHistories(
|
|
125
|
+
histories: transformTestScenarioHistories(
|
|
126
|
+
ctx.state(),
|
|
127
|
+
entire,
|
|
128
|
+
include,
|
|
129
|
+
exclude,
|
|
130
|
+
),
|
|
116
131
|
controller: createController({
|
|
117
132
|
model: ctx.model,
|
|
118
133
|
endpointNotFound,
|
|
119
134
|
dict,
|
|
135
|
+
authorizations,
|
|
120
136
|
build: (next) => {
|
|
121
137
|
pointer.value ??= [];
|
|
122
138
|
pointer.value.push(...next.scenarioGroups);
|
|
@@ -154,6 +170,7 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
154
170
|
model: Model;
|
|
155
171
|
endpointNotFound: string;
|
|
156
172
|
dict: HashMap<AutoBeOpenApi.IEndpoint, AutoBeOpenApi.IOperation>;
|
|
173
|
+
authorizations: AutoBeInterfaceAuthorization[];
|
|
157
174
|
build: (next: IAutoBeTestScenarioApplication.IProps) => void;
|
|
158
175
|
}): IAgenticaController.IClass<Model> {
|
|
159
176
|
assertSchemaModel(props.model);
|
|
@@ -166,19 +183,8 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
166
183
|
if (result.success === false) return result;
|
|
167
184
|
|
|
168
185
|
// 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
|
-
});
|
|
186
|
+
const scenarioGroups: IAutoBeTestScenarioApplication.IScenarioGroup[] =
|
|
187
|
+
uniqueScenarioGroups(result.data.scenarioGroups);
|
|
182
188
|
|
|
183
189
|
// validate endpoints
|
|
184
190
|
const errors: IValidation.IError[] = [];
|
|
@@ -202,6 +208,125 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
202
208
|
});
|
|
203
209
|
});
|
|
204
210
|
});
|
|
211
|
+
|
|
212
|
+
// Authentication Correction
|
|
213
|
+
const entireRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
|
|
214
|
+
new Map();
|
|
215
|
+
for (const authorization of props.authorizations) {
|
|
216
|
+
for (const op of authorization.operations) {
|
|
217
|
+
if (op.authorizationType === null) continue;
|
|
218
|
+
const value: IAutoBeTestScenarioAuthorizationRole = MapUtil.take(
|
|
219
|
+
entireRoles,
|
|
220
|
+
authorization.role,
|
|
221
|
+
() => ({
|
|
222
|
+
name: authorization.role,
|
|
223
|
+
join: null,
|
|
224
|
+
login: null,
|
|
225
|
+
}),
|
|
226
|
+
);
|
|
227
|
+
if (op.authorizationType === "join") value.join = op;
|
|
228
|
+
else if (op.authorizationType === "login") value.login = op;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
scenarioGroups.forEach((group) => {
|
|
233
|
+
if (props.dict.has(group.endpoint) === false) return;
|
|
234
|
+
|
|
235
|
+
const operation: AutoBeOpenApi.IOperation = props.dict.get(
|
|
236
|
+
group.endpoint,
|
|
237
|
+
);
|
|
238
|
+
group.scenarios.forEach((scenario) => {
|
|
239
|
+
// gathere authorization roles
|
|
240
|
+
const localRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
|
|
241
|
+
new Map();
|
|
242
|
+
const add = (operation: AutoBeOpenApi.IOperation) => {
|
|
243
|
+
const role: string | null = operation.authorizationRole;
|
|
244
|
+
if (role === null) return;
|
|
245
|
+
MapUtil.take(localRoles, role, () => ({
|
|
246
|
+
name: role,
|
|
247
|
+
join: null,
|
|
248
|
+
login: null,
|
|
249
|
+
}));
|
|
250
|
+
};
|
|
251
|
+
add(operation);
|
|
252
|
+
scenario.dependencies.forEach((d) => {
|
|
253
|
+
if (props.dict.has(d.endpoint) === false) return;
|
|
254
|
+
const depOperation: AutoBeOpenApi.IOperation = props.dict.get(
|
|
255
|
+
d.endpoint,
|
|
256
|
+
);
|
|
257
|
+
add(depOperation);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// Single role case - add join operation
|
|
261
|
+
if (localRoles.size === 1) {
|
|
262
|
+
const role: IAutoBeTestScenarioAuthorizationRole = localRoles
|
|
263
|
+
.values()
|
|
264
|
+
.next().value!;
|
|
265
|
+
if (role.join === null) {
|
|
266
|
+
const joinOperation: AutoBeOpenApi.IOperation | null =
|
|
267
|
+
entireRoles.get(role.name)?.join ?? null;
|
|
268
|
+
if (joinOperation === null) throw new Error("Unreachable code");
|
|
269
|
+
|
|
270
|
+
scenario.dependencies.push({
|
|
271
|
+
endpoint: {
|
|
272
|
+
method: joinOperation.method,
|
|
273
|
+
path: joinOperation.path,
|
|
274
|
+
},
|
|
275
|
+
purpose: StringUtil.trim`
|
|
276
|
+
Essential authentication prerequisite:
|
|
277
|
+
This join operation (${joinOperation.method} ${joinOperation.path}) must be executed before any operations requiring '${role.name}' role authorization.
|
|
278
|
+
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.
|
|
279
|
+
Without this join operation, the main scenario endpoint and its dependencies will fail due to insufficient authentication credentials.
|
|
280
|
+
`,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Multiple roles case - add both join and login operations
|
|
286
|
+
if (localRoles.size > 1) {
|
|
287
|
+
for (const role of localRoles.values()) {
|
|
288
|
+
if (role.join === null) {
|
|
289
|
+
const joinOperation: AutoBeOpenApi.IOperation | null =
|
|
290
|
+
entireRoles.get(role.name)?.join ?? null;
|
|
291
|
+
if (joinOperation === null) throw new Error("Unreachable code");
|
|
292
|
+
|
|
293
|
+
scenario.dependencies.push({
|
|
294
|
+
endpoint: {
|
|
295
|
+
path: joinOperation.path,
|
|
296
|
+
method: joinOperation.method,
|
|
297
|
+
},
|
|
298
|
+
purpose: StringUtil.trim`
|
|
299
|
+
Multi-actor authentication setup:
|
|
300
|
+
This join operation (${joinOperation.method} ${joinOperation.path}) is required to establish a '${role.name}' role user account in the system.
|
|
301
|
+
This scenario involves multiple authorization roles, requiring separate user accounts for each role to properly test cross-role interactions and authorization boundaries.
|
|
302
|
+
The join operation creates the foundational user identity that will be used throughout the test scenario for '${role.name}' specific operations.
|
|
303
|
+
This join operation is required for the '${role.name}' role authentication.
|
|
304
|
+
`,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
if (role.login === null) {
|
|
308
|
+
const loginOperation: AutoBeOpenApi.IOperation | null =
|
|
309
|
+
entireRoles.get(role.name)?.login ?? null;
|
|
310
|
+
if (loginOperation === null) throw new Error("Unreachable code");
|
|
311
|
+
|
|
312
|
+
scenario.dependencies.push({
|
|
313
|
+
endpoint: {
|
|
314
|
+
path: loginOperation.path,
|
|
315
|
+
method: loginOperation.method,
|
|
316
|
+
},
|
|
317
|
+
purpose: StringUtil.trim`
|
|
318
|
+
Role switching authentication:
|
|
319
|
+
This login operation (${loginOperation.method} ${loginOperation.path}) enables dynamic user role switching during test execution for the '${role.name}' role.
|
|
320
|
+
In scenarios with multiple actors, the test agent needs to authenticate as different users to simulate real-world multi-user interactions.
|
|
321
|
+
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.
|
|
322
|
+
This login operation may be required for user role swapping between multiple actors.
|
|
323
|
+
`,
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
});
|
|
205
330
|
return errors.length === 0
|
|
206
331
|
? {
|
|
207
332
|
success: true,
|
|
@@ -234,6 +359,17 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
234
359
|
};
|
|
235
360
|
}
|
|
236
361
|
|
|
362
|
+
const uniqueScenarioGroups = (
|
|
363
|
+
groups: IAutoBeTestScenarioApplication.IScenarioGroup[],
|
|
364
|
+
): IAutoBeTestScenarioApplication.IScenarioGroup[] =>
|
|
365
|
+
new HashMap(
|
|
366
|
+
groups.map((g) => new Pair(g.endpoint, g)),
|
|
367
|
+
AutoBeEndpointComparator.hashCode,
|
|
368
|
+
AutoBeEndpointComparator.equals,
|
|
369
|
+
)
|
|
370
|
+
.toJSON()
|
|
371
|
+
.map((it) => it.second);
|
|
372
|
+
|
|
237
373
|
const collection = {
|
|
238
374
|
chatgpt: (validate: Validator) =>
|
|
239
375
|
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,
|
|
@@ -10,7 +11,6 @@ import typia from "typia";
|
|
|
10
11
|
|
|
11
12
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
13
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
13
|
-
import { IProgress } from "../internal/IProgress";
|
|
14
14
|
import { completeTestCode } from "./compile/completeTestCode";
|
|
15
15
|
import { getTestScenarioArtifacts } from "./compile/getTestScenarioArtifacts";
|
|
16
16
|
import { transformTestWriteHistories } from "./histories/transformTestWriteHistories";
|
|
@@ -22,7 +22,7 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
|
|
|
22
22
|
ctx: AutoBeContext<Model>,
|
|
23
23
|
scenarios: AutoBeTestScenario[],
|
|
24
24
|
): Promise<IAutoBeTestWriteResult[]> {
|
|
25
|
-
const progress:
|
|
25
|
+
const progress: AutoBeProgressEventBase = {
|
|
26
26
|
total: scenarios.length,
|
|
27
27
|
completed: 0,
|
|
28
28
|
};
|
|
@@ -69,7 +69,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
69
69
|
ctx: AutoBeContext<Model>,
|
|
70
70
|
scenario: AutoBeTestScenario,
|
|
71
71
|
artifacts: IAutoBeTestScenarioArtifacts,
|
|
72
|
-
progress:
|
|
72
|
+
progress: AutoBeProgressEventBase,
|
|
73
73
|
): Promise<AutoBeTestWriteEvent> {
|
|
74
74
|
const pointer: IPointer<IAutoBeTestWriteApplication.IProps | null> = {
|
|
75
75
|
value: null,
|
|
@@ -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
|
|
73
|
+
* workflow. The code is compilation-error-free and follows all
|
|
74
74
|
* established 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
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { StringUtil } from "@autobe/utils";
|
|
2
|
+
|
|
3
|
+
import { AutoBeState } from "../context/AutoBeState";
|
|
4
|
+
|
|
5
|
+
type StepName = "analyze" | "prisma" | "interface" | "test" | "realize";
|
|
6
|
+
|
|
7
|
+
export const predicateStateMessage = (
|
|
8
|
+
state: AutoBeState,
|
|
9
|
+
future: StepName,
|
|
10
|
+
): string | null => {
|
|
11
|
+
if (future === "analyze") return null;
|
|
12
|
+
if (future === "prisma") return predicatePrisma(state);
|
|
13
|
+
|
|
14
|
+
const futureIndex: number = STEP_ORDER.indexOf(future);
|
|
15
|
+
for (const key of STEP_ORDER.slice(0, futureIndex))
|
|
16
|
+
if (state[key] === null) return buildMissingStepsMessage(future, key);
|
|
17
|
+
|
|
18
|
+
const prevStepName: StepName = STEP_ORDER[futureIndex - 1];
|
|
19
|
+
if (state.analyze!.step !== state[prevStepName]!.step)
|
|
20
|
+
return buildOutdatedMessage(prevStepName, "analyze", state);
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const buildMissingStepsMessage = (
|
|
25
|
+
current: StepName,
|
|
26
|
+
missing: StepName,
|
|
27
|
+
): string => {
|
|
28
|
+
const currentIndex: number = STEP_ORDER.indexOf(current);
|
|
29
|
+
const missingIndex: number = STEP_ORDER.indexOf(missing);
|
|
30
|
+
const remainingSteps: string = STEP_ORDER.slice(
|
|
31
|
+
missingIndex,
|
|
32
|
+
currentIndex + 1,
|
|
33
|
+
)
|
|
34
|
+
.map((step, index) => `${index + 1}. ${STEP_DESCRIPTIONS[step]}`)
|
|
35
|
+
.join("\n ");
|
|
36
|
+
|
|
37
|
+
const currentAction = ACTION_NAMES[current];
|
|
38
|
+
|
|
39
|
+
return StringUtil.trim`
|
|
40
|
+
${STEP_DESCRIPTIONS[missing]} not completed yet.
|
|
41
|
+
|
|
42
|
+
To ${currentAction}, complete these steps:
|
|
43
|
+
|
|
44
|
+
${remainingSteps}
|
|
45
|
+
|
|
46
|
+
Start with step ${missingIndex + 1}.
|
|
47
|
+
`;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const buildOutdatedMessage = (
|
|
51
|
+
outdatedStep: StepName,
|
|
52
|
+
currentStep: StepName,
|
|
53
|
+
state: AutoBeState,
|
|
54
|
+
): string => {
|
|
55
|
+
const outdatedVersion = state[outdatedStep]?.step;
|
|
56
|
+
const currentVersion = state[currentStep]?.step;
|
|
57
|
+
|
|
58
|
+
return StringUtil.trim`
|
|
59
|
+
${STEP_NAMES[outdatedStep]} is outdated (step ${outdatedVersion}).
|
|
60
|
+
|
|
61
|
+
Requirements are now at step ${currentVersion}.
|
|
62
|
+
|
|
63
|
+
Please update ${outdatedStep} to match current requirements.
|
|
64
|
+
`;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const predicatePrisma = (state: AutoBeState): string | null => {
|
|
68
|
+
if (state.analyze !== null) return null;
|
|
69
|
+
return StringUtil.trim`
|
|
70
|
+
Requirements analysis not started.
|
|
71
|
+
|
|
72
|
+
Discuss your project with AI to generate requirements analysis.
|
|
73
|
+
Database design will follow after requirements are ready.
|
|
74
|
+
`;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const STEP_DESCRIPTIONS: Record<StepName, string> = {
|
|
78
|
+
analyze: "Requirements analysis",
|
|
79
|
+
prisma: "Database design",
|
|
80
|
+
interface: "API interface design",
|
|
81
|
+
test: "E2E test creation",
|
|
82
|
+
realize: "Implementation",
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const STEP_NAMES: Record<StepName, string> = {
|
|
86
|
+
analyze: "Requirements analysis",
|
|
87
|
+
prisma: "Database schema",
|
|
88
|
+
interface: "API interface",
|
|
89
|
+
test: "Test functions",
|
|
90
|
+
realize: "Implementation",
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const ACTION_NAMES: Record<StepName, string> = {
|
|
94
|
+
analyze: "analyze requirements",
|
|
95
|
+
prisma: "design database",
|
|
96
|
+
interface: "design API interface",
|
|
97
|
+
test: "create tests",
|
|
98
|
+
realize: "implement the program",
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const STEP_ORDER: StepName[] = [
|
|
102
|
+
"analyze",
|
|
103
|
+
"prisma",
|
|
104
|
+
"interface",
|
|
105
|
+
"test",
|
|
106
|
+
"realize",
|
|
107
|
+
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IProgress.js","sourceRoot":"","sources":["../../../../../src/orchestrate/internal/IProgress.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { AutoBeRealizeAuthorization, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import { AutoBeState } from "../../../context/AutoBeState";
|
|
4
|
-
import { IAutoBeTestScenarioArtifacts } from "../../test/structures/IAutoBeTestScenarioArtifacts";
|
|
5
|
-
import { IAutoBeRealizeScenario } from "../orchestrateRealizeScenario";
|
|
6
|
-
import { IAutoBeRealizeCompile } from "../structures/IAutoBeRealizeCompile";
|
|
7
|
-
export declare const transformRealizeCoderHistories: (state: AutoBeState, previousCodes: IAutoBeRealizeCompile.Success[], props: IAutoBeRealizeScenario, artifacts: IAutoBeTestScenarioArtifacts, previous: string | null, diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[], authorization?: AutoBeRealizeAuthorization) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
|