@autobe/agent 0.21.0 → 0.22.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/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 +3468 -105
- 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 +3674 -360
- 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/JsonSchemaValidator.d.ts +10 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaValidator.js +59 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaValidator.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/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.d.ts +3 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +25 -18
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +5 -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 +123 -75
- 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 +117 -45
- 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 +13871 -3912
- 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/JsonSchemaValidator.d.ts +10 -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/completeTestCode.d.ts +3 -1
- 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 +6 -6
- 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 +35 -93
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +74 -97
- 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/JsonSchemaValidator.ts +66 -0
- package/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.ts +90 -0
- 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 +18 -31
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +12 -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 +44 -20
- package/src/orchestrate/test/orchestrateTestScenario.ts +52 -48
- package/src/orchestrate/test/orchestrateTestWrite.ts +20 -10
- 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/interface/utils/validateAuthorizationSchema.d.ts +0 -7
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +0 -35
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +0 -1
- 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/interface/utils/validateAuthorizationSchema.d.ts +0 -7
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +0 -41
|
@@ -95,10 +95,10 @@ export class AutoBeTokenUsageComponent
|
|
|
95
95
|
accepted_prediction: 0,
|
|
96
96
|
rejected_prediction: 0,
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
} else {
|
|
99
|
+
this.input = props.input;
|
|
100
|
+
this.output = props.output;
|
|
99
101
|
}
|
|
100
|
-
this.input = props.input;
|
|
101
|
-
this.output = props.output;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
@@ -12,6 +12,7 @@ import { IPointer } from "tstl";
|
|
|
12
12
|
import typia from "typia";
|
|
13
13
|
import { v7 } from "uuid";
|
|
14
14
|
|
|
15
|
+
import { AutoBeConfigConstant } from "../constants/AutoBeConfigConstant";
|
|
15
16
|
import { AutoBeSystemPromptConstant } from "../constants/AutoBeSystemPromptConstant";
|
|
16
17
|
import { IAutoBeConfig } from "../structures/IAutoBeConfig";
|
|
17
18
|
import { IAutoBeVendor } from "../structures/IAutoBeVendor";
|
|
@@ -31,6 +32,7 @@ export const consentFunctionCall = async (props: {
|
|
|
31
32
|
vendor: props.vendor,
|
|
32
33
|
config: {
|
|
33
34
|
...(props.config ?? []),
|
|
35
|
+
retry: props.config?.retry ?? AutoBeConfigConstant.DEFAULT_RETRY,
|
|
34
36
|
executor: {
|
|
35
37
|
describe: null,
|
|
36
38
|
},
|
|
@@ -27,6 +27,7 @@ import { ILlmSchema } from "@samchon/openapi";
|
|
|
27
27
|
import typia from "typia";
|
|
28
28
|
import { v7 } from "uuid";
|
|
29
29
|
|
|
30
|
+
import { AutoBeConfigConstant } from "../constants/AutoBeConfigConstant";
|
|
30
31
|
import { AutoBeContext } from "../context/AutoBeContext";
|
|
31
32
|
import { AutoBeState } from "../context/AutoBeState";
|
|
32
33
|
import { AutoBeTokenUsage } from "../context/AutoBeTokenUsage";
|
|
@@ -47,152 +48,160 @@ export const createAutoBeContext = <Model extends ILlmSchema.Model>(props: {
|
|
|
47
48
|
histories: () => AutoBeHistory[];
|
|
48
49
|
usage: () => AutoBeTokenUsage;
|
|
49
50
|
dispatch: (event: AutoBeEvent) => Promise<void>;
|
|
50
|
-
}): AutoBeContext<Model> =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
locale: props.config.locale ?? "en-US"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
props.histories
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
51
|
+
}): AutoBeContext<Model> => {
|
|
52
|
+
const retry: number =
|
|
53
|
+
props.config?.retry ?? AutoBeConfigConstant.DEFAULT_RETRY;
|
|
54
|
+
const locale: string = props.config.locale ?? "en-US";
|
|
55
|
+
return {
|
|
56
|
+
model: props.model,
|
|
57
|
+
vendor: props.vendor,
|
|
58
|
+
retry,
|
|
59
|
+
locale,
|
|
60
|
+
compilerListener: props.compilerListener,
|
|
61
|
+
compiler: props.compiler,
|
|
62
|
+
files: props.files,
|
|
63
|
+
histories: props.histories,
|
|
64
|
+
state: props.state,
|
|
65
|
+
usage: props.usage,
|
|
66
|
+
dispatch: createDispatch(props),
|
|
67
|
+
assistantMessage: (message) => {
|
|
68
|
+
props.histories().push(message);
|
|
69
|
+
setTimeout(() => props.dispatch(message).catch(() => {}));
|
|
70
|
+
return message;
|
|
71
|
+
},
|
|
72
|
+
conversate: async (next, closure) => {
|
|
73
|
+
const execute = async (): Promise<AutoBeContext.IResult<Model>> => {
|
|
74
|
+
const agent: MicroAgentica<Model> = new MicroAgentica<Model>({
|
|
75
|
+
model: props.model,
|
|
76
|
+
vendor: props.vendor,
|
|
77
|
+
config: {
|
|
78
|
+
...(props.config ?? {}),
|
|
79
|
+
retry: props.config?.retry ?? AutoBeConfigConstant.DEFAULT_RETRY,
|
|
80
|
+
executor: {
|
|
81
|
+
describe: null,
|
|
82
|
+
},
|
|
75
83
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
controllers: [next.controller],
|
|
79
|
-
});
|
|
80
|
-
agent.on("request", async (event) => {
|
|
81
|
-
if (next.enforceFunctionCall === true && event.body.tools)
|
|
82
|
-
event.body.tool_choice = "required";
|
|
83
|
-
if (event.body.parallel_tool_calls !== undefined)
|
|
84
|
-
delete event.body.parallel_tool_calls;
|
|
85
|
-
if (next.promptCacheKey)
|
|
86
|
-
event.body.prompt_cache_key = next.promptCacheKey;
|
|
87
|
-
await props.dispatch({
|
|
88
|
-
...event,
|
|
89
|
-
type: "vendorRequest",
|
|
90
|
-
source: next.source,
|
|
84
|
+
histories: next.histories,
|
|
85
|
+
controllers: [next.controller],
|
|
91
86
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.catch(() => {});
|
|
101
|
-
});
|
|
102
|
-
agent.on("jsonParseError", (event) => {
|
|
103
|
-
void props
|
|
104
|
-
.dispatch({
|
|
87
|
+
agent.on("request", async (event) => {
|
|
88
|
+
if (next.enforceFunctionCall === true && event.body.tools)
|
|
89
|
+
event.body.tool_choice = "required";
|
|
90
|
+
if (event.body.parallel_tool_calls !== undefined)
|
|
91
|
+
delete event.body.parallel_tool_calls;
|
|
92
|
+
if (next.promptCacheKey)
|
|
93
|
+
event.body.prompt_cache_key = next.promptCacheKey;
|
|
94
|
+
await props.dispatch({
|
|
105
95
|
...event,
|
|
96
|
+
type: "vendorRequest",
|
|
106
97
|
source: next.source,
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
agent.on("response", (event) => {
|
|
101
|
+
void props
|
|
102
|
+
.dispatch({
|
|
103
|
+
...event,
|
|
104
|
+
type: "vendorResponse",
|
|
105
|
+
source: next.source,
|
|
106
|
+
})
|
|
107
|
+
.catch(() => {});
|
|
108
|
+
});
|
|
109
|
+
agent.on("jsonParseError", (event) => {
|
|
110
|
+
void props
|
|
111
|
+
.dispatch({
|
|
112
|
+
...event,
|
|
113
|
+
source: next.source,
|
|
114
|
+
})
|
|
115
|
+
.catch(() => {});
|
|
116
|
+
});
|
|
117
|
+
agent.on("validate", (event) => {
|
|
118
|
+
void props
|
|
119
|
+
.dispatch({
|
|
120
|
+
type: "jsonValidateError",
|
|
121
|
+
id: v7(),
|
|
122
|
+
source: next.source,
|
|
123
|
+
result: event.result,
|
|
124
|
+
created_at: event.created_at,
|
|
125
|
+
})
|
|
126
|
+
.catch(() => {});
|
|
127
|
+
});
|
|
128
|
+
if (closure) closure(agent);
|
|
122
129
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
const histories: MicroAgenticaHistory<Model>[] = await agent.conversate(
|
|
131
|
+
next.message,
|
|
132
|
+
);
|
|
133
|
+
const tokenUsage: IAutoBeTokenUsageJson.IComponent = agent
|
|
134
|
+
.getTokenUsage()
|
|
135
|
+
.toJSON().aggregate;
|
|
136
|
+
props
|
|
137
|
+
.usage()
|
|
138
|
+
.record(tokenUsage, [
|
|
139
|
+
STAGES.find((stage) => next.source.startsWith(stage)) ?? "analyze",
|
|
140
|
+
]);
|
|
134
141
|
|
|
135
|
-
if (
|
|
136
|
-
true === next.enforceFunctionCall &&
|
|
137
|
-
false ===
|
|
138
|
-
histories.some((h) => h.type === "execute" && h.success === true)
|
|
139
|
-
) {
|
|
140
|
-
const failure = () => {
|
|
141
|
-
throw new Error(
|
|
142
|
-
`Failed to function calling in the ${next.source} step`,
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
const last: MicroAgenticaHistory<Model> | undefined = histories.at(-1);
|
|
146
142
|
if (
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
true === next.enforceFunctionCall &&
|
|
144
|
+
false ===
|
|
145
|
+
histories.some((h) => h.type === "execute" && h.success === true)
|
|
149
146
|
) {
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.
|
|
167
|
-
.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
147
|
+
const failure = () => {
|
|
148
|
+
throw new Error(
|
|
149
|
+
`Failed to function calling in the ${next.source} step`,
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
const last: MicroAgenticaHistory<Model> | undefined =
|
|
153
|
+
histories.at(-1);
|
|
154
|
+
if (
|
|
155
|
+
last?.type === "assistantMessage" &&
|
|
156
|
+
last.text.trim().length !== 0
|
|
157
|
+
) {
|
|
158
|
+
const consent: string | null = await consentFunctionCall({
|
|
159
|
+
source: next.source,
|
|
160
|
+
dispatch: (e) => {
|
|
161
|
+
props.dispatch(e).catch(() => {});
|
|
162
|
+
},
|
|
163
|
+
config: props.config,
|
|
164
|
+
vendor: props.vendor,
|
|
165
|
+
assistantMessage: last.text,
|
|
166
|
+
});
|
|
167
|
+
if (consent !== null) {
|
|
168
|
+
const newHistories: MicroAgenticaHistory<Model>[] =
|
|
169
|
+
await agent.conversate(consent);
|
|
170
|
+
const newTokenUsage: IAutoBeTokenUsageJson.IComponent = agent
|
|
171
|
+
.getTokenUsage()
|
|
172
|
+
.toJSON().aggregate;
|
|
173
|
+
props
|
|
174
|
+
.usage()
|
|
175
|
+
.record(
|
|
176
|
+
AutoBeTokenUsageComponent.minus(
|
|
177
|
+
new AutoBeTokenUsageComponent(newTokenUsage),
|
|
178
|
+
new AutoBeTokenUsageComponent(tokenUsage),
|
|
179
|
+
),
|
|
180
|
+
[
|
|
181
|
+
STAGES.find((stage) => next.source.startsWith(stage)) ??
|
|
182
|
+
"analyze",
|
|
183
|
+
],
|
|
184
|
+
);
|
|
185
|
+
if (
|
|
186
|
+
newHistories.some(
|
|
187
|
+
(h) => h.type === "execute" && h.success === true,
|
|
188
|
+
)
|
|
180
189
|
)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
return {
|
|
191
|
+
histories: newHistories,
|
|
192
|
+
tokenUsage: newTokenUsage,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
186
195
|
}
|
|
196
|
+
failure();
|
|
187
197
|
}
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
return
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
198
|
+
return { histories, tokenUsage };
|
|
199
|
+
};
|
|
200
|
+
if (next.enforceFunctionCall === true) return forceRetry(execute, retry);
|
|
201
|
+
else return execute();
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
};
|
|
196
205
|
|
|
197
206
|
const createDispatch = (props: {
|
|
198
207
|
state: () => AutoBeState;
|
|
@@ -330,7 +339,7 @@ const transformAndDispatch = <
|
|
|
330
339
|
|
|
331
340
|
const forceRetry = async <T>(
|
|
332
341
|
task: () => Promise<T>,
|
|
333
|
-
count: number
|
|
342
|
+
count: number,
|
|
334
343
|
): Promise<T> => {
|
|
335
344
|
let error: unknown = undefined;
|
|
336
345
|
for (let i: number = 0; i < count; ++i)
|
|
@@ -26,6 +26,8 @@ export interface IAutoBeAnalyzeReviewApplication {
|
|
|
26
26
|
export namespace IAutoBeAnalyzeReviewApplication {
|
|
27
27
|
export interface IProps {
|
|
28
28
|
/**
|
|
29
|
+
* Step 1 (CoT: Review Phase) - Enhancement Criteria
|
|
30
|
+
*
|
|
29
31
|
* The enhancement criteria and guidelines that the agent must follow.
|
|
30
32
|
*
|
|
31
33
|
* This includes:
|
|
@@ -52,6 +54,8 @@ export namespace IAutoBeAnalyzeReviewApplication {
|
|
|
52
54
|
review: string;
|
|
53
55
|
|
|
54
56
|
/**
|
|
57
|
+
* Step 2 (CoT: Plan Phase) - Original Document Plan
|
|
58
|
+
*
|
|
55
59
|
* The document plan that was used to create the content.
|
|
56
60
|
*
|
|
57
61
|
* This helps the reviewer understand:
|
|
@@ -67,6 +71,8 @@ export namespace IAutoBeAnalyzeReviewApplication {
|
|
|
67
71
|
plan: string;
|
|
68
72
|
|
|
69
73
|
/**
|
|
74
|
+
* Step 3 (CoT: Content Phase) - Complete Document Content
|
|
75
|
+
*
|
|
70
76
|
* The actual markdown document content that incorporates review feedback.
|
|
71
77
|
*
|
|
72
78
|
* This field contains a COMPLETE MARKDOWN DOCUMENT that has already
|
|
@@ -15,6 +15,8 @@ export interface IAutoBeAnalyzeWriteApplication {
|
|
|
15
15
|
export namespace IAutoBeAnalyzeWriteApplication {
|
|
16
16
|
export interface IProps {
|
|
17
17
|
/**
|
|
18
|
+
* Step 1 (CoT: Plan Phase) - Document Planning Structure
|
|
19
|
+
*
|
|
18
20
|
* The document planning structure that outlines what needs to be written.
|
|
19
21
|
*
|
|
20
22
|
* This includes:
|
|
@@ -40,6 +42,8 @@ export namespace IAutoBeAnalyzeWriteApplication {
|
|
|
40
42
|
plan: string;
|
|
41
43
|
|
|
42
44
|
/**
|
|
45
|
+
* Step 2 (CoT: Write Phase) - Document Content Creation
|
|
46
|
+
*
|
|
43
47
|
* The initial content or context for the document being written.
|
|
44
48
|
*
|
|
45
49
|
* This may include:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { AutoBeAnalyzeRole } from "@autobe/interface";
|
|
2
|
+
import { AutoBeAnalyzeHistory, AutoBeAnalyzeRole } from "@autobe/interface";
|
|
3
3
|
import { StringUtil } from "@autobe/utils";
|
|
4
4
|
import { v7 } from "uuid";
|
|
5
5
|
|
|
@@ -13,6 +13,7 @@ export const transformInterfaceAuthorizationsHistories = (
|
|
|
13
13
|
): Array<
|
|
14
14
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
15
15
|
> => {
|
|
16
|
+
const analyze: AutoBeAnalyzeHistory = state.analyze!;
|
|
16
17
|
return [
|
|
17
18
|
{
|
|
18
19
|
type: "systemMessage",
|
|
@@ -21,6 +22,23 @@ export const transformInterfaceAuthorizationsHistories = (
|
|
|
21
22
|
text: AutoBeSystemPromptConstant.INTERFACE_AUTHORIZATION,
|
|
22
23
|
},
|
|
23
24
|
...transformInterfaceAssetHistories(state),
|
|
25
|
+
{
|
|
26
|
+
type: "systemMessage",
|
|
27
|
+
id: v7(),
|
|
28
|
+
created_at: new Date().toISOString(),
|
|
29
|
+
text: StringUtil.trim`
|
|
30
|
+
## Service Prefix
|
|
31
|
+
- Original: ${analyze.prefix}
|
|
32
|
+
- PascalCase for DTOs: ${analyze.prefix
|
|
33
|
+
.split(/[-_]/)
|
|
34
|
+
.map((p) => p.charAt(0).toUpperCase() + p.slice(1))
|
|
35
|
+
.join("")}
|
|
36
|
+
- Expected DTO pattern: I${analyze.prefix
|
|
37
|
+
.split(/[-_]/)
|
|
38
|
+
.map((p) => p.charAt(0).toUpperCase() + p.slice(1))
|
|
39
|
+
.join("")}{EntityName}
|
|
40
|
+
`,
|
|
41
|
+
},
|
|
24
42
|
{
|
|
25
43
|
type: "assistantMessage",
|
|
26
44
|
id: v7(),
|
|
@@ -10,10 +10,7 @@ import { transformInterfaceAssetHistories } from "./transformInterfaceAssetHisto
|
|
|
10
10
|
export const transformInterfaceSchemasReviewHistories = (
|
|
11
11
|
state: AutoBeState,
|
|
12
12
|
operations: AutoBeOpenApi.IOperation[],
|
|
13
|
-
schemaDescriptive: Record<
|
|
14
|
-
string,
|
|
15
|
-
AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
|
|
16
|
-
>,
|
|
13
|
+
schemaDescriptive: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
|
|
17
14
|
): Array<
|
|
18
15
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
19
16
|
> => {
|
|
@@ -20,6 +20,7 @@ import { orchestrateInterfaceEndpoints } from "./orchestrateInterfaceEndpoints";
|
|
|
20
20
|
import { orchestrateInterfaceGroups } from "./orchestrateInterfaceGroups";
|
|
21
21
|
import { orchestrateInterfaceOperations } from "./orchestrateInterfaceOperations";
|
|
22
22
|
import { orchestrateInterfaceSchemas } from "./orchestrateInterfaceSchemas";
|
|
23
|
+
import { orchestrateInterfaceSchemasReview } from "./orchestrateInterfaceSchemasReview";
|
|
23
24
|
|
|
24
25
|
export const orchestrateInterface =
|
|
25
26
|
<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>) =>
|
|
@@ -94,10 +95,20 @@ export const orchestrateInterface =
|
|
|
94
95
|
schemas: await orchestrateInterfaceSchemas(ctx, operations),
|
|
95
96
|
},
|
|
96
97
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
|
|
99
|
+
const complementedSchemas: Record<
|
|
100
|
+
string,
|
|
101
|
+
AutoBeOpenApi.IJsonSchemaDescriptive
|
|
102
|
+
> = await orchestrateInterfaceComplement(ctx, document);
|
|
103
|
+
Object.assign(document.components.schemas, complementedSchemas);
|
|
104
|
+
|
|
105
|
+
const schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
106
|
+
await orchestrateInterfaceSchemasReview(
|
|
107
|
+
ctx,
|
|
108
|
+
operations,
|
|
109
|
+
document.components.schemas,
|
|
110
|
+
);
|
|
111
|
+
Object.assign(document.components.schemas, schemas);
|
|
101
112
|
|
|
102
113
|
// DO COMPILE
|
|
103
114
|
return ctx.dispatch({
|
|
@@ -61,7 +61,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
61
61
|
histories: transformInterfaceAuthorizationsHistories(ctx.state(), role),
|
|
62
62
|
controller: createController({
|
|
63
63
|
model: ctx.model,
|
|
64
|
-
role
|
|
64
|
+
role,
|
|
65
65
|
build: (next) => {
|
|
66
66
|
pointer.value = next;
|
|
67
67
|
},
|
|
@@ -87,7 +87,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
87
87
|
|
|
88
88
|
function createController<Model extends ILlmSchema.Model>(props: {
|
|
89
89
|
model: Model;
|
|
90
|
-
role:
|
|
90
|
+
role: AutoBeAnalyzeRole;
|
|
91
91
|
build: (next: IAutoBeInterfaceAuthorizationsApplication.IProps) => void;
|
|
92
92
|
}): IAgenticaController.IClass<Model> {
|
|
93
93
|
assertSchemaModel(props.model);
|
|
@@ -99,11 +99,18 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
99
99
|
typia.validate<IAutoBeInterfaceAuthorizationsApplication.IProps>(next);
|
|
100
100
|
if (result.success === false) return result;
|
|
101
101
|
|
|
102
|
+
// remove login operation for guest role
|
|
103
|
+
if (props.role.kind === "guest") {
|
|
104
|
+
result.data.operations = result.data.operations.filter(
|
|
105
|
+
(op) => op.authorizationType !== "login",
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
102
109
|
const errors: IValidation.IError[] = [];
|
|
103
110
|
result.data.operations.forEach((op, i) => {
|
|
104
111
|
// validate authorizationRole
|
|
105
112
|
if (op.authorizationRole !== null) {
|
|
106
|
-
op.authorizationRole = props.role;
|
|
113
|
+
op.authorizationRole = props.role.name;
|
|
107
114
|
}
|
|
108
115
|
|
|
109
116
|
// validate responseBody.typeName -> must be ~.IAuthorized
|
|
@@ -148,7 +155,8 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
148
155
|
.filter((v) => v !== null),
|
|
149
156
|
);
|
|
150
157
|
for (const type of typia.misc.literals<AuthorizationType>())
|
|
151
|
-
if (
|
|
158
|
+
if (props.role.kind === "guest" && type === "login") continue;
|
|
159
|
+
else if (authorizationTypes.has(type) === false)
|
|
152
160
|
errors.push({
|
|
153
161
|
path: "$input.operations[].authorizationType",
|
|
154
162
|
expected: StringUtil.trim`{
|
|
@@ -160,7 +168,7 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
160
168
|
There must be an operation that has defined AutoBeOpenApi.IOperation.authorizationType := "${type}"
|
|
161
169
|
for the "${props.role}" role's authorization activity; "${type}".
|
|
162
170
|
|
|
163
|
-
However, none of the operations have the AutoBeOpenApi.IOperation.authorizationType := "${type}"
|
|
171
|
+
However, none of the operations have the AutoBeOpenApi.IOperation.authorizationType := "${type}"
|
|
164
172
|
value, so that the "${props.role}" cannot perform the authorization ${type} activity.
|
|
165
173
|
|
|
166
174
|
Please make that operation at the next function calling. You have to do it.
|
|
@@ -3,6 +3,7 @@ import { AutoBeOpenApi } from "@autobe/interface";
|
|
|
3
3
|
import {
|
|
4
4
|
ILlmApplication,
|
|
5
5
|
ILlmSchema,
|
|
6
|
+
IValidation,
|
|
6
7
|
OpenApiTypeChecker,
|
|
7
8
|
} from "@samchon/openapi";
|
|
8
9
|
import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
|
|
@@ -14,22 +15,25 @@ import { AutoBeContext } from "../../context/AutoBeContext";
|
|
|
14
15
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
15
16
|
import { transformInterfaceComplementHistories } from "./histories/transformInterfaceComplementHistories";
|
|
16
17
|
import { IAutoBeInterfaceComplementApplication } from "./structures/IAutoBeInterfaceComplementApplication";
|
|
18
|
+
import { JsonSchemaFactory } from "./utils/JsonSchemaFactory";
|
|
19
|
+
import { JsonSchemaNamingConvention } from "./utils/JsonSchemaNamingConvention";
|
|
20
|
+
import { JsonSchemaValidator } from "./utils/JsonSchemaValidator";
|
|
21
|
+
import { fulfillJsonSchemaErrorMessages } from "./utils/fulfillJsonSchemaErrorMessages";
|
|
17
22
|
|
|
18
23
|
export function orchestrateInterfaceComplement<Model extends ILlmSchema.Model>(
|
|
19
24
|
ctx: AutoBeContext<Model>,
|
|
20
25
|
document: AutoBeOpenApi.IDocument,
|
|
21
|
-
life: number = 8,
|
|
22
26
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
23
|
-
return step(ctx, document,
|
|
27
|
+
return step(ctx, document, 8);
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
async function step<Model extends ILlmSchema.Model>(
|
|
27
31
|
ctx: AutoBeContext<Model>,
|
|
28
32
|
document: AutoBeOpenApi.IDocument,
|
|
29
|
-
|
|
33
|
+
life: number,
|
|
30
34
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
31
35
|
const missed: string[] = getMissed(document);
|
|
32
|
-
if (missed.length === 0 ||
|
|
36
|
+
if (missed.length === 0 || life <= 0) {
|
|
33
37
|
return document.components.schemas;
|
|
34
38
|
}
|
|
35
39
|
|
|
@@ -83,6 +87,7 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
83
87
|
...pointer.value,
|
|
84
88
|
...document.components.schemas,
|
|
85
89
|
};
|
|
90
|
+
JsonSchemaNamingConvention.schemas(document.operations, newSchemas);
|
|
86
91
|
return step(
|
|
87
92
|
ctx,
|
|
88
93
|
{
|
|
@@ -92,7 +97,7 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
92
97
|
schemas: newSchemas,
|
|
93
98
|
},
|
|
94
99
|
},
|
|
95
|
-
|
|
100
|
+
life - 1,
|
|
96
101
|
);
|
|
97
102
|
}
|
|
98
103
|
|
|
@@ -124,9 +129,39 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
124
129
|
) => void;
|
|
125
130
|
}): IAgenticaController.IClass<Model> {
|
|
126
131
|
assertSchemaModel(props.model);
|
|
132
|
+
|
|
133
|
+
const validate = (
|
|
134
|
+
next: unknown,
|
|
135
|
+
): IValidation<IAutoBeInterfaceComplementApplication.IProps> => {
|
|
136
|
+
JsonSchemaFactory.fix("schemas", next);
|
|
137
|
+
|
|
138
|
+
const result: IValidation<IAutoBeInterfaceComplementApplication.IProps> =
|
|
139
|
+
typia.validate<IAutoBeInterfaceComplementApplication.IProps>(next);
|
|
140
|
+
if (result.success === false) {
|
|
141
|
+
fulfillJsonSchemaErrorMessages(result.errors);
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const errors: IValidation.IError[] = [];
|
|
146
|
+
JsonSchemaValidator.validate({
|
|
147
|
+
errors,
|
|
148
|
+
schemas: result.data.schemas,
|
|
149
|
+
path: "$input.schemas",
|
|
150
|
+
});
|
|
151
|
+
if (errors.length !== 0)
|
|
152
|
+
return {
|
|
153
|
+
success: false,
|
|
154
|
+
errors,
|
|
155
|
+
data: next,
|
|
156
|
+
};
|
|
157
|
+
return result;
|
|
158
|
+
};
|
|
159
|
+
|
|
127
160
|
const application: ILlmApplication<Model> = collection[
|
|
128
|
-
props.model
|
|
129
|
-
]
|
|
161
|
+
props.model === "chatgpt" ? "chatgpt" : "claude"
|
|
162
|
+
](
|
|
163
|
+
validate,
|
|
164
|
+
) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
130
165
|
return {
|
|
131
166
|
protocol: "class",
|
|
132
167
|
name: "interface",
|
|
@@ -139,17 +174,21 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
139
174
|
};
|
|
140
175
|
}
|
|
141
176
|
|
|
142
|
-
const claude = typia.llm.application<
|
|
143
|
-
IAutoBeInterfaceComplementApplication,
|
|
144
|
-
"claude"
|
|
145
|
-
>();
|
|
146
177
|
const collection = {
|
|
147
|
-
chatgpt:
|
|
148
|
-
IAutoBeInterfaceComplementApplication,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
178
|
+
chatgpt: (validate: Validator) =>
|
|
179
|
+
typia.llm.application<IAutoBeInterfaceComplementApplication, "chatgpt">({
|
|
180
|
+
validate: {
|
|
181
|
+
complementComponents: validate,
|
|
182
|
+
},
|
|
183
|
+
}),
|
|
184
|
+
claude: (validate: Validator) =>
|
|
185
|
+
typia.llm.application<IAutoBeInterfaceComplementApplication, "claude">({
|
|
186
|
+
validate: {
|
|
187
|
+
complementComponents: validate,
|
|
188
|
+
},
|
|
189
|
+
}),
|
|
155
190
|
};
|
|
191
|
+
|
|
192
|
+
type Validator = (
|
|
193
|
+
input: unknown,
|
|
194
|
+
) => IValidation<IAutoBeInterfaceComplementApplication.IProps>;
|