@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,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AutoBeAssistantMessageHistory,
|
|
3
3
|
AutoBeOpenApi,
|
|
4
|
+
AutoBeProgressEventBase,
|
|
4
5
|
AutoBeRealizeAuthorization,
|
|
5
6
|
AutoBeRealizeFunction,
|
|
6
7
|
AutoBeRealizeHistory,
|
|
@@ -9,12 +10,13 @@ import {
|
|
|
9
10
|
IAutoBeTypeScriptCompileResult,
|
|
10
11
|
} from "@autobe/interface";
|
|
11
12
|
import { ILlmSchema } from "@samchon/openapi";
|
|
12
|
-
import {
|
|
13
|
+
import { v7 } from "uuid";
|
|
13
14
|
|
|
14
15
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
15
16
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
17
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
16
18
|
import { predicateStateMessage } from "../../utils/predicateStateMessage";
|
|
17
|
-
import {
|
|
19
|
+
import { compileRealizeFiles } from "./internal/compileRealizeFiles";
|
|
18
20
|
import { orchestrateRealizeAuthorization } from "./orchestrateRealizeAuthorization";
|
|
19
21
|
import { orchestrateRealizeCorrect } from "./orchestrateRealizeCorrect";
|
|
20
22
|
import { orchestrateRealizeScenario } from "./orchestrateRealizeScenario";
|
|
@@ -40,13 +42,14 @@ export const orchestrateRealize =
|
|
|
40
42
|
if (predicate !== null)
|
|
41
43
|
return ctx.assistantMessage({
|
|
42
44
|
type: "assistantMessage",
|
|
43
|
-
id:
|
|
45
|
+
id: v7(),
|
|
44
46
|
created_at: start.toISOString(),
|
|
45
47
|
text: predicate,
|
|
46
48
|
completed_at: new Date().toISOString(),
|
|
47
49
|
});
|
|
48
50
|
ctx.dispatch({
|
|
49
51
|
type: "realizeStart",
|
|
52
|
+
id: v7(),
|
|
50
53
|
created_at: start.toISOString(),
|
|
51
54
|
reason: props.reason,
|
|
52
55
|
step: ctx.state().test?.step ?? 0,
|
|
@@ -66,14 +69,18 @@ export const orchestrateRealize =
|
|
|
66
69
|
return orchestrateRealizeScenario(ctx, operation, authorization);
|
|
67
70
|
});
|
|
68
71
|
|
|
69
|
-
const writeProgress = {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
const writeProgress: AutoBeProgressEventBase = {
|
|
73
|
+
total: scenarios.length,
|
|
74
|
+
completed: 0,
|
|
75
|
+
};
|
|
76
|
+
const writeEvents: AutoBeRealizeWriteEvent[] = await executeCachedBatch(
|
|
77
|
+
scenarios.map((scenario) => async (promptCacheKey) => {
|
|
78
|
+
const code = await orchestrateRealizeWrite(ctx, {
|
|
73
79
|
totalAuthorizations: authorizations,
|
|
74
80
|
authorization: scenario.decoratorEvent ?? null,
|
|
75
81
|
scenario,
|
|
76
82
|
progress: writeProgress,
|
|
83
|
+
promptCacheKey,
|
|
77
84
|
});
|
|
78
85
|
return code;
|
|
79
86
|
}),
|
|
@@ -96,12 +103,16 @@ export const orchestrateRealize =
|
|
|
96
103
|
};
|
|
97
104
|
});
|
|
98
105
|
|
|
99
|
-
let compilation = await
|
|
106
|
+
let compilation = await compileRealizeFiles(ctx, {
|
|
107
|
+
authorizations,
|
|
108
|
+
functions,
|
|
109
|
+
});
|
|
100
110
|
|
|
101
111
|
if (compilation.type !== "success") {
|
|
102
|
-
const MAX_CORRECTION_ATTEMPTS =
|
|
112
|
+
const MAX_CORRECTION_ATTEMPTS = 5 as const;
|
|
103
113
|
|
|
104
114
|
const reviewProgress = {
|
|
115
|
+
id: v7(),
|
|
105
116
|
total: writeEvents.length,
|
|
106
117
|
completed: writeEvents.length,
|
|
107
118
|
};
|
|
@@ -117,37 +128,45 @@ export const orchestrateRealize =
|
|
|
117
128
|
reviewProgress.total += Object.keys(failedFiles).length;
|
|
118
129
|
const failure: IAutoBeTypeScriptCompileResult.IFailure = compilation;
|
|
119
130
|
|
|
120
|
-
await
|
|
121
|
-
Object.entries(failedFiles).map(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
scenario
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
131
|
+
await executeCachedBatch(
|
|
132
|
+
Object.entries(failedFiles).map(
|
|
133
|
+
([location, content]) =>
|
|
134
|
+
async () => {
|
|
135
|
+
const diagnostic:
|
|
136
|
+
| IAutoBeTypeScriptCompileResult.IDiagnostic
|
|
137
|
+
| undefined = failure.diagnostics.find(
|
|
138
|
+
(el) => el.file === location,
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
const scenario = scenarios.find(
|
|
142
|
+
(el) => el.location === location,
|
|
143
|
+
);
|
|
144
|
+
if (diagnostic && scenario) {
|
|
145
|
+
const correctEvent = await orchestrateRealizeCorrect(ctx, {
|
|
146
|
+
totalAuthorizations: authorizations,
|
|
147
|
+
authorization: scenario.decoratorEvent ?? null,
|
|
148
|
+
scenario,
|
|
149
|
+
code: content,
|
|
150
|
+
diagnostic,
|
|
151
|
+
progress: reviewProgress,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const corrected = functions.find(
|
|
155
|
+
(el) => el.location === correctEvent.location,
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
if (corrected) {
|
|
159
|
+
corrected.content = correctEvent.content;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
),
|
|
148
164
|
);
|
|
149
165
|
|
|
150
|
-
compilation = await
|
|
166
|
+
compilation = await compileRealizeFiles(ctx, {
|
|
167
|
+
authorizations,
|
|
168
|
+
functions,
|
|
169
|
+
});
|
|
151
170
|
if (compilation.type === "success") {
|
|
152
171
|
break;
|
|
153
172
|
}
|
|
@@ -162,14 +181,14 @@ export const orchestrateRealize =
|
|
|
162
181
|
functions,
|
|
163
182
|
authorizations,
|
|
164
183
|
});
|
|
165
|
-
|
|
166
184
|
return ctx.dispatch({
|
|
167
185
|
type: "realizeComplete",
|
|
186
|
+
id: v7(),
|
|
168
187
|
created_at: new Date().toISOString(),
|
|
169
188
|
functions,
|
|
170
189
|
authorizations,
|
|
171
190
|
controllers,
|
|
172
|
-
compiled: await
|
|
191
|
+
compiled: await compileRealizeFiles(ctx, { authorizations, functions }),
|
|
173
192
|
step: ctx.state().analyze?.step ?? 0,
|
|
174
193
|
elapsed: new Date().getTime() - start.getTime(),
|
|
175
194
|
});
|
|
@@ -9,9 +9,11 @@ import {
|
|
|
9
9
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
10
10
|
import { IPointer } 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";
|
|
16
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
15
17
|
import { transformRealizeAuthorizationHistories } from "./histories/transformRealizeAuthorization";
|
|
16
18
|
import { orchestrateRealizeAuthorizationCorrect } from "./orchestrateRealizeAuthorizationCorrect";
|
|
17
19
|
import { IAutoBeRealizeAuthorizationApplication } from "./structures/IAutoBeRealizeAuthorizationApplication";
|
|
@@ -29,6 +31,7 @@ export async function orchestrateRealizeAuthorization<
|
|
|
29
31
|
>(ctx: AutoBeContext<Model>): Promise<AutoBeRealizeAuthorization[]> {
|
|
30
32
|
ctx.dispatch({
|
|
31
33
|
type: "realizeAuthorizationStart",
|
|
34
|
+
id: v7(),
|
|
32
35
|
step: ctx.state().test?.step ?? 0,
|
|
33
36
|
created_at: new Date().toISOString(),
|
|
34
37
|
});
|
|
@@ -39,20 +42,23 @@ export async function orchestrateRealizeAuthorization<
|
|
|
39
42
|
completed: 0,
|
|
40
43
|
};
|
|
41
44
|
const templateFiles = await (await ctx.compiler()).realize.getTemplate();
|
|
42
|
-
const authorizations: AutoBeRealizeAuthorization[] = await
|
|
43
|
-
roles.map(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
const authorizations: AutoBeRealizeAuthorization[] = await executeCachedBatch(
|
|
46
|
+
roles.map(
|
|
47
|
+
(role) => (promptCacheKey) =>
|
|
48
|
+
process(
|
|
49
|
+
ctx,
|
|
50
|
+
role,
|
|
51
|
+
InternalFileSystem.DEFAULT.map((el) => ({
|
|
52
|
+
[el]: templateFiles[el],
|
|
53
|
+
})).reduce((acc, cur) => Object.assign(acc, cur), {}),
|
|
54
|
+
progress,
|
|
55
|
+
promptCacheKey,
|
|
56
|
+
),
|
|
52
57
|
),
|
|
53
58
|
);
|
|
54
59
|
ctx.dispatch({
|
|
55
60
|
type: "realizeAuthorizationComplete",
|
|
61
|
+
id: v7(),
|
|
56
62
|
created_at: new Date().toISOString(),
|
|
57
63
|
step: ctx.state().test?.step ?? 0,
|
|
58
64
|
});
|
|
@@ -64,6 +70,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
64
70
|
role: AutoBeAnalyzeRole,
|
|
65
71
|
templateFiles: Record<string, string>,
|
|
66
72
|
progress: AutoBeProgressEventBase,
|
|
73
|
+
promptCacheKey: string,
|
|
67
74
|
): Promise<AutoBeRealizeAuthorization> {
|
|
68
75
|
const pointer: IPointer<IAutoBeRealizeAuthorizationApplication.IProps | null> =
|
|
69
76
|
{
|
|
@@ -79,6 +86,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
79
86
|
},
|
|
80
87
|
}),
|
|
81
88
|
enforceFunctionCall: true,
|
|
89
|
+
promptCacheKey,
|
|
82
90
|
message: "Create Authorization Provider and Decorator.",
|
|
83
91
|
});
|
|
84
92
|
if (pointer.value === null) throw new Error("Failed to create decorator.");
|
|
@@ -114,6 +122,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
114
122
|
|
|
115
123
|
ctx.dispatch({
|
|
116
124
|
type: "realizeAuthorizationWrite",
|
|
125
|
+
id: v7(),
|
|
117
126
|
created_at: new Date().toISOString(),
|
|
118
127
|
authorization: authorization,
|
|
119
128
|
tokenUsage,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
9
9
|
import { IPointer } from "tstl";
|
|
10
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
11
12
|
|
|
12
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
13
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -58,6 +59,7 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
58
59
|
|
|
59
60
|
ctx.dispatch({
|
|
60
61
|
type: "realizeAuthorizationValidate",
|
|
62
|
+
id: v7(),
|
|
61
63
|
created_at: new Date().toISOString(),
|
|
62
64
|
authorization: authorization,
|
|
63
65
|
result: compiled,
|
|
@@ -120,6 +122,7 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
120
122
|
ctx.dispatch({
|
|
121
123
|
...pointer.value,
|
|
122
124
|
type: "realizeAuthorizationCorrect",
|
|
125
|
+
id: v7(),
|
|
123
126
|
created_at: new Date().toISOString(),
|
|
124
127
|
authorization: result,
|
|
125
128
|
result: compiled,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AutoBeProgressEventBase,
|
|
2
3
|
AutoBeRealizeAuthorization,
|
|
3
4
|
AutoBeRealizeCorrectEvent,
|
|
4
5
|
IAutoBeTypeScriptCompileResult,
|
|
5
6
|
} from "@autobe/interface";
|
|
7
|
+
import { StringUtil } from "@autobe/utils";
|
|
6
8
|
import { ILlmApplication, ILlmController, ILlmSchema } from "@samchon/openapi";
|
|
7
9
|
import { IPointer } from "tstl";
|
|
8
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
9
12
|
|
|
10
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
11
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -24,7 +27,7 @@ export async function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(
|
|
|
24
27
|
scenario: IAutoBeRealizeScenarioApplication.IProps;
|
|
25
28
|
code: string;
|
|
26
29
|
diagnostic: IAutoBeTypeScriptCompileResult.IDiagnostic;
|
|
27
|
-
progress:
|
|
30
|
+
progress: AutoBeProgressEventBase;
|
|
28
31
|
},
|
|
29
32
|
): Promise<AutoBeRealizeCorrectEvent> {
|
|
30
33
|
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
@@ -54,10 +57,11 @@ export async function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(
|
|
|
54
57
|
totalAuthorizations: props.totalAuthorizations,
|
|
55
58
|
}),
|
|
56
59
|
enforceFunctionCall: true,
|
|
57
|
-
message:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
message: StringUtil.trim`
|
|
61
|
+
Correct the TypeScript code implementation to strictly follow these rules:
|
|
62
|
+
|
|
63
|
+
1. Ensure that the code is production-ready and follows best practices.
|
|
64
|
+
`,
|
|
61
65
|
});
|
|
62
66
|
|
|
63
67
|
if (pointer.value === null)
|
|
@@ -71,6 +75,7 @@ export async function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(
|
|
|
71
75
|
|
|
72
76
|
const event: AutoBeRealizeCorrectEvent = {
|
|
73
77
|
type: "realizeCorrect",
|
|
78
|
+
id: v7(),
|
|
74
79
|
location: props.scenario.location,
|
|
75
80
|
content: pointer.value.implementationCode,
|
|
76
81
|
tokenUsage,
|
|
@@ -115,8 +120,3 @@ const collection = {
|
|
|
115
120
|
deepseek: claude,
|
|
116
121
|
"3.1": claude,
|
|
117
122
|
};
|
|
118
|
-
|
|
119
|
-
export interface IProgress {
|
|
120
|
-
total: number;
|
|
121
|
-
completed: number;
|
|
122
|
-
}
|
|
@@ -1,83 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AutoBeOpenApi,
|
|
3
|
+
AutoBeRealizeAuthorization,
|
|
4
|
+
AutoBeTestFile,
|
|
5
|
+
} from "@autobe/interface";
|
|
2
6
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
7
|
|
|
4
8
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
5
9
|
import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
|
|
6
10
|
|
|
7
|
-
export interface IAutoBeRealizeScenario {
|
|
8
|
-
/**
|
|
9
|
-
* The name of the function to be generated.
|
|
10
|
-
*
|
|
11
|
-
* Derived from the Swagger path and method. The function name must be written
|
|
12
|
-
* in snake_case. It serves as the entry point in both code generation and
|
|
13
|
-
* test code.
|
|
14
|
-
*
|
|
15
|
-
* Once the function is generated, the function name and file name will be the
|
|
16
|
-
* same. The generated file will be located at
|
|
17
|
-
* `src/providers/${function_name}.ts`.
|
|
18
|
-
*/
|
|
19
|
-
functionName: string;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Definition of path and query parameters extracted from the OpenAPI spec.
|
|
23
|
-
*
|
|
24
|
-
* Includes input values passed via URL path or query string. Used for type
|
|
25
|
-
* definitions, validation, and function signature construction.
|
|
26
|
-
*/
|
|
27
|
-
parameters: AutoBeOpenApi.IParameter[];
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Schema definition for the request body input.
|
|
31
|
-
*
|
|
32
|
-
* Extracted from the requestBody section of Swagger. Represents the input
|
|
33
|
-
* data passed in the body (e.g., JSON). Used for generating function
|
|
34
|
-
* arguments or DTOs.
|
|
35
|
-
*/
|
|
36
|
-
inputSchema: AutoBeOpenApi.IRequestBody | null;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Schema definition for the response body.
|
|
40
|
-
*
|
|
41
|
-
* Extracted from the responses section of Swagger. Used to define the return
|
|
42
|
-
* type and expected output in test code.
|
|
43
|
-
*/
|
|
44
|
-
outputSchema: AutoBeOpenApi.IResponseBody | null;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Natural language description of the function’s purpose.
|
|
48
|
-
*
|
|
49
|
-
* Extracted from the summary or description field of Swagger. Used for code
|
|
50
|
-
* documentation, test scenario generation, and conveying function intent.
|
|
51
|
-
*/
|
|
52
|
-
description: string;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* HTTP method information.
|
|
56
|
-
*
|
|
57
|
-
* Extracted from the Swagger operation method. Used to define the request
|
|
58
|
-
* type during code and test generation.
|
|
59
|
-
*/
|
|
60
|
-
method: "get" | "post" | "put" | "delete" | "patch";
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* List of scenario descriptions for test code generation.
|
|
64
|
-
*
|
|
65
|
-
* Each scenario describes the expected behavior of the function under certain
|
|
66
|
-
* conditions. Used as a basis for TDD-style automated test generation.
|
|
67
|
-
*/
|
|
68
|
-
testScenarios: string[];
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Optional decorator event for customizing code generation behavior.
|
|
72
|
-
*
|
|
73
|
-
* Provides additional metadata or instructions that can modify how the
|
|
74
|
-
* function implementation is generated. Can include custom annotations,
|
|
75
|
-
* middleware configurations, or special handling directives that affect the
|
|
76
|
-
* final code output.
|
|
77
|
-
*/
|
|
78
|
-
decoratorEvent?: AutoBeRealizeAuthorization;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
11
|
/**
|
|
82
12
|
* Generates a planning result that defines what kind of function should be
|
|
83
13
|
* created, based solely on the provided Swagger (OpenAPI) operation — without
|
|
@@ -103,7 +33,7 @@ export const orchestrateRealizeScenario = <Model extends ILlmSchema.Model>(
|
|
|
103
33
|
operation: AutoBeOpenApi.IOperation,
|
|
104
34
|
authorization?: AutoBeRealizeAuthorization,
|
|
105
35
|
): IAutoBeRealizeScenarioApplication.IProps => {
|
|
106
|
-
const
|
|
36
|
+
const testFiles: AutoBeTestFile[] =
|
|
107
37
|
ctx
|
|
108
38
|
.state()
|
|
109
39
|
.test?.files.filter(
|
|
@@ -121,7 +51,7 @@ export const orchestrateRealizeScenario = <Model extends ILlmSchema.Model>(
|
|
|
121
51
|
operation: operation,
|
|
122
52
|
functionName: functionName,
|
|
123
53
|
location: `src/providers/${functionName}.ts`,
|
|
124
|
-
|
|
54
|
+
testFiles: testFiles,
|
|
125
55
|
decoratorEvent: authorization,
|
|
126
56
|
};
|
|
127
57
|
};
|
|
@@ -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";
|
|
@@ -21,7 +24,8 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
21
24
|
totalAuthorizations: AutoBeRealizeAuthorization[];
|
|
22
25
|
authorization: AutoBeRealizeAuthorization | null;
|
|
23
26
|
scenario: IAutoBeRealizeScenarioApplication.IProps;
|
|
24
|
-
progress:
|
|
27
|
+
progress: AutoBeProgressEventBase;
|
|
28
|
+
promptCacheKey: string;
|
|
25
29
|
},
|
|
26
30
|
): Promise<AutoBeRealizeWriteEvent> {
|
|
27
31
|
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
@@ -48,23 +52,24 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
48
52
|
},
|
|
49
53
|
}),
|
|
50
54
|
enforceFunctionCall: true,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
+
`,
|
|
68
73
|
});
|
|
69
74
|
if (pointer.value === null) throw new Error("Failed to write code.");
|
|
70
75
|
|
|
@@ -76,6 +81,7 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
76
81
|
|
|
77
82
|
const event: AutoBeRealizeWriteEvent = {
|
|
78
83
|
type: "realizeWrite",
|
|
84
|
+
id: v7(),
|
|
79
85
|
location: props.scenario.location,
|
|
80
86
|
content: pointer.value.implementationCode,
|
|
81
87
|
tokenUsage,
|
|
@@ -121,8 +127,3 @@ const collection = {
|
|
|
121
127
|
deepseek: claude,
|
|
122
128
|
"3.1": claude,
|
|
123
129
|
};
|
|
124
|
-
|
|
125
|
-
export interface IProgress {
|
|
126
|
-
total: number;
|
|
127
|
-
completed: number;
|
|
128
|
-
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AutoBeOpenApi,
|
|
3
|
+
AutoBeRealizeAuthorization,
|
|
4
|
+
AutoBeTestFile,
|
|
5
|
+
} from "@autobe/interface";
|
|
2
6
|
|
|
3
7
|
export namespace IAutoBeRealizeScenarioApplication {
|
|
4
8
|
export interface IProps {
|
|
@@ -28,7 +32,7 @@ export namespace IAutoBeRealizeScenarioApplication {
|
|
|
28
32
|
* certain conditions. Used as a basis for TDD-style automated test
|
|
29
33
|
* generation.
|
|
30
34
|
*/
|
|
31
|
-
|
|
35
|
+
testFiles: AutoBeTestFile[];
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
38
|
* Optional decorator event for customizing code generation behavior.
|
|
@@ -18,13 +18,16 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
18
18
|
* 📋 STEP 1 - PRISMA SCHEMA VERIFICATION:
|
|
19
19
|
*
|
|
20
20
|
* DO:
|
|
21
|
+
*
|
|
21
22
|
* - Examine the actual Prisma schema model definition
|
|
22
23
|
* - List EVERY field that exists in the model with exact types
|
|
23
24
|
* - Explicitly note fields that DO NOT exist
|
|
24
|
-
*
|
|
25
|
+
*
|
|
25
26
|
* DO NOT:
|
|
27
|
+
*
|
|
26
28
|
* - Assume common fields exist without verification
|
|
27
|
-
* - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active
|
|
29
|
+
* - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active
|
|
30
|
+
* without checking
|
|
28
31
|
*
|
|
29
32
|
* 📋 STEP 2 - FIELD INVENTORY:
|
|
30
33
|
*
|
|
@@ -161,7 +164,7 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
161
164
|
*
|
|
162
165
|
* This is the initial drafting phase where you outline the basic skeleton
|
|
163
166
|
* of the function.
|
|
164
|
-
*
|
|
167
|
+
*
|
|
165
168
|
* DO NOT: Use the native Date type.
|
|
166
169
|
*
|
|
167
170
|
* - The function signature must correctly include `user`, `parameters`, and
|
|
@@ -174,10 +177,12 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
174
177
|
* Import rules:
|
|
175
178
|
*
|
|
176
179
|
* DO NOT:
|
|
180
|
+
*
|
|
177
181
|
* - Add any new import statements manually
|
|
178
182
|
* - Write import statements directly (this causes compile errors)
|
|
179
|
-
*
|
|
180
|
-
* Note: All necessary imports are provided globally or by the system
|
|
183
|
+
*
|
|
184
|
+
* Note: All necessary imports are provided globally or by the system
|
|
185
|
+
* automatically.
|
|
181
186
|
*
|
|
182
187
|
* ✅ Requirements:
|
|
183
188
|
*
|
|
@@ -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
|
}
|
|
@@ -19,6 +19,8 @@ const singleton = new Singleton(async (compiler: IAutoBeTestCompiler) => {
|
|
|
19
19
|
return { [location]: content };
|
|
20
20
|
};
|
|
21
21
|
return {
|
|
22
|
+
...external("node_modules/@nestia/e2e/lib/ArrayUtil.d.ts"),
|
|
23
|
+
...external("node_modules/@nestia/e2e/lib/RandomGenerator.d.ts"),
|
|
22
24
|
...external("node_modules/@nestia/e2e/lib/TestValidator.d.ts"),
|
|
23
25
|
...external("node_modules/@nestia/fetcher/lib/IConnection.d.ts"),
|
|
24
26
|
} satisfies Record<string, string>;
|
|
@@ -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,
|