@autobe/agent 0.21.0 → 0.22.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/agent/src/AutoBeAgent.js +2 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeConfigConstant.d.ts +3 -0
- package/lib/agent/src/{orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js → constants/AutoBeConfigConstant.js} +1 -1
- package/lib/agent/src/constants/AutoBeConfigConstant.js.map +1 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +27 -27
- package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +4 -3
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.js +4 -4
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +13 -10
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +6 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +50 -8
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +4 -4
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +19 -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 +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.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 +2 -2
- 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.d.ts +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +5 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +16 -10
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +3731 -228
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +43 -63
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1261 -1628
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +3466 -103
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +3672 -358
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js +1385 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js +78 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js +81 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +1 -1
- 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/orchestratePrismaCorrect.d.ts +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +2 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +22 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +13 -29
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js +2 -8
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +6 -49
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +4 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +5 -3
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +206 -118
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -39
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js.map +1 -0
- package/{src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts → lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts} +2 -13
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +86 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js +55 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js +20 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js +73 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +63 -69
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +15 -14
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js +19 -0
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js.map +1 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js +21 -0
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js.map +1 -0
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +16 -17
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +5 -4
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +21 -2
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +126 -72
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +46 -40
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +121 -42
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js +3 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js +28 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeConfig.d.ts +2 -0
- package/lib/constants/AutoBeConfigConstant.d.ts +3 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -27
- package/lib/context/AutoBeContext.d.ts +1 -0
- package/lib/index.mjs +13805 -3871
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
- package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
- package/lib/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
- package/lib/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +36 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
- package/lib/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
- package/lib/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
- package/lib/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
- package/lib/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
- package/lib/structures/IAutoBeConfig.d.ts +2 -0
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +2 -0
- package/src/constants/AutoBeConfigConstant.ts +3 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +27 -27
- package/src/context/AutoBeContext.ts +1 -0
- package/src/context/AutoBeTokenUsageComponent.ts +3 -3
- package/src/factory/consentFunctionCall.ts +2 -0
- package/src/factory/createAutoBeContext.ts +145 -136
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +6 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +4 -0
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +19 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +1 -4
- package/src/orchestrate/interface/orchestrateInterface.ts +15 -4
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -5
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +58 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -11
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +13 -117
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +33 -91
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +72 -95
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +0 -39
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +50 -146
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +31 -27
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +171 -0
- package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +83 -0
- package/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.ts +90 -0
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +2 -2
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -2
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +30 -15
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -49
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +4 -11
- package/src/orchestrate/realize/orchestrateRealize.ts +19 -75
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +1 -1
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +114 -25
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +2 -2
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +11 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +17 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +20 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +40 -74
- package/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.ts +9 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +45 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +33 -22
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +97 -0
- package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +64 -0
- package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +29 -0
- package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +82 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +101 -111
- package/src/orchestrate/test/compile/completeTestCode.ts +15 -26
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +1 -0
- package/src/orchestrate/test/compile/getTestImportStatements.ts +25 -0
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +6 -1
- package/src/orchestrate/test/compile/getTestTemplateCode.ts +25 -0
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +26 -26
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +6 -5
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +19 -0
- package/src/orchestrate/test/orchestrateTest.ts +6 -0
- package/src/orchestrate/test/orchestrateTestCorrect.ts +46 -15
- package/src/orchestrate/test/orchestrateTestScenario.ts +52 -48
- package/src/orchestrate/test/orchestrateTestWrite.ts +23 -5
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +49 -46
- package/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.ts +8 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +1 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +14 -0
- package/src/orchestrate/test/utils/getReferenceIds.ts +25 -0
- package/src/structures/IAutoBeConfig.ts +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
|
@@ -17,13 +17,13 @@ import { completeTestCode } from "./compile/completeTestCode";
|
|
|
17
17
|
import { transformTestCorrectHistories } from "./histories/transformTestCorrectHistories";
|
|
18
18
|
import { IAutoBeTestCorrectApplication } from "./structures/IAutoBeTestCorrectApplication";
|
|
19
19
|
import { IAutoBeTestFunction } from "./structures/IAutoBeTestFunction";
|
|
20
|
+
import { IAutoBeTestFunctionFailure } from "./structures/IAutoBeTestFunctionFailure";
|
|
20
21
|
import { IAutoBeTestScenarioArtifacts } from "./structures/IAutoBeTestScenarioArtifacts";
|
|
21
22
|
import { IAutoBeTestWriteResult } from "./structures/IAutoBeTestWriteResult";
|
|
22
23
|
|
|
23
24
|
export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
|
|
24
25
|
ctx: AutoBeContext<Model>,
|
|
25
26
|
writeResult: IAutoBeTestWriteResult[],
|
|
26
|
-
life: number = 4,
|
|
27
27
|
): Promise<AutoBeTestValidateEvent[]> => {
|
|
28
28
|
const result: Array<AutoBeTestValidateEvent | null> =
|
|
29
29
|
await executeCachedBatch(
|
|
@@ -33,7 +33,7 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
|
|
|
33
33
|
artifacts: w.artifacts,
|
|
34
34
|
scenario: w.scenario,
|
|
35
35
|
location: w.event.location,
|
|
36
|
-
script: w.event.final,
|
|
36
|
+
script: w.event.final ?? w.event.draft,
|
|
37
37
|
});
|
|
38
38
|
return await predicate(
|
|
39
39
|
ctx,
|
|
@@ -41,10 +41,11 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
|
|
|
41
41
|
artifacts: w.artifacts,
|
|
42
42
|
scenario: w.scenario,
|
|
43
43
|
location: w.event.location,
|
|
44
|
-
script: w.event.final,
|
|
44
|
+
script: w.event.final ?? w.event.draft,
|
|
45
45
|
},
|
|
46
|
+
[],
|
|
46
47
|
event,
|
|
47
|
-
|
|
48
|
+
ctx.retry,
|
|
48
49
|
);
|
|
49
50
|
} catch {
|
|
50
51
|
return null;
|
|
@@ -83,18 +84,20 @@ const compile = async <Model extends ILlmSchema.Model>(
|
|
|
83
84
|
const predicate = async <Model extends ILlmSchema.Model>(
|
|
84
85
|
ctx: AutoBeContext<Model>,
|
|
85
86
|
content: IAutoBeTestFunction,
|
|
87
|
+
failures: IAutoBeTestFunctionFailure[],
|
|
86
88
|
event: AutoBeTestValidateEvent,
|
|
87
89
|
life: number,
|
|
88
90
|
): Promise<AutoBeTestValidateEvent> => {
|
|
89
91
|
if (event.result.type === "failure") ctx.dispatch(event);
|
|
90
92
|
return event.result.type === "failure"
|
|
91
|
-
? await correct(ctx, content, event, life - 1)
|
|
93
|
+
? await correct(ctx, content, failures, event, life - 1)
|
|
92
94
|
: event;
|
|
93
95
|
};
|
|
94
96
|
|
|
95
97
|
const correct = async <Model extends ILlmSchema.Model>(
|
|
96
98
|
ctx: AutoBeContext<Model>,
|
|
97
99
|
content: IAutoBeTestFunction,
|
|
100
|
+
failures: IAutoBeTestFunctionFailure[],
|
|
98
101
|
validate: AutoBeTestValidateEvent,
|
|
99
102
|
life: number,
|
|
100
103
|
): Promise<AutoBeTestValidateEvent> => {
|
|
@@ -106,11 +109,13 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
106
109
|
};
|
|
107
110
|
const { tokenUsage } = await ctx.conversate({
|
|
108
111
|
source: "testCorrect",
|
|
109
|
-
histories: await transformTestCorrectHistories(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
histories: await transformTestCorrectHistories(ctx, content, [
|
|
113
|
+
...failures,
|
|
114
|
+
{
|
|
115
|
+
function: content,
|
|
116
|
+
failure: validate.result,
|
|
117
|
+
},
|
|
118
|
+
]),
|
|
114
119
|
controller: createController({
|
|
115
120
|
model: ctx.model,
|
|
116
121
|
artifacts: content.artifacts,
|
|
@@ -129,7 +134,14 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
129
134
|
if (pointer.value === null) throw new Error("Failed to modify test code.");
|
|
130
135
|
|
|
131
136
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
132
|
-
|
|
137
|
+
if (pointer.value.revise)
|
|
138
|
+
pointer.value.revise.final = await compiler.typescript.beautify(
|
|
139
|
+
pointer.value.revise.final,
|
|
140
|
+
);
|
|
141
|
+
else
|
|
142
|
+
pointer.value.draft = await compiler.typescript.beautify(
|
|
143
|
+
pointer.value.draft,
|
|
144
|
+
);
|
|
133
145
|
|
|
134
146
|
ctx.dispatch({
|
|
135
147
|
type: "testCorrect",
|
|
@@ -139,14 +151,29 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
139
151
|
result: validate.result,
|
|
140
152
|
tokenUsage,
|
|
141
153
|
step: ctx.state().analyze?.step ?? 0,
|
|
142
|
-
|
|
154
|
+
think: pointer.value.think,
|
|
155
|
+
draft: pointer.value.draft,
|
|
156
|
+
review: pointer.value.revise?.review,
|
|
157
|
+
final: pointer.value.revise?.final,
|
|
143
158
|
});
|
|
144
159
|
const newContent: IAutoBeTestFunction = {
|
|
145
160
|
...content,
|
|
146
|
-
script: pointer.value.final,
|
|
161
|
+
script: pointer.value.revise?.final ?? pointer.value.draft,
|
|
147
162
|
};
|
|
148
163
|
const newValidate: AutoBeTestValidateEvent = await compile(ctx, newContent);
|
|
149
|
-
return predicate(
|
|
164
|
+
return predicate(
|
|
165
|
+
ctx,
|
|
166
|
+
newContent,
|
|
167
|
+
[
|
|
168
|
+
...failures,
|
|
169
|
+
{
|
|
170
|
+
function: content,
|
|
171
|
+
failure: validate.result,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
newValidate,
|
|
175
|
+
life,
|
|
176
|
+
);
|
|
150
177
|
};
|
|
151
178
|
|
|
152
179
|
const createController = <Model extends ILlmSchema.Model>(props: {
|
|
@@ -166,7 +193,11 @@ const createController = <Model extends ILlmSchema.Model>(props: {
|
|
|
166
193
|
execute: {
|
|
167
194
|
rewrite: (next) => {
|
|
168
195
|
next.draft = completeTestCode(props.artifacts, next.draft);
|
|
169
|
-
|
|
196
|
+
if (next.revise)
|
|
197
|
+
next.revise.final = completeTestCode(
|
|
198
|
+
props.artifacts,
|
|
199
|
+
next.revise.final,
|
|
200
|
+
);
|
|
170
201
|
props.build(next);
|
|
171
202
|
},
|
|
172
203
|
} satisfies IAutoBeTestCorrectApplication,
|
|
@@ -64,7 +64,7 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
64
64
|
do {
|
|
65
65
|
const matrix: AutoBeOpenApi.IOperation[][] = divideArray({
|
|
66
66
|
array: include,
|
|
67
|
-
capacity:
|
|
67
|
+
capacity: 4,
|
|
68
68
|
});
|
|
69
69
|
await executeCachedBatch(
|
|
70
70
|
matrix.map((include) => async (promptCacheKey) => {
|
|
@@ -121,56 +121,60 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
121
121
|
const pointer: IPointer<IAutoBeTestScenarioApplication.IScenarioGroup[]> = {
|
|
122
122
|
value: [],
|
|
123
123
|
};
|
|
124
|
-
|
|
125
124
|
const authorizations: AutoBeInterfaceAuthorization[] =
|
|
126
125
|
ctx.state().interface?.authorizations ?? [];
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
.
|
|
157
|
-
|
|
158
|
-
(
|
|
159
|
-
(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
127
|
+
try {
|
|
128
|
+
const { tokenUsage } = await ctx.conversate({
|
|
129
|
+
source: "testScenarios",
|
|
130
|
+
histories: transformTestScenarioHistories(
|
|
131
|
+
ctx.state(),
|
|
132
|
+
props.entire,
|
|
133
|
+
props.include,
|
|
134
|
+
props.exclude,
|
|
135
|
+
),
|
|
136
|
+
controller: createController({
|
|
137
|
+
model: ctx.model,
|
|
138
|
+
endpointNotFound: props.endpointNotFound,
|
|
139
|
+
dict: props.dict,
|
|
140
|
+
authorizations,
|
|
141
|
+
build: (next) => {
|
|
142
|
+
pointer.value ??= [];
|
|
143
|
+
pointer.value.push(...next.scenarioGroups);
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
146
|
+
enforceFunctionCall: true,
|
|
147
|
+
promptCacheKey: props.promptCacheKey,
|
|
148
|
+
message: `Create e2e test scenarios.`,
|
|
149
|
+
});
|
|
150
|
+
if (pointer.value.length === 0) return [];
|
|
151
|
+
ctx.dispatch({
|
|
152
|
+
type: "testScenarios",
|
|
153
|
+
id: v7(),
|
|
154
|
+
tokenUsage,
|
|
155
|
+
scenarios: pointer.value
|
|
156
|
+
.map((v) =>
|
|
157
|
+
v.scenarios.map(
|
|
158
|
+
(s) =>
|
|
159
|
+
({
|
|
160
|
+
endpoint: v.endpoint,
|
|
161
|
+
draft: s.draft,
|
|
162
|
+
functionName: s.functionName,
|
|
163
|
+
dependencies: s.dependencies,
|
|
164
|
+
}) satisfies AutoBeTestScenario,
|
|
165
|
+
),
|
|
166
|
+
)
|
|
167
|
+
.flat(),
|
|
168
|
+
completed: (props.progress.completed += pointer.value.length),
|
|
169
|
+
total: props.progress.total,
|
|
170
|
+
step: ctx.state().interface?.step ?? 0,
|
|
171
|
+
created_at: new Date().toISOString(),
|
|
172
|
+
});
|
|
173
|
+
return pointer.value;
|
|
174
|
+
} catch {
|
|
175
|
+
console.log("test scenario, failed to function call", props.include);
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
174
178
|
};
|
|
175
179
|
|
|
176
180
|
function createController<Model extends ILlmSchema.Model>(props: {
|
|
@@ -50,7 +50,7 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
|
|
|
50
50
|
artifacts,
|
|
51
51
|
event,
|
|
52
52
|
};
|
|
53
|
-
} catch {
|
|
53
|
+
} catch (error) {
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
}),
|
|
@@ -85,16 +85,30 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
85
85
|
promptCacheKey,
|
|
86
86
|
message: "Create e2e test functions.",
|
|
87
87
|
});
|
|
88
|
-
if (pointer.value === null)
|
|
88
|
+
if (pointer.value === null) {
|
|
89
|
+
++progress.completed;
|
|
90
|
+
throw new Error("Failed to create test code.");
|
|
91
|
+
}
|
|
89
92
|
|
|
90
93
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
91
|
-
|
|
94
|
+
if (pointer.value.revise)
|
|
95
|
+
pointer.value.revise.final = await compiler.typescript.beautify(
|
|
96
|
+
pointer.value.revise.final,
|
|
97
|
+
);
|
|
98
|
+
else
|
|
99
|
+
pointer.value.draft = await compiler.typescript.beautify(
|
|
100
|
+
pointer.value.draft,
|
|
101
|
+
);
|
|
92
102
|
return {
|
|
93
103
|
type: "testWrite",
|
|
94
104
|
id: v7(),
|
|
95
105
|
created_at: new Date().toISOString(),
|
|
96
106
|
location: `test/features/api/${pointer.value.domain}/${scenario.functionName}.ts`,
|
|
97
|
-
|
|
107
|
+
scenario: pointer.value.scenario,
|
|
108
|
+
domain: pointer.value.domain,
|
|
109
|
+
draft: pointer.value.draft,
|
|
110
|
+
review: pointer.value.revise?.review,
|
|
111
|
+
final: pointer.value.revise?.final,
|
|
98
112
|
tokenUsage,
|
|
99
113
|
completed: ++progress.completed,
|
|
100
114
|
total: progress.total,
|
|
@@ -119,7 +133,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
119
133
|
execute: {
|
|
120
134
|
write: (next) => {
|
|
121
135
|
next.draft = completeTestCode(props.artifacts, next.draft);
|
|
122
|
-
|
|
136
|
+
if (next.revise)
|
|
137
|
+
next.revise.final = completeTestCode(
|
|
138
|
+
props.artifacts,
|
|
139
|
+
next.revise.final,
|
|
140
|
+
);
|
|
123
141
|
props.build(next);
|
|
124
142
|
},
|
|
125
143
|
} satisfies IAutoBeTestWriteApplication,
|
|
@@ -4,16 +4,14 @@ export interface IAutoBeTestCorrectApplication {
|
|
|
4
4
|
* generates corrected E2E test code.
|
|
5
5
|
*
|
|
6
6
|
* The AI executes this function to perform the complete error correction
|
|
7
|
-
* workflow: error
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* workflow: compilation error analysis → draft correction → code review →
|
|
8
|
+
* final corrected implementation. This multi-step process ensures systematic
|
|
9
|
+
* error resolution while preserving original test functionality and
|
|
10
|
+
* maintaining code quality.
|
|
11
11
|
*
|
|
12
|
-
* The corrector
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* corrected code through iterative refinement with comprehensive review and
|
|
16
|
-
* validation.
|
|
12
|
+
* The corrector analyzes compilation diagnostics to identify specific issues,
|
|
13
|
+
* develops correction strategies, and produces corrected code through
|
|
14
|
+
* iterative refinement with comprehensive review and validation.
|
|
17
15
|
*
|
|
18
16
|
* @param props Complete specification for error correction workflow including
|
|
19
17
|
* analysis steps, draft implementation, review process, and final code
|
|
@@ -25,47 +23,30 @@ export interface IAutoBeTestCorrectApplication {
|
|
|
25
23
|
export namespace IAutoBeTestCorrectApplication {
|
|
26
24
|
export interface IProps {
|
|
27
25
|
/**
|
|
28
|
-
* Step 1:
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* accomplishes, the expected business workflow, and the correct API
|
|
35
|
-
* integration patterns.
|
|
36
|
-
*
|
|
37
|
-
* This step ensures that error correction doesn't lose sight of the
|
|
38
|
-
* original test purpose and helps maintain the intended business logic
|
|
39
|
-
* while addressing technical compilation issues. The AI develops a
|
|
40
|
-
* comprehensive understanding of the test requirements before diving into
|
|
41
|
-
* error-specific details.
|
|
42
|
-
*
|
|
43
|
-
* Workflow: Scenario understanding → Business logic analysis → Intended
|
|
44
|
-
* functionality mapping
|
|
45
|
-
*/
|
|
46
|
-
think_without_compile_error: string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Step 2: Compilation error analysis and root cause identification.
|
|
26
|
+
* Step 1: Deep compilation error analysis and correction strategy.
|
|
27
|
+
*
|
|
28
|
+
* AI performs comprehensive analysis of compilation errors to develop
|
|
29
|
+
* targeted correction strategies. This step involves deep examination of
|
|
30
|
+
* error messages, identification of error patterns, understanding root
|
|
31
|
+
* causes, and planning systematic corrections.
|
|
50
32
|
*
|
|
51
|
-
* AI
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
33
|
+
* The AI examines each compilation diagnostic to understand where the
|
|
34
|
+
* implementation diverged from correct TypeScript usage, identifies the
|
|
35
|
+
* business logic intent behind the failed code, and formulates strategies
|
|
36
|
+
* to fix errors while preserving the original test purpose. This analysis
|
|
37
|
+
* correlates error patterns with code structure to ensure corrections
|
|
38
|
+
* address root causes rather than symptoms.
|
|
56
39
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* usage while maintaining the business logic intent. This analysis forms
|
|
60
|
-
* the foundation for targeted error correction strategies.
|
|
40
|
+
* This deep analysis forms the foundation for all subsequent correction
|
|
41
|
+
* efforts, ensuring a methodical approach to resolving compilation issues.
|
|
61
42
|
*
|
|
62
43
|
* Workflow: Error diagnostic analysis → Root cause identification →
|
|
63
|
-
* Correction strategy planning
|
|
44
|
+
* Correction strategy planning → Business logic preservation strategy
|
|
64
45
|
*/
|
|
65
|
-
|
|
46
|
+
think: string;
|
|
66
47
|
|
|
67
48
|
/**
|
|
68
|
-
* Step
|
|
49
|
+
* Step 2: Draft corrected TypeScript E2E test code implementation.
|
|
69
50
|
*
|
|
70
51
|
* AI generates the first corrected version of the test code based on error
|
|
71
52
|
* analysis and correction strategies. This draft addresses all identified
|
|
@@ -86,7 +67,29 @@ export namespace IAutoBeTestCorrectApplication {
|
|
|
86
67
|
draft: string;
|
|
87
68
|
|
|
88
69
|
/**
|
|
89
|
-
* Step 4:
|
|
70
|
+
* Step 3-4: Review and finalization process.
|
|
71
|
+
*
|
|
72
|
+
* Encapsulates the review and final implementation phases into a single
|
|
73
|
+
* revision process. This structured approach ensures systematic validation
|
|
74
|
+
* and refinement of the corrected code through comprehensive review
|
|
75
|
+
* followed by production-ready implementation.
|
|
76
|
+
*
|
|
77
|
+
* The revision process maintains clear separation between review feedback
|
|
78
|
+
* and final deliverable while ensuring all corrections are properly
|
|
79
|
+
* validated and integrated.
|
|
80
|
+
*/
|
|
81
|
+
revise: IReviseProps;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Revision properties for the final review and implementation phases.
|
|
86
|
+
*
|
|
87
|
+
* This interface encapsulates the final two steps of the error correction
|
|
88
|
+
* workflow, ensuring systematic review and production-ready code delivery.
|
|
89
|
+
*/
|
|
90
|
+
export interface IReviseProps {
|
|
91
|
+
/**
|
|
92
|
+
* Step 3: Code review and correction validation.
|
|
90
93
|
*
|
|
91
94
|
* AI performs a comprehensive review of the corrected draft implementation,
|
|
92
95
|
* validating that all compilation errors have been resolved and that the
|
|
@@ -105,7 +108,7 @@ export namespace IAutoBeTestCorrectApplication {
|
|
|
105
108
|
review: string;
|
|
106
109
|
|
|
107
110
|
/**
|
|
108
|
-
* Step
|
|
111
|
+
* Step 4: Final production-ready corrected test code.
|
|
109
112
|
*
|
|
110
113
|
* AI produces the final, polished version of the corrected test code
|
|
111
114
|
* incorporating all review feedback and validation results. This code
|
|
@@ -119,7 +122,7 @@ export namespace IAutoBeTestCorrectApplication {
|
|
|
119
122
|
* behaviors and user workflows.
|
|
120
123
|
*
|
|
121
124
|
* Workflow: Review integration → Final refinement → Production-ready
|
|
122
|
-
* implementation This is the ultimate deliverable that will replace the
|
|
125
|
+
* implementation. This is the ultimate deliverable that will replace the
|
|
123
126
|
* compilation-failed code.
|
|
124
127
|
*/
|
|
125
128
|
final: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
2
|
+
|
|
3
|
+
import { IAutoBeTestFunction } from "./IAutoBeTestFunction";
|
|
4
|
+
|
|
5
|
+
export interface IAutoBeTestFunctionFailure {
|
|
6
|
+
function: IAutoBeTestFunction;
|
|
7
|
+
failure: IAutoBeTypeScriptCompileResult.IFailure;
|
|
8
|
+
}
|
|
@@ -60,6 +60,20 @@ export namespace IAutoBeTestWriteApplication {
|
|
|
60
60
|
*/
|
|
61
61
|
draft: string;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Steps 4-5: Code review and final refinement process.
|
|
65
|
+
*
|
|
66
|
+
* Contains the iterative improvement workflow that transforms the initial
|
|
67
|
+
* draft into production-ready test code. This two-phase process ensures
|
|
68
|
+
* systematic quality enhancement through comprehensive review followed by
|
|
69
|
+
* targeted refinement based on identified issues.
|
|
70
|
+
*
|
|
71
|
+
* Workflow: Draft → Review analysis → Final implementation
|
|
72
|
+
*/
|
|
73
|
+
revise: IReviseProps;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface IReviseProps {
|
|
63
77
|
/**
|
|
64
78
|
* Step 4: Code review and quality assessment.
|
|
65
79
|
*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
import { OpenApiTypeChecker } from "@samchon/openapi";
|
|
3
|
+
|
|
4
|
+
export const getReferenceIds = (props: {
|
|
5
|
+
document: AutoBeOpenApi.IDocument;
|
|
6
|
+
operation: AutoBeOpenApi.IOperation;
|
|
7
|
+
}): string[] => {
|
|
8
|
+
const result: Set<string> = new Set();
|
|
9
|
+
const emplace = (key: string) => {
|
|
10
|
+
if (key.endsWith("_id")) result.add(key);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
props.operation.parameters.forEach((p) => emplace(p.name));
|
|
14
|
+
if (props.operation.requestBody) {
|
|
15
|
+
OpenApiTypeChecker.visit({
|
|
16
|
+
components: props.document.components,
|
|
17
|
+
schema: { $ref: props.operation.requestBody.typeName },
|
|
18
|
+
closure: (schema) => {
|
|
19
|
+
if (OpenApiTypeChecker.isObject(schema) === false) return;
|
|
20
|
+
for (const key of Object.keys(schema.properties ?? {})) emplace(key);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return Array.from(result);
|
|
25
|
+
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AutoBeOpenApi, AutoBeRealizeAuthorization, AutoBeTestFile } from "@autobe/interface";
|
|
2
|
-
export declare namespace IAutoBeRealizeScenarioApplication {
|
|
3
|
-
interface IProps {
|
|
4
|
-
/** The OpenAPI operation to be realized. */
|
|
5
|
-
operation: AutoBeOpenApi.IOperation;
|
|
6
|
-
/**
|
|
7
|
-
* The name of the function to be generated.
|
|
8
|
-
*
|
|
9
|
-
* Derived from the Swagger path and method. The function name must be
|
|
10
|
-
* written in snake_case. It serves as the entry point in both code
|
|
11
|
-
* generation and test code.
|
|
12
|
-
*
|
|
13
|
-
* Once the function is generated, the function name and file name will be
|
|
14
|
-
* the same. The generated file will be located at
|
|
15
|
-
* `src/providers/${function_name}.ts`.
|
|
16
|
-
*/
|
|
17
|
-
functionName: string;
|
|
18
|
-
/** For example, `src/providers/${function_name}.ts`. */
|
|
19
|
-
location: string;
|
|
20
|
-
/**
|
|
21
|
-
* List of scenario descriptions for test code generation.
|
|
22
|
-
*
|
|
23
|
-
* Each scenario describes the expected behavior of the function under
|
|
24
|
-
* certain conditions. Used as a basis for TDD-style automated test
|
|
25
|
-
* generation.
|
|
26
|
-
*/
|
|
27
|
-
testFiles: AutoBeTestFile[];
|
|
28
|
-
/**
|
|
29
|
-
* Optional decorator event for customizing code generation behavior.
|
|
30
|
-
*
|
|
31
|
-
* Provides additional metadata or instructions that can modify how the
|
|
32
|
-
* function implementation is generated. Can include custom annotations,
|
|
33
|
-
* middleware configurations, or special handling directives that affect the
|
|
34
|
-
* final code output.
|
|
35
|
-
*/
|
|
36
|
-
decoratorEvent?: AutoBeRealizeAuthorization;
|
|
37
|
-
}
|
|
38
|
-
}
|
package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IAutoBeRealizeScenarioApplication.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts"],"names":[],"mappings":""}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AutoBeOpenApi, AutoBeRealizeAuthorization, AutoBeTestFile } from "@autobe/interface";
|
|
2
|
-
export declare namespace IAutoBeRealizeScenarioApplication {
|
|
3
|
-
interface IProps {
|
|
4
|
-
/** The OpenAPI operation to be realized. */
|
|
5
|
-
operation: AutoBeOpenApi.IOperation;
|
|
6
|
-
/**
|
|
7
|
-
* The name of the function to be generated.
|
|
8
|
-
*
|
|
9
|
-
* Derived from the Swagger path and method. The function name must be
|
|
10
|
-
* written in snake_case. It serves as the entry point in both code
|
|
11
|
-
* generation and test code.
|
|
12
|
-
*
|
|
13
|
-
* Once the function is generated, the function name and file name will be
|
|
14
|
-
* the same. The generated file will be located at
|
|
15
|
-
* `src/providers/${function_name}.ts`.
|
|
16
|
-
*/
|
|
17
|
-
functionName: string;
|
|
18
|
-
/** For example, `src/providers/${function_name}.ts`. */
|
|
19
|
-
location: string;
|
|
20
|
-
/**
|
|
21
|
-
* List of scenario descriptions for test code generation.
|
|
22
|
-
*
|
|
23
|
-
* Each scenario describes the expected behavior of the function under
|
|
24
|
-
* certain conditions. Used as a basis for TDD-style automated test
|
|
25
|
-
* generation.
|
|
26
|
-
*/
|
|
27
|
-
testFiles: AutoBeTestFile[];
|
|
28
|
-
/**
|
|
29
|
-
* Optional decorator event for customizing code generation behavior.
|
|
30
|
-
*
|
|
31
|
-
* Provides additional metadata or instructions that can modify how the
|
|
32
|
-
* function implementation is generated. Can include custom annotations,
|
|
33
|
-
* middleware configurations, or special handling directives that affect the
|
|
34
|
-
* final code output.
|
|
35
|
-
*/
|
|
36
|
-
decoratorEvent?: AutoBeRealizeAuthorization;
|
|
37
|
-
}
|
|
38
|
-
}
|