@autobe/agent 0.19.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/agent/src/AutoBeAgent.js +3 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.js +3 -3
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +6 -6
- package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
- 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 +8 -5
- 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/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 +31 -30
- 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 +22 -18
- 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 +6 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- 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 +74 -48
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +24 -4
- 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/IAutoBeInterfaceOperationApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +38 -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 +8 -4
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +21 -17
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +13 -10
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +16 -15
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +33 -32
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +62 -59
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +2 -2
- 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 +16 -7
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +20 -8
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +17 -17
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
- 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 +6 -6
- package/lib/context/AutoBeContext.d.ts +1 -0
- package/lib/index.mjs +1044 -270
- 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/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +38 -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/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/utils/executeCachedBatch.d.ts +1 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +4 -3
- package/src/AutoBeMockAgent.ts +4 -4
- package/src/constants/AutoBeSystemPromptConstant.ts +6 -6
- package/src/context/AutoBeContext.ts +1 -0
- package/src/factory/consentFunctionCall.ts +4 -3
- package/src/factory/createAutoBeContext.ts +9 -6
- 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/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 +13 -9
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +53 -50
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +47 -23
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +85 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +40 -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 +0 -74
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +24 -23
- package/src/orchestrate/test/compile/completeTestCode.ts +17 -13
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +17 -16
- package/src/orchestrate/test/histories/transformTestHistories.ts +35 -34
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +62 -57
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +3 -3
- package/src/orchestrate/test/orchestrateTest.ts +7 -9
- package/src/orchestrate/test/orchestrateTestCorrect.ts +34 -24
- package/src/orchestrate/test/orchestrateTestScenario.ts +28 -21
- package/src/orchestrate/test/orchestrateTestWrite.ts +16 -17
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +3 -3
- 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/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
|
@@ -2,11 +2,13 @@ import { IAgenticaController } from "@agentica/core";
|
|
|
2
2
|
import {
|
|
3
3
|
AutoBeInterfaceSchemasReviewEvent,
|
|
4
4
|
AutoBeOpenApi,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
5
6
|
} from "@autobe/interface";
|
|
6
7
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
7
8
|
import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
|
|
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";
|
|
@@ -23,7 +25,7 @@ export async function orchestrateInterfaceSchemasReview<
|
|
|
23
25
|
string,
|
|
24
26
|
AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
|
|
25
27
|
>,
|
|
26
|
-
progress:
|
|
28
|
+
progress: AutoBeProgressEventBase,
|
|
27
29
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
28
30
|
try {
|
|
29
31
|
const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
|
|
@@ -35,6 +37,7 @@ export async function orchestrateInterfaceSchemasReview<
|
|
|
35
37
|
controller: createController({
|
|
36
38
|
model: ctx.model,
|
|
37
39
|
pointer,
|
|
40
|
+
operations,
|
|
38
41
|
schemas,
|
|
39
42
|
}),
|
|
40
43
|
histories: transformInterfaceSchemasReviewHistories(
|
|
@@ -59,6 +62,7 @@ export async function orchestrateInterfaceSchemasReview<
|
|
|
59
62
|
).schemas ?? {};
|
|
60
63
|
ctx.dispatch({
|
|
61
64
|
type: "interfaceSchemasReview",
|
|
65
|
+
id: v7(),
|
|
62
66
|
schemas: schemas,
|
|
63
67
|
review: pointer.value.review,
|
|
64
68
|
plan: pointer.value.plan,
|
|
@@ -80,6 +84,7 @@ export async function orchestrateInterfaceSchemasReview<
|
|
|
80
84
|
function createController<Model extends ILlmSchema.Model>(props: {
|
|
81
85
|
model: Model;
|
|
82
86
|
pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null>;
|
|
87
|
+
operations: AutoBeOpenApi.IOperation[];
|
|
83
88
|
schemas: Record<
|
|
84
89
|
string,
|
|
85
90
|
AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
|
|
@@ -100,14 +105,93 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
100
105
|
schemas: result.data.content,
|
|
101
106
|
path: "$input.content",
|
|
102
107
|
});
|
|
108
|
+
|
|
109
|
+
Object.entries(result.data.content).forEach(
|
|
110
|
+
([tagName, jsonDescriptive]) => {
|
|
111
|
+
const index: AutoBeOpenApi.IOperation | undefined =
|
|
112
|
+
props.operations.find(
|
|
113
|
+
(op) =>
|
|
114
|
+
op.responseBody?.typeName === tagName &&
|
|
115
|
+
op.method === "patch" &&
|
|
116
|
+
op.name === "index",
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
// The index API should return the `IPage<T>` type.
|
|
120
|
+
if (index) {
|
|
121
|
+
// First check if the schema has the correct object structure
|
|
122
|
+
if (
|
|
123
|
+
!("type" in jsonDescriptive) ||
|
|
124
|
+
jsonDescriptive.type !== "object"
|
|
125
|
+
) {
|
|
126
|
+
errors.push({
|
|
127
|
+
path: `$input.content.${tagName}`,
|
|
128
|
+
expected: `{ type: "object", properties: { ... } }`,
|
|
129
|
+
value: jsonDescriptive,
|
|
130
|
+
description: `IPage schema must have type: "object". Found: ${JSON.stringify(jsonDescriptive)}`,
|
|
131
|
+
});
|
|
132
|
+
} else if (!("properties" in jsonDescriptive)) {
|
|
133
|
+
errors.push({
|
|
134
|
+
path: `$input.content.${tagName}`,
|
|
135
|
+
expected: `Schema with "properties" field`,
|
|
136
|
+
value: jsonDescriptive,
|
|
137
|
+
description: `IPage schema must have a "properties" field containing "pagination" and "data" properties.`,
|
|
138
|
+
});
|
|
139
|
+
} else if (
|
|
140
|
+
typia.is<AutoBeOpenApi.IJsonSchema.IObject>(jsonDescriptive)
|
|
141
|
+
) {
|
|
142
|
+
jsonDescriptive.properties ??= {};
|
|
143
|
+
|
|
144
|
+
// Check pagination property
|
|
145
|
+
const pagination = jsonDescriptive.properties["pagination"];
|
|
146
|
+
if (!pagination || !("$ref" in pagination)) {
|
|
147
|
+
errors.push({
|
|
148
|
+
path: `$input.content.${tagName}.properties.pagination`,
|
|
149
|
+
expected: `{ $ref: "#/components/schemas/IPage.IPagination" }`,
|
|
150
|
+
value: pagination,
|
|
151
|
+
description: `IPage must have a "pagination" property with $ref to IPage.IPagination.`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Check data property
|
|
156
|
+
const data = jsonDescriptive.properties["data"];
|
|
157
|
+
if (!typia.is<AutoBeOpenApi.IJsonSchema.IArray>(data)) {
|
|
158
|
+
errors.push({
|
|
159
|
+
path: `$input.content.${tagName}.properties.data`,
|
|
160
|
+
expected: `AutoBeOpenApi.IJsonSchema.IArray`,
|
|
161
|
+
value: data,
|
|
162
|
+
description: `The 'data' property must be an array for the index operation.`,
|
|
163
|
+
});
|
|
164
|
+
} else {
|
|
165
|
+
// Check if array items have proper type reference (not 'any')
|
|
166
|
+
const arraySchema: AutoBeOpenApi.IJsonSchema.IArray = data;
|
|
167
|
+
if (
|
|
168
|
+
!arraySchema.items ||
|
|
169
|
+
!("$ref" in arraySchema.items) ||
|
|
170
|
+
arraySchema.items.$ref === "#/components/schemas/any"
|
|
171
|
+
) {
|
|
172
|
+
errors.push({
|
|
173
|
+
path: `$input.content.${tagName}.properties.data.items`,
|
|
174
|
+
expected: `Reference to a specific type (e.g., $ref to ISummary type)`,
|
|
175
|
+
value: arraySchema.items,
|
|
176
|
+
description: `The 'data' array must have a specific item type, not 'any[]'. Use a proper type reference like '{Entity}.ISummary' for paginated results.`,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
);
|
|
184
|
+
|
|
103
185
|
if (errors.length !== 0)
|
|
104
186
|
return {
|
|
105
187
|
success: false,
|
|
106
188
|
errors,
|
|
107
189
|
data: next,
|
|
108
190
|
};
|
|
191
|
+
|
|
109
192
|
return result;
|
|
110
193
|
};
|
|
194
|
+
|
|
111
195
|
const application: ILlmApplication<Model> = collection[
|
|
112
196
|
props.model === "chatgpt" ? "chatgpt" : "claude"
|
|
113
197
|
](
|
|
@@ -91,6 +91,45 @@ export namespace IAutoBeInterfaceOperationApplication {
|
|
|
91
91
|
AutoBeOpenApi.IOperation,
|
|
92
92
|
"authorizationRole" | "authorizationType"
|
|
93
93
|
> {
|
|
94
|
+
/**
|
|
95
|
+
* Prisma schema models relevant to this operation.
|
|
96
|
+
*
|
|
97
|
+
* Contains the complete Prisma schema definitions for all entities involved
|
|
98
|
+
* in this operation, including their fields, relations, and database
|
|
99
|
+
* constraints. This enables comprehensive validation and schema-aware
|
|
100
|
+
* operation design.
|
|
101
|
+
*
|
|
102
|
+
* The schema information serves multiple critical purposes:
|
|
103
|
+
*
|
|
104
|
+
* - **Field Verification**: Ensures all referenced fields actually exist in
|
|
105
|
+
* the database schema and have the correct types
|
|
106
|
+
* - **Relationship Validation**: Confirms that entity relationships are
|
|
107
|
+
* properly defined and can support the operation's data access patterns
|
|
108
|
+
* - **Soft-Delete Detection**: For DELETE operations, identifies whether
|
|
109
|
+
* entities have soft-delete fields (deleted_at, is_deleted, etc.) to
|
|
110
|
+
* determine if the operation should perform logical deletion instead of
|
|
111
|
+
* physical removal
|
|
112
|
+
* - **Constraint Awareness**: Understands unique constraints, required
|
|
113
|
+
* fields, and default values to generate accurate request/response
|
|
114
|
+
* schemas
|
|
115
|
+
*
|
|
116
|
+
* Example content might include:
|
|
117
|
+
*
|
|
118
|
+
* ```prisma
|
|
119
|
+
* model User {
|
|
120
|
+
* id String @id @default(uuid())
|
|
121
|
+
* email String @unique
|
|
122
|
+
* name String
|
|
123
|
+
* deleted_at DateTime? // Indicates soft-delete capability
|
|
124
|
+
* posts Post[]
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* This schema context ensures operations are fully aligned with the actual
|
|
129
|
+
* database structure and business logic requirements.
|
|
130
|
+
*/
|
|
131
|
+
prisma_schemas: string;
|
|
132
|
+
|
|
94
133
|
/**
|
|
95
134
|
* Authorization roles required to access this API operation.
|
|
96
135
|
*
|
|
@@ -135,5 +135,44 @@ export namespace IAutoBeInterfaceOperationsReviewApplication {
|
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
137
|
export interface IOperation
|
|
138
|
-
extends Omit<AutoBeOpenApi.IOperation, "authorizationType"> {
|
|
138
|
+
extends Omit<AutoBeOpenApi.IOperation, "authorizationType"> {
|
|
139
|
+
/**
|
|
140
|
+
* Prisma schema models relevant to this operation.
|
|
141
|
+
*
|
|
142
|
+
* Contains the complete Prisma schema definitions for all entities involved
|
|
143
|
+
* in this operation, including their fields, relations, and database
|
|
144
|
+
* constraints. This enables comprehensive validation and schema-aware
|
|
145
|
+
* operation design.
|
|
146
|
+
*
|
|
147
|
+
* The schema information serves multiple critical purposes:
|
|
148
|
+
*
|
|
149
|
+
* - **Field Verification**: Ensures all referenced fields actually exist in
|
|
150
|
+
* the database schema and have the correct types
|
|
151
|
+
* - **Relationship Validation**: Confirms that entity relationships are
|
|
152
|
+
* properly defined and can support the operation's data access patterns
|
|
153
|
+
* - **Soft-Delete Detection**: For DELETE operations, identifies whether
|
|
154
|
+
* entities have soft-delete fields (deleted_at, is_deleted, etc.) to
|
|
155
|
+
* determine if the operation should perform logical deletion instead of
|
|
156
|
+
* physical removal
|
|
157
|
+
* - **Constraint Awareness**: Understands unique constraints, required
|
|
158
|
+
* fields, and default values to generate accurate request/response
|
|
159
|
+
* schemas
|
|
160
|
+
*
|
|
161
|
+
* Example content might include:
|
|
162
|
+
*
|
|
163
|
+
* ```prisma
|
|
164
|
+
* model User {
|
|
165
|
+
* id String @id @default(uuid())
|
|
166
|
+
* email String @unique
|
|
167
|
+
* name String
|
|
168
|
+
* deleted_at DateTime? // Indicates soft-delete capability
|
|
169
|
+
* posts Post[]
|
|
170
|
+
* }
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* This schema context ensures operations are fully aligned with the actual
|
|
174
|
+
* database structure and business logic requirements.
|
|
175
|
+
*/
|
|
176
|
+
prisma_schemas: string;
|
|
177
|
+
}
|
|
139
178
|
}
|
|
@@ -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,
|