@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 { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
+
import { StringUtil } from "@autobe/utils";
|
|
2
3
|
import { NamingConvention } from "typia/lib/utils/NamingConvention";
|
|
3
|
-
import {
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
7
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
@@ -17,67 +18,68 @@ export const transformPrismaComponentsHistories = (
|
|
|
17
18
|
if (prefix) prefix = NamingConvention.snake(prefix);
|
|
18
19
|
return [
|
|
19
20
|
{
|
|
20
|
-
id:
|
|
21
|
+
id: v7(),
|
|
21
22
|
created_at: new Date().toISOString(),
|
|
22
23
|
type: "systemMessage",
|
|
23
24
|
text: AutoBeSystemPromptConstant.PRISMA_COMPONENT,
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
|
-
id:
|
|
27
|
+
id: v7(),
|
|
27
28
|
created_at: new Date().toISOString(),
|
|
28
29
|
type: "assistantMessage",
|
|
29
|
-
text:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
JSON.stringify(state.analyze.files)
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
30
|
+
text: StringUtil.trim`
|
|
31
|
+
Here is the requirement analysis report.
|
|
32
|
+
|
|
33
|
+
Call the provided tool function to generate Prisma DB schema
|
|
34
|
+
referencing below requirement analysis report.
|
|
35
|
+
|
|
36
|
+
## Requirement Analysis Report
|
|
37
|
+
|
|
38
|
+
\`\`\`json
|
|
39
|
+
${JSON.stringify(state.analyze.files)}
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
## Prefix
|
|
43
|
+
|
|
44
|
+
- Prefix provided by the user: ${prefix}
|
|
45
|
+
|
|
46
|
+
The user wants all database schema (table) names to start with the prefix provided below.
|
|
47
|
+
|
|
48
|
+
- DO: Use the provided prefix for all table names
|
|
49
|
+
- DO: Place special-purpose prefixes like \`mv\` (for materialized views) before the given prefix
|
|
50
|
+
- DO NOT: Apply prefix if it is \`null\`
|
|
51
|
+
|
|
52
|
+
## Prefix Example
|
|
53
|
+
|
|
54
|
+
If the prefix is \`shopping\`, then table names are like:
|
|
55
|
+
|
|
56
|
+
- \`shopping_sales\`
|
|
57
|
+
- \`shopping_sale_options\`
|
|
58
|
+
|
|
59
|
+
In cases where a table is created for performance optimization purposes
|
|
60
|
+
(e.g., materialized views), the \`mv_\` prefix must come first. For example:
|
|
61
|
+
|
|
62
|
+
- \`mv_shopping_daily_stats\`
|
|
63
|
+
|
|
64
|
+
${
|
|
65
|
+
state.analyze.roles.length > 0
|
|
66
|
+
? StringUtil.trim`
|
|
67
|
+
## User Role Handling
|
|
68
|
+
|
|
69
|
+
The Requirement Analysis Report contains the following user roles: ${state.analyze.roles.join(", ")}
|
|
70
|
+
|
|
71
|
+
**Do not normalize** user roles into a single table.
|
|
72
|
+
Instead, create separate tables for each distinct role mentioned in the requirements.
|
|
73
|
+
|
|
74
|
+
Create separate tables for each role:
|
|
75
|
+
|
|
76
|
+
${state.analyze.roles
|
|
77
|
+
.map((role) => `- ${prefix}_${role.name.toLowerCase()}`)
|
|
78
|
+
.join("\n")}
|
|
79
|
+
`
|
|
80
|
+
: ""
|
|
81
|
+
}
|
|
82
|
+
`,
|
|
81
83
|
},
|
|
82
84
|
];
|
|
83
85
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { IAutoBePrismaValidation } 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
|
|
|
@@ -11,46 +12,34 @@ export const transformPrismaCorrectHistories = (
|
|
|
11
12
|
> => {
|
|
12
13
|
return [
|
|
13
14
|
{
|
|
14
|
-
id:
|
|
15
|
+
id: v7(),
|
|
15
16
|
created_at: new Date().toISOString(),
|
|
16
17
|
type: "systemMessage",
|
|
17
18
|
text: AutoBeSystemPromptConstant.PRISMA_CORRECT,
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
|
-
id:
|
|
21
|
+
id: v7(),
|
|
21
22
|
created_at: new Date().toISOString(),
|
|
22
23
|
type: "assistantMessage",
|
|
23
|
-
text:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
JSON.stringify(result.data)
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
text: StringUtil.trim`
|
|
25
|
+
Here is the Prisma application data what you made:
|
|
26
|
+
|
|
27
|
+
\`\`\`json
|
|
28
|
+
${JSON.stringify(result.data)}
|
|
29
|
+
\`\`\`
|
|
30
|
+
`,
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
|
-
id:
|
|
33
|
+
id: v7(),
|
|
33
34
|
created_at: new Date().toISOString(),
|
|
34
35
|
type: "assistantMessage",
|
|
35
|
-
text:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
JSON.stringify(result.errors)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: v4(),
|
|
45
|
-
created_at: new Date().toISOString(),
|
|
46
|
-
type: "systemMessage",
|
|
47
|
-
text: [
|
|
48
|
-
"Before fixing the schema files,",
|
|
49
|
-
"study about Prisma schema language",
|
|
50
|
-
"from the best practices and examples",
|
|
51
|
-
"",
|
|
52
|
-
AutoBeSystemPromptConstant.PRISMA_EXAMPLE,
|
|
53
|
-
].join("\n"),
|
|
36
|
+
text: StringUtil.trim`
|
|
37
|
+
Below are the list of errors what you have to fix:
|
|
38
|
+
|
|
39
|
+
\`\`\`json
|
|
40
|
+
${JSON.stringify(result.errors)}
|
|
41
|
+
\`\`\`
|
|
42
|
+
`,
|
|
54
43
|
},
|
|
55
44
|
];
|
|
56
45
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBePrisma } 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
|
|
|
@@ -14,53 +15,55 @@ export const transformPrismaReviewHistories = (props: {
|
|
|
14
15
|
> => {
|
|
15
16
|
return [
|
|
16
17
|
{
|
|
17
|
-
id:
|
|
18
|
+
id: v7(),
|
|
18
19
|
created_at: new Date().toISOString(),
|
|
19
20
|
type: "systemMessage",
|
|
20
21
|
text: AutoBeSystemPromptConstant.PRISMA_SCHEMA,
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
|
-
id:
|
|
24
|
+
id: v7(),
|
|
24
25
|
created_at: new Date().toISOString(),
|
|
25
|
-
type: "
|
|
26
|
-
text:
|
|
27
|
-
"Here is the requirement analysis report given by the user:",
|
|
28
|
-
"",
|
|
29
|
-
"```json",
|
|
30
|
-
JSON.stringify(props.analysis),
|
|
31
|
-
"```",
|
|
32
|
-
"",
|
|
33
|
-
"Reading the requirement analysis report, you AI made below AST definition for the database design:",
|
|
34
|
-
"",
|
|
35
|
-
"```json",
|
|
36
|
-
JSON.stringify(props.application),
|
|
37
|
-
"```",
|
|
38
|
-
"",
|
|
39
|
-
"And here are the Prisma schema files generated (compiled) from the above AST:",
|
|
40
|
-
"",
|
|
41
|
-
"```prisma",
|
|
42
|
-
JSON.stringify(props.schemas),
|
|
43
|
-
"```",
|
|
44
|
-
].join("\n"),
|
|
26
|
+
type: "systemMessage",
|
|
27
|
+
text: AutoBeSystemPromptConstant.PRISMA_REVIEW,
|
|
45
28
|
},
|
|
46
29
|
{
|
|
47
|
-
id:
|
|
30
|
+
id: v7(),
|
|
48
31
|
created_at: new Date().toISOString(),
|
|
49
|
-
type: "
|
|
50
|
-
text:
|
|
32
|
+
type: "assistantMessage",
|
|
33
|
+
text: StringUtil.trim`
|
|
34
|
+
Here is the requirement analysis report given by the user:
|
|
35
|
+
|
|
36
|
+
\`\`\`json
|
|
37
|
+
${JSON.stringify(props.analysis)}
|
|
38
|
+
\`\`\`
|
|
39
|
+
|
|
40
|
+
Reading the requirement analysis report, you AI made
|
|
41
|
+
below AST definition for the database design:
|
|
42
|
+
|
|
43
|
+
\`\`\`json
|
|
44
|
+
${JSON.stringify(props.application)}
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
And here are the Prisma schema files generated (compiled)
|
|
48
|
+
from the above AST:
|
|
49
|
+
|
|
50
|
+
\`\`\`json
|
|
51
|
+
${JSON.stringify(props.schemas)}
|
|
52
|
+
\`\`\`
|
|
53
|
+
`,
|
|
51
54
|
},
|
|
52
55
|
{
|
|
53
|
-
id:
|
|
56
|
+
id: v7(),
|
|
54
57
|
created_at: new Date().toISOString(),
|
|
55
58
|
type: "assistantMessage",
|
|
56
|
-
text:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
text: StringUtil.trim`
|
|
60
|
+
Now, please review the tables in the "${props.component.namespace}" namespace.
|
|
61
|
+
|
|
62
|
+
Focus your review exclusively on these tables.
|
|
63
|
+
|
|
64
|
+
**Tables in this namespace:**
|
|
65
|
+
${props.component.tables.map((table) => `- ${table}`).join("\n")}
|
|
66
|
+
`,
|
|
64
67
|
},
|
|
65
68
|
];
|
|
66
69
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBePrisma } 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
|
|
|
@@ -13,42 +14,54 @@ export const transformPrismaSchemaHistories = (
|
|
|
13
14
|
> => {
|
|
14
15
|
return [
|
|
15
16
|
{
|
|
16
|
-
id:
|
|
17
|
+
id: v7(),
|
|
17
18
|
created_at: new Date().toISOString(),
|
|
18
19
|
type: "systemMessage",
|
|
19
20
|
text: AutoBeSystemPromptConstant.PRISMA_SCHEMA,
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
|
-
id:
|
|
23
|
+
id: v7(),
|
|
23
24
|
created_at: new Date().toISOString(),
|
|
24
25
|
type: "assistantMessage",
|
|
25
|
-
text:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
JSON.stringify(
|
|
30
|
-
|
|
26
|
+
text: StringUtil.trim`
|
|
27
|
+
Here is the requirement analysis report:
|
|
28
|
+
|
|
29
|
+
\`\`\`json
|
|
30
|
+
${JSON.stringify(requirementAnalysisReport)}
|
|
31
|
+
\`\`\`
|
|
32
|
+
`,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: v7(),
|
|
36
|
+
created_at: new Date().toISOString(),
|
|
37
|
+
type: "assistantMessage",
|
|
38
|
+
text: StringUtil.trim`
|
|
39
|
+
Here is the input data for generating Prisma DB schema.
|
|
40
|
+
|
|
41
|
+
\`\`\`json
|
|
42
|
+
${JSON.stringify({
|
|
31
43
|
targetComponent,
|
|
32
44
|
otherTables,
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
})}
|
|
46
|
+
\`\`\`
|
|
47
|
+
`,
|
|
36
48
|
},
|
|
37
49
|
{
|
|
38
|
-
id:
|
|
50
|
+
id: v7(),
|
|
39
51
|
created_at: new Date().toISOString(),
|
|
40
52
|
type: "systemMessage",
|
|
41
|
-
text:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
text: StringUtil.trim`
|
|
54
|
+
You've already taken a mistake that creating models from the other components.
|
|
55
|
+
|
|
56
|
+
Note that, you have to make models from the target component only. Never make
|
|
57
|
+
models from the other components. The other components' models are already made.
|
|
58
|
+
|
|
59
|
+
\`\`\`json
|
|
60
|
+
${JSON.stringify({
|
|
48
61
|
targetComponent,
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
})}
|
|
63
|
+
\`\`\`
|
|
64
|
+
`,
|
|
52
65
|
},
|
|
53
66
|
];
|
|
54
67
|
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "@autobe/interface";
|
|
11
11
|
import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
|
|
12
12
|
import { ILlmSchema } from "@samchon/openapi";
|
|
13
|
-
import {
|
|
13
|
+
import { v7 } from "uuid";
|
|
14
14
|
|
|
15
15
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
16
16
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
@@ -30,13 +30,14 @@ export const orchestratePrisma = async <Model extends ILlmSchema.Model>(
|
|
|
30
30
|
if (predicate !== null)
|
|
31
31
|
return ctx.assistantMessage({
|
|
32
32
|
type: "assistantMessage",
|
|
33
|
-
id:
|
|
33
|
+
id: v7(),
|
|
34
34
|
created_at: start.toISOString(),
|
|
35
35
|
text: predicate,
|
|
36
36
|
completed_at: new Date().toISOString(),
|
|
37
37
|
});
|
|
38
38
|
ctx.dispatch({
|
|
39
39
|
type: "prismaStart",
|
|
40
|
+
id: v7(),
|
|
40
41
|
created_at: start.toISOString(),
|
|
41
42
|
reason: props.reason,
|
|
42
43
|
step: ctx.state().analyze?.step ?? 0,
|
|
@@ -93,6 +94,7 @@ export const orchestratePrisma = async <Model extends ILlmSchema.Model>(
|
|
|
93
94
|
// PROPAGATE
|
|
94
95
|
return ctx.dispatch({
|
|
95
96
|
type: "prismaComplete",
|
|
97
|
+
id: v7(),
|
|
96
98
|
result,
|
|
97
99
|
schemas: finalSchemas,
|
|
98
100
|
compiled: await compiler.prisma.compile({
|
|
@@ -3,6 +3,7 @@ import { AutoBePrismaComponentsEvent } from "@autobe/interface/src/events/AutoBe
|
|
|
3
3
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
4
4
|
import { IPointer } from "tstl";
|
|
5
5
|
import typia from "typia";
|
|
6
|
+
import { v7 } from "uuid";
|
|
6
7
|
|
|
7
8
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
8
9
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -36,6 +37,7 @@ export async function orchestratePrismaComponents<
|
|
|
36
37
|
throw new Error("Failed to extract files and tables."); // unreachable
|
|
37
38
|
return {
|
|
38
39
|
type: "prismaComponents",
|
|
40
|
+
id: v7(),
|
|
39
41
|
created_at: start.toISOString(),
|
|
40
42
|
thinking: pointer.value.thinking,
|
|
41
43
|
review: pointer.value.review,
|
|
@@ -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";
|
|
@@ -49,6 +50,7 @@ async function iterate<Model extends ILlmSchema.Model>(
|
|
|
49
50
|
);
|
|
50
51
|
ctx.dispatch({
|
|
51
52
|
type: "prismaValidate",
|
|
53
|
+
id: v7(),
|
|
52
54
|
result,
|
|
53
55
|
schemas,
|
|
54
56
|
compiled: await compiler.prisma.compile({
|
|
@@ -144,6 +146,7 @@ async function execute<Model extends ILlmSchema.Model>(
|
|
|
144
146
|
};
|
|
145
147
|
ctx.dispatch({
|
|
146
148
|
type: "prismaCorrect",
|
|
149
|
+
id: v7(),
|
|
147
150
|
failure,
|
|
148
151
|
planning: pointer.value.planning,
|
|
149
152
|
correction: correction,
|
|
@@ -4,9 +4,11 @@ import { AutoBePrismaReviewEvent } from "@autobe/interface/src/events/AutoBePris
|
|
|
4
4
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
5
5
|
import { IPointer } from "tstl";
|
|
6
6
|
import typia from "typia";
|
|
7
|
+
import { v7 } from "uuid";
|
|
7
8
|
|
|
8
9
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
10
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
11
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
10
12
|
import { transformPrismaReviewHistories } from "./histories/transformPrismaReviewHistories";
|
|
11
13
|
import { IAutoBePrismaReviewApplication } from "./structures/IAutoBePrismaReviewApplication";
|
|
12
14
|
|
|
@@ -21,10 +23,16 @@ export async function orchestratePrismaReview<Model extends ILlmSchema.Model>(
|
|
|
21
23
|
total: componentList.length,
|
|
22
24
|
};
|
|
23
25
|
return (
|
|
24
|
-
await
|
|
25
|
-
componentList.map(async (
|
|
26
|
+
await executeCachedBatch(
|
|
27
|
+
componentList.map((component) => async (promptCacheKey) => {
|
|
26
28
|
try {
|
|
27
|
-
return await step(ctx,
|
|
29
|
+
return await step(ctx, {
|
|
30
|
+
application,
|
|
31
|
+
schemas,
|
|
32
|
+
component,
|
|
33
|
+
progress,
|
|
34
|
+
promptCacheKey,
|
|
35
|
+
});
|
|
28
36
|
} catch {
|
|
29
37
|
++progress.completed;
|
|
30
38
|
return null;
|
|
@@ -36,10 +44,13 @@ export async function orchestratePrismaReview<Model extends ILlmSchema.Model>(
|
|
|
36
44
|
|
|
37
45
|
async function step<Model extends ILlmSchema.Model>(
|
|
38
46
|
ctx: AutoBeContext<Model>,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
props: {
|
|
48
|
+
application: AutoBePrisma.IApplication;
|
|
49
|
+
schemas: Record<string, string>;
|
|
50
|
+
component: AutoBePrisma.IComponent;
|
|
51
|
+
progress: AutoBeProgressEventBase;
|
|
52
|
+
promptCacheKey: string;
|
|
53
|
+
},
|
|
43
54
|
): Promise<AutoBePrismaReviewEvent> {
|
|
44
55
|
const start: Date = new Date();
|
|
45
56
|
const pointer: IPointer<IAutoBePrismaReviewApplication.IProps | null> = {
|
|
@@ -55,9 +66,9 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
55
66
|
.reduce((acc, cur) => {
|
|
56
67
|
return Object.assign(acc, cur);
|
|
57
68
|
}, {}) ?? {},
|
|
58
|
-
application,
|
|
59
|
-
schemas,
|
|
60
|
-
component,
|
|
69
|
+
application: props.application,
|
|
70
|
+
schemas: props.schemas,
|
|
71
|
+
component: props.component,
|
|
61
72
|
}),
|
|
62
73
|
controller: createController(ctx, {
|
|
63
74
|
build: (next) => {
|
|
@@ -65,6 +76,7 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
65
76
|
},
|
|
66
77
|
}),
|
|
67
78
|
enforceFunctionCall: true,
|
|
79
|
+
promptCacheKey: props.promptCacheKey,
|
|
68
80
|
message: "Please review the Prisma schema file.",
|
|
69
81
|
});
|
|
70
82
|
if (pointer.value === null)
|
|
@@ -72,14 +84,15 @@ async function step<Model extends ILlmSchema.Model>(
|
|
|
72
84
|
|
|
73
85
|
const event: AutoBePrismaReviewEvent = {
|
|
74
86
|
type: "prismaReview",
|
|
87
|
+
id: v7(),
|
|
75
88
|
created_at: start.toISOString(),
|
|
76
|
-
filename: component.filename,
|
|
89
|
+
filename: props.component.filename,
|
|
77
90
|
review: pointer.value.review,
|
|
78
91
|
plan: pointer.value.plan,
|
|
79
92
|
modifications: pointer.value.modifications,
|
|
80
93
|
tokenUsage,
|
|
81
|
-
completed: ++progress.completed,
|
|
82
|
-
total: progress.total,
|
|
94
|
+
completed: ++props.progress.completed,
|
|
95
|
+
total: props.progress.total,
|
|
83
96
|
step: ctx.state().analyze?.step ?? 0,
|
|
84
97
|
};
|
|
85
98
|
ctx.dispatch(event);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import { AutoBePrisma } from "@autobe/interface";
|
|
3
3
|
import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
|
|
4
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
5
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
5
6
|
import { IPointer } from "tstl";
|
|
6
7
|
import typia from "typia";
|
|
8
|
+
import { v7 } from "uuid";
|
|
7
9
|
|
|
8
10
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
11
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
12
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
10
13
|
import { transformPrismaSchemaHistories } from "./histories/transformPrismaSchemaHistories";
|
|
11
14
|
import { IAutoBePrismaSchemaApplication } from "./structures/IAutoBePrismaSchemaApplication";
|
|
12
15
|
|
|
@@ -19,8 +22,8 @@ export async function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(
|
|
|
19
22
|
.map((c) => c.tables.length)
|
|
20
23
|
.reduce((x, y) => x + y, 0);
|
|
21
24
|
const completed: IPointer<number> = { value: 0 };
|
|
22
|
-
return await
|
|
23
|
-
componentList.map(async (
|
|
25
|
+
return await executeCachedBatch(
|
|
26
|
+
componentList.map((component) => async (promptCacheKey) => {
|
|
24
27
|
const otherTables: string[] = componentList
|
|
25
28
|
.filter((y) => component !== y)
|
|
26
29
|
.map((c) => c.tables)
|
|
@@ -31,6 +34,7 @@ export async function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(
|
|
|
31
34
|
start,
|
|
32
35
|
total,
|
|
33
36
|
completed,
|
|
37
|
+
promptCacheKey,
|
|
34
38
|
});
|
|
35
39
|
ctx.dispatch(event);
|
|
36
40
|
return event;
|
|
@@ -46,6 +50,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
46
50
|
start: Date;
|
|
47
51
|
total: number;
|
|
48
52
|
completed: IPointer<number>;
|
|
53
|
+
promptCacheKey: string;
|
|
49
54
|
},
|
|
50
55
|
): Promise<AutoBePrismaSchemasEvent> {
|
|
51
56
|
const pointer: IPointer<IAutoBePrismaSchemaApplication.IProps | null> = {
|
|
@@ -71,12 +76,14 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
71
76
|
},
|
|
72
77
|
}),
|
|
73
78
|
enforceFunctionCall: true,
|
|
79
|
+
promptCacheKey: props.promptCacheKey,
|
|
74
80
|
message: "Make prisma schema file please",
|
|
75
81
|
});
|
|
76
82
|
if (pointer.value === null)
|
|
77
83
|
throw new Error("Unreachable code: Prisma Schema not generated");
|
|
78
84
|
return {
|
|
79
85
|
type: "prismaSchemas",
|
|
86
|
+
id: v7(),
|
|
80
87
|
created_at: props.start.toISOString(),
|
|
81
88
|
plan: pointer.value.plan,
|
|
82
89
|
models: pointer.value.models,
|
|
@@ -118,6 +125,7 @@ function createController<Model extends ILlmSchema.Model>(
|
|
|
118
125
|
|
|
119
126
|
ctx.dispatch({
|
|
120
127
|
type: "prismaInsufficient",
|
|
128
|
+
id: v7(),
|
|
121
129
|
created_at: new Date().toISOString(),
|
|
122
130
|
component: props.targetComponent,
|
|
123
131
|
actual,
|
|
@@ -131,26 +139,26 @@ function createController<Model extends ILlmSchema.Model>(
|
|
|
131
139
|
path: "$input.models",
|
|
132
140
|
value: result.data.models,
|
|
133
141
|
expected: `Array<AutoBePrisma.IModel>`,
|
|
134
|
-
description:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
JSON.stringify({
|
|
142
|
+
description: StringUtil.trim`
|
|
143
|
+
You missed some tables from the current domain's component.
|
|
144
|
+
|
|
145
|
+
Look at the following details to fix the schemas. Never forget to
|
|
146
|
+
compose the \`missed\` tables at the next function calling.
|
|
147
|
+
|
|
148
|
+
- filename: current domain's filename
|
|
149
|
+
- namespace: current domain's namespace
|
|
150
|
+
- expected: expected tables in the current domain
|
|
151
|
+
- actual: actual tables you made
|
|
152
|
+
- missed: tables you have missed, and you have to compose again
|
|
153
|
+
|
|
154
|
+
${JSON.stringify({
|
|
147
155
|
filename: props.targetComponent.filename,
|
|
148
156
|
namespace: props.targetComponent.namespace,
|
|
149
157
|
expected,
|
|
150
158
|
actual,
|
|
151
159
|
missed,
|
|
152
|
-
})
|
|
153
|
-
|
|
160
|
+
})}
|
|
161
|
+
`,
|
|
154
162
|
},
|
|
155
163
|
],
|
|
156
164
|
};
|