@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
|
@@ -56,7 +56,7 @@ const getRealizeWriteDto_1 = require("./utils/getRealizeWriteDto");
|
|
|
56
56
|
const replaceImportStatements_1 = require("./utils/replaceImportStatements");
|
|
57
57
|
function orchestrateRealizeWrite(ctx, props) {
|
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
var _a, _b, _c;
|
|
59
|
+
var _a, _b, _c, _d, _e;
|
|
60
60
|
const pointer = {
|
|
61
61
|
value: null,
|
|
62
62
|
};
|
|
@@ -98,20 +98,28 @@ function orchestrateRealizeWrite(ctx, props) {
|
|
|
98
98
|
});
|
|
99
99
|
if (pointer.value === null)
|
|
100
100
|
throw new Error("Failed to write code.");
|
|
101
|
-
pointer.value.
|
|
101
|
+
pointer.value.draft = yield (0, replaceImportStatements_1.replaceImportStatements)(ctx, {
|
|
102
102
|
operation: props.scenario.operation,
|
|
103
|
-
|
|
103
|
+
schemas: props.document.components.schemas,
|
|
104
|
+
code: pointer.value.draft,
|
|
104
105
|
decoratorType: (_a = props.authorization) === null || _a === void 0 ? void 0 : _a.payload.name,
|
|
105
106
|
});
|
|
107
|
+
if (pointer.value.revise.final)
|
|
108
|
+
pointer.value.revise.final = yield (0, replaceImportStatements_1.replaceImportStatements)(ctx, {
|
|
109
|
+
operation: props.scenario.operation,
|
|
110
|
+
schemas: props.document.components.schemas,
|
|
111
|
+
code: pointer.value.revise.final,
|
|
112
|
+
decoratorType: (_b = props.authorization) === null || _b === void 0 ? void 0 : _b.payload.name,
|
|
113
|
+
});
|
|
106
114
|
const event = {
|
|
107
115
|
type: "realizeWrite",
|
|
108
116
|
id: (0, uuid_1.v7)(),
|
|
109
117
|
location: props.scenario.location,
|
|
110
|
-
content: pointer.value.final,
|
|
118
|
+
content: (_c = pointer.value.revise.final) !== null && _c !== void 0 ? _c : pointer.value.draft,
|
|
111
119
|
tokenUsage,
|
|
112
120
|
completed: ++props.progress.completed,
|
|
113
121
|
total: props.progress.total,
|
|
114
|
-
step: (
|
|
122
|
+
step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
115
123
|
created_at: new Date().toISOString(),
|
|
116
124
|
};
|
|
117
125
|
ctx.dispatch(event);
|
|
@@ -126,7 +134,7 @@ function createController(props) {
|
|
|
126
134
|
name: "Write code",
|
|
127
135
|
application,
|
|
128
136
|
execute: {
|
|
129
|
-
|
|
137
|
+
write: (next) => {
|
|
130
138
|
props.build(next);
|
|
131
139
|
},
|
|
132
140
|
},
|
|
@@ -140,53 +148,81 @@ const claude = {
|
|
|
140
148
|
},
|
|
141
149
|
functions: [
|
|
142
150
|
{
|
|
143
|
-
name: "
|
|
151
|
+
name: "write",
|
|
144
152
|
parameters: {
|
|
145
|
-
description: "
|
|
153
|
+
description: " Chain of Thinking properties for implementation\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeWriteApplication.IProps}",
|
|
146
154
|
type: "object",
|
|
147
155
|
properties: {
|
|
148
156
|
plan: {
|
|
149
|
-
description: "
|
|
157
|
+
description: "Implementation plan and strategy.\n\nAnalyzes the provider function requirements, identifies related Prisma\nschemas, and outlines the implementation approach. Includes schema\nvalidation and API contract verification.",
|
|
150
158
|
type: "string"
|
|
151
159
|
},
|
|
152
|
-
|
|
153
|
-
description: "
|
|
160
|
+
draft: {
|
|
161
|
+
description: "Initial implementation draft.\n\nThe first complete implementation attempt based on the plan. May contain\nareas that need refinement in the review phase.",
|
|
154
162
|
type: "string"
|
|
155
163
|
},
|
|
156
|
-
|
|
157
|
-
description: "
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
final: {
|
|
161
|
-
description: "Step 4 - Final implementation See REALIZE_WRITE.md for requirements",
|
|
162
|
-
type: "string"
|
|
164
|
+
revise: {
|
|
165
|
+
description: "Revision and finalization phase.\n\nReviews the draft implementation and produces the final code with all\nimprovements and corrections applied.",
|
|
166
|
+
$ref: "#/$defs/IAutoBeRealizeWriteApplication.IReviseProps"
|
|
163
167
|
}
|
|
164
168
|
},
|
|
165
169
|
required: [
|
|
166
170
|
"plan",
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"final"
|
|
171
|
+
"draft",
|
|
172
|
+
"revise"
|
|
170
173
|
],
|
|
171
174
|
additionalProperties: false,
|
|
172
|
-
$defs: {
|
|
175
|
+
$defs: {
|
|
176
|
+
"IAutoBeRealizeWriteApplication.IReviseProps": {
|
|
177
|
+
type: "object",
|
|
178
|
+
properties: {
|
|
179
|
+
review: {
|
|
180
|
+
description: "Review and improvement suggestions.\n\nIdentifies areas for improvement in the draft code, including:\n\n- Type safety enhancements\n- Prisma query optimizations\n- Null/undefined handling corrections\n- Authentication/authorization improvements\n- Error handling refinements",
|
|
181
|
+
type: "string"
|
|
182
|
+
},
|
|
183
|
+
final: {
|
|
184
|
+
description: "Final implementation code.\n\nThe complete, production-ready implementation with all review suggestions\napplied.\n\nReturns `null` if the draft is already perfect and needs no changes.",
|
|
185
|
+
oneOf: [
|
|
186
|
+
{
|
|
187
|
+
type: "null"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
type: "string"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
required: [
|
|
196
|
+
"review",
|
|
197
|
+
"final"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
173
201
|
},
|
|
174
|
-
description: "
|
|
175
|
-
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.
|
|
202
|
+
description: "Generate complete provider function implementation using Chain of Thinking.\n\nFollows a 3-phase process: plan \u2192 draft \u2192 revise.\n\nEnsures type safety, proper Prisma usage, and API contract compliance.",
|
|
203
|
+
validate: (() => { const _io0 = input => "string" === typeof input.plan && "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.plan || _report(_exceptionable, {
|
|
176
204
|
path: _path + ".plan",
|
|
177
205
|
expected: "string",
|
|
178
206
|
value: input.plan
|
|
179
|
-
}), "string" === typeof input.
|
|
180
|
-
path: _path + ".
|
|
207
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
208
|
+
path: _path + ".draft",
|
|
181
209
|
expected: "string",
|
|
182
|
-
value: input.
|
|
183
|
-
}), "
|
|
210
|
+
value: input.draft
|
|
211
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
212
|
+
path: _path + ".revise",
|
|
213
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
214
|
+
value: input.revise
|
|
215
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
216
|
+
path: _path + ".revise",
|
|
217
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
218
|
+
value: input.revise
|
|
219
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
184
220
|
path: _path + ".review",
|
|
185
221
|
expected: "string",
|
|
186
222
|
value: input.review
|
|
187
|
-
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
223
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
188
224
|
path: _path + ".final",
|
|
189
|
-
expected: "string",
|
|
225
|
+
expected: "(null | string)",
|
|
190
226
|
value: input.final
|
|
191
227
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
192
228
|
if (false === __is(input)) {
|
|
@@ -229,53 +265,80 @@ const collection = {
|
|
|
229
265
|
},
|
|
230
266
|
functions: [
|
|
231
267
|
{
|
|
232
|
-
name: "
|
|
268
|
+
name: "write",
|
|
233
269
|
parameters: {
|
|
234
|
-
description: "
|
|
270
|
+
description: " Chain of Thinking properties for implementation\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeWriteApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Revision and finalization phase.\n> \n> Reviews the draft implementation and produces the final code with all\n> improvements and corrections applied.",
|
|
235
271
|
type: "object",
|
|
236
272
|
properties: {
|
|
237
273
|
plan: {
|
|
238
|
-
description: "
|
|
274
|
+
description: "Implementation plan and strategy.\n\nAnalyzes the provider function requirements, identifies related Prisma\nschemas, and outlines the implementation approach. Includes schema\nvalidation and API contract verification.",
|
|
239
275
|
type: "string"
|
|
240
276
|
},
|
|
241
|
-
|
|
242
|
-
description: "
|
|
277
|
+
draft: {
|
|
278
|
+
description: "Initial implementation draft.\n\nThe first complete implementation attempt based on the plan. May contain\nareas that need refinement in the review phase.",
|
|
243
279
|
type: "string"
|
|
244
280
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
type: "string"
|
|
248
|
-
},
|
|
249
|
-
final: {
|
|
250
|
-
description: "Step 4 - Final implementation See REALIZE_WRITE.md for requirements",
|
|
251
|
-
type: "string"
|
|
281
|
+
revise: {
|
|
282
|
+
$ref: "#/$defs/IAutoBeRealizeWriteApplication.IReviseProps"
|
|
252
283
|
}
|
|
253
284
|
},
|
|
254
285
|
required: [
|
|
255
286
|
"plan",
|
|
256
|
-
"
|
|
257
|
-
"
|
|
258
|
-
"final"
|
|
287
|
+
"draft",
|
|
288
|
+
"revise"
|
|
259
289
|
],
|
|
260
290
|
additionalProperties: false,
|
|
261
|
-
$defs: {
|
|
291
|
+
$defs: {
|
|
292
|
+
"IAutoBeRealizeWriteApplication.IReviseProps": {
|
|
293
|
+
type: "object",
|
|
294
|
+
properties: {
|
|
295
|
+
review: {
|
|
296
|
+
description: "Review and improvement suggestions.\n\nIdentifies areas for improvement in the draft code, including:\n\n- Type safety enhancements\n- Prisma query optimizations\n- Null/undefined handling corrections\n- Authentication/authorization improvements\n- Error handling refinements",
|
|
297
|
+
type: "string"
|
|
298
|
+
},
|
|
299
|
+
final: {
|
|
300
|
+
description: "Final implementation code.\n\nThe complete, production-ready implementation with all review suggestions\napplied.\n\nReturns `null` if the draft is already perfect and needs no changes.",
|
|
301
|
+
anyOf: [
|
|
302
|
+
{
|
|
303
|
+
type: "null"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
type: "string"
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
required: [
|
|
312
|
+
"review",
|
|
313
|
+
"final"
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
}
|
|
262
317
|
},
|
|
263
|
-
description: "
|
|
264
|
-
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.
|
|
318
|
+
description: "Generate complete provider function implementation using Chain of Thinking.\n\nFollows a 3-phase process: plan \u2192 draft \u2192 revise.\n\nEnsures type safety, proper Prisma usage, and API contract compliance.",
|
|
319
|
+
validate: (() => { const _io0 = input => "string" === typeof input.plan && "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.plan || _report(_exceptionable, {
|
|
265
320
|
path: _path + ".plan",
|
|
266
321
|
expected: "string",
|
|
267
322
|
value: input.plan
|
|
268
|
-
}), "string" === typeof input.
|
|
269
|
-
path: _path + ".
|
|
323
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
324
|
+
path: _path + ".draft",
|
|
270
325
|
expected: "string",
|
|
271
|
-
value: input.
|
|
272
|
-
}), "
|
|
326
|
+
value: input.draft
|
|
327
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
328
|
+
path: _path + ".revise",
|
|
329
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
330
|
+
value: input.revise
|
|
331
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
332
|
+
path: _path + ".revise",
|
|
333
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
334
|
+
value: input.revise
|
|
335
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
273
336
|
path: _path + ".review",
|
|
274
337
|
expected: "string",
|
|
275
338
|
value: input.review
|
|
276
|
-
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
339
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
277
340
|
path: _path + ".final",
|
|
278
|
-
expected: "string",
|
|
341
|
+
expected: "(null | string)",
|
|
279
342
|
value: input.final
|
|
280
343
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
281
344
|
if (false === __is(input)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeWrite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeWrite.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,39 +1,65 @@
|
|
|
1
1
|
export interface IAutoBeRealizeCorrectApplication {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Systematically analyze and correct TypeScript compilation errors.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Implements a three-phase workflow (think → draft → revise) that balances
|
|
6
|
+
* efficiency for simple errors with thoroughness for complex problems.
|
|
7
7
|
*
|
|
8
|
-
* @param props
|
|
8
|
+
* @param props Three-phase correction properties
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
correct(props: IAutoBeRealizeCorrectApplication.IProps): void;
|
|
11
11
|
}
|
|
12
12
|
export declare namespace IAutoBeRealizeCorrectApplication {
|
|
13
|
-
/**
|
|
14
|
-
* Properties for error correction following Chain of Thinking (CoT).
|
|
15
|
-
*
|
|
16
|
-
* All phases are wrapped in a `revise` object for systematic error
|
|
17
|
-
* resolution.
|
|
18
|
-
*/
|
|
19
13
|
interface IProps {
|
|
20
|
-
/**
|
|
21
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Initial error analysis and correction strategy.
|
|
16
|
+
*
|
|
17
|
+
* Analyzes TypeScript compilation errors to understand:
|
|
18
|
+
*
|
|
19
|
+
* - Error patterns and root causes
|
|
20
|
+
* - Required fixes and their impact
|
|
21
|
+
* - Whether quick fixes or deep refactoring is needed
|
|
22
|
+
* - Prisma schema and API contract constraints
|
|
23
|
+
*/
|
|
24
|
+
think: string;
|
|
25
|
+
/**
|
|
26
|
+
* First correction attempt.
|
|
27
|
+
*
|
|
28
|
+
* Implements the initial fixes identified in the think phase. For simple
|
|
29
|
+
* errors (typos, missing imports), this may be the final solution. Complex
|
|
30
|
+
* errors may require further refinement.
|
|
31
|
+
*/
|
|
32
|
+
draft: string;
|
|
33
|
+
/**
|
|
34
|
+
* Revision and finalization phase.
|
|
35
|
+
*
|
|
36
|
+
* Reviews the draft corrections and produces the final, error-free code
|
|
37
|
+
* that maintains all business requirements.
|
|
38
|
+
*/
|
|
39
|
+
revise: IReviseProps;
|
|
22
40
|
}
|
|
23
|
-
interface
|
|
41
|
+
interface IReviseProps {
|
|
42
|
+
/**
|
|
43
|
+
* Correction review and validation.
|
|
44
|
+
*
|
|
45
|
+
* Analyzes the draft corrections to ensure:
|
|
46
|
+
*
|
|
47
|
+
* - All TypeScript errors are resolved
|
|
48
|
+
* - Business logic remains intact
|
|
49
|
+
* - AutoBE coding standards are maintained
|
|
50
|
+
* - No new errors are introduced
|
|
51
|
+
* - Performance and security are preserved
|
|
52
|
+
*/
|
|
53
|
+
review: string;
|
|
24
54
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
55
|
+
* Final error-free implementation.
|
|
56
|
+
*
|
|
57
|
+
* The complete, corrected code that passes all TypeScript compilation
|
|
58
|
+
* checks.
|
|
59
|
+
*
|
|
60
|
+
* Returns `null` if the draft corrections are sufficient and need no
|
|
61
|
+
* further changes.
|
|
28
62
|
*/
|
|
29
|
-
|
|
30
|
-
/** Step 2: Provider function implementation plan. */
|
|
31
|
-
plan?: string;
|
|
32
|
-
/** Step 3: Relevant Prisma schema definitions. */
|
|
33
|
-
prismaSchemas?: string;
|
|
34
|
-
/** Step 4: Refined version with improved completeness. */
|
|
35
|
-
review?: string;
|
|
36
|
-
/** Step 5: Final complete TypeScript function implementation. */
|
|
37
|
-
final: string;
|
|
63
|
+
final: string | null;
|
|
38
64
|
}
|
|
39
65
|
}
|
|
@@ -1,51 +1,61 @@
|
|
|
1
1
|
export interface IAutoBeRealizeWriteApplication {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Generate complete provider function implementation using Chain of Thinking.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* functions that handle business logic for API operations. It follows a
|
|
7
|
-
* schema-first approach with multiple refinement phases to ensure type-safe,
|
|
8
|
-
* error-free code generation.
|
|
5
|
+
* Follows a 3-phase process: plan → draft → revise.
|
|
9
6
|
*
|
|
10
|
-
*
|
|
7
|
+
* Ensures type safety, proper Prisma usage, and API contract compliance.
|
|
11
8
|
*
|
|
12
|
-
*
|
|
13
|
-
* 2. Schema definition for relevant models
|
|
14
|
-
* 3. Review and refinement for completeness
|
|
15
|
-
* 4. Final implementation with all validations and type safety
|
|
16
|
-
*
|
|
17
|
-
* @param next Properties containing the multi-phase implementation plan and
|
|
18
|
-
* code
|
|
9
|
+
* @param props Chain of Thinking properties for implementation
|
|
19
10
|
*/
|
|
20
|
-
|
|
11
|
+
write(props: IAutoBeRealizeWriteApplication.IProps): void;
|
|
21
12
|
}
|
|
22
13
|
export declare namespace IAutoBeRealizeWriteApplication {
|
|
23
|
-
/**
|
|
24
|
-
* Properties for the Realize Write Application following Chain of Thinking
|
|
25
|
-
* (CoT).
|
|
26
|
-
*
|
|
27
|
-
* Each field represents a distinct phase in the implementation process.
|
|
28
|
-
* Detailed guidelines are in REALIZE_WRITE.md.
|
|
29
|
-
*/
|
|
30
14
|
interface IProps {
|
|
31
15
|
/**
|
|
32
|
-
*
|
|
16
|
+
* Implementation plan and strategy.
|
|
33
17
|
*
|
|
34
|
-
*
|
|
18
|
+
* Analyzes the provider function requirements, identifies related Prisma
|
|
19
|
+
* schemas, and outlines the implementation approach. Includes schema
|
|
20
|
+
* validation and API contract verification.
|
|
21
|
+
*/
|
|
22
|
+
plan: string;
|
|
23
|
+
/**
|
|
24
|
+
* Initial implementation draft.
|
|
35
25
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
* The first complete implementation attempt based on the plan. May contain
|
|
27
|
+
* areas that need refinement in the review phase.
|
|
28
|
+
*/
|
|
29
|
+
draft: string;
|
|
30
|
+
/**
|
|
31
|
+
* Revision and finalization phase.
|
|
40
32
|
*
|
|
41
|
-
*
|
|
33
|
+
* Reviews the draft implementation and produces the final code with all
|
|
34
|
+
* improvements and corrections applied.
|
|
35
|
+
*/
|
|
36
|
+
revise: IReviseProps;
|
|
37
|
+
}
|
|
38
|
+
interface IReviseProps {
|
|
39
|
+
/**
|
|
40
|
+
* Review and improvement suggestions.
|
|
41
|
+
*
|
|
42
|
+
* Identifies areas for improvement in the draft code, including:
|
|
43
|
+
*
|
|
44
|
+
* - Type safety enhancements
|
|
45
|
+
* - Prisma query optimizations
|
|
46
|
+
* - Null/undefined handling corrections
|
|
47
|
+
* - Authentication/authorization improvements
|
|
48
|
+
* - Error handling refinements
|
|
42
49
|
*/
|
|
43
|
-
plan: string;
|
|
44
|
-
/** Step 2 - Relevant Prisma schema models and fields */
|
|
45
|
-
prismaSchemas: string;
|
|
46
|
-
/** Step 3 - Refined version with real operations */
|
|
47
50
|
review: string;
|
|
48
|
-
/**
|
|
49
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Final implementation code.
|
|
53
|
+
*
|
|
54
|
+
* The complete, production-ready implementation with all review suggestions
|
|
55
|
+
* applied.
|
|
56
|
+
*
|
|
57
|
+
* Returns `null` if the draft is already perfect and needs no changes.
|
|
58
|
+
*/
|
|
59
|
+
final: string | null;
|
|
50
60
|
}
|
|
51
61
|
}
|
|
@@ -11,7 +11,7 @@ var InternalFileSystem;
|
|
|
11
11
|
InternalFileSystem.DEFAULT = [
|
|
12
12
|
"src/providers/authorize/jwtAuthorize.ts",
|
|
13
13
|
"src/MyGlobal.ts",
|
|
14
|
-
"src/
|
|
14
|
+
"src/utils/toISOStringSafe.ts",
|
|
15
15
|
];
|
|
16
16
|
})(InternalFileSystem || (exports.InternalFileSystem = InternalFileSystem = {}));
|
|
17
17
|
//# sourceMappingURL=InternalFileSystem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalFileSystem.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/utils/InternalFileSystem.ts"],"names":[],"mappings":";;;AAAA,IAAiB,kBAAkB,CAWlC;AAXD,WAAiB,kBAAkB;IACjC;;;;OAIG;IACU,0BAAO,GAAG;QACrB,yCAAyC;QACzC,iBAAiB;QACjB,
|
|
1
|
+
{"version":3,"file":"InternalFileSystem.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/utils/InternalFileSystem.ts"],"names":[],"mappings":";;;AAAA,IAAiB,kBAAkB,CAWlC;AAXD,WAAiB,kBAAkB;IACjC;;;;OAIG;IACU,0BAAO,GAAG;QACrB,yCAAyC;QACzC,iBAAiB;QACjB,8BAA8B;KAC/B,CAAC;AACJ,CAAC,EAXgB,kBAAkB,kCAAlB,kBAAkB,QAWlC"}
|
|
@@ -58,7 +58,7 @@ function transformFunctionName(operation) {
|
|
|
58
58
|
const functionName = `${operation.method}${operation.path
|
|
59
59
|
.split("/")
|
|
60
60
|
.filter(Boolean)
|
|
61
|
-
.map((segment
|
|
61
|
+
.map((segment) => {
|
|
62
62
|
if (segment.startsWith("{") && segment.endsWith("}")) {
|
|
63
63
|
// {userId} → UserId
|
|
64
64
|
const paramName = segment.slice(1, -1);
|
|
@@ -71,10 +71,6 @@ function transformFunctionName(operation) {
|
|
|
71
71
|
const words = segment.split("-");
|
|
72
72
|
return words
|
|
73
73
|
.map((word) => {
|
|
74
|
-
if (index === 0 && words.length === 1) {
|
|
75
|
-
// First segment without hyphens stays lowercase for first word
|
|
76
|
-
return word;
|
|
77
|
-
}
|
|
78
74
|
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
79
75
|
})
|
|
80
76
|
.join("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRealizeScenario.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/utils/generateRealizeScenario.ts"],"names":[],"mappings":";;AA8BA,0DA2BC;AA/CD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,uBAAuB,CACrC,GAAyB,EACzB,SAAmC,EACnC,cAA4C;;IAE5C,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CACvC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,iBAAiB,CACrD,CAAC;IAEF,MAAM,SAAS,GACb,MAAA,MAAA,GAAG;SACA,KAAK,EAAE;SACP,IAAI,0CAAE,KAAK,CAAC,MAAM,CACjB,CAAC,EAAE,EAAE,EAAE,CACL,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;QAChD,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAC/C,mCAAI,EAAE,CAAC;IAEZ,MAAM,YAAY,GAAW,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAE9D,OAAO;QACL,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,iBAAiB,YAAY,KAAK;QAC5C,SAAS,EAAE,SAAS;QACpB,cAAc,EAAE,aAAa;KAC9B,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,qBAAqB,CAAC,SAAmC;IAChE,MAAM,YAAY,GAAG,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,IAAI;SACtD,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generateRealizeScenario.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/utils/generateRealizeScenario.ts"],"names":[],"mappings":";;AA8BA,0DA2BC;AA/CD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,uBAAuB,CACrC,GAAyB,EACzB,SAAmC,EACnC,cAA4C;;IAE5C,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CACvC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,iBAAiB,CACrD,CAAC;IAEF,MAAM,SAAS,GACb,MAAA,MAAA,GAAG;SACA,KAAK,EAAE;SACP,IAAI,0CAAE,KAAK,CAAC,MAAM,CACjB,CAAC,EAAE,EAAE,EAAE,CACL,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;QAChD,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAC/C,mCAAI,EAAE,CAAC;IAEZ,MAAM,YAAY,GAAW,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAE9D,OAAO;QACL,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,iBAAiB,YAAY,KAAK;QAC5C,SAAS,EAAE,SAAS;QACpB,cAAc,EAAE,aAAa;KAC9B,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,qBAAqB,CAAC,SAAmC;IAChE,MAAM,YAAY,GAAG,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,IAAI;SACtD,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACf,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACrD,oBAAoB;YACpB,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACvC,OAAO,SAAS;iBACb,KAAK,CAAC,GAAG,CAAC;iBACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBAC3D,IAAI,CAAC,EAAE,CAAC,CAAC;QACd,CAAC;QACD,qBAAqB;QACrB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK;aACT,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACZ,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC;aACD,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACd,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -16,9 +16,9 @@ import { IAutoBeRealizeScenarioResult } from "../structures/IAutoBeRealizeScenar
|
|
|
16
16
|
* import { MyGlobal } from "../MyGlobal";
|
|
17
17
|
* // ... other imports
|
|
18
18
|
*
|
|
19
|
-
* async function post__users_create(
|
|
19
|
+
* async function post__users_create(props: {
|
|
20
20
|
* body: IUserCreateRequest
|
|
21
|
-
* ): Promise<IUserResponse> {
|
|
21
|
+
* }): Promise<IUserResponse> {
|
|
22
22
|
* ...
|
|
23
23
|
* }
|
|
24
24
|
* ```;
|
|
@@ -28,4 +28,9 @@ import { IAutoBeRealizeScenarioResult } from "../structures/IAutoBeRealizeScenar
|
|
|
28
28
|
* @param authorization - Authorization context if endpoint is authenticated
|
|
29
29
|
* @returns Complete TypeScript code template as a formatted string
|
|
30
30
|
*/
|
|
31
|
-
export declare function getRealizeWriteCodeTemplate(
|
|
31
|
+
export declare function getRealizeWriteCodeTemplate(props: {
|
|
32
|
+
scenario: IAutoBeRealizeScenarioResult;
|
|
33
|
+
operation: AutoBeOpenApi.IOperation;
|
|
34
|
+
schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
35
|
+
authorization: AutoBeRealizeAuthorization | null;
|
|
36
|
+
}): string;
|