@autobe/agent 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeAgent.js +8 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeMockAgent.js +10 -5
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +14 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.d.ts +10 -0
- package/lib/agent/src/factory/consentFunctionCall.js +213 -0
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +79 -19
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +41 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -9
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +45 -31
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +25 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +8 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +15 -12
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +33 -44
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +10 -4
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +45 -45
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +14 -14
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -30
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +24 -31
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +4 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +27 -26
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +13 -12
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +4 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +11 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +36 -29
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +31 -9
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +1571 -1144
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +24 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +6 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +12 -14
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +103 -71
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +147 -116
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +401 -233
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +362 -178
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +97 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +75 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +35 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +60 -66
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +19 -30
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +38 -35
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +39 -26
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +15 -4
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +7 -9
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +38 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +61 -10
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +68 -24
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +24 -21
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +59 -57
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +17 -13
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +287 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +46 -49
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +7 -0
- package/lib/agent/src/orchestrate/realize/internal/{compile.js → compileRealizeFiles.js} +12 -29
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +76 -45
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +15 -9
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +9 -7
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +25 -20
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +8 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +36 -27
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/agent/src/orchestrate/{internal/IProgress.js → realize/structures/IAutoBeRealizeCorrectApplication.js} +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +5 -1
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +13 -10
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +17 -16
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +33 -32
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +97 -49
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +3 -3
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +17 -4
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +18 -9
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +138 -23
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +17 -17
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +7 -6
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/agent/src/orchestrate/{realize/structures/IAutoBeRealizeCoderApplication.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/agent/src/utils/executeCachedBatch.d.ts +1 -0
- package/lib/agent/src/utils/executeCachedBatch.js +23 -0
- package/lib/agent/src/utils/executeCachedBatch.js.map +1 -0
- package/lib/agent/src/utils/predicateStateMessage.d.ts +4 -0
- package/lib/agent/src/utils/predicateStateMessage.js +87 -0
- package/lib/agent/src/utils/predicateStateMessage.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/context/AutoBeContext.d.ts +1 -0
- package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/factory/consentFunctionCall.d.ts +10 -0
- package/lib/index.mjs +4799 -2637
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +8 -3
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +97 -14
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +75 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/orchestrate/realize/internal/compileRealizeFiles.d.ts +7 -0
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +8 -6
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +7 -6
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/utils/executeCachedBatch.d.ts +1 -0
- package/lib/utils/predicateStateMessage.d.ts +4 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +18 -3
- package/src/AutoBeMockAgent.ts +13 -15
- package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
- package/src/context/AutoBeContext.ts +1 -0
- package/src/context/AutoBeTokenUsageComponent.ts +20 -0
- package/src/factory/consentFunctionCall.ts +129 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeContext.ts +108 -20
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +53 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +13 -10
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +68 -47
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +33 -21
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +21 -10
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +18 -40
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +15 -8
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +16 -16
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +47 -47
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +14 -14
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +31 -30
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +20 -29
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +3 -3
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +23 -22
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +12 -11
- package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +11 -10
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +37 -30
- package/src/orchestrate/interface/orchestrateInterface.ts +53 -12
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +142 -32
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +13 -9
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +8 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +82 -74
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +51 -32
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +174 -56
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +149 -63
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +16 -16
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +101 -14
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +77 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +47 -14
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +18 -24
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +41 -0
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +61 -66
- package/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.ts +19 -30
- package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +38 -35
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +36 -23
- package/src/orchestrate/prisma/orchestratePrisma.ts +17 -6
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +8 -19
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +3 -0
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +37 -18
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +25 -17
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +24 -21
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +57 -59
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +20 -14
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +294 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +62 -57
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +71 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +109 -86
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +22 -13
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -0
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +28 -24
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +0 -74
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +37 -28
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +19 -16
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +7 -0
- package/src/orchestrate/test/compile/completeTestCode.ts +17 -13
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +17 -16
- package/src/orchestrate/test/histories/transformTestHistories.ts +35 -34
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +116 -60
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +3 -3
- package/src/orchestrate/test/orchestrateTest.ts +18 -8
- package/src/orchestrate/test/orchestrateTestCorrect.ts +34 -24
- package/src/orchestrate/test/orchestrateTestScenario.ts +179 -36
- package/src/orchestrate/test/orchestrateTestWrite.ts +18 -19
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +7 -6
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +2 -2
- package/src/utils/executeCachedBatch.ts +15 -0
- package/src/utils/predicateStateMessage.ts +107 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +0 -46
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/agent/src/orchestrate/internal/IProgress.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js +0 -213
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -5
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +0 -1
- package/lib/agent/src/utils/pipe.d.ts +0 -5
- package/lib/agent/src/utils/pipe.js +0 -14
- package/lib/agent/src/utils/pipe.js.map +0 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -4
- package/lib/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/orchestrate/realize/internal/compile.d.ts +0 -7
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/utils/pipe.d.ts +0 -5
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +0 -53
- package/src/orchestrate/internal/IProgress.ts +0 -4
- package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
- package/src/orchestrate/realize/internal/compile.ts +0 -84
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +0 -358
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +0 -70
- package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +0 -2
- package/src/utils/pipe.ts +0 -39
- /package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/lib/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.ts → IAutoBeRealizeCorrectApplication.ts} +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AutoBeProgressEventBase,
|
|
2
3
|
AutoBeRealizeAuthorization,
|
|
3
4
|
AutoBeRealizeWriteEvent,
|
|
4
5
|
} from "@autobe/interface";
|
|
6
|
+
import { StringUtil } from "@autobe/utils";
|
|
5
7
|
import { ILlmApplication, ILlmController, ILlmSchema } from "@samchon/openapi";
|
|
6
8
|
import { IPointer } from "tstl";
|
|
7
9
|
import typia from "typia";
|
|
10
|
+
import { v7 } from "uuid";
|
|
8
11
|
|
|
9
12
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
10
13
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -17,13 +20,17 @@ import { replaceImportStatements } from "./utils/replaceImportStatements";
|
|
|
17
20
|
|
|
18
21
|
export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
19
22
|
ctx: AutoBeContext<Model>,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
props: {
|
|
24
|
+
totalAuthorizations: AutoBeRealizeAuthorization[];
|
|
25
|
+
authorization: AutoBeRealizeAuthorization | null;
|
|
26
|
+
scenario: IAutoBeRealizeScenarioApplication.IProps;
|
|
27
|
+
progress: AutoBeProgressEventBase;
|
|
28
|
+
promptCacheKey: string;
|
|
29
|
+
},
|
|
23
30
|
): Promise<AutoBeRealizeWriteEvent> {
|
|
24
31
|
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
25
32
|
await getTestScenarioArtifacts(ctx, {
|
|
26
|
-
endpoint: scenario.operation,
|
|
33
|
+
endpoint: props.scenario.operation,
|
|
27
34
|
dependencies: [],
|
|
28
35
|
});
|
|
29
36
|
const pointer: IPointer<IAutoBeRealizeWriteApplication.IProps | null> = {
|
|
@@ -33,9 +40,10 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
33
40
|
source: "realizeWrite",
|
|
34
41
|
histories: transformRealizeWriteHistories({
|
|
35
42
|
state: ctx.state(),
|
|
36
|
-
scenario,
|
|
43
|
+
scenario: props.scenario,
|
|
37
44
|
artifacts,
|
|
38
|
-
authorization,
|
|
45
|
+
authorization: props.authorization,
|
|
46
|
+
totalAuthorizations: props.totalAuthorizations,
|
|
39
47
|
}),
|
|
40
48
|
controller: createController({
|
|
41
49
|
model: ctx.model,
|
|
@@ -44,35 +52,41 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
44
52
|
},
|
|
45
53
|
}),
|
|
46
54
|
enforceFunctionCall: true,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
promptCacheKey: props.promptCacheKey,
|
|
56
|
+
message: StringUtil.trim`
|
|
57
|
+
Write complete, production-ready TypeScript code that strictly follows these rules:
|
|
58
|
+
|
|
59
|
+
DO NOT:
|
|
60
|
+
- Use the native \`Date\` type anywhere
|
|
61
|
+
- Use \`as\` for type assertions
|
|
62
|
+
|
|
63
|
+
DO:
|
|
64
|
+
- Write all date/datetime values as \`string & tags.Format<'date-time'>\`
|
|
65
|
+
- Generate UUIDs using \`v4()\` and type as \`string & tags.Format<'uuid'>\`
|
|
66
|
+
- Resolve types properly without assertions
|
|
67
|
+
- Type all functions with clear parameter and return types
|
|
68
|
+
6. Do not skip validations or default values where necessary.
|
|
69
|
+
7. Follow functional, immutable, and consistent code structure.
|
|
70
|
+
|
|
71
|
+
Use \`@nestia/e2e\` test structure if relevant.
|
|
72
|
+
`,
|
|
60
73
|
});
|
|
61
74
|
if (pointer.value === null) throw new Error("Failed to write code.");
|
|
62
75
|
|
|
63
76
|
pointer.value.implementationCode = await replaceImportStatements(ctx)(
|
|
64
77
|
artifacts,
|
|
65
78
|
pointer.value.implementationCode,
|
|
66
|
-
authorization?.payload.name,
|
|
79
|
+
props.authorization?.payload.name,
|
|
67
80
|
);
|
|
68
81
|
|
|
69
82
|
const event: AutoBeRealizeWriteEvent = {
|
|
70
83
|
type: "realizeWrite",
|
|
71
|
-
|
|
84
|
+
id: v7(),
|
|
85
|
+
location: props.scenario.location,
|
|
72
86
|
content: pointer.value.implementationCode,
|
|
73
87
|
tokenUsage,
|
|
74
|
-
completed: ++progress.completed,
|
|
75
|
-
total: progress.total,
|
|
88
|
+
completed: ++props.progress.completed,
|
|
89
|
+
total: props.progress.total,
|
|
76
90
|
step: ctx.state().analyze?.step ?? 0,
|
|
77
91
|
created_at: new Date().toISOString(),
|
|
78
92
|
};
|
|
@@ -113,8 +127,3 @@ const collection = {
|
|
|
113
127
|
deepseek: claude,
|
|
114
128
|
"3.1": claude,
|
|
115
129
|
};
|
|
116
|
-
|
|
117
|
-
export interface IProgress {
|
|
118
|
-
total: number;
|
|
119
|
-
completed: number;
|
|
120
|
-
}
|
|
@@ -41,7 +41,7 @@ export namespace IAutoBeRealizeAuthorizationApplication {
|
|
|
41
41
|
* called by the decorator to verify JWT tokens and return authenticated
|
|
42
42
|
* user information for the specified role.
|
|
43
43
|
*
|
|
44
|
-
*
|
|
44
|
+
* DO: Use camelCase naming convention.
|
|
45
45
|
*/
|
|
46
46
|
name: string & CamelPattern;
|
|
47
47
|
|
|
@@ -64,7 +64,7 @@ export namespace IAutoBeRealizeAuthorizationApplication {
|
|
|
64
64
|
* authorize users for the specific role, injecting the authenticated user
|
|
65
65
|
* payload as a method parameter.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
67
|
+
* DO: Use PascalCase naming convention.
|
|
68
68
|
*/
|
|
69
69
|
name: string & PascalPattern;
|
|
70
70
|
|
|
@@ -86,7 +86,7 @@ export namespace IAutoBeRealizeAuthorizationApplication {
|
|
|
86
86
|
* authenticated user data that will be injected into Controller methods
|
|
87
87
|
* when using the decorator.
|
|
88
88
|
*
|
|
89
|
-
*
|
|
89
|
+
* DO: Use PascalCase naming convention.
|
|
90
90
|
*/
|
|
91
91
|
name: string & PascalPattern;
|
|
92
92
|
|
|
@@ -13,16 +13,18 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
13
13
|
* function according to the Realize Coder Agent specification. Before
|
|
14
14
|
* writing the actual code, think through the logic and structure.
|
|
15
15
|
*
|
|
16
|
-
* The plan
|
|
16
|
+
* The plan follows a SCHEMA-FIRST APPROACH:
|
|
17
17
|
*
|
|
18
|
-
* 📋 STEP 1 - PRISMA SCHEMA VERIFICATION
|
|
18
|
+
* 📋 STEP 1 - PRISMA SCHEMA VERIFICATION:
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
20
|
+
* DO:
|
|
21
|
+
* - Examine the actual Prisma schema model definition
|
|
22
|
+
* - List EVERY field that exists in the model with exact types
|
|
23
|
+
* - Explicitly note fields that DO NOT exist
|
|
24
|
+
*
|
|
25
|
+
* DO NOT:
|
|
26
|
+
* - Assume common fields exist without verification
|
|
27
|
+
* - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active without checking
|
|
26
28
|
*
|
|
27
29
|
* 📋 STEP 2 - FIELD INVENTORY:
|
|
28
30
|
*
|
|
@@ -158,8 +160,9 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
158
160
|
* Draft WITHOUT using native Date type.
|
|
159
161
|
*
|
|
160
162
|
* This is the initial drafting phase where you outline the basic skeleton
|
|
161
|
-
* of the function.
|
|
162
|
-
*
|
|
163
|
+
* of the function.
|
|
164
|
+
*
|
|
165
|
+
* DO NOT: Use the native Date type.
|
|
163
166
|
*
|
|
164
167
|
* - The function signature must correctly include `user`, `parameters`, and
|
|
165
168
|
* `body` arguments.
|
|
@@ -168,13 +171,13 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
168
171
|
* - Mark any incomplete or missing parts clearly with placeholders (e.g.,
|
|
169
172
|
* comments or temporary values).
|
|
170
173
|
*
|
|
171
|
-
*
|
|
174
|
+
* Import rules:
|
|
172
175
|
*
|
|
173
|
-
*
|
|
174
|
-
* -
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
176
|
+
* DO NOT:
|
|
177
|
+
* - Add any new import statements manually
|
|
178
|
+
* - Write import statements directly (this causes compile errors)
|
|
179
|
+
*
|
|
180
|
+
* Note: All necessary imports are provided globally or by the system automatically.
|
|
178
181
|
*
|
|
179
182
|
* ✅ Requirements:
|
|
180
183
|
*
|
|
@@ -46,6 +46,12 @@ export function replaceImportStatements<Model extends ILlmSchema.Model>(
|
|
|
46
46
|
.replace(
|
|
47
47
|
/import\s*{\s*toISOStringSafe\s*}\s*from\s*["']\.\.\/util\/toISOStringSafe["']\s*;?\s*/gm,
|
|
48
48
|
"",
|
|
49
|
+
)
|
|
50
|
+
// Remove JWT import if it exists (to prevent duplication)
|
|
51
|
+
.replace(/import\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm, "")
|
|
52
|
+
.replace(
|
|
53
|
+
/import\s*\*\s*as\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm,
|
|
54
|
+
"",
|
|
49
55
|
);
|
|
50
56
|
|
|
51
57
|
// Remove any existing API structure imports
|
|
@@ -81,6 +87,7 @@ export function replaceImportStatements<Model extends ILlmSchema.Model>(
|
|
|
81
87
|
|
|
82
88
|
// Build the standard imports
|
|
83
89
|
const imports = [
|
|
90
|
+
'import jwt from "jsonwebtoken";',
|
|
84
91
|
'import { MyGlobal } from "../MyGlobal";',
|
|
85
92
|
'import typia, { tags } from "typia";',
|
|
86
93
|
'import { Prisma } from "@prisma/client";',
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { StringUtil } from "@autobe/utils";
|
|
2
|
+
|
|
1
3
|
import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
|
|
2
4
|
|
|
3
5
|
export function completeTestCode(
|
|
@@ -18,18 +20,20 @@ export function completeTestCode(
|
|
|
18
20
|
'string & Format<"uuid">',
|
|
19
21
|
'string & tags.Format<"uuid">',
|
|
20
22
|
);
|
|
21
|
-
code =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
code = StringUtil.trim`
|
|
24
|
+
import { ArrayUtil, RandomGenerator, TestValidator } from "@nestia/e2e";
|
|
25
|
+
import { IConnection } from "@nestia/fetcher";
|
|
26
|
+
import typia, { tags } from "typia";
|
|
27
|
+
|
|
28
|
+
import api from "@ORGANIZATION/PROJECT-api";
|
|
29
|
+
${typeReferences
|
|
30
|
+
.map(
|
|
31
|
+
(ref) =>
|
|
32
|
+
`import type { ${ref} } from "@ORGANIZATION/PROJECT-api/lib/structures/${ref}";`,
|
|
33
|
+
)
|
|
34
|
+
.join("\n")}
|
|
35
|
+
|
|
36
|
+
${code}
|
|
37
|
+
`;
|
|
34
38
|
return code;
|
|
35
39
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { v7 } from "uuid";
|
|
4
4
|
|
|
5
5
|
import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
|
|
6
6
|
import { IAutoBeTestWriteResult } from "./structures/IAutoBeTestWriteResult";
|
|
@@ -14,13 +14,13 @@ export const transformTestCorrectHistories = (
|
|
|
14
14
|
> => {
|
|
15
15
|
return [
|
|
16
16
|
{
|
|
17
|
-
id:
|
|
17
|
+
id: v7(),
|
|
18
18
|
created_at: new Date().toISOString(),
|
|
19
19
|
type: "systemMessage",
|
|
20
20
|
text: AutoBeSystemPromptConstant.TEST_WRITE,
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
id:
|
|
23
|
+
id: v7(),
|
|
24
24
|
created_at: new Date().toISOString(),
|
|
25
25
|
type: "assistantMessage",
|
|
26
26
|
text: [
|
|
@@ -43,7 +43,7 @@ export const transformTestCorrectHistories = (
|
|
|
43
43
|
].join("\n"),
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
id:
|
|
46
|
+
id: v7(),
|
|
47
47
|
created_at: new Date().toISOString(),
|
|
48
48
|
type: "systemMessage",
|
|
49
49
|
text: AutoBeSystemPromptConstant.TEST_CORRECT,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
7
|
import { IAutoBeTestFunction } from "../structures/IAutoBeTestFunction";
|
|
@@ -14,25 +15,25 @@ export const transformTestCorrectHistories = (
|
|
|
14
15
|
> => [
|
|
15
16
|
...transformTestWriteHistories(func.scenario, func.artifacts),
|
|
16
17
|
{
|
|
17
|
-
id:
|
|
18
|
+
id: v7(),
|
|
18
19
|
created_at: new Date().toISOString(),
|
|
19
20
|
type: "assistantMessage",
|
|
20
|
-
text:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
func.script
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
JSON.stringify(failure.diagnostics)
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
text: StringUtil.trim`
|
|
22
|
+
## Generated TypeScript Code
|
|
23
|
+
\`\`\`typescript
|
|
24
|
+
${func.script}
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
## Compile Errors
|
|
28
|
+
Fix the compilation error in the provided code.
|
|
29
|
+
|
|
30
|
+
\`\`\`json
|
|
31
|
+
${JSON.stringify(failure.diagnostics)}
|
|
32
|
+
\`\`\`
|
|
33
|
+
`,
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
|
-
id:
|
|
36
|
+
id: v7(),
|
|
36
37
|
created_at: new Date().toISOString(),
|
|
37
38
|
type: "systemMessage",
|
|
38
39
|
text: AutoBeSystemPromptConstant.TEST_CORRECT.replace(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import {
|
|
2
|
+
import { StringUtil } from "@autobe/utils";
|
|
3
|
+
import { v7 } from "uuid";
|
|
3
4
|
|
|
4
5
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
5
6
|
|
|
@@ -11,67 +12,67 @@ export const transformTestHistories = (
|
|
|
11
12
|
if (state.analyze === null)
|
|
12
13
|
return [
|
|
13
14
|
{
|
|
14
|
-
id:
|
|
15
|
+
id: v7(),
|
|
15
16
|
created_at: new Date().toISOString(),
|
|
16
17
|
type: "systemMessage",
|
|
17
|
-
text:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
text: StringUtil.trim`
|
|
19
|
+
Requirement analysis is not yet completed.
|
|
20
|
+
Don't call the any tool function,
|
|
21
|
+
but say to process the requirement analysis.
|
|
22
|
+
`,
|
|
22
23
|
},
|
|
23
24
|
];
|
|
24
25
|
else if (state.prisma === null)
|
|
25
26
|
return [
|
|
26
27
|
{
|
|
27
|
-
id:
|
|
28
|
+
id: v7(),
|
|
28
29
|
created_at: new Date().toISOString(),
|
|
29
30
|
type: "systemMessage",
|
|
30
|
-
text:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
text: StringUtil.trim`
|
|
32
|
+
Prisma DB schema generation is not yet completed.
|
|
33
|
+
Don't call the any tool function,
|
|
34
|
+
but say to process the Prisma DB schema generation.
|
|
35
|
+
`,
|
|
35
36
|
},
|
|
36
37
|
];
|
|
37
38
|
else if (state.analyze.step !== state.prisma.step)
|
|
38
39
|
return [
|
|
39
40
|
{
|
|
40
|
-
id:
|
|
41
|
+
id: v7(),
|
|
41
42
|
created_at: new Date().toISOString(),
|
|
42
43
|
type: "systemMessage",
|
|
43
|
-
text:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
text: StringUtil.trim`
|
|
45
|
+
Prisma DB schema generation has not been updated
|
|
46
|
+
for the latest requirement analysis.
|
|
47
|
+
Don't call the any tool function,
|
|
48
|
+
but say to re-process the Prisma DB schema generation.
|
|
49
|
+
`,
|
|
49
50
|
},
|
|
50
51
|
];
|
|
51
52
|
else if (state.prisma.compiled.type !== "success")
|
|
52
53
|
return [
|
|
53
54
|
{
|
|
54
|
-
id:
|
|
55
|
+
id: v7(),
|
|
55
56
|
created_at: new Date().toISOString(),
|
|
56
57
|
type: "systemMessage",
|
|
57
|
-
text:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
text: StringUtil.trim`
|
|
59
|
+
Prisma DB schema generation has not been updated
|
|
60
|
+
for the latest requirement analysis.
|
|
61
|
+
Don't call the any tool function,
|
|
62
|
+
but say to re-process the Prisma DB schema generation.
|
|
63
|
+
`,
|
|
63
64
|
},
|
|
64
65
|
];
|
|
65
66
|
return [
|
|
66
67
|
{
|
|
67
|
-
id:
|
|
68
|
+
id: v7(),
|
|
68
69
|
created_at: new Date().toISOString(),
|
|
69
70
|
type: "systemMessage",
|
|
70
|
-
text:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
text: StringUtil.trim`
|
|
72
|
+
Interface generation is not yet completed.
|
|
73
|
+
Don't call the any tool function,
|
|
74
|
+
but say to process the interface generation.
|
|
75
|
+
`,
|
|
75
76
|
},
|
|
76
77
|
];
|
|
77
|
-
};
|
|
78
|
+
};
|
|
@@ -1,70 +1,126 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
-
import {
|
|
2
|
+
import { AutoBeInterfaceAuthorization, AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
+
import { MapUtil, StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
|
+
import { AutoBeState } from "../../../context/AutoBeState";
|
|
8
|
+
import { IAutoBeTestScenarioAuthorizationRole } from "../structures/IAutoBeTestScenarioAuthorizationRole";
|
|
6
9
|
|
|
7
10
|
export const transformTestScenarioHistories = (
|
|
11
|
+
state: AutoBeState,
|
|
8
12
|
entire: AutoBeOpenApi.IOperation[],
|
|
9
13
|
include: AutoBeOpenApi.IOperation[],
|
|
10
14
|
exclude: Pick<AutoBeOpenApi.IOperation, "method" | "path">[],
|
|
11
15
|
): Array<
|
|
12
16
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
13
|
-
> =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
17
|
+
> => {
|
|
18
|
+
const authorizations: AutoBeInterfaceAuthorization[] =
|
|
19
|
+
state.interface?.authorizations ?? [];
|
|
20
|
+
|
|
21
|
+
const authorizationRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
|
|
22
|
+
new Map();
|
|
23
|
+
|
|
24
|
+
for (const authorization of authorizations) {
|
|
25
|
+
for (const op of authorization.operations) {
|
|
26
|
+
if (op.authorizationType === null) continue;
|
|
27
|
+
const value: IAutoBeTestScenarioAuthorizationRole = MapUtil.take(
|
|
28
|
+
authorizationRoles,
|
|
29
|
+
authorization.role,
|
|
30
|
+
() => ({
|
|
31
|
+
name: authorization.role,
|
|
32
|
+
join: null,
|
|
33
|
+
login: null,
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
if (op.authorizationType === "join") value.join = op;
|
|
37
|
+
else if (op.authorizationType === "login") value.login = op;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
id: v7(),
|
|
44
|
+
created_at: new Date().toISOString(),
|
|
45
|
+
type: "systemMessage",
|
|
46
|
+
text: AutoBeSystemPromptConstant.TEST_SCENARIO,
|
|
47
|
+
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
48
|
+
{
|
|
49
|
+
id: v7(),
|
|
50
|
+
created_at: new Date().toISOString(),
|
|
51
|
+
type: "systemMessage",
|
|
52
|
+
text: StringUtil.trim`
|
|
53
|
+
# Operations
|
|
54
|
+
|
|
55
|
+
Below are the full operations. Please refer to this.
|
|
56
|
+
Your role is to draft all test cases for each given Operation.
|
|
57
|
+
It is also permissible to write multiple test codes on a single endpoint.
|
|
58
|
+
However, rather than meaningless tests, business logic tests should be written and an E2E test situation should be assumed.
|
|
59
|
+
|
|
60
|
+
Please carefully analyze each operation to identify all dependencies required for testing.
|
|
61
|
+
For example, if you want to test liking and then deleting a post,
|
|
62
|
+
you might think to test post creation, liking, and unlike operations.
|
|
63
|
+
However, even if not explicitly mentioned, user registration or login are essential prerequisites.
|
|
64
|
+
Pay close attention to IDs and related values in the API,
|
|
65
|
+
and ensure you identify all dependencies between endpoints.
|
|
66
|
+
|
|
67
|
+
\`\`\`json
|
|
68
|
+
${JSON.stringify(
|
|
69
|
+
entire.map((el) => ({
|
|
70
|
+
...el,
|
|
71
|
+
specification: undefined,
|
|
72
|
+
})),
|
|
73
|
+
)}
|
|
74
|
+
\`\`\`
|
|
75
|
+
`,
|
|
76
|
+
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
77
|
+
{
|
|
78
|
+
id: v7(),
|
|
79
|
+
created_at: new Date().toISOString(),
|
|
80
|
+
type: "systemMessage",
|
|
81
|
+
text: StringUtil.trim`
|
|
82
|
+
# Included in Test Plan
|
|
83
|
+
|
|
84
|
+
Below are the endpoints that have been included in the test plan.
|
|
85
|
+
Each endpoint shows its authentication requirements and related authentication APIs.
|
|
86
|
+
When testing endpoints that require authentication, ensure you include the corresponding join/login operations in your test scenario to establish proper authentication context.
|
|
87
|
+
|
|
88
|
+
${include
|
|
89
|
+
.map((el, i) => {
|
|
90
|
+
const roles = Array.from(authorizationRoles.values()).filter(
|
|
91
|
+
(role) => role.name === el.authorizationRole,
|
|
92
|
+
);
|
|
93
|
+
return StringUtil.trim`
|
|
94
|
+
## ${i + 1}. ${el.method.toUpperCase()} ${el.path}
|
|
95
|
+
|
|
96
|
+
Related Authentication APIs:
|
|
97
|
+
|
|
98
|
+
${
|
|
99
|
+
roles.length > 0
|
|
100
|
+
? roles
|
|
101
|
+
.map((role) => {
|
|
102
|
+
return StringUtil.trim`
|
|
103
|
+
- ${role.join?.method.toUpperCase()}: ${role.join?.path}
|
|
104
|
+
- ${role.login?.method.toUpperCase()}: ${role.login?.path}
|
|
105
|
+
`;
|
|
106
|
+
})
|
|
107
|
+
.join("\n")
|
|
108
|
+
: "- None"
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
})
|
|
112
|
+
.join("\n")}
|
|
113
|
+
|
|
114
|
+
# Excluded from Test Plan
|
|
115
|
+
|
|
116
|
+
These are the endpoints that have already been used in test codes generated as part of a plan group.
|
|
117
|
+
These endpoints do not need to be tested again.
|
|
118
|
+
However, it is allowed to reference or depend on these endpoints when writing test codes for other purposes.
|
|
119
|
+
|
|
120
|
+
${exclude
|
|
121
|
+
.map((el) => `- ${el.method.toUpperCase()}: ${el.path}`)
|
|
122
|
+
.join("\n")}
|
|
123
|
+
`,
|
|
124
|
+
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
125
|
+
];
|
|
126
|
+
};
|