@autobe/agent 0.19.1 → 0.21.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/agent/src/AutoBeAgent.js +3 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.js +4 -3
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +12 -11
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/agent/src/context/AutoBeContext.d.ts +3 -2
- package/lib/agent/src/factory/consentFunctionCall.js +3 -2
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +11 -6
- 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/{transformAnalyzeReviewerHistories.js → transformAnalyzeReviewHistories.js} +24 -29
- 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.js +31 -29
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +19 -5
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +9 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +11 -9
- 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 +5 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +45 -46
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +13 -13
- 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 +23 -22
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +33 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- 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 +32 -31
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +3 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +28 -24
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +2 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +11 -5
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +365 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +2 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +80 -54
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1635 -1180
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +30 -24
- 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 +178 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js +3 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +78 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +54 -54
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +18 -29
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +37 -34
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +38 -25
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +3 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +2 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +3 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +19 -9
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +28 -21
- 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 +58 -56
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- 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.js +12 -3
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +35 -30
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/{orchestrate/realize/internal/compile.d.ts → agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
- package/lib/agent/src/orchestrate/realize/internal/{compile.js → compileRealizeFiles.js} +6 -6
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +26 -12
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +9 -3
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +3 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +12 -8
- 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 +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +25 -21
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
- 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/compile/getTestExternalDeclarations.js +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +44 -27
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +63 -60
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +118 -96
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -5
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +17 -8
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +30 -18
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +18 -18
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
- 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/constants/AutoBeSystemPromptConstant.d.ts +12 -11
- package/lib/context/AutoBeContext.d.ts +3 -2
- package/lib/index.mjs +3265 -1702
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +78 -0
- package/lib/{agent/src/orchestrate/realize/internal/compile.d.ts → orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/utils/executeCachedBatch.d.ts +1 -0
- package/package.json +7 -7
- package/src/AutoBeAgent.ts +4 -3
- package/src/AutoBeMockAgent.ts +5 -4
- package/src/constants/AutoBeSystemPromptConstant.ts +12 -11
- package/src/context/AutoBeContext.ts +3 -0
- package/src/factory/consentFunctionCall.ts +4 -3
- package/src/factory/createAutoBeContext.ts +11 -7
- package/src/orchestrate/analyze/histories/{transformAnalyzeReviewerHistories.ts → transformAnalyzeReviewHistories.ts} +23 -30
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +13 -10
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +60 -61
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +20 -13
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +20 -9
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +13 -11
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +10 -5
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +47 -48
- 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 -19
- package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +39 -0
- 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 +31 -30
- package/src/orchestrate/interface/orchestrateInterface.ts +4 -2
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +36 -29
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +18 -10
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +95 -0
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +53 -50
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +120 -10
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +47 -23
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +85 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +65 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +82 -1
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +57 -55
- 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 +4 -2
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +2 -0
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +3 -0
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +26 -13
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +25 -17
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +24 -21
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +42 -40
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +17 -13
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +14 -5
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +35 -30
- package/src/orchestrate/realize/internal/{compile.ts → compileRealizeFiles.ts} +15 -11
- package/src/orchestrate/realize/orchestrateRealize.ts +59 -40
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +19 -10
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -0
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +10 -10
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +7 -77
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +24 -23
- package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts +6 -2
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +10 -5
- package/src/orchestrate/test/compile/completeTestCode.ts +17 -13
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +2 -0
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +50 -37
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +62 -57
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +27 -7
- package/src/orchestrate/test/orchestrateTest.ts +7 -9
- package/src/orchestrate/test/orchestrateTestCorrect.ts +39 -25
- package/src/orchestrate/test/orchestrateTestScenario.ts +28 -21
- package/src/orchestrate/test/orchestrateTestWrite.ts +17 -18
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +3 -3
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +28 -1
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +2 -2
- package/src/utils/executeCachedBatch.ts +15 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +0 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +0 -74
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +0 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
- package/lib/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
- package/src/orchestrate/test/histories/transformTestHistories.ts +0 -77
|
@@ -1,46 +1,59 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
5
|
+
import { v7 } from "uuid";
|
|
4
6
|
|
|
5
7
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
8
|
+
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
6
9
|
import { IAutoBeTestFunction } from "../structures/IAutoBeTestFunction";
|
|
7
10
|
import { transformTestWriteHistories } from "./transformTestWriteHistories";
|
|
8
11
|
|
|
9
|
-
export const transformTestCorrectHistories =
|
|
12
|
+
export const transformTestCorrectHistories = async <
|
|
13
|
+
Model extends ILlmSchema.Model,
|
|
14
|
+
>(
|
|
15
|
+
ctx: AutoBeContext<Model>,
|
|
10
16
|
func: IAutoBeTestFunction,
|
|
11
17
|
failure: IAutoBeTypeScriptCompileResult.IFailure,
|
|
12
|
-
):
|
|
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
|
-
|
|
18
|
+
): Promise<
|
|
19
|
+
Array<
|
|
20
|
+
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
21
|
+
>
|
|
22
|
+
> => {
|
|
23
|
+
const previous = await transformTestWriteHistories(
|
|
24
|
+
ctx,
|
|
25
|
+
func.scenario,
|
|
26
|
+
func.artifacts,
|
|
27
|
+
);
|
|
28
|
+
return [
|
|
29
|
+
...previous.slice(0, -1),
|
|
30
|
+
{
|
|
31
|
+
id: v7(),
|
|
32
|
+
created_at: new Date().toISOString(),
|
|
33
|
+
type: "systemMessage",
|
|
34
|
+
text: AutoBeSystemPromptConstant.TEST_CORRECT,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: v7(),
|
|
38
|
+
created_at: new Date().toISOString(),
|
|
39
|
+
type: "assistantMessage",
|
|
40
|
+
text: StringUtil.trim`
|
|
41
|
+
${previous.at(-1)!.text}
|
|
42
|
+
|
|
43
|
+
## Generated TypeScript Code
|
|
44
|
+
|
|
45
|
+
\`\`\`typescript
|
|
46
|
+
${func.script}
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
## Compile Errors
|
|
50
|
+
|
|
51
|
+
Fix the compilation error in the provided code.
|
|
52
|
+
|
|
53
|
+
\`\`\`json
|
|
54
|
+
${JSON.stringify(failure.diagnostics)}
|
|
55
|
+
\`\`\`
|
|
56
|
+
`,
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeInterfaceAuthorization, AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
-
import { MapUtil } from "@autobe/utils";
|
|
4
|
-
import {
|
|
3
|
+
import { MapUtil, StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
5
5
|
|
|
6
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
7
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
@@ -40,82 +40,87 @@ export const transformTestScenarioHistories = (
|
|
|
40
40
|
|
|
41
41
|
return [
|
|
42
42
|
{
|
|
43
|
-
id:
|
|
43
|
+
id: v7(),
|
|
44
44
|
created_at: new Date().toISOString(),
|
|
45
45
|
type: "systemMessage",
|
|
46
46
|
text: AutoBeSystemPromptConstant.TEST_SCENARIO,
|
|
47
47
|
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
48
48
|
{
|
|
49
|
-
id:
|
|
49
|
+
id: v7(),
|
|
50
50
|
created_at: new Date().toISOString(),
|
|
51
51
|
type: "systemMessage",
|
|
52
|
-
text:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
JSON.stringify(
|
|
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
69
|
entire.map((el) => ({
|
|
70
70
|
...el,
|
|
71
71
|
specification: undefined,
|
|
72
72
|
})),
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
)}
|
|
74
|
+
\`\`\`
|
|
75
|
+
`,
|
|
76
76
|
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
77
77
|
{
|
|
78
|
-
id:
|
|
78
|
+
id: v7(),
|
|
79
79
|
created_at: new Date().toISOString(),
|
|
80
80
|
type: "systemMessage",
|
|
81
|
-
text:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
include
|
|
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
89
|
.map((el, i) => {
|
|
90
90
|
const roles = Array.from(authorizationRoles.values()).filter(
|
|
91
91
|
(role) => role.name === el.authorizationRole,
|
|
92
92
|
);
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
+
`;
|
|
107
111
|
})
|
|
108
|
-
.join("\n")
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
|
116
121
|
.map((el) => `- ${el.method.toUpperCase()}: ${el.path}`)
|
|
117
|
-
.join("\n")
|
|
118
|
-
|
|
122
|
+
.join("\n")}
|
|
123
|
+
`,
|
|
119
124
|
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
120
125
|
];
|
|
121
126
|
};
|
|
@@ -4,37 +4,51 @@ import { StringUtil, transformOpenApiDocument } from "@autobe/utils";
|
|
|
4
4
|
import {
|
|
5
5
|
HttpMigration,
|
|
6
6
|
IHttpMigrateApplication,
|
|
7
|
+
ILlmSchema,
|
|
7
8
|
OpenApi,
|
|
8
9
|
} from "@samchon/openapi";
|
|
9
10
|
import typia from "typia";
|
|
10
|
-
import {
|
|
11
|
+
import { v7 } from "uuid";
|
|
11
12
|
|
|
12
13
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
14
|
+
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
15
|
+
import { getTestExternalDeclarations } from "../compile/getTestExternalDeclarations";
|
|
13
16
|
import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
|
|
14
17
|
|
|
15
|
-
export function transformTestWriteHistories
|
|
18
|
+
export async function transformTestWriteHistories<
|
|
19
|
+
Model extends ILlmSchema.Model,
|
|
20
|
+
>(
|
|
21
|
+
ctx: AutoBeContext<Model>,
|
|
16
22
|
scenario: AutoBeTestScenario,
|
|
17
23
|
artifacts: IAutoBeTestScenarioArtifacts,
|
|
18
|
-
):
|
|
24
|
+
): Promise<
|
|
25
|
+
Array<
|
|
26
|
+
IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage
|
|
27
|
+
>
|
|
28
|
+
> {
|
|
19
29
|
return [
|
|
20
30
|
{
|
|
21
|
-
id:
|
|
31
|
+
id: v7(),
|
|
22
32
|
created_at: new Date().toISOString(),
|
|
23
33
|
type: "systemMessage",
|
|
24
34
|
text: AutoBeSystemPromptConstant.TEST_WRITE.replace(
|
|
25
35
|
"{{AutoBeTestScenario}}",
|
|
26
36
|
JSON.stringify(typia.llm.parameters<AutoBeTestScenario, "llama">()),
|
|
27
|
-
)
|
|
37
|
+
),
|
|
28
38
|
},
|
|
29
39
|
{
|
|
30
|
-
id:
|
|
40
|
+
id: v7(),
|
|
31
41
|
created_at: new Date().toISOString(),
|
|
32
|
-
type: "
|
|
42
|
+
type: "assistantMessage",
|
|
33
43
|
text: StringUtil.trim`
|
|
34
44
|
Here is the list of input material composition.
|
|
35
45
|
|
|
36
46
|
Make e2e test functions based on the following information.
|
|
37
47
|
|
|
48
|
+
## Function Name
|
|
49
|
+
|
|
50
|
+
The e2e test function name must be ${JSON.stringify(scenario.functionName)}.
|
|
51
|
+
|
|
38
52
|
## Scenario Plan
|
|
39
53
|
|
|
40
54
|
Here is the scenario plan what you have to implement.
|
|
@@ -66,6 +80,12 @@ export function transformTestWriteHistories(
|
|
|
66
80
|
\`\`\`json
|
|
67
81
|
${JSON.stringify(artifacts.e2e)}
|
|
68
82
|
\`\`\`
|
|
83
|
+
|
|
84
|
+
## External Definitions
|
|
85
|
+
|
|
86
|
+
\`\`\`json
|
|
87
|
+
${JSON.stringify(await getTestExternalDeclarations(ctx))}
|
|
88
|
+
\`\`\`
|
|
69
89
|
`,
|
|
70
90
|
},
|
|
71
91
|
];
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
IAutoBeTypeScriptCompileResult,
|
|
9
9
|
} from "@autobe/interface";
|
|
10
10
|
import { ILlmSchema } from "@samchon/openapi";
|
|
11
|
-
import {
|
|
11
|
+
import { v7 } from "uuid";
|
|
12
12
|
|
|
13
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
14
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
@@ -29,13 +29,14 @@ export const orchestrateTest =
|
|
|
29
29
|
if (predicate !== null)
|
|
30
30
|
return ctx.assistantMessage({
|
|
31
31
|
type: "assistantMessage",
|
|
32
|
-
id:
|
|
32
|
+
id: v7(),
|
|
33
33
|
created_at: start.toISOString(),
|
|
34
34
|
text: predicate,
|
|
35
35
|
completed_at: new Date().toISOString(),
|
|
36
36
|
});
|
|
37
37
|
ctx.dispatch({
|
|
38
38
|
type: "testStart",
|
|
39
|
+
id: v7(),
|
|
39
40
|
created_at: start.toISOString(),
|
|
40
41
|
reason: props.reason,
|
|
41
42
|
step: ctx.state().analyze?.step ?? 0,
|
|
@@ -46,7 +47,7 @@ export const orchestrateTest =
|
|
|
46
47
|
ctx.state().interface?.document.operations ?? [];
|
|
47
48
|
if (operations.length === 0)
|
|
48
49
|
return ctx.assistantMessage({
|
|
49
|
-
id:
|
|
50
|
+
id: v7(),
|
|
50
51
|
type: "assistantMessage",
|
|
51
52
|
created_at: start.toISOString(),
|
|
52
53
|
completed_at: new Date().toISOString(),
|
|
@@ -63,14 +64,10 @@ export const orchestrateTest =
|
|
|
63
64
|
ctx,
|
|
64
65
|
scenarios,
|
|
65
66
|
);
|
|
66
|
-
|
|
67
67
|
const corrects: AutoBeTestValidateEvent[] = await orchestrateTestCorrect(
|
|
68
68
|
ctx,
|
|
69
69
|
written,
|
|
70
70
|
);
|
|
71
|
-
const success: AutoBeTestValidateEvent[] = corrects.filter(
|
|
72
|
-
(c) => c.result.type === "success",
|
|
73
|
-
);
|
|
74
71
|
|
|
75
72
|
// DO COMPILE
|
|
76
73
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
@@ -82,13 +79,14 @@ export const orchestrateTest =
|
|
|
82
79
|
dbms: "sqlite",
|
|
83
80
|
}),
|
|
84
81
|
).filter(([key]) => key.endsWith(".ts")),
|
|
85
|
-
...
|
|
82
|
+
...corrects.map((s) => [s.file.location, s.file.content]),
|
|
86
83
|
]),
|
|
87
84
|
});
|
|
88
85
|
return ctx.dispatch({
|
|
89
86
|
type: "testComplete",
|
|
87
|
+
id: v7(),
|
|
90
88
|
created_at: new Date().toISOString(),
|
|
91
|
-
files:
|
|
89
|
+
files: corrects.map((s) => s.file),
|
|
92
90
|
compiled,
|
|
93
91
|
step: ctx.state().interface?.step ?? 0,
|
|
94
92
|
elapsed: new Date().getTime() - start.getTime(),
|
|
@@ -4,12 +4,15 @@ import {
|
|
|
4
4
|
IAutoBeCompiler,
|
|
5
5
|
IAutoBeTypeScriptCompileResult,
|
|
6
6
|
} from "@autobe/interface";
|
|
7
|
+
import { StringUtil } from "@autobe/utils";
|
|
7
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
9
|
import { IPointer } from "tstl";
|
|
9
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
10
12
|
|
|
11
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
15
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
13
16
|
import { completeTestCode } from "./compile/completeTestCode";
|
|
14
17
|
import { transformTestCorrectHistories } from "./histories/transformTestCorrectHistories";
|
|
15
18
|
import { IAutoBeTestCorrectApplication } from "./structures/IAutoBeTestCorrectApplication";
|
|
@@ -22,31 +25,32 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
|
|
|
22
25
|
writeResult: IAutoBeTestWriteResult[],
|
|
23
26
|
life: number = 4,
|
|
24
27
|
): Promise<AutoBeTestValidateEvent[]> => {
|
|
25
|
-
const result: Array<AutoBeTestValidateEvent | null> =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
scenario: w.scenario,
|
|
31
|
-
location: w.event.location,
|
|
32
|
-
script: w.event.final,
|
|
33
|
-
});
|
|
34
|
-
return predicate(
|
|
35
|
-
ctx,
|
|
36
|
-
{
|
|
28
|
+
const result: Array<AutoBeTestValidateEvent | null> =
|
|
29
|
+
await executeCachedBatch(
|
|
30
|
+
writeResult.map((w) => async () => {
|
|
31
|
+
try {
|
|
32
|
+
const event: AutoBeTestValidateEvent = await compile(ctx, {
|
|
37
33
|
artifacts: w.artifacts,
|
|
38
34
|
scenario: w.scenario,
|
|
39
35
|
location: w.event.location,
|
|
40
36
|
script: w.event.final,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
});
|
|
38
|
+
return await predicate(
|
|
39
|
+
ctx,
|
|
40
|
+
{
|
|
41
|
+
artifacts: w.artifacts,
|
|
42
|
+
scenario: w.scenario,
|
|
43
|
+
location: w.event.location,
|
|
44
|
+
script: w.event.final,
|
|
45
|
+
},
|
|
46
|
+
event,
|
|
47
|
+
life,
|
|
48
|
+
);
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
50
54
|
return result.filter((r) => r !== null);
|
|
51
55
|
};
|
|
52
56
|
|
|
@@ -64,6 +68,7 @@ const compile = async <Model extends ILlmSchema.Model>(
|
|
|
64
68
|
});
|
|
65
69
|
return {
|
|
66
70
|
type: "testValidate",
|
|
71
|
+
id: v7(),
|
|
67
72
|
file: {
|
|
68
73
|
scenario: func.scenario,
|
|
69
74
|
location: func.location,
|
|
@@ -83,7 +88,7 @@ const predicate = async <Model extends ILlmSchema.Model>(
|
|
|
83
88
|
): Promise<AutoBeTestValidateEvent> => {
|
|
84
89
|
if (event.result.type === "failure") ctx.dispatch(event);
|
|
85
90
|
return event.result.type === "failure"
|
|
86
|
-
? correct(ctx, content, event, life - 1)
|
|
91
|
+
? await correct(ctx, content, event, life - 1)
|
|
87
92
|
: event;
|
|
88
93
|
};
|
|
89
94
|
|
|
@@ -101,7 +106,11 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
101
106
|
};
|
|
102
107
|
const { tokenUsage } = await ctx.conversate({
|
|
103
108
|
source: "testCorrect",
|
|
104
|
-
histories: transformTestCorrectHistories(
|
|
109
|
+
histories: await transformTestCorrectHistories(
|
|
110
|
+
ctx,
|
|
111
|
+
content,
|
|
112
|
+
validate.result,
|
|
113
|
+
),
|
|
105
114
|
controller: createController({
|
|
106
115
|
model: ctx.model,
|
|
107
116
|
artifacts: content.artifacts,
|
|
@@ -110,8 +119,12 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
110
119
|
},
|
|
111
120
|
}),
|
|
112
121
|
enforceFunctionCall: true,
|
|
113
|
-
message:
|
|
114
|
-
|
|
122
|
+
message: StringUtil.trim`
|
|
123
|
+
Fix the AutoBeTest.IFunction data to resolve the compilation error.
|
|
124
|
+
|
|
125
|
+
You don't need to explain me anything, but just fix it immediately
|
|
126
|
+
without any hesitation, explanation, and questions.
|
|
127
|
+
`,
|
|
115
128
|
});
|
|
116
129
|
if (pointer.value === null) throw new Error("Failed to modify test code.");
|
|
117
130
|
|
|
@@ -120,6 +133,7 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
120
133
|
|
|
121
134
|
ctx.dispatch({
|
|
122
135
|
type: "testCorrect",
|
|
136
|
+
id: v7(),
|
|
123
137
|
created_at: new Date().toISOString(),
|
|
124
138
|
file: validate.file,
|
|
125
139
|
result: validate.result,
|
|
@@ -9,10 +9,12 @@ import { AutoBeEndpointComparator, MapUtil, StringUtil } from "@autobe/utils";
|
|
|
9
9
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
10
10
|
import { HashMap, IPointer, Pair } from "tstl";
|
|
11
11
|
import typia from "typia";
|
|
12
|
+
import { v7 } from "uuid";
|
|
12
13
|
|
|
13
14
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
15
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
15
16
|
import { divideArray } from "../../utils/divideArray";
|
|
17
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
16
18
|
import { transformTestScenarioHistories } from "./histories/transformTestScenarioHistories";
|
|
17
19
|
import { IAutoBeTestScenarioApplication } from "./structures/IAutoBeTestScenarioApplication";
|
|
18
20
|
import { IAutoBeTestScenarioAuthorizationRole } from "./structures/IAutoBeTestScenarioAuthorizationRole";
|
|
@@ -64,18 +66,18 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
64
66
|
array: include,
|
|
65
67
|
capacity: 5,
|
|
66
68
|
});
|
|
67
|
-
await
|
|
68
|
-
matrix.map(async (
|
|
69
|
+
await executeCachedBatch(
|
|
70
|
+
matrix.map((include) => async (promptCacheKey) => {
|
|
69
71
|
exclude.push(
|
|
70
|
-
...(await divideAndConquer(
|
|
71
|
-
ctx,
|
|
72
|
+
...(await divideAndConquer(ctx, {
|
|
72
73
|
dict,
|
|
73
74
|
endpointNotFound,
|
|
74
|
-
operations,
|
|
75
|
+
entire: operations,
|
|
75
76
|
include,
|
|
76
|
-
exclude.map((x) => x.endpoint),
|
|
77
|
+
exclude: exclude.map((x) => x.endpoint),
|
|
77
78
|
progress,
|
|
78
|
-
|
|
79
|
+
promptCacheKey,
|
|
80
|
+
})),
|
|
79
81
|
);
|
|
80
82
|
}),
|
|
81
83
|
);
|
|
@@ -106,13 +108,16 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
106
108
|
|
|
107
109
|
const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
108
110
|
ctx: AutoBeContext<Model>,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
props: {
|
|
112
|
+
dict: HashMap<AutoBeOpenApi.IEndpoint, AutoBeOpenApi.IOperation>;
|
|
113
|
+
endpointNotFound: string;
|
|
114
|
+
entire: AutoBeOpenApi.IOperation[];
|
|
115
|
+
include: AutoBeOpenApi.IOperation[];
|
|
116
|
+
exclude: AutoBeOpenApi.IEndpoint[];
|
|
117
|
+
progress: AutoBeProgressEventBase;
|
|
118
|
+
promptCacheKey: string;
|
|
119
|
+
},
|
|
120
|
+
): Promise<IAutoBeTestScenarioApplication.IScenarioGroup[]> => {
|
|
116
121
|
const pointer: IPointer<IAutoBeTestScenarioApplication.IScenarioGroup[]> = {
|
|
117
122
|
value: [],
|
|
118
123
|
};
|
|
@@ -124,14 +129,14 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
124
129
|
source: "testScenarios",
|
|
125
130
|
histories: transformTestScenarioHistories(
|
|
126
131
|
ctx.state(),
|
|
127
|
-
entire,
|
|
128
|
-
include,
|
|
129
|
-
exclude,
|
|
132
|
+
props.entire,
|
|
133
|
+
props.include,
|
|
134
|
+
props.exclude,
|
|
130
135
|
),
|
|
131
136
|
controller: createController({
|
|
132
137
|
model: ctx.model,
|
|
133
|
-
endpointNotFound,
|
|
134
|
-
dict,
|
|
138
|
+
endpointNotFound: props.endpointNotFound,
|
|
139
|
+
dict: props.dict,
|
|
135
140
|
authorizations,
|
|
136
141
|
build: (next) => {
|
|
137
142
|
pointer.value ??= [];
|
|
@@ -139,11 +144,13 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
139
144
|
},
|
|
140
145
|
}),
|
|
141
146
|
enforceFunctionCall: true,
|
|
147
|
+
promptCacheKey: props.promptCacheKey,
|
|
142
148
|
message: `Create e2e test scenarios.`,
|
|
143
149
|
});
|
|
144
150
|
if (pointer.value.length === 0) return [];
|
|
145
151
|
ctx.dispatch({
|
|
146
152
|
type: "testScenarios",
|
|
153
|
+
id: v7(),
|
|
147
154
|
tokenUsage,
|
|
148
155
|
scenarios: pointer.value
|
|
149
156
|
.map((v) =>
|
|
@@ -158,8 +165,8 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
158
165
|
),
|
|
159
166
|
)
|
|
160
167
|
.flat(),
|
|
161
|
-
completed: ++progress.completed,
|
|
162
|
-
total: progress.total,
|
|
168
|
+
completed: ++props.progress.completed,
|
|
169
|
+
total: props.progress.total,
|
|
163
170
|
step: ctx.state().interface?.step ?? 0,
|
|
164
171
|
created_at: new Date().toISOString(),
|
|
165
172
|
});
|