@autobe/agent 0.14.5 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeMockAgent.js +1 -1
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +11 -9
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/index.mjs +3557 -2635
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +4 -9
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -8
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +65 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +62 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +63 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +28 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.js +14 -9
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +13 -40
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +3 -2
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +52 -32
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +350 -0
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +252 -226
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +4 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +411 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +55 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +23 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +108 -0
- package/lib/orchestrate/{realize/structures/IAutoBeRealizeDecoratorApplication.js → interface/structures/IAutoBeInterfaceGroupApplication.js} +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +122 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +75 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js.map +1 -0
- package/lib/orchestrate/interface/{OpenApiEndpointComparator.d.ts → utils/OpenApiEndpointComparator.d.ts} +1 -0
- package/lib/orchestrate/interface/{OpenApiEndpointComparator.js → utils/OpenApiEndpointComparator.js} +6 -0
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +17 -3
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +81 -88
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +4 -0
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +513 -0
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +3 -2
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/structures/{IAutoBeRealizeDecoratorApplication.d.ts → IAutoBeRealizeAuthorizationApplication.d.ts} +9 -9
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +33 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +34 -13
- package/lib/orchestrate/realize/transformRealizeAuthorization.d.ts +4 -0
- package/lib/orchestrate/realize/transformRealizeAuthorization.js +43 -0
- package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.d.ts +5 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +71 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +5 -5
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
- package/lib/orchestrate/realize/utils/InternalFileSystem.d.ts +8 -0
- package/lib/orchestrate/realize/utils/InternalFileSystem.js +17 -0
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/ProviderFileSystem.d.ts +3 -0
- package/lib/orchestrate/realize/utils/ProviderFileSystem.js +8 -0
- package/lib/orchestrate/realize/utils/ProviderFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +2 -2
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +36 -36
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +2 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +29 -13
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +2 -0
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.js +3 -2
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
- package/lib/utils/arrayToRecord.d.ts +17 -0
- package/lib/utils/arrayToRecord.js +19 -0
- package/lib/utils/arrayToRecord.js.map +1 -0
- package/lib/utils/backoffRetry.js +0 -1
- package/lib/utils/backoffRetry.js.map +1 -1
- package/package.json +6 -5
- package/src/AutoBeMockAgent.ts +1 -1
- package/src/constants/AutoBeSystemPromptConstant.ts +11 -9
- package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +1 -3
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +1 -3
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +75 -0
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +69 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +34 -0
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +32 -0
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +34 -0
- package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +66 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +34 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +17 -8
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +22 -97
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +48 -55
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +109 -0
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +83 -120
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +197 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +58 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.ts +24 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +112 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +125 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +76 -0
- package/src/orchestrate/interface/{OpenApiEndpointComparator.ts → utils/OpenApiEndpointComparator.ts} +8 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +25 -3
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +45 -54
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +179 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +3 -6
- package/src/orchestrate/realize/structures/{IAutoBeRealizeDecoratorApplication.ts → IAutoBeRealizeAuthorizationApplication.ts} +11 -9
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +40 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +42 -24
- package/src/orchestrate/realize/{transformRealizeDecorator.ts → transformRealizeAuthorization.ts} +13 -2
- package/src/orchestrate/realize/{transformRealizeDecoratorCorrectHistories.ts → transformRealizeAuthorizationCorrectHistories.ts} +15 -7
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +4 -4
- package/src/orchestrate/realize/utils/InternalFileSystem.ts +12 -0
- package/src/orchestrate/realize/utils/ProviderFileSystem.ts +4 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +2 -2
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +59 -53
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -0
- package/src/orchestrate/test/orchestrateTestCorrect.ts +3 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +4 -2
- package/src/orchestrate/test/orchestrateTestWrite.ts +8 -1
- package/src/utils/arrayToRecord.ts +49 -0
- package/src/utils/backoffRetry.ts +0 -1
- package/lib/orchestrate/interface/OpenApiEndpointComparator.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.d.ts +0 -4
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +0 -473
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +0 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.d.ts +0 -3
- package/lib/orchestrate/interface/transformInterfaceHistories.js +0 -149
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeDecoratorApplication.js.map +0 -1
- package/lib/orchestrate/realize/transformRealizeDecorator.d.ts +0 -4
- package/lib/orchestrate/realize/transformRealizeDecorator.js +0 -32
- package/lib/orchestrate/realize/transformRealizeDecorator.js.map +0 -1
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.d.ts +0 -5
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js +0 -62
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js.map +0 -1
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +0 -292
- package/src/orchestrate/interface/transformInterfaceHistories.ts +0 -152
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
IAutoBeTypeScriptCompileResult,
|
|
6
6
|
} from "@autobe/interface";
|
|
7
7
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
|
-
import fs from "fs/promises";
|
|
9
|
-
import path from "path";
|
|
10
8
|
import { IPointer } from "tstl";
|
|
11
9
|
import typia from "typia";
|
|
12
10
|
|
|
13
11
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
12
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
15
13
|
import { enforceToolCall } from "../../utils/enforceToolCall";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
14
|
+
import { orchestrateRealizeAuthorizationCorrect } from "./orchestrateRealizeAuthorizationCorrect";
|
|
15
|
+
import { IAutoBeRealizeAuthorizationApplication } from "./structures/IAutoBeRealizeAuthorizationApplication";
|
|
16
|
+
import { transformRealizeAuthorizationHistories } from "./transformRealizeAuthorization";
|
|
17
|
+
import { transformRealizeAuthorizationCorrectHistories } from "./transformRealizeAuthorizationCorrectHistories";
|
|
19
18
|
import { AuthorizationFileSystem } from "./utils/AuthorizationFileSystem";
|
|
19
|
+
import { InternalFileSystem } from "./utils/InternalFileSystem";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* 1. Create decorator and its parameters. and design the Authorization Provider.
|
|
@@ -35,34 +35,22 @@ export async function orchestrateRealizeAuthorization<
|
|
|
35
35
|
|
|
36
36
|
let completed = 0;
|
|
37
37
|
|
|
38
|
-
const templateFiles =
|
|
39
|
-
"src/MyGlobal.ts": await fs.readFile(
|
|
40
|
-
path.join(
|
|
41
|
-
__dirname,
|
|
42
|
-
"../../../../../internals/template/realize/src/MyGlobal.ts",
|
|
43
|
-
),
|
|
44
|
-
"utf-8",
|
|
45
|
-
),
|
|
46
|
-
"src/authentications/jwtAuthorize.ts": await fs.readFile(
|
|
47
|
-
path.join(
|
|
48
|
-
__dirname,
|
|
49
|
-
"../../../../../internals/template/realize/src/providers/jwtAuthorize.ts",
|
|
50
|
-
),
|
|
51
|
-
"utf-8",
|
|
52
|
-
),
|
|
53
|
-
};
|
|
38
|
+
const templateFiles = await (await ctx.compiler()).realize.getTemplate();
|
|
54
39
|
|
|
55
40
|
ctx.dispatch({
|
|
56
41
|
type: "realizeAuthorizationStart",
|
|
57
42
|
step: ctx.state().test?.step ?? 0,
|
|
58
43
|
created_at: new Date().toISOString(),
|
|
59
44
|
});
|
|
45
|
+
|
|
60
46
|
const authorizations: AutoBeRealizeAuthorization[] = await Promise.all(
|
|
61
47
|
roles.map(async (role) => {
|
|
62
48
|
const authorization: AutoBeRealizeAuthorization = await process(
|
|
63
49
|
ctx,
|
|
64
50
|
role,
|
|
65
|
-
|
|
51
|
+
InternalFileSystem.DEFAULT.map((el) => ({
|
|
52
|
+
[el]: templateFiles[el],
|
|
53
|
+
})).reduce((acc, cur) => Object.assign(acc, cur), {}),
|
|
66
54
|
);
|
|
67
55
|
ctx.dispatch({
|
|
68
56
|
type: "realizeAuthorizationWrite",
|
|
@@ -88,9 +76,10 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
88
76
|
role: string,
|
|
89
77
|
templateFiles: Record<string, string>,
|
|
90
78
|
): Promise<AutoBeRealizeAuthorization> {
|
|
91
|
-
const pointer: IPointer<
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
const pointer: IPointer<IAutoBeRealizeAuthorizationApplication.IProps | null> =
|
|
80
|
+
{
|
|
81
|
+
value: null,
|
|
82
|
+
};
|
|
94
83
|
const agentica: MicroAgentica<Model> = new MicroAgentica({
|
|
95
84
|
model: ctx.model,
|
|
96
85
|
vendor: ctx.vendor,
|
|
@@ -100,7 +89,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
100
89
|
describe: null,
|
|
101
90
|
},
|
|
102
91
|
},
|
|
103
|
-
histories:
|
|
92
|
+
histories: transformRealizeAuthorizationHistories(ctx, role),
|
|
104
93
|
controllers: [
|
|
105
94
|
createApplication({
|
|
106
95
|
model: ctx.model,
|
|
@@ -127,24 +116,25 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
127
116
|
pointer.value.decorator.name,
|
|
128
117
|
),
|
|
129
118
|
name: pointer.value.decorator.name,
|
|
130
|
-
content: pointer.value.decorator.
|
|
119
|
+
content: pointer.value.decorator.content,
|
|
131
120
|
},
|
|
132
121
|
payload: {
|
|
133
122
|
location: AuthorizationFileSystem.payloadPath(pointer.value.payload.name),
|
|
134
123
|
name: pointer.value.payload.name,
|
|
135
|
-
content: pointer.value.payload.
|
|
124
|
+
content: pointer.value.payload.content,
|
|
136
125
|
},
|
|
137
126
|
provider: {
|
|
138
127
|
location: AuthorizationFileSystem.providerPath(
|
|
139
128
|
pointer.value.provider.name,
|
|
140
129
|
),
|
|
141
130
|
name: pointer.value.provider.name,
|
|
142
|
-
content: pointer.value.provider.
|
|
131
|
+
content: pointer.value.provider.content,
|
|
143
132
|
},
|
|
144
133
|
};
|
|
145
134
|
const compiled = ctx.state().prisma?.compiled;
|
|
146
135
|
const prismaClients: Record<string, string> =
|
|
147
136
|
compiled?.type === "success" ? compiled.nodeModules : {};
|
|
137
|
+
|
|
148
138
|
return correctDecorator(ctx, authorization, prismaClients, templateFiles);
|
|
149
139
|
}
|
|
150
140
|
|
|
@@ -182,9 +172,10 @@ async function correctDecorator<Model extends ILlmSchema.Model>(
|
|
|
182
172
|
return auth;
|
|
183
173
|
}
|
|
184
174
|
|
|
185
|
-
const pointer: IPointer<
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
const pointer: IPointer<IAutoBeRealizeAuthorizationApplication.IProps | null> =
|
|
176
|
+
{
|
|
177
|
+
value: null,
|
|
178
|
+
};
|
|
188
179
|
const agentica: MicroAgentica<Model> = new MicroAgentica({
|
|
189
180
|
model: ctx.model,
|
|
190
181
|
vendor: ctx.vendor,
|
|
@@ -194,7 +185,7 @@ async function correctDecorator<Model extends ILlmSchema.Model>(
|
|
|
194
185
|
describe: null,
|
|
195
186
|
},
|
|
196
187
|
},
|
|
197
|
-
histories:
|
|
188
|
+
histories: transformRealizeAuthorizationCorrectHistories(
|
|
198
189
|
ctx,
|
|
199
190
|
auth,
|
|
200
191
|
templateFiles,
|
|
@@ -225,38 +216,38 @@ async function correctDecorator<Model extends ILlmSchema.Model>(
|
|
|
225
216
|
decorator: {
|
|
226
217
|
location: auth.decorator.location,
|
|
227
218
|
name: pointer.value.decorator.name,
|
|
228
|
-
content: pointer.value.decorator.
|
|
219
|
+
content: pointer.value.decorator.content,
|
|
229
220
|
},
|
|
230
221
|
payload: {
|
|
231
222
|
location: auth.payload.location,
|
|
232
223
|
name: pointer.value.payload.name,
|
|
233
|
-
content: pointer.value.payload.
|
|
224
|
+
content: pointer.value.payload.content,
|
|
234
225
|
},
|
|
235
226
|
provider: {
|
|
236
227
|
location: auth.provider.location,
|
|
237
228
|
name: pointer.value.provider.name,
|
|
238
|
-
content: pointer.value.provider.
|
|
229
|
+
content: pointer.value.provider.content,
|
|
239
230
|
},
|
|
240
231
|
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
232
|
+
|
|
233
|
+
const res: AutoBeRealizeAuthorization =
|
|
234
|
+
await orchestrateRealizeAuthorizationCorrect(
|
|
235
|
+
ctx,
|
|
236
|
+
corrected,
|
|
237
|
+
prismaClients,
|
|
238
|
+
templateFiles,
|
|
239
|
+
life - 1,
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
return {
|
|
243
|
+
...res,
|
|
244
|
+
role: auth.role,
|
|
245
|
+
};
|
|
255
246
|
}
|
|
256
247
|
|
|
257
248
|
function createApplication<Model extends ILlmSchema.Model>(props: {
|
|
258
249
|
model: Model;
|
|
259
|
-
build: (next:
|
|
250
|
+
build: (next: IAutoBeRealizeAuthorizationApplication.IProps) => void;
|
|
260
251
|
}): IAgenticaController.IClass<Model> {
|
|
261
252
|
assertSchemaModel(props.model);
|
|
262
253
|
|
|
@@ -272,12 +263,12 @@ function createApplication<Model extends ILlmSchema.Model>(props: {
|
|
|
272
263
|
createDecorator: (next) => {
|
|
273
264
|
props.build(next);
|
|
274
265
|
},
|
|
275
|
-
} satisfies
|
|
266
|
+
} satisfies IAutoBeRealizeAuthorizationApplication,
|
|
276
267
|
};
|
|
277
268
|
}
|
|
278
269
|
|
|
279
270
|
const claude = typia.llm.application<
|
|
280
|
-
|
|
271
|
+
IAutoBeRealizeAuthorizationApplication,
|
|
281
272
|
"claude",
|
|
282
273
|
{
|
|
283
274
|
reference: true;
|
|
@@ -285,7 +276,7 @@ const claude = typia.llm.application<
|
|
|
285
276
|
>();
|
|
286
277
|
const collection = {
|
|
287
278
|
chatgpt: typia.llm.application<
|
|
288
|
-
|
|
279
|
+
IAutoBeRealizeAuthorizationApplication,
|
|
289
280
|
"chatgpt",
|
|
290
281
|
{ reference: true }
|
|
291
282
|
>(),
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { IAgenticaController, MicroAgentica } from "@agentica/core";
|
|
2
|
+
import {
|
|
3
|
+
AutoBeRealizeAuthorization,
|
|
4
|
+
AutoBeRealizeAuthorizationCorrect,
|
|
5
|
+
IAutoBeCompiler,
|
|
6
|
+
IAutoBeTypeScriptCompileResult,
|
|
7
|
+
} from "@autobe/interface";
|
|
8
|
+
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
9
|
+
import { IPointer } from "tstl";
|
|
10
|
+
import typia from "typia";
|
|
11
|
+
|
|
12
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
13
|
+
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
14
|
+
import { enforceToolCall } from "../../utils/enforceToolCall";
|
|
15
|
+
import { IAutoBeRealizeAuthorizationCorrectApplication } from "./structures/IAutoBeRealizeAuthorizationCorrectApplication";
|
|
16
|
+
import { transformRealizeAuthorizationCorrectHistories } from "./transformRealizeAuthorizationCorrectHistories";
|
|
17
|
+
import { AuthorizationFileSystem } from "./utils/AuthorizationFileSystem";
|
|
18
|
+
|
|
19
|
+
export async function orchestrateRealizeAuthorizationCorrect<
|
|
20
|
+
Model extends ILlmSchema.Model,
|
|
21
|
+
>(
|
|
22
|
+
ctx: AutoBeContext<Model>,
|
|
23
|
+
authorization: AutoBeRealizeAuthorization,
|
|
24
|
+
prismaClients: Record<string, string>,
|
|
25
|
+
templateFiles: Record<string, string>,
|
|
26
|
+
life: number = 4,
|
|
27
|
+
): Promise<AutoBeRealizeAuthorization> {
|
|
28
|
+
// Check Compile
|
|
29
|
+
const files: Record<string, string> = {
|
|
30
|
+
...templateFiles,
|
|
31
|
+
...prismaClients,
|
|
32
|
+
[AuthorizationFileSystem.decoratorPath(authorization.decorator.name)]:
|
|
33
|
+
authorization.decorator.content,
|
|
34
|
+
[AuthorizationFileSystem.providerPath(authorization.provider.name)]:
|
|
35
|
+
authorization.provider.content,
|
|
36
|
+
[AuthorizationFileSystem.payloadPath(authorization.payload.name)]:
|
|
37
|
+
authorization.payload.content,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
41
|
+
|
|
42
|
+
const compiled: IAutoBeTypeScriptCompileResult =
|
|
43
|
+
await compiler.typescript.compile({
|
|
44
|
+
files,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
ctx.dispatch({
|
|
48
|
+
type: "realizeAuthorizationValidate",
|
|
49
|
+
created_at: new Date().toISOString(),
|
|
50
|
+
authorization: authorization,
|
|
51
|
+
result: compiled,
|
|
52
|
+
step: ctx.state().test?.step ?? 0,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (compiled.type === "success") {
|
|
56
|
+
return authorization;
|
|
57
|
+
} else if (compiled.type === "exception" || life === 0) {
|
|
58
|
+
return authorization;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const pointer: IPointer<IAutoBeRealizeAuthorizationCorrectApplication.IProps | null> =
|
|
62
|
+
{
|
|
63
|
+
value: null,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const agentica: MicroAgentica<Model> = new MicroAgentica({
|
|
67
|
+
model: ctx.model,
|
|
68
|
+
vendor: ctx.vendor,
|
|
69
|
+
config: {
|
|
70
|
+
...(ctx.config ?? {}),
|
|
71
|
+
executor: {
|
|
72
|
+
describe: null,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
histories: transformRealizeAuthorizationCorrectHistories(
|
|
76
|
+
ctx,
|
|
77
|
+
authorization,
|
|
78
|
+
templateFiles,
|
|
79
|
+
compiled.diagnostics,
|
|
80
|
+
),
|
|
81
|
+
controllers: [
|
|
82
|
+
createApplication({
|
|
83
|
+
model: ctx.model,
|
|
84
|
+
build: (next) => {
|
|
85
|
+
pointer.value = next;
|
|
86
|
+
},
|
|
87
|
+
}),
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
enforceToolCall(agentica);
|
|
91
|
+
|
|
92
|
+
await agentica
|
|
93
|
+
.conversate("Please correct the decorator and the provider.")
|
|
94
|
+
.finally(() => {
|
|
95
|
+
const tokenUsage = agentica.getTokenUsage();
|
|
96
|
+
ctx.usage().record(tokenUsage, ["realize"]);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
if (pointer.value === null) throw new Error("Failed to correct decorator.");
|
|
100
|
+
|
|
101
|
+
const result: AutoBeRealizeAuthorizationCorrect = {
|
|
102
|
+
...pointer.value,
|
|
103
|
+
decorator: {
|
|
104
|
+
...pointer.value.decorator,
|
|
105
|
+
location: AuthorizationFileSystem.decoratorPath(
|
|
106
|
+
pointer.value.decorator.name,
|
|
107
|
+
),
|
|
108
|
+
},
|
|
109
|
+
provider: {
|
|
110
|
+
...pointer.value.provider,
|
|
111
|
+
location: AuthorizationFileSystem.providerPath(
|
|
112
|
+
pointer.value.provider.name,
|
|
113
|
+
),
|
|
114
|
+
},
|
|
115
|
+
payload: {
|
|
116
|
+
...pointer.value.payload,
|
|
117
|
+
location: AuthorizationFileSystem.payloadPath(pointer.value.payload.name),
|
|
118
|
+
},
|
|
119
|
+
role: authorization.role,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
ctx.dispatch({
|
|
123
|
+
...pointer.value,
|
|
124
|
+
type: "realizeAuthorizationCorrect",
|
|
125
|
+
created_at: new Date().toISOString(),
|
|
126
|
+
authorization: result,
|
|
127
|
+
result: compiled,
|
|
128
|
+
step: ctx.state().test?.step ?? 0,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
return await orchestrateRealizeAuthorizationCorrect(
|
|
132
|
+
ctx,
|
|
133
|
+
result,
|
|
134
|
+
prismaClients,
|
|
135
|
+
templateFiles,
|
|
136
|
+
life - 1,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function createApplication<Model extends ILlmSchema.Model>(props: {
|
|
141
|
+
model: Model;
|
|
142
|
+
build: (next: IAutoBeRealizeAuthorizationCorrectApplication.IProps) => void;
|
|
143
|
+
}): IAgenticaController.IClass<Model> {
|
|
144
|
+
assertSchemaModel(props.model);
|
|
145
|
+
|
|
146
|
+
const application: ILlmApplication<Model> = collection[
|
|
147
|
+
props.model
|
|
148
|
+
] as unknown as ILlmApplication<Model>;
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
protocol: "class",
|
|
152
|
+
name: "Correct Authorization",
|
|
153
|
+
application,
|
|
154
|
+
execute: {
|
|
155
|
+
correctDecorator: (next) => {
|
|
156
|
+
props.build(next);
|
|
157
|
+
},
|
|
158
|
+
} satisfies IAutoBeRealizeAuthorizationCorrectApplication,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const claude = typia.llm.application<
|
|
163
|
+
IAutoBeRealizeAuthorizationCorrectApplication,
|
|
164
|
+
"claude",
|
|
165
|
+
{
|
|
166
|
+
reference: true;
|
|
167
|
+
}
|
|
168
|
+
>();
|
|
169
|
+
const collection = {
|
|
170
|
+
chatgpt: typia.llm.application<
|
|
171
|
+
IAutoBeRealizeAuthorizationCorrectApplication,
|
|
172
|
+
"chatgpt",
|
|
173
|
+
{ reference: true }
|
|
174
|
+
>(),
|
|
175
|
+
claude,
|
|
176
|
+
llama: claude,
|
|
177
|
+
deepseek: claude,
|
|
178
|
+
"3.1": claude,
|
|
179
|
+
};
|
|
@@ -9,10 +9,7 @@ import typia from "typia";
|
|
|
9
9
|
|
|
10
10
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
11
11
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
12
|
-
import {
|
|
13
|
-
randomBackoffRetry,
|
|
14
|
-
randomBackoffStrategy,
|
|
15
|
-
} from "../../utils/backoffRetry";
|
|
12
|
+
import { randomBackoffRetry } from "../../utils/backoffRetry";
|
|
16
13
|
import { enforceToolCall } from "../../utils/enforceToolCall";
|
|
17
14
|
import { getTestScenarioArtifacts } from "../test/compile/getTestScenarioArtifacts";
|
|
18
15
|
import { IAutoBeTestScenarioArtifacts } from "../test/structures/IAutoBeTestScenarioArtifacts";
|
|
@@ -20,6 +17,7 @@ import { RealizePlannerOutput } from "./orchestrateRealizePlanner";
|
|
|
20
17
|
import { IAutoBeRealizeCoderApplication } from "./structures/IAutoBeRealizeCoderApplication";
|
|
21
18
|
import { FAILED } from "./structures/IAutoBeRealizeFailedSymbol";
|
|
22
19
|
import { transformRealizeCoderHistories } from "./transformRealizeCoderHistories";
|
|
20
|
+
import { RealizeFileSystem } from "./utils/ProviderFileSystem";
|
|
23
21
|
import { replaceImportStatements } from "./utils/replaceImportStatements";
|
|
24
22
|
|
|
25
23
|
/**
|
|
@@ -85,7 +83,6 @@ export const orchestrateRealizeCoder = async <Model extends ILlmSchema.Model>(
|
|
|
85
83
|
vendor: ctx.vendor,
|
|
86
84
|
config: {
|
|
87
85
|
...ctx.config,
|
|
88
|
-
backoffStrategy: randomBackoffStrategy,
|
|
89
86
|
executor: {
|
|
90
87
|
describe: null,
|
|
91
88
|
},
|
|
@@ -138,7 +135,7 @@ export const orchestrateRealizeCoder = async <Model extends ILlmSchema.Model>(
|
|
|
138
135
|
|
|
139
136
|
return {
|
|
140
137
|
...pointer.value,
|
|
141
|
-
filename:
|
|
138
|
+
filename: RealizeFileSystem.providerPath(props.functionName),
|
|
142
139
|
};
|
|
143
140
|
};
|
|
144
141
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
createDecorator: (
|
|
1
|
+
export interface IAutoBeRealizeAuthorizationApplication {
|
|
2
|
+
createDecorator: (
|
|
3
|
+
next: IAutoBeRealizeAuthorizationApplication.IProps,
|
|
4
|
+
) => void;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
|
-
export namespace
|
|
7
|
+
export namespace IAutoBeRealizeAuthorizationApplication {
|
|
6
8
|
export interface IProps {
|
|
7
9
|
/**
|
|
8
10
|
* Authentication Provider function configuration containing the function
|
|
@@ -10,7 +12,7 @@ export namespace IAutoBeRealizeDecoratorApplication {
|
|
|
10
12
|
* verification, role validation, and database queries to authenticate
|
|
11
13
|
* users.
|
|
12
14
|
*/
|
|
13
|
-
provider:
|
|
15
|
+
provider: IAutoBeRealizeAuthorizationApplication.IProvider;
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Authentication Decorator configuration containing the decorator name and
|
|
@@ -18,7 +20,7 @@ export namespace IAutoBeRealizeDecoratorApplication {
|
|
|
18
20
|
* decorators to automatically inject authenticated user data into
|
|
19
21
|
* Controller methods.
|
|
20
22
|
*/
|
|
21
|
-
decorator:
|
|
23
|
+
decorator: IAutoBeRealizeAuthorizationApplication.IDecorator;
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Authentication Payload Type configuration containing the payload type
|
|
@@ -27,7 +29,7 @@ export namespace IAutoBeRealizeDecoratorApplication {
|
|
|
27
29
|
* Controller methods when using the decorator. It serves as the TypeScript
|
|
28
30
|
* type for the parameter in Controller method signatures.
|
|
29
31
|
*/
|
|
30
|
-
payload:
|
|
32
|
+
payload: IAutoBeRealizeAuthorizationApplication.IPayloadType;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export interface IProvider {
|
|
@@ -48,7 +50,7 @@ export namespace IAutoBeRealizeDecoratorApplication {
|
|
|
48
50
|
* UnauthorizedException, and the Payload interface definition with id (UUID
|
|
49
51
|
* format) and type (role discriminator) fields using typia tags.
|
|
50
52
|
*/
|
|
51
|
-
|
|
53
|
+
content: string;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
export interface IDecorator {
|
|
@@ -69,7 +71,7 @@ export namespace IAutoBeRealizeDecoratorApplication {
|
|
|
69
71
|
* pattern using tstl library for efficient decorator instance management,
|
|
70
72
|
* and proper TypeScript typing for the ParameterDecorator interface.
|
|
71
73
|
*/
|
|
72
|
-
|
|
74
|
+
content: string;
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
export interface IPayloadType {
|
|
@@ -89,6 +91,6 @@ export namespace IAutoBeRealizeDecoratorApplication {
|
|
|
89
91
|
* when using the decorator. It serves as the TypeScript type for the
|
|
90
92
|
* parameter in Controller method signatures.
|
|
91
93
|
*/
|
|
92
|
-
|
|
94
|
+
content: string;
|
|
93
95
|
}
|
|
94
96
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IAutoBeRealizeAuthorizationApplication } from "./IAutoBeRealizeAuthorizationApplication";
|
|
2
|
+
|
|
3
|
+
export interface IAutoBeRealizeAuthorizationCorrectApplication {
|
|
4
|
+
correctDecorator: (
|
|
5
|
+
next: IAutoBeRealizeAuthorizationCorrectApplication.IProps,
|
|
6
|
+
) => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export namespace IAutoBeRealizeAuthorizationCorrectApplication {
|
|
10
|
+
export interface IProps
|
|
11
|
+
extends IAutoBeRealizeAuthorizationApplication.IProps {
|
|
12
|
+
/**
|
|
13
|
+
* Step 1: TypeScript compilation error analysis and diagnosis.
|
|
14
|
+
*
|
|
15
|
+
* AI identifies all compilation errors (type mismatches, imports, syntax)
|
|
16
|
+
* and categorizes them by component (providers/decorator/payload). Analyzes
|
|
17
|
+
* error dependencies and determines fix priorities for systematic
|
|
18
|
+
* resolution.
|
|
19
|
+
*/
|
|
20
|
+
error_analysis: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Step 2: Corrected implementation with all compilation errors resolved.
|
|
24
|
+
*
|
|
25
|
+
* AI generates fixed versions of provider, decorator, and payload code.
|
|
26
|
+
* Maintains original functionality while ensuring TypeScript compilation
|
|
27
|
+
* success and proper NestJS/Prisma framework integration.
|
|
28
|
+
*/
|
|
29
|
+
corrected_implementation: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Step 3: Final validation and comprehensive fix summary.
|
|
33
|
+
*
|
|
34
|
+
* AI validates corrected code compiles successfully and documents all
|
|
35
|
+
* changes made. Provides production-ready code with detailed change log for
|
|
36
|
+
* maintenance reference.
|
|
37
|
+
*/
|
|
38
|
+
validation_summary: string;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -4,42 +4,60 @@ import {
|
|
|
4
4
|
} from "@autobe/interface";
|
|
5
5
|
import { tags } from "typia";
|
|
6
6
|
|
|
7
|
-
import { IAutoBeRealizeCoderApplication } from "./IAutoBeRealizeCoderApplication";
|
|
8
7
|
import { FAILED } from "./IAutoBeRealizeFailedSymbol";
|
|
9
8
|
|
|
10
9
|
export namespace IAutoBeRealizeCompile {
|
|
11
|
-
|
|
12
|
-
type:
|
|
10
|
+
type IBase<T extends "success" | "failed"> = {
|
|
11
|
+
type: T;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
interface IOperation {
|
|
15
|
+
/**
|
|
16
|
+
* Operation: An object containing the function specification including the
|
|
17
|
+
* endpoint
|
|
18
|
+
*/
|
|
13
19
|
op: AutoBeOpenApi.IOperation;
|
|
14
|
-
result: Pick<
|
|
15
|
-
IAutoBeRealizeCoderApplication.RealizeCoderOutput,
|
|
16
|
-
"filename" | "implementationCode"
|
|
17
|
-
> & {
|
|
18
|
-
/** Function name */
|
|
19
|
-
name: string;
|
|
20
|
-
};
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
interface SuccessResult {
|
|
23
|
+
/** The name of the file where the implementation will be written */
|
|
24
|
+
filename: string;
|
|
25
|
+
/** The generated implementation code for the function */
|
|
26
|
+
implementationCode: string;
|
|
27
|
+
/** Function name */
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Success extends IBase<"success">, IOperation {
|
|
32
|
+
result: SuccessResult;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface Fail extends IBase<"failed">, IOperation {
|
|
26
36
|
result: FAILED;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
>;
|
|
39
|
+
export interface FileContentMapEntry {
|
|
40
|
+
result: "failed" | "success";
|
|
41
|
+
content: string;
|
|
42
|
+
role?: (string & tags.MinLength<1>) | null;
|
|
43
|
+
endpoint?: AutoBeOpenApi.IEndpoint;
|
|
44
|
+
location?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type FileContentMap = Record<string, FileContentMapEntry>;
|
|
40
49
|
|
|
41
50
|
export interface CompileDiagnostics {
|
|
51
|
+
/**
|
|
52
|
+
* Array containing all errors including previous attempts. Includes errors
|
|
53
|
+
* that have already been resolved. Used to preserve error context and
|
|
54
|
+
* identify recurring error patterns.
|
|
55
|
+
*/
|
|
42
56
|
total: IAutoBeTypeScriptCompileResult.IDiagnostic[];
|
|
57
|
+
/**
|
|
58
|
+
* Array containing errors from the most recent code compilation. These are
|
|
59
|
+
* the errors that need to be resolved in the current iteration.
|
|
60
|
+
*/
|
|
43
61
|
current: IAutoBeTypeScriptCompileResult.IDiagnostic[];
|
|
44
62
|
}
|
|
45
63
|
}
|
package/src/orchestrate/realize/{transformRealizeDecorator.ts → transformRealizeAuthorization.ts}
RENAMED
|
@@ -4,8 +4,9 @@ import { v4 } from "uuid";
|
|
|
4
4
|
|
|
5
5
|
import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
|
|
6
6
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
7
|
+
import { AuthorizationFileSystem } from "./utils/AuthorizationFileSystem";
|
|
7
8
|
|
|
8
|
-
export const
|
|
9
|
+
export const transformRealizeAuthorizationHistories = (
|
|
9
10
|
ctx: AutoBeContext<ILlmSchema.Model>,
|
|
10
11
|
role: string,
|
|
11
12
|
): Array<
|
|
@@ -16,7 +17,7 @@ export const transformRealizeDecoratorHistories = (
|
|
|
16
17
|
id: v4(),
|
|
17
18
|
created_at: new Date().toISOString(),
|
|
18
19
|
type: "systemMessage",
|
|
19
|
-
text: AutoBeSystemPromptConstant.
|
|
20
|
+
text: AutoBeSystemPromptConstant.REALIZE_AUTHORIZATION,
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
23
|
id: v4(),
|
|
@@ -31,6 +32,16 @@ export const transformRealizeDecoratorHistories = (
|
|
|
31
32
|
"",
|
|
32
33
|
JSON.stringify(ctx.state().prisma?.schemas, null, 2),
|
|
33
34
|
"",
|
|
35
|
+
"## File Structure Example",
|
|
36
|
+
"",
|
|
37
|
+
"Please refer to the following file structure to construct appropriate import paths:",
|
|
38
|
+
"",
|
|
39
|
+
"File locations:",
|
|
40
|
+
"",
|
|
41
|
+
`- Decorator Path : ${AuthorizationFileSystem.decoratorPath("AdminAuth.ts")}`,
|
|
42
|
+
`- Payload Path : ${AuthorizationFileSystem.payloadPath("AdminPayload.ts")}`,
|
|
43
|
+
`- Provider Path : ${AuthorizationFileSystem.providerPath("adminAuthorize.ts")}`,
|
|
44
|
+
"",
|
|
34
45
|
].join("\n"),
|
|
35
46
|
},
|
|
36
47
|
];
|