@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,60 +0,0 @@
|
|
|
1
|
-
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import { StringUtil } from "@autobe/utils";
|
|
4
|
-
import { v7 } from "uuid";
|
|
5
|
-
|
|
6
|
-
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
|
-
|
|
8
|
-
interface IFailure {
|
|
9
|
-
diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[];
|
|
10
|
-
script: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** Transform date correction histories for AI conversation */
|
|
14
|
-
export const transformCommonCorrectDateHistories = (
|
|
15
|
-
failures: IFailure[],
|
|
16
|
-
): Array<
|
|
17
|
-
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
18
|
-
> => [
|
|
19
|
-
{
|
|
20
|
-
id: v7(),
|
|
21
|
-
created_at: new Date().toISOString(),
|
|
22
|
-
type: "systemMessage",
|
|
23
|
-
text: AutoBeSystemPromptConstant.REALIZE_DATE,
|
|
24
|
-
},
|
|
25
|
-
...failures.map(
|
|
26
|
-
(f, i, array) =>
|
|
27
|
-
({
|
|
28
|
-
id: v7(),
|
|
29
|
-
created_at: new Date().toISOString(),
|
|
30
|
-
type: "assistantMessage",
|
|
31
|
-
text: StringUtil.trim`
|
|
32
|
-
# ${i === array.length - 1 ? "Latest Date Type Failure" : "Previous Date Type Failure"}
|
|
33
|
-
|
|
34
|
-
## Generated TypeScript Code
|
|
35
|
-
\`\`\`typescript
|
|
36
|
-
${f.script}
|
|
37
|
-
\`\`\`
|
|
38
|
-
|
|
39
|
-
## Date-Related Compile Errors
|
|
40
|
-
${f.diagnostics
|
|
41
|
-
.map((d) => {
|
|
42
|
-
const location = d.file
|
|
43
|
-
? `[${d.file}${d.start ? `:${d.start}` : ""}]`
|
|
44
|
-
: "[Unknown location]";
|
|
45
|
-
const code = d.code ? `TS${d.code}` : "";
|
|
46
|
-
const messageText = d.messageText || "Date type error";
|
|
47
|
-
return `- ${location} ${code}: ${messageText}`;
|
|
48
|
-
})
|
|
49
|
-
.join("\n")}
|
|
50
|
-
|
|
51
|
-
## Required Fixes:
|
|
52
|
-
- Replace all Date type declarations with string & tags.Format<"date-time">
|
|
53
|
-
- Wrap Date objects with toISOStringSafe(value)
|
|
54
|
-
- Check null/undefined BEFORE calling toISOStringSafe (it doesn't accept null)
|
|
55
|
-
- Remove Date variable declarations (const now = new Date() is forbidden)
|
|
56
|
-
- toISOStringSafe requires a parameter - it's not optional
|
|
57
|
-
`,
|
|
58
|
-
}) satisfies IAgenticaHistoryJson.IAssistantMessage,
|
|
59
|
-
),
|
|
60
|
-
];
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import typia from "typia";
|
|
2
|
-
|
|
3
|
-
/** Application interface for Date type correction in generated code */
|
|
4
|
-
export interface IAutoBeCommonCorrectDateApplication {
|
|
5
|
-
/**
|
|
6
|
-
* Rewrite the function to fix Date type issues
|
|
7
|
-
*
|
|
8
|
-
* @param props - Correction properties
|
|
9
|
-
*/
|
|
10
|
-
rewrite(props: IAutoBeCommonCorrectDateApplication.IProps): void;
|
|
11
|
-
|
|
12
|
-
/** Reject the correction task if Date issues cannot be fixed */
|
|
13
|
-
reject(): void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export namespace IAutoBeCommonCorrectDateApplication {
|
|
17
|
-
/** Properties for Date type correction */
|
|
18
|
-
export interface IProps {
|
|
19
|
-
/** The correction revision containing the fixed code */
|
|
20
|
-
revise: {
|
|
21
|
-
/** Optional: Analysis of Date type errors found */
|
|
22
|
-
analysis?: string & typia.tags.MaxLength<4000>;
|
|
23
|
-
|
|
24
|
-
/** Optional: Strategy for fixing Date issues */
|
|
25
|
-
strategy?: string & typia.tags.MaxLength<2000>;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Final corrected code with all Date type issues resolved
|
|
29
|
-
*
|
|
30
|
-
* Must follow these rules:
|
|
31
|
-
*
|
|
32
|
-
* - No ': Date' type declarations
|
|
33
|
-
* - All dates use 'string & tags.Format<"date-time">'
|
|
34
|
-
* - All Date objects wrapped with toISOStringSafe()
|
|
35
|
-
* - Null checks before toISOStringSafe()
|
|
36
|
-
*/
|
|
37
|
-
final: string;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
-
import { hash } from "tstl";
|
|
3
|
-
|
|
4
|
-
export namespace OpenApiEndpointComparator {
|
|
5
|
-
export function hashCode(e: AutoBeOpenApi.IEndpoint): number {
|
|
6
|
-
return hash(e.path, e.method);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function equals(
|
|
10
|
-
x: AutoBeOpenApi.IEndpoint,
|
|
11
|
-
y: AutoBeOpenApi.IEndpoint,
|
|
12
|
-
): boolean {
|
|
13
|
-
return x.path === y.path && x.method === y.method;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function compare(
|
|
17
|
-
x: AutoBeOpenApi.IEndpoint,
|
|
18
|
-
y: AutoBeOpenApi.IEndpoint,
|
|
19
|
-
): number {
|
|
20
|
-
if (x.path !== y.path) return x.path.localeCompare(y.path);
|
|
21
|
-
return x.method.localeCompare(y.method);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutoBeProgressEventBase,
|
|
3
|
-
AutoBeRealizeAuthorization,
|
|
4
|
-
AutoBeRealizeFunction,
|
|
5
|
-
AutoBeRealizeValidateEvent,
|
|
6
|
-
IAutoBeTypeScriptCompileResult,
|
|
7
|
-
} from "@autobe/interface";
|
|
8
|
-
import { StringUtil } from "@autobe/utils";
|
|
9
|
-
import { ILlmApplication, ILlmController, ILlmSchema } from "@samchon/openapi";
|
|
10
|
-
import { IPointer } from "tstl";
|
|
11
|
-
import typia from "typia";
|
|
12
|
-
import { v7 } from "uuid";
|
|
13
|
-
|
|
14
|
-
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
15
|
-
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
16
|
-
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
17
|
-
import { transformCommonCorrectDateHistories } from "../common/histories/transformCommonCorrectDateHistories";
|
|
18
|
-
import { IAutoBeCommonCorrectDateApplication } from "../common/structures/IAutoBeCommonCorrectDateApplication";
|
|
19
|
-
import { compileRealizeFiles } from "./internal/compileRealizeFiles";
|
|
20
|
-
|
|
21
|
-
/** Result of attempting to correct a single function */
|
|
22
|
-
type CorrectionResult = {
|
|
23
|
-
result: "success" | "ignore" | "exception";
|
|
24
|
-
func: AutoBeRealizeFunction;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const orchestrateRealizeCorrectDate = async <
|
|
28
|
-
Model extends ILlmSchema.Model,
|
|
29
|
-
>(
|
|
30
|
-
ctx: AutoBeContext<Model>,
|
|
31
|
-
authorizations: AutoBeRealizeAuthorization[],
|
|
32
|
-
functions: AutoBeRealizeFunction[],
|
|
33
|
-
progress: AutoBeProgressEventBase,
|
|
34
|
-
life: number = ctx.retry,
|
|
35
|
-
): Promise<AutoBeRealizeFunction[]> => {
|
|
36
|
-
const validateEvent: AutoBeRealizeValidateEvent = await compileRealizeFiles(
|
|
37
|
-
ctx,
|
|
38
|
-
{
|
|
39
|
-
authorizations,
|
|
40
|
-
functions,
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
return predicate(
|
|
45
|
-
ctx,
|
|
46
|
-
authorizations,
|
|
47
|
-
functions,
|
|
48
|
-
[],
|
|
49
|
-
progress,
|
|
50
|
-
validateEvent,
|
|
51
|
-
life,
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const predicate = async <Model extends ILlmSchema.Model>(
|
|
56
|
-
ctx: AutoBeContext<Model>,
|
|
57
|
-
authorizations: AutoBeRealizeAuthorization[],
|
|
58
|
-
functions: AutoBeRealizeFunction[],
|
|
59
|
-
failures: IAutoBeTypeScriptCompileResult.IDiagnostic[],
|
|
60
|
-
progress: AutoBeProgressEventBase,
|
|
61
|
-
event: AutoBeRealizeValidateEvent,
|
|
62
|
-
life: number,
|
|
63
|
-
): Promise<AutoBeRealizeFunction[]> => {
|
|
64
|
-
if (event.result.type === "failure") {
|
|
65
|
-
ctx.dispatch(event);
|
|
66
|
-
|
|
67
|
-
return await correct(
|
|
68
|
-
ctx,
|
|
69
|
-
authorizations,
|
|
70
|
-
functions,
|
|
71
|
-
[...failures, ...event.result.diagnostics],
|
|
72
|
-
progress,
|
|
73
|
-
event,
|
|
74
|
-
life,
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
return functions;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const correct = async <Model extends ILlmSchema.Model>(
|
|
81
|
-
ctx: AutoBeContext<Model>,
|
|
82
|
-
authorizations: AutoBeRealizeAuthorization[],
|
|
83
|
-
functions: AutoBeRealizeFunction[],
|
|
84
|
-
failures: IAutoBeTypeScriptCompileResult.IDiagnostic[],
|
|
85
|
-
progress: AutoBeProgressEventBase,
|
|
86
|
-
event: AutoBeRealizeValidateEvent,
|
|
87
|
-
life: number,
|
|
88
|
-
): Promise<AutoBeRealizeFunction[]> => {
|
|
89
|
-
// Early returns for non-correctable cases
|
|
90
|
-
if (event.result.type !== "failure" || life < 0) {
|
|
91
|
-
return functions;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Filter only Date-related errors
|
|
95
|
-
const dateErrors = filterDateErrors(failures);
|
|
96
|
-
const locations: string[] = diagnose(event).filter(
|
|
97
|
-
(l) =>
|
|
98
|
-
functions.map((f) => f.location).includes(l) &&
|
|
99
|
-
dateErrors.some((e) => e.file === l),
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
// If no date errors found, return original functions
|
|
103
|
-
if (locations.length === 0) {
|
|
104
|
-
return functions;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
progress.total += locations.length;
|
|
108
|
-
|
|
109
|
-
const converted: CorrectionResult[] = await executeCachedBatch(
|
|
110
|
-
locations.map((location) => async (): Promise<CorrectionResult> => {
|
|
111
|
-
const func: AutoBeRealizeFunction = functions.find(
|
|
112
|
-
(f) => f.location === location,
|
|
113
|
-
)!;
|
|
114
|
-
|
|
115
|
-
const pointer: IPointer<
|
|
116
|
-
IAutoBeCommonCorrectDateApplication.IProps | false | null
|
|
117
|
-
> = {
|
|
118
|
-
value: null,
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const { tokenUsage } = await ctx.conversate({
|
|
122
|
-
source: "realizeCorrect",
|
|
123
|
-
histories: transformCommonCorrectDateHistories([
|
|
124
|
-
{
|
|
125
|
-
script: func.content,
|
|
126
|
-
diagnostics: dateErrors.filter((d) => d.file === location),
|
|
127
|
-
},
|
|
128
|
-
]),
|
|
129
|
-
controller: createController({
|
|
130
|
-
model: ctx.model,
|
|
131
|
-
then: (next) => {
|
|
132
|
-
pointer.value = next;
|
|
133
|
-
},
|
|
134
|
-
reject: () => {
|
|
135
|
-
pointer.value = false;
|
|
136
|
-
},
|
|
137
|
-
}),
|
|
138
|
-
enforceFunctionCall: true,
|
|
139
|
-
message: StringUtil.trim`
|
|
140
|
-
Fix ALL Date type problems in this code following these ABSOLUTE RULES:
|
|
141
|
-
|
|
142
|
-
🔴 CRITICAL DATE TYPE RULES:
|
|
143
|
-
1. NEVER declare variables with ': Date' type
|
|
144
|
-
2. NEVER use 'Date' as return type or parameter type
|
|
145
|
-
3. ALWAYS use 'string & tags.Format<"date-time">' for date type declarations
|
|
146
|
-
4. Use toISOStringSafe() to convert Date or string to ISO format
|
|
147
|
-
5. toISOStringSafe() REQUIRES a parameter - it's NOT optional
|
|
148
|
-
|
|
149
|
-
📅 toISOStringSafe FUNCTION SIGNATURE:
|
|
150
|
-
function toISOStringSafe(
|
|
151
|
-
value: Date | (string & tags.Format<"date-time">)
|
|
152
|
-
): string & tags.Format<"date-time">
|
|
153
|
-
|
|
154
|
-
Note: This function CANNOT accept null or undefined!
|
|
155
|
-
|
|
156
|
-
📅 CORRECT PATTERNS:
|
|
157
|
-
- Creating timestamps: toISOStringSafe(new Date())
|
|
158
|
-
- Converting nullable dates: value ? toISOStringSafe(value) : null
|
|
159
|
-
- Converting strings: toISOStringSafe(dateString)
|
|
160
|
-
- Type declarations: string & tags.Format<'date-time'>
|
|
161
|
-
- Never store Date in variables: const now = new Date() is FORBIDDEN
|
|
162
|
-
|
|
163
|
-
🚨 COMMON ERRORS TO FIX:
|
|
164
|
-
- Type 'Date' is not assignable → Use toISOStringSafe()
|
|
165
|
-
- Direct Date assignment → Wrap with toISOStringSafe()
|
|
166
|
-
- Date type in function signature → Change to string & tags.Format<'date-time'>
|
|
167
|
-
- For nullable values → Check null BEFORE calling toISOStringSafe()
|
|
168
|
-
|
|
169
|
-
Fix these Date type issues immediately. If you cannot fix them, reject the task.
|
|
170
|
-
Do not explain, just fix the code or give up.
|
|
171
|
-
`,
|
|
172
|
-
});
|
|
173
|
-
++progress.completed;
|
|
174
|
-
if (pointer.value === null)
|
|
175
|
-
return { result: "exception" as const, func: func };
|
|
176
|
-
else if (pointer.value === false)
|
|
177
|
-
return { result: "ignore" as const, func: func };
|
|
178
|
-
|
|
179
|
-
ctx.dispatch({
|
|
180
|
-
id: v7(),
|
|
181
|
-
type: "realizeCorrect",
|
|
182
|
-
content: pointer.value.revise.final,
|
|
183
|
-
created_at: new Date().toISOString(),
|
|
184
|
-
location: func.location,
|
|
185
|
-
step: ctx.state().analyze?.step ?? 0,
|
|
186
|
-
tokenUsage,
|
|
187
|
-
completed: progress.completed,
|
|
188
|
-
total: progress.total,
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
return {
|
|
192
|
-
result: "success" as const,
|
|
193
|
-
func: { ...func, content: pointer.value.revise.final },
|
|
194
|
-
};
|
|
195
|
-
}),
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
const newValidate: AutoBeRealizeValidateEvent = await compileRealizeFiles(
|
|
199
|
-
ctx,
|
|
200
|
-
{ authorizations, functions: converted.map((c) => c.func) },
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
if (newValidate.result.type === "success") {
|
|
204
|
-
return converted.map((c) => c.func);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const newLocations: string[] = diagnose(newValidate);
|
|
208
|
-
|
|
209
|
-
// Separate successful, failed, and ignored corrections
|
|
210
|
-
const { success, failed, ignored } = separateCorrectionResults(
|
|
211
|
-
converted,
|
|
212
|
-
newLocations,
|
|
213
|
-
);
|
|
214
|
-
|
|
215
|
-
// If no failures to retry, return success and ignored functions
|
|
216
|
-
if (failed.length === 0) {
|
|
217
|
-
return [...success, ...ignored];
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Collect diagnostics relevant to failed functions
|
|
221
|
-
const failedLocations: string[] = failed.map((f) => f.location);
|
|
222
|
-
const allDiagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[] = [
|
|
223
|
-
...failures,
|
|
224
|
-
...(newValidate.result.type === "failure"
|
|
225
|
-
? newValidate.result.diagnostics
|
|
226
|
-
: []),
|
|
227
|
-
];
|
|
228
|
-
const relevantDiagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[] =
|
|
229
|
-
filterRelevantDiagnostics(allDiagnostics, failedLocations);
|
|
230
|
-
|
|
231
|
-
// Recursively retry failed functions
|
|
232
|
-
const retriedFunctions: AutoBeRealizeFunction[] = await predicate(
|
|
233
|
-
ctx,
|
|
234
|
-
authorizations,
|
|
235
|
-
failed,
|
|
236
|
-
relevantDiagnostics,
|
|
237
|
-
progress,
|
|
238
|
-
newValidate,
|
|
239
|
-
life - 1,
|
|
240
|
-
);
|
|
241
|
-
|
|
242
|
-
return [...success, ...ignored, ...retriedFunctions];
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Extract unique file locations from validation event diagnostics
|
|
247
|
-
*
|
|
248
|
-
* @param event - Validation event containing compilation results
|
|
249
|
-
* @returns Array of unique file paths that have errors
|
|
250
|
-
*/
|
|
251
|
-
const diagnose = (event: AutoBeRealizeValidateEvent): string[] => {
|
|
252
|
-
if (event.result.type !== "failure") {
|
|
253
|
-
return [];
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
const diagnostics = event.result.diagnostics;
|
|
257
|
-
const locations = diagnostics
|
|
258
|
-
.map((d) => d.file)
|
|
259
|
-
.filter((f): f is string => f !== null)
|
|
260
|
-
.filter((f) => f.startsWith("src/providers"));
|
|
261
|
-
|
|
262
|
-
return Array.from(new Set(locations));
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Filter diagnostics to only include Date-related errors
|
|
267
|
-
*
|
|
268
|
-
* @param diagnostics - All diagnostics
|
|
269
|
-
* @returns Date-related diagnostics only
|
|
270
|
-
*/
|
|
271
|
-
const filterDateErrors = (
|
|
272
|
-
diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[],
|
|
273
|
-
): IAutoBeTypeScriptCompileResult.IDiagnostic[] => {
|
|
274
|
-
return diagnostics.filter((d) => {
|
|
275
|
-
const messageText = d.messageText?.toLowerCase() || "";
|
|
276
|
-
return (
|
|
277
|
-
messageText.includes("date") ||
|
|
278
|
-
messageText.includes("date-time") ||
|
|
279
|
-
messageText.includes("toisostring") ||
|
|
280
|
-
messageText.includes("cannot read property") ||
|
|
281
|
-
messageText.includes("type 'date'") ||
|
|
282
|
-
messageText.includes("tags.format<'date-time'>") ||
|
|
283
|
-
messageText.includes('tags.format<"date-time">')
|
|
284
|
-
);
|
|
285
|
-
});
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Separate correction results into successful, failed, and ignored functions
|
|
290
|
-
*
|
|
291
|
-
* @param corrections - Array of correction results
|
|
292
|
-
* @param errorLocations - File paths that still have errors
|
|
293
|
-
* @returns Object with success, failed, and ignored function arrays
|
|
294
|
-
*/
|
|
295
|
-
const separateCorrectionResults = (
|
|
296
|
-
corrections: CorrectionResult[],
|
|
297
|
-
errorLocations: string[],
|
|
298
|
-
): {
|
|
299
|
-
success: AutoBeRealizeFunction[];
|
|
300
|
-
failed: AutoBeRealizeFunction[];
|
|
301
|
-
ignored: AutoBeRealizeFunction[];
|
|
302
|
-
} => {
|
|
303
|
-
const success = corrections
|
|
304
|
-
.filter(
|
|
305
|
-
(c) =>
|
|
306
|
-
c.result === "success" && !errorLocations.includes(c.func.location),
|
|
307
|
-
)
|
|
308
|
-
.map((c) => c.func);
|
|
309
|
-
|
|
310
|
-
const failed = corrections
|
|
311
|
-
.filter(
|
|
312
|
-
(c) => c.result === "success" && errorLocations.includes(c.func.location),
|
|
313
|
-
)
|
|
314
|
-
.map((c) => c.func);
|
|
315
|
-
|
|
316
|
-
const ignored = corrections
|
|
317
|
-
.filter((c) => c.result === "ignore" || c.result === "exception")
|
|
318
|
-
.map((c) => c.func);
|
|
319
|
-
|
|
320
|
-
return { success, failed, ignored };
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Filter diagnostics to only include those relevant to specific functions
|
|
325
|
-
*
|
|
326
|
-
* @param diagnostics - All diagnostics
|
|
327
|
-
* @param functionLocations - Locations of functions to filter for
|
|
328
|
-
* @returns Filtered diagnostics
|
|
329
|
-
*/
|
|
330
|
-
const filterRelevantDiagnostics = (
|
|
331
|
-
diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[],
|
|
332
|
-
functionLocations: string[],
|
|
333
|
-
): IAutoBeTypeScriptCompileResult.IDiagnostic[] => {
|
|
334
|
-
return diagnostics.filter(
|
|
335
|
-
(d) => d.file && functionLocations.includes(d.file),
|
|
336
|
-
);
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
const createController = <Model extends ILlmSchema.Model>(props: {
|
|
340
|
-
model: Model;
|
|
341
|
-
then: (next: IAutoBeCommonCorrectDateApplication.IProps) => void;
|
|
342
|
-
reject: () => void;
|
|
343
|
-
}): ILlmController<Model> => {
|
|
344
|
-
assertSchemaModel(props.model);
|
|
345
|
-
const application = collection[
|
|
346
|
-
props.model === "chatgpt" ? "chatgpt" : "claude"
|
|
347
|
-
] satisfies ILlmApplication<any> as any as ILlmApplication<Model>;
|
|
348
|
-
return {
|
|
349
|
-
protocol: "class",
|
|
350
|
-
name: "correctDateInvalidRequest",
|
|
351
|
-
application,
|
|
352
|
-
execute: {
|
|
353
|
-
rewrite: (next) => {
|
|
354
|
-
props.then(next);
|
|
355
|
-
},
|
|
356
|
-
reject: () => {
|
|
357
|
-
props.reject();
|
|
358
|
-
},
|
|
359
|
-
} satisfies IAutoBeCommonCorrectDateApplication,
|
|
360
|
-
};
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
const collection = {
|
|
364
|
-
chatgpt: typia.llm.application<
|
|
365
|
-
IAutoBeCommonCorrectDateApplication,
|
|
366
|
-
"chatgpt"
|
|
367
|
-
>(),
|
|
368
|
-
claude: typia.llm.application<
|
|
369
|
-
IAutoBeCommonCorrectDateApplication,
|
|
370
|
-
"claude"
|
|
371
|
-
>(),
|
|
372
|
-
};
|