@autobe/agent 0.24.2 → 0.25.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/AutoBeAgent.js +11 -1
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +1 -0
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +21 -21
- package/lib/context/IAutoBeApplication.d.ts +101 -6
- package/lib/context/IAutoBeApplicationProps.d.ts +6 -2
- package/lib/factory/createAgenticaHistory.js +1 -1
- package/lib/factory/createAgenticaHistory.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +80 -90
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +6 -5
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +3914 -2594
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +18 -3
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +19 -7
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +3 -2
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +36 -23
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +22 -42
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +2 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +20 -7
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.js → transformInterfaceCommonPrerequisiteHistories.js} +4 -4
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -23
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +22 -6
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +4 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +27 -6
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +21 -5
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +102 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +20 -4
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +45 -11
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +277 -37
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +69 -70
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +6 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +28 -13
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +11 -8
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +36 -21
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +260 -29
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.d.ts +5 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +713 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +83 -53
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js +41 -7
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +0 -38
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -10
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +52 -0
- package/lib/orchestrate/{common/structures/IAutoBeCommonCorrectDateApplication.js → interface/structures/IAutoBeInterfacePrerequisitesApplication.js} +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +0 -33
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +6 -2
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +105 -5
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +20 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.d.ts +3 -4
- package/lib/orchestrate/interface/utils/OperationValidator.js +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +4 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +19 -8
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +6 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +20 -6
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +3 -3
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -3
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +12 -6
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/{common/histories/transformCommonCorrectDateHistories.d.ts → realize/histories/transformRealizeCorrectCastingHistories.d.ts} +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +32 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +14 -22
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +6 -6
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +8 -2
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js +1 -2
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.d.ts +2 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +119 -42
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +82 -52
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +128 -88
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +117 -54
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +52 -26
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +44 -34
- package/lib/orchestrate/realize/utils/InternalFileSystem.js +1 -1
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -5
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +8 -3
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +44 -17
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +4 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js +24 -9
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.d.ts +8 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js +48 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +93 -53
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +11 -7
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +7 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +35 -96
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +6 -3
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +33 -77
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +111 -94
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +20 -14
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +81 -50
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +31 -13
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +18 -7
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +20 -12
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +46 -25
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +9 -5
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.d.ts +8 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +11 -7
- package/lib/orchestrate/test/utils/getPrerequisites.d.ts +5 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js +36 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js.map +1 -0
- package/lib/orchestrate/test/utils/getReferenceIds.js +1 -1
- package/lib/orchestrate/test/utils/getReferenceIds.js.map +1 -1
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +17 -1
- package/src/AutoBeMockAgent.ts +1 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +21 -21
- package/src/context/IAutoBeApplication.ts +101 -6
- package/src/context/IAutoBeApplicationProps.ts +6 -2
- package/src/factory/createAgenticaHistory.ts +11 -5
- package/src/factory/createAutoBeContext.ts +6 -5
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +5 -1
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +16 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +22 -7
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +3 -2
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +2 -2
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +25 -45
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +2 -1
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +23 -9
- package/src/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.ts → transformInterfaceCommonPrerequisiteHistories.ts} +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +33 -24
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +26 -9
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +30 -6
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +24 -7
- package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +118 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +23 -6
- package/src/orchestrate/interface/orchestrateInterface.ts +65 -20
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +22 -12
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +34 -47
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +40 -28
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +51 -35
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +274 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +52 -33
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +1 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +0 -39
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -10
- package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +58 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +0 -34
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +92 -4
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +19 -1
- package/src/orchestrate/interface/utils/OperationValidator.ts +9 -7
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +20 -6
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +24 -9
- package/src/orchestrate/prisma/orchestratePrisma.ts +7 -3
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +5 -1
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +15 -10
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +44 -0
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -24
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +6 -6
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +6 -4
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +1 -5
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +102 -16
- package/src/orchestrate/realize/orchestrateRealize.ts +121 -81
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +50 -7
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +14 -4
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +54 -29
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +46 -35
- package/src/orchestrate/realize/utils/InternalFileSystem.ts +1 -1
- package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -5
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +54 -22
- package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +28 -16
- package/src/orchestrate/realize/utils/printErrorHints.ts +55 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +99 -97
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +14 -7
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +50 -115
- package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +41 -111
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +35 -12
- package/src/orchestrate/test/orchestrateTest.ts +19 -13
- package/src/orchestrate/test/orchestrateTestCorrect.ts +71 -51
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +13 -1
- package/src/orchestrate/test/orchestrateTestScenario.ts +27 -17
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +32 -19
- package/src/orchestrate/test/orchestrateTestWrite.ts +20 -10
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +9 -228
- package/src/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.ts +8 -2
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +11 -78
- package/src/orchestrate/test/utils/getPrerequisites.ts +51 -0
- package/src/orchestrate/test/utils/getReferenceIds.ts +2 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js +0 -48
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js.map +0 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.d.ts +0 -35
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +0 -3
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +0 -1
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.d.ts +0 -6
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js +0 -22
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.d.ts +0 -4
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js +0 -540
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js.map +0 -1
- package/src/orchestrate/common/histories/transformCommonCorrectDateHistories.ts +0 -60
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.ts +0 -40
- package/src/orchestrate/interface/utils/OpenApiEndpointComparator.ts +0 -23
- package/src/orchestrate/realize/orchestrateRealizeCorrectDate.ts +0 -372
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformRealizeWriteHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/histories/transformRealizeWriteHistories.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAC3C,+BAA0B;AAK1B,sFAAmF;AACnF,gFAA6E;AAC7E,iHAA8G;AAEvG,MAAM,8BAA8B,GAAG,CAAC,KAM9C,EAEC,EAAE;IACF,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CACjC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;QACpC,EAAE,CAAC,OAAO,CAAC,QAAQ;QACnB,EAAE,CAAC,OAAO,CAAC,OAAO;KACnB,CAAC,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;IAE3C,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI;QAC9B,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,mCAAmC;oBACnC,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;SACC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI;QAClC,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,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AsB,GAAG,SAAS,CAAC,iBAAiB;QACxD,CAAC,CAAC,IAAA,2FAA4C,EAAC,SAAS,EAAE,QAAQ,CAAC;QACnE,CAAC,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"transformRealizeWriteHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/histories/transformRealizeWriteHistories.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAC3C,+BAA0B;AAK1B,sFAAmF;AACnF,gFAA6E;AAC7E,iHAA8G;AAEvG,MAAM,8BAA8B,GAAG,CAAC,KAM9C,EAEC,EAAE;IACF,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CACjC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;QACpC,EAAE,CAAC,OAAO,CAAC,QAAQ;QACnB,EAAE,CAAC,OAAO,CAAC,OAAO;KACnB,CAAC,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;IAE3C,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI;QAC9B,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,mCAAmC;oBACnC,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;SACC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI;QAClC,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,mDAAmD;oBACnD,mCAAmC;oBACnC,qDAAqD;iBACtD,CAAC,IAAI,CAAC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E,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;OAYpB;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AA5JW,QAAA,8BAA8B,kCA4JzC"}
|
|
@@ -26,7 +26,7 @@ function compileRealizeFiles(ctx, props) {
|
|
|
26
26
|
const compiled = yield compiler.typescript.compile({
|
|
27
27
|
files: files,
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
return {
|
|
30
30
|
type: "realizeValidate",
|
|
31
31
|
id: (0, uuid_1.v7)(),
|
|
32
32
|
files: files,
|
|
@@ -34,7 +34,6 @@ function compileRealizeFiles(ctx, props) {
|
|
|
34
34
|
step: (_c = (_b = ctx.state().analyze) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
|
|
35
35
|
created_at: new Date().toISOString(),
|
|
36
36
|
};
|
|
37
|
-
return event;
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
39
|
//# sourceMappingURL=compileRealizeFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileRealizeFiles.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/internal/compileRealizeFiles.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,
|
|
1
|
+
{"version":3,"file":"compileRealizeFiles.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/internal/compileRealizeFiles.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,kDAiDC;AArDD,+BAA0B;AAI1B,SAAsB,mBAAmB,CACvC,GAAyB,EACzB,KAGC;;;QAED,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,0CAAE,QAAQ,CAAC;QAC5C,MAAM,QAAQ,GAA2B,MAAM,CAAC,WAAW,CACzD,KAAK,CAAC,cAAc,CAAC,GAAG,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AQ,CAAC,UAAU,CAAC,OAAO,CAAC;YAChC,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;QACL,OAAO;YACL,IAAI,EAAE,iBAAiB;YACvB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;YACpC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC,CAAC;IACJ,CAAC;CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AutoBeProgressEventBase, AutoBeRealizeAuthorization, AutoBeRealizeFunction } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
|
|
4
|
+
import { IAutoBeRealizeScenarioResult } from "./structures/IAutoBeRealizeScenarioResult";
|
|
5
|
+
export declare const orchestrateRealizeCorrectCasting: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenarios: IAutoBeRealizeScenarioResult[], authorizations: AutoBeRealizeAuthorization[], functions: AutoBeRealizeFunction[], progress: AutoBeProgressEventBase, life?: number) => Promise<AutoBeRealizeFunction[]>;
|
|
@@ -52,39 +52,48 @@ const typia_1 = __importDefault(require("typia"));
|
|
|
52
52
|
const uuid_1 = require("uuid");
|
|
53
53
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
54
|
const executeCachedBatch_1 = require("../../utils/executeCachedBatch");
|
|
55
|
-
const
|
|
55
|
+
const transformRealizeCorrectCastingHistories_1 = require("./histories/transformRealizeCorrectCastingHistories");
|
|
56
56
|
const compileRealizeFiles_1 = require("./internal/compileRealizeFiles");
|
|
57
|
-
const
|
|
57
|
+
const getRealizeWriteCodeTemplate_1 = require("./utils/getRealizeWriteCodeTemplate");
|
|
58
|
+
const replaceImportStatements_1 = require("./utils/replaceImportStatements");
|
|
59
|
+
const orchestrateRealizeCorrectCasting = (ctx_1, scenarios_1, authorizations_1, functions_1, progress_1, ...args_1) => __awaiter(void 0, [ctx_1, scenarios_1, authorizations_1, functions_1, progress_1, ...args_1], void 0, function* (ctx, scenarios, authorizations, functions, progress, life = ctx.retry) {
|
|
58
60
|
const validateEvent = yield (0, compileRealizeFiles_1.compileRealizeFiles)(ctx, {
|
|
59
61
|
authorizations,
|
|
60
62
|
functions,
|
|
61
63
|
});
|
|
62
|
-
return predicate(ctx, authorizations, functions, [], progress, validateEvent, life);
|
|
64
|
+
return predicate(ctx, scenarios, authorizations, functions, [], progress, validateEvent, life);
|
|
63
65
|
});
|
|
64
66
|
exports.orchestrateRealizeCorrectCasting = orchestrateRealizeCorrectCasting;
|
|
65
|
-
const predicate = (ctx, authorizations, functions, failures, progress, event, life) => __awaiter(void 0, void 0, void 0, function* () {
|
|
67
|
+
const predicate = (ctx, scenarios, authorizations, functions, failures, progress, event, life) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
68
|
if (event.result.type === "failure") {
|
|
67
69
|
ctx.dispatch(event);
|
|
68
|
-
return yield correct(ctx, authorizations, functions, [...failures, ...event.result.diagnostics], progress, event, life);
|
|
70
|
+
return yield correct(ctx, scenarios, authorizations, functions, [...failures, ...event.result.diagnostics], progress, event, life);
|
|
69
71
|
}
|
|
70
72
|
return functions;
|
|
71
73
|
});
|
|
72
|
-
const correct = (ctx, authorizations, functions, failures, progress, event, life) => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
+
const correct = (ctx, scenarios, authorizations, functions, failures, progress, event, life) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
75
|
// Early returns for non-correctable cases
|
|
74
76
|
if (event.result.type !== "failure" || life < 0) {
|
|
75
77
|
return functions;
|
|
76
78
|
}
|
|
77
79
|
const locations = diagnose(event).filter((l) => functions.map((f) => f.location).includes(l));
|
|
80
|
+
// If no locations to correct, return original functions
|
|
81
|
+
if (locations.length === 0) {
|
|
82
|
+
return functions;
|
|
83
|
+
}
|
|
78
84
|
progress.total += locations.length;
|
|
79
85
|
const converted = yield (0, executeCachedBatch_1.executeCachedBatch)(locations.map((location) => () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
var _a, _b;
|
|
86
|
+
var _a, _b, _c, _d;
|
|
81
87
|
const func = functions.find((f) => f.location === location);
|
|
88
|
+
const scenario = scenarios.find((s) => s.location === func.location);
|
|
89
|
+
const operation = scenario.operation;
|
|
90
|
+
const authorization = authorizations.find((a) => a.role.name === operation.authorizationRole);
|
|
82
91
|
const pointer = {
|
|
83
92
|
value: null,
|
|
84
93
|
};
|
|
85
94
|
const { tokenUsage } = yield ctx.conversate({
|
|
86
95
|
source: "realizeCorrect",
|
|
87
|
-
histories: (0,
|
|
96
|
+
histories: (0, transformRealizeCorrectCastingHistories_1.transformRealizeCorrectCastingHistories)([
|
|
88
97
|
{
|
|
89
98
|
script: func.content,
|
|
90
99
|
diagnostics: failures.filter((d) => d.file === location),
|
|
@@ -111,6 +120,35 @@ const correct = (ctx, authorizations, functions, failures, progress, event, life
|
|
|
111
120
|
|
|
112
121
|
You don't need to explain me anything, but just fix or give it up
|
|
113
122
|
immediately without any hesitation, explanation, and questions.
|
|
123
|
+
|
|
124
|
+
The instruction to write at first was as follows, and the code you received is the code you wrote according to this instruction.
|
|
125
|
+
When modifying, modify the entire code, but not the import statement.
|
|
126
|
+
|
|
127
|
+
Below is template code you wrote:
|
|
128
|
+
|
|
129
|
+
${(0, getRealizeWriteCodeTemplate_1.getRealizeWriteCodeTemplate)({
|
|
130
|
+
scenario,
|
|
131
|
+
schemas: ctx.state().interface.document.components.schemas,
|
|
132
|
+
operation: scenario.operation,
|
|
133
|
+
authorization: authorization !== null && authorization !== void 0 ? authorization : null,
|
|
134
|
+
})}
|
|
135
|
+
|
|
136
|
+
Current code is as follows:
|
|
137
|
+
|
|
138
|
+
\`\`\`typescript
|
|
139
|
+
${func.content}
|
|
140
|
+
\`\`\`
|
|
141
|
+
|
|
142
|
+
Also, never use typia.assert and typia.assertGuard like functions
|
|
143
|
+
to the Prisma types. Your mission is to fix the casting problem of
|
|
144
|
+
primitive types like string or number. Prisma type is not your scope.
|
|
145
|
+
|
|
146
|
+
If you take a mistake that casting the Prisma type with the typia.assert
|
|
147
|
+
function, it would be fallen into the infinite compilation due to extremely
|
|
148
|
+
complicated Prisma type. Note that, the typia.assert function is allowed
|
|
149
|
+
only in the individual property level string or literal type.
|
|
150
|
+
|
|
151
|
+
I repeat that, never assert the Prisma type. It's not your mission.
|
|
114
152
|
`,
|
|
115
153
|
});
|
|
116
154
|
++progress.completed;
|
|
@@ -118,48 +156,75 @@ const correct = (ctx, authorizations, functions, failures, progress, event, life
|
|
|
118
156
|
return { result: "exception", func: func };
|
|
119
157
|
else if (pointer.value === false)
|
|
120
158
|
return { result: "ignore", func: func };
|
|
159
|
+
pointer.value.draft = yield (0, replaceImportStatements_1.replaceImportStatements)(ctx, {
|
|
160
|
+
schemas: ctx.state().interface.document.components.schemas,
|
|
161
|
+
operation: operation,
|
|
162
|
+
code: pointer.value.draft,
|
|
163
|
+
decoratorType: authorization === null || authorization === void 0 ? void 0 : authorization.payload.name,
|
|
164
|
+
});
|
|
165
|
+
if (pointer.value.revise.final)
|
|
166
|
+
pointer.value.revise.final = yield (0, replaceImportStatements_1.replaceImportStatements)(ctx, {
|
|
167
|
+
schemas: ctx.state().interface.document.components.schemas,
|
|
168
|
+
operation: operation,
|
|
169
|
+
code: pointer.value.revise.final,
|
|
170
|
+
decoratorType: authorization === null || authorization === void 0 ? void 0 : authorization.payload.name,
|
|
171
|
+
});
|
|
121
172
|
ctx.dispatch({
|
|
122
173
|
id: (0, uuid_1.v7)(),
|
|
123
174
|
type: "realizeCorrect",
|
|
124
|
-
content: pointer.value.revise.final,
|
|
175
|
+
content: (_a = pointer.value.revise.final) !== null && _a !== void 0 ? _a : pointer.value.draft,
|
|
125
176
|
created_at: new Date().toISOString(),
|
|
126
177
|
location: func.location,
|
|
127
|
-
step: (
|
|
178
|
+
step: (_c = (_b = ctx.state().analyze) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
|
|
128
179
|
tokenUsage,
|
|
129
180
|
completed: progress.completed,
|
|
130
181
|
total: progress.total,
|
|
131
182
|
});
|
|
132
183
|
return {
|
|
133
184
|
result: "success",
|
|
134
|
-
func: Object.assign(Object.assign({}, func), { content: pointer.value.revise.final }),
|
|
185
|
+
func: Object.assign(Object.assign({}, func), { content: (_d = pointer.value.revise.final) !== null && _d !== void 0 ? _d : pointer.value.draft }),
|
|
135
186
|
};
|
|
136
187
|
})));
|
|
188
|
+
// Get functions that were not modified (not in locations array)
|
|
189
|
+
const unchangedFunctions = functions.filter((f) => !locations.includes(f.location));
|
|
190
|
+
// Merge converted functions with unchanged functions for validation
|
|
191
|
+
const allFunctionsForValidation = [
|
|
192
|
+
...converted.map((c) => c.func),
|
|
193
|
+
...unchangedFunctions,
|
|
194
|
+
];
|
|
137
195
|
const newValidate = yield (0, compileRealizeFiles_1.compileRealizeFiles)(ctx, {
|
|
138
196
|
authorizations,
|
|
139
|
-
functions:
|
|
197
|
+
functions: allFunctionsForValidation,
|
|
140
198
|
});
|
|
141
|
-
|
|
142
|
-
|
|
199
|
+
const newResult = newValidate.result;
|
|
200
|
+
if (newResult.type === "success") {
|
|
201
|
+
return allFunctionsForValidation;
|
|
202
|
+
}
|
|
203
|
+
else if (newResult.type === "exception") {
|
|
204
|
+
// Compilation exception, return current functions. because retrying won't help.
|
|
205
|
+
return functions;
|
|
206
|
+
}
|
|
207
|
+
if (newResult.diagnostics.every((d) => { var _a; return !((_a = d.file) === null || _a === void 0 ? void 0 : _a.startsWith("src/providers")); })) {
|
|
208
|
+
// No diagnostics related to provider functions, stop correcting
|
|
209
|
+
return allFunctionsForValidation;
|
|
143
210
|
}
|
|
144
211
|
const newLocations = diagnose(newValidate);
|
|
145
212
|
// Separate successful, failed, and ignored corrections
|
|
146
213
|
const { success, failed, ignored } = separateCorrectionResults(converted, newLocations);
|
|
147
|
-
// If no failures to retry, return
|
|
214
|
+
// If no failures to retry, return all functions
|
|
148
215
|
if (failed.length === 0) {
|
|
149
|
-
return [...success, ...ignored];
|
|
216
|
+
return [...success, ...ignored, ...unchangedFunctions];
|
|
150
217
|
}
|
|
151
218
|
// Collect diagnostics relevant to failed functions
|
|
152
219
|
const failedLocations = failed.map((f) => f.location);
|
|
153
220
|
const allDiagnostics = [
|
|
154
221
|
...failures,
|
|
155
|
-
...(
|
|
156
|
-
? newValidate.result.diagnostics
|
|
157
|
-
: []),
|
|
222
|
+
...(newResult.type === "failure" ? newResult.diagnostics : []),
|
|
158
223
|
];
|
|
159
224
|
const relevantDiagnostics = filterRelevantDiagnostics(allDiagnostics, failedLocations);
|
|
160
225
|
// Recursively retry failed functions
|
|
161
|
-
const retriedFunctions = yield predicate(ctx, authorizations, failed, relevantDiagnostics, progress, newValidate, life - 1);
|
|
162
|
-
return [...success, ...ignored, ...retriedFunctions];
|
|
226
|
+
const retriedFunctions = yield predicate(ctx, scenarios, authorizations, failed, relevantDiagnostics, progress, newValidate, life - 1);
|
|
227
|
+
return [...success, ...ignored, ...retriedFunctions, ...unchangedFunctions];
|
|
163
228
|
});
|
|
164
229
|
/**
|
|
165
230
|
* Extract unique file locations from validation event diagnostics
|
|
@@ -236,11 +301,11 @@ const collection = {
|
|
|
236
301
|
{
|
|
237
302
|
name: "rewrite",
|
|
238
303
|
parameters: {
|
|
239
|
-
description: " - The analysis and correction properties\n\n------------------------------\n\
|
|
304
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Review and finalization of type casting corrections.\n> \n> Contains the review of applied corrections and the final code with all\n> type casting issues resolved while preserving type safety and validation\n> intent.",
|
|
240
305
|
type: "object",
|
|
241
306
|
properties: {
|
|
242
307
|
think: {
|
|
243
|
-
description: "Initial analysis of the type casting or assignment error.\n\nContains the agent's analysis of the specific type mismatch pattern:\n\n- Type of casting error (tag incompatibility, nullable assignment, literal
|
|
308
|
+
description: "Initial analysis of the type casting or assignment error.\n\nContains the agent's analysis of the specific type mismatch pattern:\n\n- Type of casting error (tag incompatibility, nullable assignment, literal\n type conversion, etc.)\n- Whether nullable or undefined types are involved\n- If Date to string conversions are needed\n- The chosen fix strategy for the specific error type",
|
|
244
309
|
type: "string"
|
|
245
310
|
},
|
|
246
311
|
draft: {
|
|
@@ -259,7 +324,6 @@ const collection = {
|
|
|
259
324
|
additionalProperties: false,
|
|
260
325
|
$defs: {
|
|
261
326
|
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
262
|
-
description: "Properties for the revision phase of type casting corrections.",
|
|
263
327
|
type: "object",
|
|
264
328
|
properties: {
|
|
265
329
|
review: {
|
|
@@ -267,8 +331,15 @@ const collection = {
|
|
|
267
331
|
type: "string"
|
|
268
332
|
},
|
|
269
333
|
final: {
|
|
270
|
-
description: "Final corrected code with all type casting issues resolved.\n\nThe complete code ready for TypeScript compilation, with all type casting\nand assignment errors properly fixed using appropriate patterns while\nmaintaining type safety and the original validation logic.",
|
|
271
|
-
|
|
334
|
+
description: "Final corrected code with all type casting issues resolved.\n\nThe complete code ready for TypeScript compilation, with all type casting\nand assignment errors properly fixed using appropriate patterns while\nmaintaining type safety and the original validation logic. When the draft\nalready successfully resolves all type casting issues with no problems\nfound during review, this value can be null, indicating no further\nrefinements are necessary.\n\nA `null` value signifies the draft corrections were already optimal and\nrequire no additional modifications.",
|
|
335
|
+
anyOf: [
|
|
336
|
+
{
|
|
337
|
+
type: "null"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
type: "string"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
272
343
|
}
|
|
273
344
|
},
|
|
274
345
|
required: [
|
|
@@ -278,8 +349,8 @@ const collection = {
|
|
|
278
349
|
}
|
|
279
350
|
}
|
|
280
351
|
},
|
|
281
|
-
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or
|
|
282
|
-
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
352
|
+
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or\nassignment related compilation error patterns.\n\nThe agent applies various fix strategies based on the error type:\n\n- **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to\n strip incompatible tags, or `typia.assert<T>()` as a last resort\n- **Date conversions**: Uses `.toISOString()` method for Date to string\n conversions\n- **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&\n !== undefined)\n- **typia.assert vs assertGuard**: Uses assert for value assignment,\n assertGuard for type narrowing\n- **Literal type conversions**: Uses `typia.assert<T>()` for runtime\n validation\n- **Optional chaining results**: Uses `=== true` or `??` operators\n- **\"No overlap\" errors**: Removes redundant comparisons",
|
|
353
|
+
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
283
354
|
path: _path + ".think",
|
|
284
355
|
expected: "string",
|
|
285
356
|
value: input.think
|
|
@@ -299,9 +370,9 @@ const collection = {
|
|
|
299
370
|
path: _path + ".review",
|
|
300
371
|
expected: "string",
|
|
301
372
|
value: input.review
|
|
302
|
-
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
373
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
303
374
|
path: _path + ".final",
|
|
304
|
-
expected: "string",
|
|
375
|
+
expected: "(null | string)",
|
|
305
376
|
value: input.final
|
|
306
377
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
307
378
|
if (false === __is(input)) {
|
|
@@ -341,7 +412,7 @@ const collection = {
|
|
|
341
412
|
required: [],
|
|
342
413
|
$defs: {}
|
|
343
414
|
},
|
|
344
|
-
description: "Reject function when error is not related to type casting or assignment.\n\nThis function is called when the compilation error is unrelated to type
|
|
415
|
+
description: "Reject function when error is not related to type casting or assignment.\n\nThis function is called when the compilation error is unrelated to type\ncasting issues (e.g., missing imports, syntax errors, undefined variables),\nindicating the error should be handled by a different agent.",
|
|
345
416
|
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
346
417
|
if (false === __is(input)) {
|
|
347
418
|
errors = [];
|
|
@@ -375,11 +446,11 @@ const collection = {
|
|
|
375
446
|
{
|
|
376
447
|
name: "rewrite",
|
|
377
448
|
parameters: {
|
|
378
|
-
description: " - The analysis and correction properties\n\n------------------------------\n\
|
|
449
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}",
|
|
379
450
|
type: "object",
|
|
380
451
|
properties: {
|
|
381
452
|
think: {
|
|
382
|
-
description: "Initial analysis of the type casting or assignment error.\n\nContains the agent's analysis of the specific type mismatch pattern:\n\n- Type of casting error (tag incompatibility, nullable assignment, literal
|
|
453
|
+
description: "Initial analysis of the type casting or assignment error.\n\nContains the agent's analysis of the specific type mismatch pattern:\n\n- Type of casting error (tag incompatibility, nullable assignment, literal\n type conversion, etc.)\n- Whether nullable or undefined types are involved\n- If Date to string conversions are needed\n- The chosen fix strategy for the specific error type",
|
|
383
454
|
type: "string"
|
|
384
455
|
},
|
|
385
456
|
draft: {
|
|
@@ -387,7 +458,7 @@ const collection = {
|
|
|
387
458
|
type: "string"
|
|
388
459
|
},
|
|
389
460
|
revise: {
|
|
390
|
-
description: "Review and finalization of type casting corrections.\n\nContains the review of applied corrections and the final code with all\ntype casting issues resolved while preserving type safety and validation
|
|
461
|
+
description: "Review and finalization of type casting corrections.\n\nContains the review of applied corrections and the final code with all\ntype casting issues resolved while preserving type safety and validation\nintent.",
|
|
391
462
|
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
392
463
|
}
|
|
393
464
|
},
|
|
@@ -399,7 +470,6 @@ const collection = {
|
|
|
399
470
|
additionalProperties: false,
|
|
400
471
|
$defs: {
|
|
401
472
|
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
402
|
-
description: "Properties for the revision phase of type casting corrections.",
|
|
403
473
|
type: "object",
|
|
404
474
|
properties: {
|
|
405
475
|
review: {
|
|
@@ -407,8 +477,15 @@ const collection = {
|
|
|
407
477
|
type: "string"
|
|
408
478
|
},
|
|
409
479
|
final: {
|
|
410
|
-
description: "Final corrected code with all type casting issues resolved.\n\nThe complete code ready for TypeScript compilation, with all type casting\nand assignment errors properly fixed using appropriate patterns while\nmaintaining type safety and the original validation logic.",
|
|
411
|
-
|
|
480
|
+
description: "Final corrected code with all type casting issues resolved.\n\nThe complete code ready for TypeScript compilation, with all type casting\nand assignment errors properly fixed using appropriate patterns while\nmaintaining type safety and the original validation logic. When the draft\nalready successfully resolves all type casting issues with no problems\nfound during review, this value can be null, indicating no further\nrefinements are necessary.\n\nA `null` value signifies the draft corrections were already optimal and\nrequire no additional modifications.",
|
|
481
|
+
oneOf: [
|
|
482
|
+
{
|
|
483
|
+
type: "null"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
type: "string"
|
|
487
|
+
}
|
|
488
|
+
]
|
|
412
489
|
}
|
|
413
490
|
},
|
|
414
491
|
required: [
|
|
@@ -418,8 +495,8 @@ const collection = {
|
|
|
418
495
|
}
|
|
419
496
|
}
|
|
420
497
|
},
|
|
421
|
-
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or
|
|
422
|
-
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
498
|
+
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or\nassignment related compilation error patterns.\n\nThe agent applies various fix strategies based on the error type:\n\n- **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to\n strip incompatible tags, or `typia.assert<T>()` as a last resort\n- **Date conversions**: Uses `.toISOString()` method for Date to string\n conversions\n- **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&\n !== undefined)\n- **typia.assert vs assertGuard**: Uses assert for value assignment,\n assertGuard for type narrowing\n- **Literal type conversions**: Uses `typia.assert<T>()` for runtime\n validation\n- **Optional chaining results**: Uses `=== true` or `??` operators\n- **\"No overlap\" errors**: Removes redundant comparisons",
|
|
499
|
+
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
423
500
|
path: _path + ".think",
|
|
424
501
|
expected: "string",
|
|
425
502
|
value: input.think
|
|
@@ -439,9 +516,9 @@ const collection = {
|
|
|
439
516
|
path: _path + ".review",
|
|
440
517
|
expected: "string",
|
|
441
518
|
value: input.review
|
|
442
|
-
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
519
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
443
520
|
path: _path + ".final",
|
|
444
|
-
expected: "string",
|
|
521
|
+
expected: "(null | string)",
|
|
445
522
|
value: input.final
|
|
446
523
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
447
524
|
if (false === __is(input)) {
|
|
@@ -481,7 +558,7 @@ const collection = {
|
|
|
481
558
|
required: [],
|
|
482
559
|
$defs: {}
|
|
483
560
|
},
|
|
484
|
-
description: "Reject function when error is not related to type casting or assignment.\n\nThis function is called when the compilation error is unrelated to type
|
|
561
|
+
description: "Reject function when error is not related to type casting or assignment.\n\nThis function is called when the compilation error is unrelated to type\ncasting issues (e.g., missing imports, syntax errors, undefined variables),\nindicating the error should be handled by a different agent.",
|
|
485
562
|
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
486
563
|
if (false === __is(input)) {
|
|
487
564
|
errors = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestRateRealizeCorrectCasting.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,yCAA2C;AAG3C,kDAA0B;AAC1B,+BAA0B;AAG1B,uEAAoE;AACpE,uEAAoE;
|
|
1
|
+
{"version":3,"file":"orchestRateRealizeCorrectCasting.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,yCAA2C;AAG3C,kDAA0B;AAC1B,+BAA0B;AAG1B,uEAAoE;AACpE,uEAAoE;AAEpE,iHAA8G;AAC9G,wEAAqE;AAErE,qFAAkF;AAClF,6EAA0E;AAQnE,MAAM,gCAAgC,GAAG,2EASZ,EAAE,kHANpC,GAAyB,EACzB,SAAyC,EACzC,cAA4C,EAC5C,SAAkC,EAClC,QAAiC,EACjC,OAAe,GAAG,CAAC,KAAK;IAExB,MAAM,aAAa,GAA+B,MAAM,IAAA,yCAAmB,EACzE,GAAG,EACH;QACE,cAAc;QACd,SAAS;KACV,CACF,CAAC;IACF,OAAO,SAAS,CACd,GAAG,EACH,SAAS,EACT,cAAc,EACd,SAAS,EACT,EAAE,EACF,QAAQ,EACR,aAAa,EACb,IAAI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AAE,CAAC,IAAI,EAAE,EAAE;gBAChB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,CAAC;SAC+C;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAGJ;IACH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAGH;CACJ,CAAC"}
|
|
@@ -17,14 +17,13 @@ const compileRealizeFiles_1 = require("./internal/compileRealizeFiles");
|
|
|
17
17
|
const orchestRateRealizeCorrectCasting_1 = require("./orchestRateRealizeCorrectCasting");
|
|
18
18
|
const orchestrateRealizeAuthorization_1 = require("./orchestrateRealizeAuthorization");
|
|
19
19
|
const orchestrateRealizeCorrect_1 = require("./orchestrateRealizeCorrect");
|
|
20
|
-
const orchestrateRealizeCorrectDate_1 = require("./orchestrateRealizeCorrectDate");
|
|
21
20
|
const orchestrateRealizeWrite_1 = require("./orchestrateRealizeWrite");
|
|
22
21
|
const generateRealizeScenario_1 = require("./utils/generateRealizeScenario");
|
|
23
22
|
const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
23
|
var _a, _b, _c, _d, _e;
|
|
25
24
|
// PREDICATION
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
25
|
+
const document = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document;
|
|
26
|
+
if (document === undefined)
|
|
28
27
|
throw new Error("Can't do realize agent because operations are nothing.");
|
|
29
28
|
const start = new Date();
|
|
30
29
|
const predicate = (0, predicateStateMessage_1.predicateStateMessage)(ctx.state(), "realize");
|
|
@@ -40,75 +39,106 @@ const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0,
|
|
|
40
39
|
type: "realizeStart",
|
|
41
40
|
id: (0, uuid_1.v7)(),
|
|
42
41
|
created_at: start.toISOString(),
|
|
43
|
-
reason: props.
|
|
42
|
+
reason: props.instruction,
|
|
44
43
|
step: (_c = (_b = ctx.state().test) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
|
|
45
44
|
});
|
|
46
|
-
//
|
|
45
|
+
// PREPARE ASSETS
|
|
46
|
+
const compiler = yield ctx.compiler();
|
|
47
47
|
const authorizations = yield (0, orchestrateRealizeAuthorization_1.orchestrateRealizeAuthorization)(ctx);
|
|
48
|
-
// SCENARIOS
|
|
49
|
-
const scenarios = operations.map((operation) => (0, generateRealizeScenario_1.generateRealizeScenario)(ctx, operation, authorizations));
|
|
50
48
|
const writeProgress = {
|
|
51
|
-
total:
|
|
49
|
+
total: document.operations.length,
|
|
52
50
|
completed: 0,
|
|
53
51
|
};
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
const correctProgress = {
|
|
53
|
+
total: document.operations.length,
|
|
54
|
+
completed: 0,
|
|
55
|
+
};
|
|
56
|
+
const process = (artifacts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
+
const writes = (yield (0, executeCachedBatch_1.executeCachedBatch)(artifacts.map((art) => (promptCacheKey) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
+
var _a;
|
|
59
|
+
const props = {
|
|
60
|
+
totalAuthorizations: authorizations,
|
|
61
|
+
authorization: (_a = art.decoratorEvent) !== null && _a !== void 0 ? _a : null,
|
|
62
|
+
scenario: art,
|
|
63
|
+
document,
|
|
64
|
+
progress: writeProgress,
|
|
65
|
+
promptCacheKey,
|
|
66
|
+
};
|
|
67
|
+
try {
|
|
68
|
+
return yield (0, orchestrateRealizeWrite_1.orchestrateRealizeWrite)(ctx, props);
|
|
69
|
+
}
|
|
70
|
+
catch (_b) {
|
|
71
|
+
try {
|
|
72
|
+
return yield (0, orchestrateRealizeWrite_1.orchestrateRealizeWrite)(ctx, props);
|
|
73
|
+
}
|
|
74
|
+
catch (_c) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
})))).filter((w) => w !== null);
|
|
79
|
+
const functions = Object.entries(Object.fromEntries(writes.map((w) => [w.location, w.content]))).map(([location, content]) => {
|
|
80
|
+
const scenario = artifacts.find((el) => el.location === location);
|
|
81
|
+
return {
|
|
82
|
+
location,
|
|
83
|
+
content,
|
|
84
|
+
endpoint: {
|
|
85
|
+
method: scenario.operation.method,
|
|
86
|
+
path: scenario.operation.path,
|
|
87
|
+
},
|
|
88
|
+
name: scenario.functionName,
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const corrected = yield (0, orchestRateRealizeCorrectCasting_1.orchestrateRealizeCorrectCasting)(ctx, artifacts, authorizations, functions, correctProgress).then((res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
92
|
+
return yield (0, orchestrateRealizeCorrect_1.orchestrateRealizeCorrect)(ctx, artifacts, authorizations, res, [], correctProgress);
|
|
93
|
+
}));
|
|
94
|
+
const validate = yield (0, compileRealizeFiles_1.compileRealizeFiles)(ctx, {
|
|
95
|
+
authorizations,
|
|
96
|
+
functions: corrected,
|
|
65
97
|
});
|
|
66
|
-
return code;
|
|
67
|
-
})));
|
|
68
|
-
const functions = Object.entries(Object.fromEntries(writeEvents
|
|
69
|
-
.filter((w) => w !== null)
|
|
70
|
-
.map((event) => [event.location, event.content]))).map(([location, content]) => {
|
|
71
|
-
const scenario = scenarios.find((el) => el.location === location);
|
|
72
98
|
return {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
endpoint: {
|
|
76
|
-
method: scenario.operation.method,
|
|
77
|
-
path: scenario.operation.path,
|
|
78
|
-
},
|
|
79
|
-
name: scenario.functionName,
|
|
99
|
+
corrected,
|
|
100
|
+
validate,
|
|
80
101
|
};
|
|
81
102
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
// SCENARIOS
|
|
104
|
+
const entireScenarios = document.operations.map((operation) => (0, generateRealizeScenario_1.generateRealizeScenario)(ctx, operation, authorizations));
|
|
105
|
+
let bucket = yield process(entireScenarios);
|
|
106
|
+
for (let i = 0; i < 2; ++i) {
|
|
107
|
+
if (bucket.validate.result.type !== "failure")
|
|
108
|
+
break;
|
|
109
|
+
const failedScenarios = Array.from(new Set(bucket.validate.result.diagnostics.map((f) => f.file)))
|
|
110
|
+
.map((location) => bucket.corrected.find((f) => f.location === location))
|
|
111
|
+
.filter((f) => f !== undefined)
|
|
112
|
+
.map((f) => entireScenarios.find((s) => s.operation.path === f.endpoint.path &&
|
|
113
|
+
s.operation.method === f.endpoint.method))
|
|
114
|
+
.filter((o) => o !== undefined);
|
|
115
|
+
if (failedScenarios.length === 0)
|
|
116
|
+
break;
|
|
117
|
+
writeProgress.total += failedScenarios.length;
|
|
118
|
+
correctProgress.total += failedScenarios.length;
|
|
119
|
+
const newBucket = yield process(failedScenarios);
|
|
120
|
+
const corrected = new Map([
|
|
121
|
+
...bucket.corrected.map((f) => [f.location, f]),
|
|
122
|
+
...newBucket.corrected.map((f) => [f.location, f]),
|
|
123
|
+
]);
|
|
124
|
+
bucket = {
|
|
125
|
+
corrected: Array.from(corrected.values()),
|
|
126
|
+
validate: newBucket.validate,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
95
129
|
const controllers = yield compiler.realize.controller({
|
|
96
130
|
document: ctx.state().interface.document,
|
|
97
|
-
functions:
|
|
98
|
-
authorizations,
|
|
99
|
-
});
|
|
100
|
-
const { result } = yield (0, compileRealizeFiles_1.compileRealizeFiles)(ctx, {
|
|
131
|
+
functions: bucket.corrected,
|
|
101
132
|
authorizations,
|
|
102
|
-
functions: totalCorrected,
|
|
103
133
|
});
|
|
104
134
|
return ctx.dispatch({
|
|
105
135
|
type: "realizeComplete",
|
|
106
136
|
id: (0, uuid_1.v7)(),
|
|
107
137
|
created_at: new Date().toISOString(),
|
|
108
|
-
functions,
|
|
138
|
+
functions: bucket.corrected,
|
|
109
139
|
authorizations,
|
|
110
140
|
controllers,
|
|
111
|
-
compiled: result,
|
|
141
|
+
compiled: bucket.validate.result,
|
|
112
142
|
step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
113
143
|
elapsed: new Date().getTime() - start.getTime(),
|
|
114
144
|
});
|