@autobe/agent 0.16.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeMockAgent.d.ts +5 -5
- package/lib/agent/src/AutoBeAgent.d.ts +52 -0
- package/lib/{AutoBeAgent.js → agent/src/AutoBeAgent.js} +37 -9
- package/lib/agent/src/AutoBeAgent.js.map +1 -0
- package/lib/agent/src/AutoBeAgentBase.d.ts +18 -0
- package/lib/agent/src/AutoBeAgentBase.js.map +1 -0
- package/lib/agent/src/AutoBeMockAgent.d.ts +15 -0
- package/lib/{AutoBeMockAgent.js → agent/src/AutoBeMockAgent.js} +34 -4
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +34 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -0
- package/lib/agent/src/context/AutoBeContext.d.ts +41 -0
- package/lib/agent/src/context/AutoBeContext.js.map +1 -0
- package/lib/agent/src/context/AutoBeState.d.ts +8 -0
- package/lib/agent/src/context/AutoBeState.js.map +1 -0
- package/lib/agent/src/context/AutoBeTokenUsage.d.ts +173 -0
- package/lib/agent/src/context/AutoBeTokenUsage.js +188 -0
- package/lib/agent/src/context/AutoBeTokenUsage.js.map +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +116 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +137 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -0
- package/lib/agent/src/context/IAutoBeApplication.d.ts +107 -0
- package/lib/agent/src/context/IAutoBeApplication.js.map +1 -0
- package/lib/agent/src/context/IAutoBeApplicationProps.d.ts +4 -0
- package/lib/agent/src/context/IAutoBeApplicationProps.js.map +1 -0
- package/lib/agent/src/context/IAutoBeApplicationResult.d.ts +4 -0
- package/lib/agent/src/context/IAutoBeApplicationResult.js.map +1 -0
- package/lib/agent/src/context/assertSchemaModel.d.ts +2 -0
- package/lib/agent/src/context/assertSchemaModel.js.map +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.d.ts +7 -0
- package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -0
- package/lib/agent/src/factory/createAutoBeApplication.d.ts +7 -0
- package/lib/{factory → agent/src/factory}/createAutoBeApplication.js +1 -1
- package/lib/agent/src/factory/createAutoBeApplication.js.map +1 -0
- package/lib/agent/src/factory/createAutoBeContext.d.ts +19 -0
- package/lib/agent/src/factory/createAutoBeContext.js +214 -0
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -0
- package/lib/agent/src/factory/createAutoBeState.d.ts +3 -0
- package/lib/agent/src/factory/createAutoBeState.js.map +1 -0
- package/lib/agent/src/factory/getAutoBeGenerated.d.ts +4 -0
- package/lib/{factory → agent/src/factory}/getAutoBeGenerated.js +17 -14
- package/lib/agent/src/factory/getAutoBeGenerated.js.map +1 -0
- package/lib/agent/src/factory/getAutoBeRealizeGenerated.d.ts +7 -0
- package/lib/agent/src/factory/getAutoBeRealizeGenerated.js +27 -0
- package/lib/agent/src/factory/getAutoBeRealizeGenerated.js.map +1 -0
- package/lib/agent/src/factory/index.d.ts +1 -0
- package/lib/agent/src/factory/index.js.map +1 -0
- package/lib/agent/src/index.d.ts +6 -0
- package/lib/{index.js → agent/src/index.js} +1 -0
- package/lib/agent/src/index.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +46 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +30 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +49 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.d.ts +5 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +64 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +265 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +4 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +727 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +8 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +242 -0
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +105 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.js +3 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +78 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.js +3 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +70 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.js +3 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.d.ts +2 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +1 -0
- package/lib/agent/src/orchestrate/index.d.ts +5 -0
- package/lib/agent/src/orchestrate/index.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +34 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +62 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +49 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +28 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +51 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +35 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +28 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +53 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.d.ts +5 -0
- package/lib/{orchestrate → agent/src/orchestrate}/interface/orchestrateInterface.js +12 -24
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +4 -0
- package/lib/{orchestrate/interface/orchestrateInterfaceOperations.js → agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js} +227 -562
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -0
- package/lib/{orchestrate → agent/src/orchestrate}/interface/orchestrateInterfaceComplement.js +20 -32
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +5 -0
- package/lib/{orchestrate → agent/src/orchestrate}/interface/orchestrateInterfaceEndpoints.js +40 -41
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -0
- package/lib/{orchestrate → agent/src/orchestrate}/interface/orchestrateInterfaceGroups.js +15 -25
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +1768 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1317 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +4 -0
- package/lib/{orchestrate → agent/src/orchestrate}/interface/orchestrateInterfaceSchemas.js +59 -71
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +7 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +467 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.d.ts +47 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.js +3 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +55 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +24 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +108 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +126 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +96 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js +3 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +75 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +91 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js +3 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/OpenApiEndpointComparator.d.ts +6 -0
- package/lib/agent/src/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +1 -0
- package/lib/agent/src/orchestrate/internal/IProgress.d.ts +4 -0
- package/lib/agent/src/orchestrate/internal/IProgress.js +3 -0
- package/lib/agent/src/orchestrate/internal/IProgress.js.map +1 -0
- package/lib/{orchestrate/prisma → agent/src/orchestrate/prisma/histories}/transformPrismaComponentsHistories.d.ts +1 -1
- package/lib/{orchestrate/prisma → agent/src/orchestrate/prisma/histories}/transformPrismaComponentsHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -0
- package/lib/{orchestrate/prisma → agent/src/orchestrate/prisma/histories}/transformPrismaCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.d.ts +8 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +59 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -0
- package/lib/{orchestrate/prisma → agent/src/orchestrate/prisma/histories}/transformPrismaSchemaHistories.d.ts +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +48 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.d.ts +5 -0
- package/lib/{orchestrate → agent/src/orchestrate}/prisma/orchestratePrisma.js +37 -40
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +5 -0
- package/lib/{orchestrate → agent/src/orchestrate}/prisma/orchestratePrismaComponent.js +164 -58
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.d.ts +4 -0
- package/lib/{orchestrate → agent/src/orchestrate}/prisma/orchestratePrismaCorrect.js +130 -92
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.d.ts +5 -0
- package/lib/{orchestrate/prisma/orchestratePrismaSchemas.js → agent/src/orchestrate/prisma/orchestratePrismaReview.js} +197 -328
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.d.ts +5 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +1625 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.d.ts +121 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.js +3 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.d.ts +142 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.js +3 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.d.ts +105 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.js +3 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.d.ts +99 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.js +3 -0
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/ProviderCodeComparator.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/ProviderCodeComparator.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +40 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +80 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +7 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +13 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +32 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +11 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +160 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +7 -0
- package/lib/agent/src/orchestrate/realize/internal/compile.js +61 -0
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +113 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.d.ts +10 -0
- package/lib/{orchestrate → agent/src/orchestrate}/realize/orchestrateRealizeAuthorization.js +84 -70
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +4 -0
- package/lib/{orchestrate → agent/src/orchestrate}/realize/orchestrateRealizeAuthorizationCorrect.js +66 -52
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +351 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -0
- package/lib/{orchestrate/realize/orchestrateRealizePlanner.d.ts → agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts} +5 -3
- package/lib/{orchestrate/realize/orchestrateRealizePlanner.js → agent/src/orchestrate/realize/orchestrateRealizeScenario.js} +14 -24
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +9 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +340 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +92 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +27 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +345 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +56 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +2 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.d.ts +79 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +276 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/AuthorizationFileSystem.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/utils/AuthorizationFileSystem.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +4 -0
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/InternalFileSystem.d.ts +8 -0
- package/lib/agent/src/orchestrate/realize/utils/InternalFileSystem.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/ProviderFileSystem.d.ts +3 -0
- package/lib/agent/src/orchestrate/realize/utils/ProviderFileSystem.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.d.ts +4 -0
- package/lib/{orchestrate → agent/src/orchestrate}/realize/utils/replaceImportStatements.js +1 -0
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -0
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.d.ts +2 -0
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -0
- package/lib/agent/src/orchestrate/test/compile/filterTestFileName.d.ts +1 -0
- package/lib/agent/src/orchestrate/test/compile/filterTestFileName.js.map +1 -0
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.d.ts +3 -0
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +5 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -0
- package/lib/{orchestrate/test → agent/src/orchestrate/test/histories}/transformTestCorrectHistories.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -0
- package/lib/{orchestrate/test → agent/src/orchestrate/test/histories}/transformTestHistories.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +56 -0
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -0
- package/lib/{orchestrate/test → agent/src/orchestrate/test/histories}/transformTestWriteHistories.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +179 -0
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.d.ts +5 -0
- package/lib/{orchestrate → agent/src/orchestrate}/test/orchestrateTest.js +12 -30
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -0
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.d.ts +5 -0
- package/lib/{orchestrate → agent/src/orchestrate}/test/orchestrateTestCorrect.js +27 -43
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -0
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.d.ts +4 -0
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +858 -0
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -0
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.d.ts +5 -0
- package/lib/{orchestrate → agent/src/orchestrate}/test/orchestrateTestWrite.js +53 -54
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +121 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunction.d.ts +8 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunction.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +134 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +7 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +113 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteResult.d.ts +7 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeConfig.d.ts +73 -0
- package/lib/agent/src/structures/IAutoBeConfig.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeProps.d.ts +109 -0
- package/lib/agent/src/structures/IAutoBeProps.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeVendor.d.ts +87 -0
- package/lib/agent/src/structures/IAutoBeVendor.js.map +1 -0
- package/lib/agent/src/utils/arrayToRecord.d.ts +17 -0
- package/lib/agent/src/utils/arrayToRecord.js.map +1 -0
- package/lib/agent/src/utils/backoffRetry.d.ts +22 -0
- package/lib/agent/src/utils/backoffRetry.js.map +1 -0
- package/lib/agent/src/utils/divideArray.d.ts +4 -0
- package/lib/agent/src/utils/divideArray.js.map +1 -0
- package/lib/agent/src/utils/emplaceMap.d.ts +1 -0
- package/lib/agent/src/utils/emplaceMap.js.map +1 -0
- package/lib/{orchestrate/realize/RealizePipe.d.ts → agent/src/utils/pipe.d.ts} +1 -1
- package/lib/agent/src/utils/pipe.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +19 -17
- package/lib/context/AutoBeContext.d.ts +31 -8
- package/lib/context/AutoBeTokenUsage.d.ts +168 -11
- package/lib/context/AutoBeTokenUsageComponent.d.ts +116 -0
- package/lib/factory/createAutoBeContext.d.ts +19 -0
- package/lib/factory/getAutoBeGenerated.d.ts +1 -1
- package/lib/factory/getAutoBeRealizeGenerated.d.ts +7 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.mjs +10629 -5867
- package/lib/index.mjs.map +1 -1
- package/lib/interface/src/histories/contents/AutoBeAnalyzeFile.d.ts +153 -0
- package/lib/interface/src/histories/contents/AutoBeAnalyzeFile.js +3 -0
- package/lib/interface/src/histories/contents/AutoBeAnalyzeFile.js.map +1 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +4 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +4 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +4 -0
- package/lib/orchestrate/analyze/orchestrateAnalyze.d.ts +0 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +6 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +4 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -12
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +105 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +78 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +70 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +2 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.d.ts +5 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +5 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +7 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.d.ts +47 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +2 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +6 -2
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +96 -0
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +91 -0
- package/lib/orchestrate/internal/IProgress.d.ts +4 -0
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +3 -0
- package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.d.ts +3 -0
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.d.ts +8 -0
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +3 -0
- package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaReview.d.ts +5 -0
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +1 -1
- package/lib/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.d.ts +121 -0
- package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.d.ts +142 -0
- package/lib/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.d.ts +105 -0
- package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.d.ts +99 -0
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +5 -0
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.d.ts +5 -0
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +7 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +13 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +11 -0
- package/lib/orchestrate/realize/internal/compile.d.ts +7 -0
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -0
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +91 -0
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +9 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +10 -3
- package/lib/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.d.ts +79 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +38 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +276 -0
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +4 -0
- package/lib/orchestrate/test/histories/transformTestHistories.d.ts +3 -0
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +3 -0
- package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +8 -0
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +2 -2
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +25 -24
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -1
- package/package.json +10 -10
- package/src/AutoBeAgent.ts +45 -10
- package/src/AutoBeMockAgent.ts +41 -11
- package/src/constants/AutoBeSystemPromptConstant.ts +19 -17
- package/src/context/AutoBeContext.ts +60 -7
- package/src/context/AutoBeTokenUsage.ts +260 -54
- package/src/context/AutoBeTokenUsageComponent.ts +198 -0
- package/src/factory/createAutoBeApplication.ts +4 -12
- package/src/factory/createAutoBeContext.ts +256 -0
- package/src/factory/getAutoBeGenerated.ts +17 -24
- package/src/factory/getAutoBeRealizeGenerated.ts +30 -0
- package/src/index.ts +1 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +53 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +34 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +56 -0
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +61 -109
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +89 -0
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +123 -0
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +51 -52
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +108 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +85 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +71 -0
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +40 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +27 -0
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +45 -22
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +43 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +63 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +14 -23
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +106 -0
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +27 -44
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +28 -34
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +15 -32
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +207 -103
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +84 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +72 -82
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +143 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.ts +49 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.ts +2 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +6 -2
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +102 -0
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +98 -0
- package/src/orchestrate/internal/IProgress.ts +4 -0
- package/src/orchestrate/prisma/{transformPrismaComponentsHistories.ts → histories/transformPrismaComponentsHistories.ts} +2 -2
- package/src/orchestrate/prisma/{transformPrismaCorrectHistories.ts → histories/transformPrismaCorrectHistories.ts} +1 -1
- package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +66 -0
- package/src/orchestrate/prisma/{transformPrismaSchemaHistories.ts → histories/transformPrismaSchemaHistories.ts} +3 -3
- package/src/orchestrate/prisma/orchestratePrisma.ts +73 -67
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +27 -112
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +100 -202
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +118 -0
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +137 -210
- package/src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.ts +125 -0
- package/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.ts +144 -0
- package/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.ts +108 -0
- package/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.ts +101 -0
- package/src/orchestrate/realize/{transformRealizeAuthorization.ts → histories/transformRealizeAuthorization.ts} +14 -10
- package/src/orchestrate/realize/{transformRealizeAuthorizationCorrectHistories.ts → histories/transformRealizeAuthorizationCorrectHistories.ts} +9 -7
- package/src/orchestrate/realize/{transformRealizeCoderHistories.ts → histories/transformRealizeCoderHistories.ts} +6 -6
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +47 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +184 -0
- package/src/orchestrate/realize/internal/compile.ts +84 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +118 -40
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +45 -57
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +19 -41
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +118 -0
- package/src/orchestrate/realize/{orchestrateRealizePlanner.ts → orchestrateRealizeScenario.ts} +15 -15
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +120 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +11 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.ts +81 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts +43 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +282 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +3 -1
- package/src/orchestrate/test/experimental/orchestrateTestCorrect.ast +5 -9
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +23 -22
- package/src/orchestrate/test/{transformTestCorrectHistories.ts → histories/transformTestCorrectHistories.ts} +2 -2
- package/src/orchestrate/test/{transformTestHistories.ts → histories/transformTestHistories.ts} +1 -1
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +70 -0
- package/src/orchestrate/test/{transformTestWriteHistories.ts → histories/transformTestWriteHistories.ts} +3 -3
- package/src/orchestrate/test/orchestrateTest.ts +11 -32
- package/src/orchestrate/test/orchestrateTestCorrect.ts +32 -62
- package/src/orchestrate/test/orchestrateTestScenario.ts +95 -158
- package/src/orchestrate/test/orchestrateTestWrite.ts +48 -71
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +25 -24
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +3 -1
- package/lib/AutoBeAgent.js.map +0 -1
- package/lib/AutoBeAgentBase.js.map +0 -1
- package/lib/AutoBeMockAgent.js.map +0 -1
- package/lib/constants/AutoBeSystemPromptConstant.js.map +0 -1
- package/lib/context/AutoBeContext.js.map +0 -1
- package/lib/context/AutoBeState.js.map +0 -1
- package/lib/context/AutoBeTokenUsage.js +0 -61
- package/lib/context/AutoBeTokenUsage.js.map +0 -1
- package/lib/context/IAutoBeApplication.js.map +0 -1
- package/lib/context/IAutoBeApplicationProps.js.map +0 -1
- package/lib/context/IAutoBeApplicationResult.js.map +0 -1
- package/lib/context/assertSchemaModel.js.map +0 -1
- package/lib/factory/createAgenticaHistory.js.map +0 -1
- package/lib/factory/createAutoBeApplication.js.map +0 -1
- package/lib/factory/createAutoBeState.js.map +0 -1
- package/lib/factory/getAutoBeGenerated.js.map +0 -1
- package/lib/factory/index.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.d.ts +0 -45
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js +0 -27
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +0 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzePointer.d.ts +0 -9
- package/lib/orchestrate/analyze/AutoBeAnalyzePointer.js +0 -3
- package/lib/orchestrate/analyze/AutoBeAnalyzePointer.js.map +0 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +0 -125
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +0 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.d.ts +0 -5
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js +0 -561
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js.map +0 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.d.ts +0 -12
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +0 -395
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +0 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +0 -347
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +0 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.d.ts +0 -68
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.js +0 -3
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.js.map +0 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.d.ts +0 -5
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +0 -27
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +0 -1
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.d.ts +0 -12
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js +0 -78
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js.map +0 -1
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.d.ts +0 -16
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +0 -79
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +0 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
- package/lib/orchestrate/index.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +0 -62
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +0 -28
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +0 -28
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +0 -28
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +0 -28
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterface.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js.map +0 -1
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +0 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +0 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +0 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +0 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +0 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +0 -1
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js.map +0 -1
- package/lib/orchestrate/prisma/transformPrismaHistories.d.ts +0 -3
- package/lib/orchestrate/prisma/transformPrismaHistories.js +0 -55
- package/lib/orchestrate/prisma/transformPrismaHistories.js.map +0 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +0 -48
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +0 -1
- package/lib/orchestrate/realize/ProviderCodeComparator.js.map +0 -1
- package/lib/orchestrate/realize/RealizePipe.js +0 -14
- package/lib/orchestrate/realize/RealizePipe.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +0 -74
- package/lib/orchestrate/realize/orchestrateRealize.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +0 -26
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +0 -420
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
- package/lib/orchestrate/realize/transformRealizeAuthorization.d.ts +0 -4
- package/lib/orchestrate/realize/transformRealizeAuthorization.js +0 -39
- package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +0 -1
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.d.ts +0 -5
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +0 -80
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +0 -1
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +0 -1
- package/lib/orchestrate/realize/utils/AuthorizationFileSystem.js.map +0 -1
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +0 -1
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +0 -1
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +0 -1
- package/lib/orchestrate/realize/utils/ProviderFileSystem.js.map +0 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +0 -1
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.d.ts +0 -11
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +0 -221
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +0 -1
- package/lib/orchestrate/test/compile/completeTestCode.js.map +0 -1
- package/lib/orchestrate/test/compile/filterTestFileName.js.map +0 -1
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +0 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +0 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +0 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +0 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +0 -866
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +0 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +0 -1
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +0 -1
- package/lib/orchestrate/test/transformTestHistories.js.map +0 -1
- package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +0 -3
- package/lib/orchestrate/test/transformTestScenarioHistories.js +0 -100
- package/lib/orchestrate/test/transformTestScenarioHistories.js.map +0 -1
- package/lib/orchestrate/test/transformTestWriteHistories.js +0 -178
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +0 -1
- package/lib/structures/IAutoBeConfig.js.map +0 -1
- package/lib/structures/IAutoBeProps.js.map +0 -1
- package/lib/structures/IAutoBeVendor.js.map +0 -1
- package/lib/utils/arrayToRecord.js.map +0 -1
- package/lib/utils/backoffRetry.js.map +0 -1
- package/lib/utils/divideArray.js.map +0 -1
- package/lib/utils/emplaceMap.js.map +0 -1
- package/lib/utils/enforceToolCall.d.ts +0 -3
- package/lib/utils/enforceToolCall.js +0 -13
- package/lib/utils/enforceToolCall.js.map +0 -1
- package/lib/utils/forceRetry.d.ts +0 -1
- package/lib/utils/forceRetry.js +0 -26
- package/lib/utils/forceRetry.js.map +0 -1
- package/lib/utils/pipe.js.map +0 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeFileSystem.ts +0 -58
- package/src/orchestrate/analyze/AutoBeAnalyzePointer.ts +0 -10
- package/src/orchestrate/analyze/orchestrateAnalyzeComposer.ts +0 -112
- package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +0 -131
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.ts +0 -75
- package/src/orchestrate/analyze/transformAnalyzeReviewerHistories.ts +0 -31
- package/src/orchestrate/analyze/transformAnalyzeWriteHistories.ts +0 -94
- package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +0 -96
- package/src/orchestrate/prisma/transformPrismaHistories.ts +0 -59
- package/src/orchestrate/realize/RealizePipe.ts +0 -39
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +0 -182
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +0 -308
- package/src/orchestrate/test/transformTestScenarioHistories.ts +0 -105
- package/src/utils/enforceToolCall.ts +0 -13
- package/src/utils/forceRetry.ts +0 -13
- /package/lib/{AutoBeAgentBase.js → agent/src/AutoBeAgentBase.js} +0 -0
- /package/lib/{constants → agent/src/constants}/AutoBeSystemPromptConstant.js +0 -0
- /package/lib/{context → agent/src/context}/AutoBeContext.js +0 -0
- /package/lib/{context → agent/src/context}/AutoBeState.js +0 -0
- /package/lib/{context → agent/src/context}/IAutoBeApplication.js +0 -0
- /package/lib/{context → agent/src/context}/IAutoBeApplicationProps.js +0 -0
- /package/lib/{context → agent/src/context}/IAutoBeApplicationResult.js +0 -0
- /package/lib/{context → agent/src/context}/assertSchemaModel.js +0 -0
- /package/lib/{factory → agent/src/factory}/createAgenticaHistory.js +0 -0
- /package/lib/{factory → agent/src/factory}/createAutoBeState.js +0 -0
- /package/lib/{factory → agent/src/factory}/index.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/facade/transformFacadeStateMessage.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/index.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/histories/transformInterfaceAssetHistories.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/histories/transformInterfacePrerequisiteHistories.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/structures/IAutoBeInterfaceComplementApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/structures/IAutoBeInterfaceEndpointApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/structures/IAutoBeInterfaceGroupApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/structures/IAutoBeInterfaceOperationApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/structures/IAutoBeInterfaceSchemaApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/interface/utils/OpenApiEndpointComparator.js +0 -0
- /package/lib/{orchestrate/prisma → agent/src/orchestrate/prisma/histories}/transformPrismaCorrectHistories.d.ts +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/ProviderCodeComparator.js +0 -0
- /package/lib/{orchestrate/realize → agent/src/orchestrate/realize/histories}/transformRealizeCoderHistories.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/structures/IAutoBeRealizeAuthorizationApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/structures/IAutoBeRealizeCoderApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/structures/IAutoBeRealizeCompile.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/utils/AuthorizationFileSystem.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/utils/AutoBeRealizeAuthorizationFileSystem.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/utils/InternalFileSystem.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/realize/utils/ProviderFileSystem.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/compile/completeTestCode.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/compile/filterTestFileName.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/compile/getTestExternalDeclarations.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/compile/getTestScenarioArtifacts.js +0 -0
- /package/lib/{orchestrate/test → agent/src/orchestrate/test/histories}/transformTestCorrectHistories.js +0 -0
- /package/lib/{orchestrate/test → agent/src/orchestrate/test/histories}/transformTestHistories.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/structures/IAutoBeTestCorrectApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/structures/IAutoBeTestFunction.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/structures/IAutoBeTestScenarioApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/structures/IAutoBeTestScenarioArtifacts.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/structures/IAutoBeTestWriteApplication.js +0 -0
- /package/lib/{orchestrate → agent/src/orchestrate}/test/structures/IAutoBeTestWriteResult.js +0 -0
- /package/lib/{structures → agent/src/structures}/IAutoBeConfig.js +0 -0
- /package/lib/{structures → agent/src/structures}/IAutoBeProps.js +0 -0
- /package/lib/{structures → agent/src/structures}/IAutoBeVendor.js +0 -0
- /package/lib/{utils → agent/src/utils}/arrayToRecord.js +0 -0
- /package/lib/{utils → agent/src/utils}/backoffRetry.js +0 -0
- /package/lib/{utils → agent/src/utils}/divideArray.js +0 -0
- /package/lib/{utils → agent/src/utils}/emplaceMap.js +0 -0
- /package/lib/{utils → agent/src/utils}/pipe.js +0 -0
|
@@ -4,16 +4,22 @@ import {
|
|
|
4
4
|
AutoBeRealizeAuthorization,
|
|
5
5
|
AutoBeRealizeFunction,
|
|
6
6
|
AutoBeRealizeHistory,
|
|
7
|
+
AutoBeRealizeWriteEvent,
|
|
7
8
|
IAutoBeCompiler,
|
|
9
|
+
IAutoBeTypeScriptCompileResult,
|
|
8
10
|
} from "@autobe/interface";
|
|
9
11
|
import { ILlmSchema } from "@samchon/openapi";
|
|
10
|
-
import { v4 } from "uuid";
|
|
11
12
|
|
|
12
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
13
14
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
14
15
|
import { getAutoBeGenerated } from "../../factory/getAutoBeGenerated";
|
|
16
|
+
import { getAutoBeRealizeGenerated } from "../../factory/getAutoBeRealizeGenerated";
|
|
17
|
+
import { compile } from "./internal/compile";
|
|
15
18
|
import { orchestrateRealizeAuthorization } from "./orchestrateRealizeAuthorization";
|
|
16
|
-
import {
|
|
19
|
+
import { orchestrateRealizeCorrect } from "./orchestrateRealizeCorrect";
|
|
20
|
+
import { orchestrateRealizeScenario } from "./orchestrateRealizeScenario";
|
|
21
|
+
import { orchestrateRealizeWrite } from "./orchestrateRealizeWrite";
|
|
22
|
+
import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
|
|
17
23
|
|
|
18
24
|
export const orchestrateRealize =
|
|
19
25
|
<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>) =>
|
|
@@ -29,23 +35,107 @@ export const orchestrateRealize =
|
|
|
29
35
|
const start: Date = new Date();
|
|
30
36
|
ctx.dispatch({
|
|
31
37
|
type: "realizeStart",
|
|
32
|
-
created_at:
|
|
38
|
+
created_at: start.toISOString(),
|
|
33
39
|
reason: props.reason,
|
|
34
40
|
step: ctx.state().test?.step ?? 0,
|
|
35
41
|
});
|
|
36
42
|
|
|
37
|
-
// generate authorizations and functions
|
|
38
43
|
const authorizations: AutoBeRealizeAuthorization[] =
|
|
39
44
|
await orchestrateRealizeAuthorization(ctx);
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
|
|
46
|
+
const scenarios: IAutoBeRealizeScenarioApplication.IProps[] =
|
|
47
|
+
operations.map((operation) => orchestrateRealizeScenario(ctx, operation));
|
|
48
|
+
|
|
49
|
+
const writeProgress = { total: scenarios.length, completed: 0 };
|
|
50
|
+
const writeEvents: AutoBeRealizeWriteEvent[] = await Promise.all(
|
|
51
|
+
scenarios.map(async (scenario) => {
|
|
52
|
+
const code = orchestrateRealizeWrite(
|
|
53
|
+
ctx,
|
|
54
|
+
scenario.decoratorEvent ?? null,
|
|
55
|
+
scenario,
|
|
56
|
+
writeProgress,
|
|
57
|
+
);
|
|
58
|
+
return code;
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
let providers = Object.fromEntries(
|
|
63
|
+
writeEvents.map((event) => [event.location, event.content]),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
let finalCompilationResult = await compile(ctx, {
|
|
42
67
|
authorizations,
|
|
43
|
-
|
|
68
|
+
providers,
|
|
44
69
|
});
|
|
45
70
|
|
|
46
|
-
|
|
71
|
+
if (finalCompilationResult.type !== "success") {
|
|
72
|
+
const MAX_CORRECTION_ATTEMPTS = 3 as const;
|
|
73
|
+
|
|
74
|
+
const reviewProgress = {
|
|
75
|
+
total: writeEvents.length,
|
|
76
|
+
completed: writeEvents.length,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
for (let attempt = 0; attempt < MAX_CORRECTION_ATTEMPTS; attempt++) {
|
|
80
|
+
if (finalCompilationResult.result.type === "failure") {
|
|
81
|
+
const failedFiles: Record<string, string> =
|
|
82
|
+
finalCompilationResult.files;
|
|
83
|
+
|
|
84
|
+
reviewProgress.total += Object.keys(failedFiles).length;
|
|
85
|
+
const compilationResult: IAutoBeTypeScriptCompileResult.IFailure =
|
|
86
|
+
finalCompilationResult.result;
|
|
87
|
+
|
|
88
|
+
await Promise.all(
|
|
89
|
+
Object.entries(failedFiles).map(async ([location, content]) => {
|
|
90
|
+
const diagnostic:
|
|
91
|
+
| IAutoBeTypeScriptCompileResult.IDiagnostic
|
|
92
|
+
| undefined = compilationResult.diagnostics.find(
|
|
93
|
+
(el) => el.file === location,
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const scenario = scenarios.find((el) => el.location === location);
|
|
97
|
+
if (diagnostic && scenario) {
|
|
98
|
+
const correctEvent = await orchestrateRealizeCorrect(
|
|
99
|
+
ctx,
|
|
100
|
+
scenario.decoratorEvent ?? null,
|
|
101
|
+
scenario,
|
|
102
|
+
content,
|
|
103
|
+
diagnostic,
|
|
104
|
+
reviewProgress,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
providers[correctEvent.location] = correctEvent.content;
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
finalCompilationResult = await compile(ctx, {
|
|
113
|
+
authorizations,
|
|
114
|
+
providers,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
if (finalCompilationResult.type === "success") {
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const functions: AutoBeRealizeFunction[] = Object.entries(providers).map(
|
|
125
|
+
([location, content]) => {
|
|
126
|
+
const scenario = scenarios.find((el) => el.location === location)!;
|
|
127
|
+
return {
|
|
128
|
+
location,
|
|
129
|
+
content,
|
|
130
|
+
endpoint: {
|
|
131
|
+
method: scenario.operation.method,
|
|
132
|
+
path: scenario.operation.path,
|
|
133
|
+
},
|
|
134
|
+
name: scenario.functionName,
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
);
|
|
47
138
|
|
|
48
|
-
// compile controllers
|
|
49
139
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
50
140
|
const controllers: Record<string, string> =
|
|
51
141
|
await compiler.realize.controller({
|
|
@@ -54,41 +144,29 @@ export const orchestrateRealize =
|
|
|
54
144
|
authorizations,
|
|
55
145
|
});
|
|
56
146
|
|
|
57
|
-
|
|
58
|
-
type: "realize",
|
|
59
|
-
compiled: result.compiled,
|
|
60
|
-
authorizations,
|
|
61
|
-
functions,
|
|
62
|
-
controllers,
|
|
63
|
-
completed_at: new Date().toISOString(),
|
|
64
|
-
created_at: start.toISOString(),
|
|
65
|
-
id: v4(),
|
|
66
|
-
reason: props.reason,
|
|
67
|
-
step: ctx.state().analyze?.step ?? 0,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// report
|
|
71
|
-
ctx.dispatch({
|
|
147
|
+
return ctx.dispatch({
|
|
72
148
|
type: "realizeComplete",
|
|
73
149
|
created_at: new Date().toISOString(),
|
|
74
|
-
functions
|
|
75
|
-
authorizations
|
|
76
|
-
controllers
|
|
150
|
+
functions,
|
|
151
|
+
authorizations,
|
|
152
|
+
controllers,
|
|
77
153
|
compiled: await compiler.typescript.compile({
|
|
78
|
-
files:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
154
|
+
files: {
|
|
155
|
+
...(await getAutoBeGenerated(
|
|
156
|
+
compiler,
|
|
157
|
+
ctx.state(),
|
|
158
|
+
ctx.histories(),
|
|
159
|
+
ctx.usage(),
|
|
160
|
+
)),
|
|
161
|
+
...(await getAutoBeRealizeGenerated({
|
|
162
|
+
document: ctx.state().interface!.document,
|
|
163
|
+
authorizations,
|
|
164
|
+
functions,
|
|
165
|
+
compiler,
|
|
166
|
+
})),
|
|
167
|
+
},
|
|
87
168
|
}),
|
|
88
169
|
step: ctx.state().analyze?.step ?? 0,
|
|
170
|
+
elapsed: new Date().getTime() - start.getTime(),
|
|
89
171
|
});
|
|
90
|
-
ctx.state().realize = history;
|
|
91
|
-
ctx.histories().push(history);
|
|
92
|
-
|
|
93
|
-
return history;
|
|
94
172
|
};
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { IAgenticaController
|
|
2
|
-
import {
|
|
1
|
+
import { IAgenticaController } from "@agentica/core";
|
|
2
|
+
import {
|
|
3
|
+
AutoBeAnalyzeRole,
|
|
4
|
+
AutoBeRealizeAuthorization,
|
|
5
|
+
AutoBeRealizeAuthorizationWriteEvent,
|
|
6
|
+
IAutoBeCompiler,
|
|
7
|
+
} from "@autobe/interface";
|
|
3
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
4
9
|
import { IPointer } from "tstl";
|
|
5
10
|
import typia from "typia";
|
|
6
11
|
|
|
7
12
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
8
13
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
9
|
-
import {
|
|
14
|
+
import { IProgress } from "../internal/IProgress";
|
|
15
|
+
import { transformRealizeAuthorizationHistories } from "./histories/transformRealizeAuthorization";
|
|
10
16
|
import { orchestrateRealizeAuthorizationCorrect } from "./orchestrateRealizeAuthorizationCorrect";
|
|
11
17
|
import { IAutoBeRealizeAuthorizationApplication } from "./structures/IAutoBeRealizeAuthorizationApplication";
|
|
12
|
-
import { transformRealizeAuthorizationHistories } from "./transformRealizeAuthorization";
|
|
13
18
|
import { AuthorizationFileSystem } from "./utils/AuthorizationFileSystem";
|
|
14
19
|
import { InternalFileSystem } from "./utils/InternalFileSystem";
|
|
15
20
|
|
|
@@ -22,37 +27,29 @@ import { InternalFileSystem } from "./utils/InternalFileSystem";
|
|
|
22
27
|
export async function orchestrateRealizeAuthorization<
|
|
23
28
|
Model extends ILlmSchema.Model,
|
|
24
29
|
>(ctx: AutoBeContext<Model>): Promise<AutoBeRealizeAuthorization[]> {
|
|
25
|
-
const roles = ctx.state().analyze?.roles.map((role) => role.name) ?? [];
|
|
26
|
-
|
|
27
|
-
let completed = 0;
|
|
28
|
-
|
|
29
|
-
const templateFiles = await (await ctx.compiler()).realize.getTemplate();
|
|
30
|
-
|
|
31
30
|
ctx.dispatch({
|
|
32
31
|
type: "realizeAuthorizationStart",
|
|
33
32
|
step: ctx.state().test?.step ?? 0,
|
|
34
33
|
created_at: new Date().toISOString(),
|
|
35
34
|
});
|
|
36
35
|
|
|
36
|
+
const roles: AutoBeAnalyzeRole[] = ctx.state().analyze?.roles ?? [];
|
|
37
|
+
const progress: IProgress = {
|
|
38
|
+
total: roles.length,
|
|
39
|
+
completed: 0,
|
|
40
|
+
};
|
|
41
|
+
const templateFiles = await (await ctx.compiler()).realize.getTemplate();
|
|
37
42
|
const authorizations: AutoBeRealizeAuthorization[] = await Promise.all(
|
|
38
|
-
roles.map(
|
|
39
|
-
|
|
43
|
+
roles.map((role) =>
|
|
44
|
+
process(
|
|
40
45
|
ctx,
|
|
41
46
|
role,
|
|
42
47
|
InternalFileSystem.DEFAULT.map((el) => ({
|
|
43
48
|
[el]: templateFiles[el],
|
|
44
49
|
})).reduce((acc, cur) => Object.assign(acc, cur), {}),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
created_at: new Date().toISOString(),
|
|
49
|
-
authorization: authorization,
|
|
50
|
-
completed: ++completed,
|
|
51
|
-
total: roles.length,
|
|
52
|
-
step: ctx.state().test?.step ?? 0,
|
|
53
|
-
});
|
|
54
|
-
return authorization;
|
|
55
|
-
}),
|
|
50
|
+
progress,
|
|
51
|
+
),
|
|
52
|
+
),
|
|
56
53
|
);
|
|
57
54
|
ctx.dispatch({
|
|
58
55
|
type: "realizeAuthorizationComplete",
|
|
@@ -64,40 +61,26 @@ export async function orchestrateRealizeAuthorization<
|
|
|
64
61
|
|
|
65
62
|
async function process<Model extends ILlmSchema.Model>(
|
|
66
63
|
ctx: AutoBeContext<Model>,
|
|
67
|
-
role:
|
|
64
|
+
role: AutoBeAnalyzeRole,
|
|
68
65
|
templateFiles: Record<string, string>,
|
|
66
|
+
progress: IProgress,
|
|
69
67
|
): Promise<AutoBeRealizeAuthorization> {
|
|
70
68
|
const pointer: IPointer<IAutoBeRealizeAuthorizationApplication.IProps | null> =
|
|
71
69
|
{
|
|
72
70
|
value: null,
|
|
73
71
|
};
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
vendor: ctx.vendor,
|
|
77
|
-
config: {
|
|
78
|
-
...(ctx.config ?? {}),
|
|
79
|
-
executor: {
|
|
80
|
-
describe: null,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
72
|
+
const { tokenUsage } = await ctx.conversate({
|
|
73
|
+
source: "realizeAuthorizationWrite",
|
|
83
74
|
histories: transformRealizeAuthorizationHistories(ctx, role),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
controller: createController({
|
|
76
|
+
model: ctx.model,
|
|
77
|
+
build: (next) => {
|
|
78
|
+
pointer.value = next;
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
enforceFunctionCall: true,
|
|
82
|
+
message: "Create Authorization Provider and Decorator.",
|
|
92
83
|
});
|
|
93
|
-
enforceToolCall(agentica);
|
|
94
|
-
|
|
95
|
-
await agentica
|
|
96
|
-
.conversate("Create Authorization Provider and Decorator.")
|
|
97
|
-
.finally(() => {
|
|
98
|
-
const tokenUsage = agentica.getTokenUsage();
|
|
99
|
-
ctx.usage().record(tokenUsage, ["realize"]);
|
|
100
|
-
});
|
|
101
84
|
if (pointer.value === null) throw new Error("Failed to create decorator.");
|
|
102
85
|
|
|
103
86
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
@@ -129,6 +112,15 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
129
112
|
const prismaClients: Record<string, string> =
|
|
130
113
|
compiled?.type === "success" ? compiled.nodeModules : {};
|
|
131
114
|
|
|
115
|
+
ctx.dispatch({
|
|
116
|
+
type: "realizeAuthorizationWrite",
|
|
117
|
+
created_at: new Date().toISOString(),
|
|
118
|
+
authorization: authorization,
|
|
119
|
+
tokenUsage,
|
|
120
|
+
completed: ++progress.completed,
|
|
121
|
+
total: progress.total,
|
|
122
|
+
step: ctx.state().test?.step ?? 0,
|
|
123
|
+
} satisfies AutoBeRealizeAuthorizationWriteEvent);
|
|
132
124
|
return orchestrateRealizeAuthorizationCorrect(
|
|
133
125
|
ctx,
|
|
134
126
|
authorization,
|
|
@@ -137,7 +129,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
137
129
|
);
|
|
138
130
|
}
|
|
139
131
|
|
|
140
|
-
function
|
|
132
|
+
function createController<Model extends ILlmSchema.Model>(props: {
|
|
141
133
|
model: Model;
|
|
142
134
|
build: (next: IAutoBeRealizeAuthorizationApplication.IProps) => void;
|
|
143
135
|
}): IAgenticaController.IClass<Model> {
|
|
@@ -145,7 +137,7 @@ function createApplication<Model extends ILlmSchema.Model>(props: {
|
|
|
145
137
|
|
|
146
138
|
const application: ILlmApplication<Model> = collection[
|
|
147
139
|
props.model
|
|
148
|
-
] as unknown as ILlmApplication<Model>;
|
|
140
|
+
] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
149
141
|
|
|
150
142
|
return {
|
|
151
143
|
protocol: "class",
|
|
@@ -161,16 +153,12 @@ function createApplication<Model extends ILlmSchema.Model>(props: {
|
|
|
161
153
|
|
|
162
154
|
const claude = typia.llm.application<
|
|
163
155
|
IAutoBeRealizeAuthorizationApplication,
|
|
164
|
-
"claude"
|
|
165
|
-
{
|
|
166
|
-
reference: true;
|
|
167
|
-
}
|
|
156
|
+
"claude"
|
|
168
157
|
>();
|
|
169
158
|
const collection = {
|
|
170
159
|
chatgpt: typia.llm.application<
|
|
171
160
|
IAutoBeRealizeAuthorizationApplication,
|
|
172
|
-
"chatgpt"
|
|
173
|
-
{ reference: true }
|
|
161
|
+
"chatgpt"
|
|
174
162
|
>(),
|
|
175
163
|
claude,
|
|
176
164
|
llama: claude,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAgenticaController
|
|
1
|
+
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import {
|
|
3
3
|
AutoBeRealizeAuthorization,
|
|
4
4
|
AutoBeRealizeAuthorizationCorrect,
|
|
@@ -11,9 +11,8 @@ import typia from "typia";
|
|
|
11
11
|
|
|
12
12
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
13
13
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
14
|
-
import {
|
|
14
|
+
import { transformRealizeAuthorizationCorrectHistories } from "./histories/transformRealizeAuthorizationCorrectHistories";
|
|
15
15
|
import { IAutoBeRealizeAuthorizationCorrectApplication } from "./structures/IAutoBeRealizeAuthorizationCorrectApplication";
|
|
16
|
-
import { transformRealizeAuthorizationCorrectHistories } from "./transformRealizeAuthorizationCorrectHistories";
|
|
17
16
|
import { AuthorizationFileSystem } from "./utils/AuthorizationFileSystem";
|
|
18
17
|
import { AutoBeRealizeAuthorizationReplaceImport } from "./utils/AutoBeRealizeAuthorizationReplaceImport";
|
|
19
18
|
|
|
@@ -29,13 +28,13 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
29
28
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
30
29
|
const providerContent: string = await compiler.typescript.beautify(
|
|
31
30
|
AutoBeRealizeAuthorizationReplaceImport.replaceProviderImport(
|
|
32
|
-
authorization.role,
|
|
31
|
+
authorization.role.name,
|
|
33
32
|
authorization.provider.content,
|
|
34
33
|
),
|
|
35
34
|
);
|
|
36
35
|
const decoratorContent: string = await compiler.typescript.beautify(
|
|
37
36
|
AutoBeRealizeAuthorizationReplaceImport.replaceDecoratorImport(
|
|
38
|
-
authorization.role,
|
|
37
|
+
authorization.role.name,
|
|
39
38
|
authorization.decorator.content,
|
|
40
39
|
),
|
|
41
40
|
);
|
|
@@ -75,40 +74,23 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
75
74
|
{
|
|
76
75
|
value: null,
|
|
77
76
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
model: ctx.model,
|
|
81
|
-
vendor: ctx.vendor,
|
|
82
|
-
config: {
|
|
83
|
-
...(ctx.config ?? {}),
|
|
84
|
-
executor: {
|
|
85
|
-
describe: null,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
77
|
+
const { tokenUsage } = await ctx.conversate({
|
|
78
|
+
source: "realizeAuthorizationCorrect",
|
|
88
79
|
histories: transformRealizeAuthorizationCorrectHistories(
|
|
89
80
|
ctx,
|
|
90
81
|
authorization,
|
|
91
82
|
templateFiles,
|
|
92
83
|
compiled.diagnostics,
|
|
93
84
|
),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
85
|
+
controller: createController({
|
|
86
|
+
model: ctx.model,
|
|
87
|
+
build: (next) => {
|
|
88
|
+
pointer.value = next;
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
enforceFunctionCall: true,
|
|
92
|
+
message: "Please correct the decorator and the provider.",
|
|
102
93
|
});
|
|
103
|
-
enforceToolCall(agentica);
|
|
104
|
-
|
|
105
|
-
await agentica
|
|
106
|
-
.conversate("Please correct the decorator and the provider.")
|
|
107
|
-
.finally(() => {
|
|
108
|
-
const tokenUsage = agentica.getTokenUsage();
|
|
109
|
-
ctx.usage().record(tokenUsage, ["realize"]);
|
|
110
|
-
});
|
|
111
|
-
|
|
112
94
|
if (pointer.value === null) throw new Error("Failed to correct decorator.");
|
|
113
95
|
|
|
114
96
|
const result: AutoBeRealizeAuthorizationCorrect = {
|
|
@@ -141,6 +123,7 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
141
123
|
created_at: new Date().toISOString(),
|
|
142
124
|
authorization: result,
|
|
143
125
|
result: compiled,
|
|
126
|
+
tokenUsage,
|
|
144
127
|
step: ctx.state().test?.step ?? 0,
|
|
145
128
|
});
|
|
146
129
|
|
|
@@ -153,7 +136,7 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
153
136
|
);
|
|
154
137
|
}
|
|
155
138
|
|
|
156
|
-
function
|
|
139
|
+
function createController<Model extends ILlmSchema.Model>(props: {
|
|
157
140
|
model: Model;
|
|
158
141
|
build: (next: IAutoBeRealizeAuthorizationCorrectApplication.IProps) => void;
|
|
159
142
|
}): IAgenticaController.IClass<Model> {
|
|
@@ -161,8 +144,7 @@ function createApplication<Model extends ILlmSchema.Model>(props: {
|
|
|
161
144
|
|
|
162
145
|
const application: ILlmApplication<Model> = collection[
|
|
163
146
|
props.model
|
|
164
|
-
] as unknown as ILlmApplication<Model>;
|
|
165
|
-
|
|
147
|
+
] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
166
148
|
return {
|
|
167
149
|
protocol: "class",
|
|
168
150
|
name: "Correct Authorization",
|
|
@@ -177,16 +159,12 @@ function createApplication<Model extends ILlmSchema.Model>(props: {
|
|
|
177
159
|
|
|
178
160
|
const claude = typia.llm.application<
|
|
179
161
|
IAutoBeRealizeAuthorizationCorrectApplication,
|
|
180
|
-
"claude"
|
|
181
|
-
{
|
|
182
|
-
reference: true;
|
|
183
|
-
}
|
|
162
|
+
"claude"
|
|
184
163
|
>();
|
|
185
164
|
const collection = {
|
|
186
165
|
chatgpt: typia.llm.application<
|
|
187
166
|
IAutoBeRealizeAuthorizationCorrectApplication,
|
|
188
|
-
"chatgpt"
|
|
189
|
-
{ reference: true }
|
|
167
|
+
"chatgpt"
|
|
190
168
|
>(),
|
|
191
169
|
claude,
|
|
192
170
|
llama: claude,
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutoBeRealizeAuthorization,
|
|
3
|
+
AutoBeRealizeCorrectEvent,
|
|
4
|
+
IAutoBeTypeScriptCompileResult,
|
|
5
|
+
} from "@autobe/interface";
|
|
6
|
+
import { ILlmApplication, ILlmController, ILlmSchema } from "@samchon/openapi";
|
|
7
|
+
import { IPointer } from "tstl";
|
|
8
|
+
import typia from "typia";
|
|
9
|
+
|
|
10
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
11
|
+
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
12
|
+
import { getTestScenarioArtifacts } from "../test/compile/getTestScenarioArtifacts";
|
|
13
|
+
import { IAutoBeTestScenarioArtifacts } from "../test/structures/IAutoBeTestScenarioArtifacts";
|
|
14
|
+
import { transformRealizeCorrectHistories } from "./histories/transformRealizeCorrectHistories";
|
|
15
|
+
import { IAutoBeRealizeCorrectApplication } from "./structures/IAutoBeRealizeReviewApplication";
|
|
16
|
+
import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
|
|
17
|
+
import { replaceImportStatements } from "./utils/replaceImportStatements";
|
|
18
|
+
|
|
19
|
+
export async function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(
|
|
20
|
+
ctx: AutoBeContext<Model>,
|
|
21
|
+
authorization: AutoBeRealizeAuthorization | null,
|
|
22
|
+
scenario: IAutoBeRealizeScenarioApplication.IProps,
|
|
23
|
+
code: string,
|
|
24
|
+
diagnostic: IAutoBeTypeScriptCompileResult.IDiagnostic,
|
|
25
|
+
progress: IProgress,
|
|
26
|
+
): Promise<AutoBeRealizeCorrectEvent> {
|
|
27
|
+
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
28
|
+
await getTestScenarioArtifacts(ctx, {
|
|
29
|
+
endpoint: scenario.operation,
|
|
30
|
+
dependencies: [],
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const pointer: IPointer<IAutoBeRealizeCorrectApplication.IProps | null> = {
|
|
34
|
+
value: null,
|
|
35
|
+
};
|
|
36
|
+
const { tokenUsage } = await ctx.conversate({
|
|
37
|
+
source: "realizeCorrect",
|
|
38
|
+
controller: createController({
|
|
39
|
+
model: ctx.model,
|
|
40
|
+
build: (next) => {
|
|
41
|
+
pointer.value = next;
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
histories: transformRealizeCorrectHistories({
|
|
45
|
+
state: ctx.state(),
|
|
46
|
+
scenario,
|
|
47
|
+
artifacts,
|
|
48
|
+
authorization,
|
|
49
|
+
code,
|
|
50
|
+
diagnostic,
|
|
51
|
+
}),
|
|
52
|
+
enforceFunctionCall: true,
|
|
53
|
+
message: [
|
|
54
|
+
`Correct the TypeScript code implementation to strictly follow these rules:`,
|
|
55
|
+
`1. Ensure that the code is production-ready and follows best practices.`,
|
|
56
|
+
].join("\n"),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
if (pointer.value === null)
|
|
60
|
+
throw new Error("Failed to correct implementation code.");
|
|
61
|
+
|
|
62
|
+
pointer.value.implementationCode = await replaceImportStatements(ctx)(
|
|
63
|
+
artifacts,
|
|
64
|
+
pointer.value.implementationCode,
|
|
65
|
+
authorization?.payload.name,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const event: AutoBeRealizeCorrectEvent = {
|
|
69
|
+
type: "realizeCorrect",
|
|
70
|
+
location: scenario.location,
|
|
71
|
+
content: pointer.value.implementationCode,
|
|
72
|
+
tokenUsage,
|
|
73
|
+
completed: ++progress.completed,
|
|
74
|
+
total: progress.total,
|
|
75
|
+
step: ctx.state().analyze?.step ?? 0,
|
|
76
|
+
created_at: new Date().toISOString(),
|
|
77
|
+
};
|
|
78
|
+
ctx.dispatch(event);
|
|
79
|
+
return event;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function createController<Model extends ILlmSchema.Model>(props: {
|
|
83
|
+
model: Model;
|
|
84
|
+
build: (next: IAutoBeRealizeCorrectApplication.IProps) => void;
|
|
85
|
+
}): ILlmController<Model> {
|
|
86
|
+
assertSchemaModel(props.model);
|
|
87
|
+
const application: ILlmApplication<Model> = collection[
|
|
88
|
+
props.model
|
|
89
|
+
] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
protocol: "class",
|
|
93
|
+
name: "Write code",
|
|
94
|
+
application,
|
|
95
|
+
execute: {
|
|
96
|
+
review: (next) => {
|
|
97
|
+
props.build(next);
|
|
98
|
+
},
|
|
99
|
+
} satisfies IAutoBeRealizeCorrectApplication,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const claude = typia.llm.application<
|
|
104
|
+
IAutoBeRealizeCorrectApplication,
|
|
105
|
+
"claude"
|
|
106
|
+
>();
|
|
107
|
+
const collection = {
|
|
108
|
+
chatgpt: typia.llm.application<IAutoBeRealizeCorrectApplication, "chatgpt">(),
|
|
109
|
+
claude,
|
|
110
|
+
llama: claude,
|
|
111
|
+
deepseek: claude,
|
|
112
|
+
"3.1": claude,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export interface IProgress {
|
|
116
|
+
total: number;
|
|
117
|
+
completed: number;
|
|
118
|
+
}
|
package/src/orchestrate/realize/{orchestrateRealizePlanner.ts → orchestrateRealizeScenario.ts}
RENAMED
|
@@ -2,8 +2,9 @@ import { AutoBeOpenApi, AutoBeRealizeAuthorization } from "@autobe/interface";
|
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
|
|
4
4
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
5
|
+
import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
|
|
5
6
|
|
|
6
|
-
export interface
|
|
7
|
+
export interface IAutoBeRealizeScenario {
|
|
7
8
|
/**
|
|
8
9
|
* The name of the function to be generated.
|
|
9
10
|
*
|
|
@@ -56,7 +57,7 @@ export interface RealizePlannerOutput {
|
|
|
56
57
|
* Extracted from the Swagger operation method. Used to define the request
|
|
57
58
|
* type during code and test generation.
|
|
58
59
|
*/
|
|
59
|
-
|
|
60
|
+
method: "get" | "post" | "put" | "delete" | "patch";
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
63
|
* List of scenario descriptions for test code generation.
|
|
@@ -91,16 +92,17 @@ export interface RealizePlannerOutput {
|
|
|
91
92
|
* next step in the AutoBE pipeline, which is responsible for generating the
|
|
92
93
|
* actual implementation code.
|
|
93
94
|
*
|
|
95
|
+
* @author Kakasoo
|
|
94
96
|
* @param ctx - AutoBE context including model and configuration
|
|
95
97
|
* @param operation - A single OpenAPI operation object to analyze and plan
|
|
96
98
|
* @returns A planning object containing all structural information needed to
|
|
97
99
|
* generate the function
|
|
98
100
|
*/
|
|
99
|
-
export const
|
|
101
|
+
export const orchestrateRealizeScenario = <Model extends ILlmSchema.Model>(
|
|
100
102
|
ctx: AutoBeContext<Model>,
|
|
101
103
|
operation: AutoBeOpenApi.IOperation,
|
|
102
104
|
authorization?: AutoBeRealizeAuthorization,
|
|
103
|
-
):
|
|
105
|
+
): IAutoBeRealizeScenarioApplication.IProps => {
|
|
104
106
|
const testScenarios =
|
|
105
107
|
ctx
|
|
106
108
|
.state()
|
|
@@ -110,18 +112,16 @@ export const orchestrateRealizePlanner = async <Model extends ILlmSchema.Model>(
|
|
|
110
112
|
el.scenario.endpoint.path === operation.path,
|
|
111
113
|
) ?? [];
|
|
112
114
|
|
|
115
|
+
const functionName = `${operation.method}_${operation.path
|
|
116
|
+
.replaceAll("/", "_")
|
|
117
|
+
.replaceAll("-", "_")
|
|
118
|
+
.replaceAll("{", "$")
|
|
119
|
+
.replaceAll("}", "")}`;
|
|
113
120
|
return {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
outputSchema: operation.responseBody,
|
|
118
|
-
operationType: operation.method,
|
|
121
|
+
operation: operation,
|
|
122
|
+
functionName: functionName,
|
|
123
|
+
location: `src/providers/${functionName}.ts`,
|
|
119
124
|
testScenarios: testScenarios.map((el) => el.scenario.draft),
|
|
120
|
-
functionName: `${operation.method}_${operation.path
|
|
121
|
-
.replaceAll("/", "_")
|
|
122
|
-
.replaceAll("-", "_")
|
|
123
|
-
.replaceAll("{", "$")
|
|
124
|
-
.replaceAll("}", "")}`,
|
|
125
125
|
decoratorEvent: authorization,
|
|
126
|
-
}
|
|
126
|
+
};
|
|
127
127
|
};
|