@autobe/agent 0.15.0 → 0.16.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/AutoBeAgent.js +2 -2
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.d.ts +1 -0
- package/lib/AutoBeMockAgent.js +18 -4
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +3 -3
- package/lib/factory/getAutoBeGenerated.js +2 -1
- package/lib/factory/getAutoBeGenerated.js.map +1 -1
- package/lib/index.mjs +739 -577
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.d.ts +0 -15
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js +0 -3
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +19 -12
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.d.ts +1 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js +3 -5
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.d.ts +7 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +363 -4
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +3 -3
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +3 -118
- 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/writeDocumentUntilReviewPassed.d.ts +11 -4
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +61 -45
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +17 -10
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/realize/ProviderCodeComparator.d.ts +5 -0
- package/lib/orchestrate/realize/ProviderCodeComparator.js +16 -0
- package/lib/orchestrate/realize/ProviderCodeComparator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +41 -53
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +13 -87
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +32 -43
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +3 -2
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +25 -39
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +15 -15
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +11 -17
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +4 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +21 -17
- package/lib/orchestrate/realize/transformRealizeAuthorization.js +5 -9
- package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +9 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +3 -2
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +58 -27
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.d.ts +5 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js +10 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +4 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +38 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +2 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +15 -2
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.d.ts +9 -2
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +158 -100
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +1 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +1 -1
- package/src/AutoBeMockAgent.ts +20 -6
- package/src/constants/AutoBeSystemPromptConstant.ts +3 -3
- package/src/factory/getAutoBeGenerated.ts +2 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeFileSystem.ts +0 -15
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +17 -17
- package/src/orchestrate/analyze/orchestrateAnalyzeComposer.ts +4 -7
- package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +100 -6
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -21
- package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +76 -59
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +17 -10
- package/src/orchestrate/realize/ProviderCodeComparator.ts +15 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +54 -59
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +12 -120
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +21 -5
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +10 -9
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +15 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +11 -18
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +4 -2
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +24 -17
- package/src/orchestrate/realize/transformRealizeAuthorization.ts +5 -9
- package/src/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.ts +9 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +73 -25
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.ts +9 -0
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +64 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +41 -2
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +219 -145
- package/src/orchestrate/test/orchestrateTest.ts +1 -1
|
@@ -53,7 +53,6 @@ const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
|
53
53
|
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
54
54
|
const orchestrateRealizeAuthorizationCorrect_1 = require("./orchestrateRealizeAuthorizationCorrect");
|
|
55
55
|
const transformRealizeAuthorization_1 = require("./transformRealizeAuthorization");
|
|
56
|
-
const transformRealizeAuthorizationCorrectHistories_1 = require("./transformRealizeAuthorizationCorrectHistories");
|
|
57
56
|
const AuthorizationFileSystem_1 = require("./utils/AuthorizationFileSystem");
|
|
58
57
|
const InternalFileSystem_1 = require("./utils/InternalFileSystem");
|
|
59
58
|
/**
|
|
@@ -64,15 +63,13 @@ const InternalFileSystem_1 = require("./utils/InternalFileSystem");
|
|
|
64
63
|
*/
|
|
65
64
|
function orchestrateRealizeAuthorization(ctx) {
|
|
66
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
var _a, _b, _c, _d, _e, _f
|
|
68
|
-
const roles = (
|
|
69
|
-
.state()
|
|
70
|
-
.interface) === null || _a === void 0 ? void 0 : _a.document.components.authorization) === null || _b === void 0 ? void 0 : _b.map((auth) => auth.name)) !== null && _c !== void 0 ? _c : [];
|
|
66
|
+
var _a, _b, _c, _d, _e, _f;
|
|
67
|
+
const roles = (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.roles.map((role) => role.name)) !== null && _b !== void 0 ? _b : [];
|
|
71
68
|
let completed = 0;
|
|
72
69
|
const templateFiles = yield (yield ctx.compiler()).realize.getTemplate();
|
|
73
70
|
ctx.dispatch({
|
|
74
71
|
type: "realizeAuthorizationStart",
|
|
75
|
-
step: (
|
|
72
|
+
step: (_d = (_c = ctx.state().test) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
|
|
76
73
|
created_at: new Date().toISOString(),
|
|
77
74
|
});
|
|
78
75
|
const authorizations = yield Promise.all(roles.map((role) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -93,7 +90,7 @@ function orchestrateRealizeAuthorization(ctx) {
|
|
|
93
90
|
ctx.dispatch({
|
|
94
91
|
type: "realizeAuthorizationComplete",
|
|
95
92
|
created_at: new Date().toISOString(),
|
|
96
|
-
step: (
|
|
93
|
+
step: (_f = (_e = ctx.state().test) === null || _e === void 0 ? void 0 : _e.step) !== null && _f !== void 0 ? _f : 0,
|
|
97
94
|
});
|
|
98
95
|
return authorizations;
|
|
99
96
|
});
|
|
@@ -129,6 +126,7 @@ function process(ctx, role, templateFiles) {
|
|
|
129
126
|
});
|
|
130
127
|
if (pointer.value === null)
|
|
131
128
|
throw new Error("Failed to create decorator.");
|
|
129
|
+
const compiler = yield ctx.compiler();
|
|
132
130
|
const authorization = {
|
|
133
131
|
role,
|
|
134
132
|
decorator: {
|
|
@@ -139,7 +137,7 @@ function process(ctx, role, templateFiles) {
|
|
|
139
137
|
payload: {
|
|
140
138
|
location: AuthorizationFileSystem_1.AuthorizationFileSystem.payloadPath(pointer.value.payload.name),
|
|
141
139
|
name: pointer.value.payload.name,
|
|
142
|
-
content: pointer.value.payload.content,
|
|
140
|
+
content: yield compiler.typescript.beautify(pointer.value.payload.content),
|
|
143
141
|
},
|
|
144
142
|
provider: {
|
|
145
143
|
location: AuthorizationFileSystem_1.AuthorizationFileSystem.providerPath(pointer.value.provider.name),
|
|
@@ -149,79 +147,7 @@ function process(ctx, role, templateFiles) {
|
|
|
149
147
|
};
|
|
150
148
|
const compiled = (_b = ctx.state().prisma) === null || _b === void 0 ? void 0 : _b.compiled;
|
|
151
149
|
const prismaClients = (compiled === null || compiled === void 0 ? void 0 : compiled.type) === "success" ? compiled.nodeModules : {};
|
|
152
|
-
return
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
function correctDecorator(ctx_1, auth_1, prismaClients_1, templateFiles_1) {
|
|
156
|
-
return __awaiter(this, arguments, void 0, function* (ctx, auth, prismaClients, templateFiles, life = 4) {
|
|
157
|
-
var _a, _b, _c;
|
|
158
|
-
// Check Compile
|
|
159
|
-
const files = Object.assign(Object.assign(Object.assign({}, templateFiles), prismaClients), { [auth.decorator.location]: auth.decorator.content, [auth.payload.location]: auth.payload.content, [auth.provider.location]: auth.provider.content });
|
|
160
|
-
const compiler = yield ctx.compiler();
|
|
161
|
-
const result = yield compiler.typescript.compile({
|
|
162
|
-
files,
|
|
163
|
-
});
|
|
164
|
-
ctx.dispatch({
|
|
165
|
-
type: "realizeAuthorizationValidate",
|
|
166
|
-
created_at: new Date().toISOString(),
|
|
167
|
-
result,
|
|
168
|
-
authorization: auth,
|
|
169
|
-
step: (_b = (_a = ctx.state().test) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
170
|
-
});
|
|
171
|
-
if (result.type === "success") {
|
|
172
|
-
return auth;
|
|
173
|
-
}
|
|
174
|
-
else if (result.type === "exception" || life === 0) {
|
|
175
|
-
return auth;
|
|
176
|
-
}
|
|
177
|
-
const pointer = {
|
|
178
|
-
value: null,
|
|
179
|
-
};
|
|
180
|
-
const agentica = new core_1.MicroAgentica({
|
|
181
|
-
model: ctx.model,
|
|
182
|
-
vendor: ctx.vendor,
|
|
183
|
-
config: Object.assign(Object.assign({}, ((_c = ctx.config) !== null && _c !== void 0 ? _c : {})), { executor: {
|
|
184
|
-
describe: null,
|
|
185
|
-
} }),
|
|
186
|
-
histories: (0, transformRealizeAuthorizationCorrectHistories_1.transformRealizeAuthorizationCorrectHistories)(ctx, auth, templateFiles, result.diagnostics),
|
|
187
|
-
controllers: [
|
|
188
|
-
createApplication({
|
|
189
|
-
model: ctx.model,
|
|
190
|
-
build: (next) => {
|
|
191
|
-
pointer.value = next;
|
|
192
|
-
},
|
|
193
|
-
}),
|
|
194
|
-
],
|
|
195
|
-
});
|
|
196
|
-
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
197
|
-
yield agentica
|
|
198
|
-
.conversate("Please correct the decorator and the provider.")
|
|
199
|
-
.finally(() => {
|
|
200
|
-
const tokenUsage = agentica.getTokenUsage();
|
|
201
|
-
ctx.usage().record(tokenUsage, ["realize"]);
|
|
202
|
-
});
|
|
203
|
-
if (pointer.value === null)
|
|
204
|
-
throw new Error("Failed to correct decorator.");
|
|
205
|
-
const corrected = {
|
|
206
|
-
role: auth.role,
|
|
207
|
-
decorator: {
|
|
208
|
-
location: auth.decorator.location,
|
|
209
|
-
name: pointer.value.decorator.name,
|
|
210
|
-
content: pointer.value.decorator.content,
|
|
211
|
-
},
|
|
212
|
-
payload: {
|
|
213
|
-
location: auth.payload.location,
|
|
214
|
-
name: pointer.value.payload.name,
|
|
215
|
-
content: pointer.value.payload.content,
|
|
216
|
-
},
|
|
217
|
-
provider: {
|
|
218
|
-
location: auth.provider.location,
|
|
219
|
-
name: pointer.value.provider.name,
|
|
220
|
-
content: pointer.value.provider.content,
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
const res = yield (0, orchestrateRealizeAuthorizationCorrect_1.orchestrateRealizeAuthorizationCorrect)(ctx, corrected, prismaClients, templateFiles, life - 1);
|
|
224
|
-
return Object.assign(Object.assign({}, res), { role: auth.role });
|
|
150
|
+
return (0, orchestrateRealizeAuthorizationCorrect_1.orchestrateRealizeAuthorizationCorrect)(ctx, authorization, prismaClients, templateFiles);
|
|
225
151
|
});
|
|
226
152
|
}
|
|
227
153
|
function createApplication(props) {
|
|
@@ -279,7 +205,7 @@ const claude = {
|
|
|
279
205
|
type: "string"
|
|
280
206
|
},
|
|
281
207
|
content: {
|
|
282
|
-
description: "Complete TypeScript code for the authentication Provider function
|
|
208
|
+
description: "Complete TypeScript code for the authentication Provider function. Must\ninclude: JWT token verification using jwtAuthorize function, role type\nchecking against payload.type, database query using\nMyGlobal.prisma.{tableName} pattern to verify user existence, and proper\nerror handling with ForbiddenException and UnauthorizedException. The\nfunction should return the authenticated user payload data.",
|
|
283
209
|
type: "string"
|
|
284
210
|
}
|
|
285
211
|
},
|
|
@@ -309,11 +235,11 @@ const claude = {
|
|
|
309
235
|
type: "object",
|
|
310
236
|
properties: {
|
|
311
237
|
name: {
|
|
312
|
-
description: "The name of the
|
|
238
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.",
|
|
313
239
|
type: "string"
|
|
314
240
|
},
|
|
315
241
|
content: {
|
|
316
|
-
description: "
|
|
242
|
+
description: "Complete TypeScript code for the Payload type interface in {Role}Payload\nformat (e.g., AdminPayload, UserPayload). Must include: id field with\nUUID format validation, type field as role discriminator, and proper\ntypia tags for validation. This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator and serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
317
243
|
type: "string"
|
|
318
244
|
}
|
|
319
245
|
},
|
|
@@ -443,7 +369,7 @@ const collection = {
|
|
|
443
369
|
type: "string"
|
|
444
370
|
},
|
|
445
371
|
content: {
|
|
446
|
-
description: "Complete TypeScript code for the authentication Provider function
|
|
372
|
+
description: "Complete TypeScript code for the authentication Provider function. Must\ninclude: JWT token verification using jwtAuthorize function, role type\nchecking against payload.type, database query using\nMyGlobal.prisma.{tableName} pattern to verify user existence, and proper\nerror handling with ForbiddenException and UnauthorizedException. The\nfunction should return the authenticated user payload data.",
|
|
447
373
|
type: "string"
|
|
448
374
|
}
|
|
449
375
|
},
|
|
@@ -473,11 +399,11 @@ const collection = {
|
|
|
473
399
|
type: "object",
|
|
474
400
|
properties: {
|
|
475
401
|
name: {
|
|
476
|
-
description: "The name of the
|
|
402
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.",
|
|
477
403
|
type: "string"
|
|
478
404
|
},
|
|
479
405
|
content: {
|
|
480
|
-
description: "
|
|
406
|
+
description: "Complete TypeScript code for the Payload type interface in {Role}Payload\nformat (e.g., AdminPayload, UserPayload). Must include: id field with\nUUID format validation, type field as role discriminator, and proper\ntypia tags for validation. This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator and serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
481
407
|
type: "string"
|
|
482
408
|
}
|
|
483
409
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeAuthorization.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorization.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeAuthorization.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorization.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -53,12 +53,15 @@ const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
|
53
53
|
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
54
54
|
const transformRealizeAuthorizationCorrectHistories_1 = require("./transformRealizeAuthorizationCorrectHistories");
|
|
55
55
|
const AuthorizationFileSystem_1 = require("./utils/AuthorizationFileSystem");
|
|
56
|
+
const AutoBeRealizeAuthorizationReplaceImport_1 = require("./utils/AutoBeRealizeAuthorizationReplaceImport");
|
|
56
57
|
function orchestrateRealizeAuthorizationCorrect(ctx_1, authorization_1, prismaClients_1, templateFiles_1) {
|
|
57
58
|
return __awaiter(this, arguments, void 0, function* (ctx, authorization, prismaClients, templateFiles, life = 4) {
|
|
58
59
|
var _a, _b, _c, _d, _e;
|
|
59
|
-
// Check Compile
|
|
60
|
-
const files = Object.assign(Object.assign(Object.assign({}, templateFiles), prismaClients), { [AuthorizationFileSystem_1.AuthorizationFileSystem.decoratorPath(authorization.decorator.name)]: authorization.decorator.content, [AuthorizationFileSystem_1.AuthorizationFileSystem.providerPath(authorization.provider.name)]: authorization.provider.content, [AuthorizationFileSystem_1.AuthorizationFileSystem.payloadPath(authorization.payload.name)]: authorization.payload.content });
|
|
61
60
|
const compiler = yield ctx.compiler();
|
|
61
|
+
const providerContent = yield compiler.typescript.beautify(AutoBeRealizeAuthorizationReplaceImport_1.AutoBeRealizeAuthorizationReplaceImport.replaceProviderImport(authorization.role, authorization.provider.content));
|
|
62
|
+
const decoratorContent = yield compiler.typescript.beautify(AutoBeRealizeAuthorizationReplaceImport_1.AutoBeRealizeAuthorizationReplaceImport.replaceDecoratorImport(authorization.role, authorization.decorator.content));
|
|
63
|
+
// Check Compile
|
|
64
|
+
const files = Object.assign(Object.assign(Object.assign({}, templateFiles), prismaClients), { [AuthorizationFileSystem_1.AuthorizationFileSystem.decoratorPath(authorization.decorator.name)]: decoratorContent, [AuthorizationFileSystem_1.AuthorizationFileSystem.providerPath(authorization.provider.name)]: providerContent, [AuthorizationFileSystem_1.AuthorizationFileSystem.payloadPath(authorization.payload.name)]: authorization.payload.content });
|
|
62
65
|
const compiled = yield compiler.typescript.compile({
|
|
63
66
|
files,
|
|
64
67
|
});
|
|
@@ -103,7 +106,11 @@ function orchestrateRealizeAuthorizationCorrect(ctx_1, authorization_1, prismaCl
|
|
|
103
106
|
});
|
|
104
107
|
if (pointer.value === null)
|
|
105
108
|
throw new Error("Failed to correct decorator.");
|
|
106
|
-
const result = Object.assign(Object.assign({}, pointer.value), { decorator: Object.assign(Object.assign({}, pointer.value.decorator), { location: AuthorizationFileSystem_1.AuthorizationFileSystem.decoratorPath(pointer.value.decorator.name) }), provider: Object.assign(Object.assign({}, pointer.value.provider), { location: AuthorizationFileSystem_1.AuthorizationFileSystem.providerPath(pointer.value.provider.name) }), payload:
|
|
109
|
+
const result = Object.assign(Object.assign({}, pointer.value), { decorator: Object.assign(Object.assign({}, pointer.value.decorator), { location: AuthorizationFileSystem_1.AuthorizationFileSystem.decoratorPath(pointer.value.decorator.name) }), provider: Object.assign(Object.assign({}, pointer.value.provider), { location: AuthorizationFileSystem_1.AuthorizationFileSystem.providerPath(pointer.value.provider.name) }), payload: {
|
|
110
|
+
name: pointer.value.payload.name,
|
|
111
|
+
location: AuthorizationFileSystem_1.AuthorizationFileSystem.payloadPath(pointer.value.payload.name),
|
|
112
|
+
content: yield compiler.typescript.beautify(pointer.value.payload.content),
|
|
113
|
+
}, role: authorization.role });
|
|
107
114
|
ctx.dispatch(Object.assign(Object.assign({}, pointer.value), { type: "realizeAuthorizationCorrect", created_at: new Date().toISOString(), authorization: result, result: compiled, step: (_e = (_d = ctx.state().test) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0 }));
|
|
108
115
|
return yield orchestrateRealizeAuthorizationCorrect(ctx, result, prismaClients, templateFiles, life - 1);
|
|
109
116
|
});
|
|
@@ -136,15 +143,11 @@ const claude = {
|
|
|
136
143
|
type: "object",
|
|
137
144
|
properties: {
|
|
138
145
|
error_analysis: {
|
|
139
|
-
description: "Step 1: TypeScript compilation error analysis and diagnosis.\n\nAI identifies all compilation errors (type mismatches
|
|
146
|
+
description: "Step 1: TypeScript compilation error analysis and diagnosis.\n\nAI identifies and categorizes all compilation errors (type mismatches,\nimport issues, syntax errors) by component (providers/decorator/payload).\nLists specific error messages with their locations and types for\nsystematic troubleshooting.",
|
|
140
147
|
type: "string"
|
|
141
148
|
},
|
|
142
|
-
|
|
143
|
-
description: "Step 2:
|
|
144
|
-
type: "string"
|
|
145
|
-
},
|
|
146
|
-
validation_summary: {
|
|
147
|
-
description: "Step 3: Final validation and comprehensive fix summary.\n\nAI validates corrected code compiles successfully and documents all\nchanges made. Provides production-ready code with detailed change log for\nmaintenance reference.",
|
|
149
|
+
solution_guidance: {
|
|
150
|
+
description: "Step 2: Solution guidance and fix recommendations.\n\nAI provides clear, actionable instructions on how to resolve each\nidentified error. Includes specific steps like \"add property X to\ninterface Y\", \"update import path from A to B\", or \"change type from C to\nD\". Focus on guidance rather than generating complete code\nimplementations.",
|
|
148
151
|
type: "string"
|
|
149
152
|
},
|
|
150
153
|
provider: {
|
|
@@ -162,8 +165,7 @@ const claude = {
|
|
|
162
165
|
},
|
|
163
166
|
required: [
|
|
164
167
|
"error_analysis",
|
|
165
|
-
"
|
|
166
|
-
"validation_summary",
|
|
168
|
+
"solution_guidance",
|
|
167
169
|
"provider",
|
|
168
170
|
"decorator",
|
|
169
171
|
"payload"
|
|
@@ -178,7 +180,7 @@ const claude = {
|
|
|
178
180
|
type: "string"
|
|
179
181
|
},
|
|
180
182
|
content: {
|
|
181
|
-
description: "Complete TypeScript code for the authentication Provider function
|
|
183
|
+
description: "Complete TypeScript code for the authentication Provider function. Must\ninclude: JWT token verification using jwtAuthorize function, role type\nchecking against payload.type, database query using\nMyGlobal.prisma.{tableName} pattern to verify user existence, and proper\nerror handling with ForbiddenException and UnauthorizedException. The\nfunction should return the authenticated user payload data.",
|
|
182
184
|
type: "string"
|
|
183
185
|
}
|
|
184
186
|
},
|
|
@@ -208,11 +210,11 @@ const claude = {
|
|
|
208
210
|
type: "object",
|
|
209
211
|
properties: {
|
|
210
212
|
name: {
|
|
211
|
-
description: "The name of the
|
|
213
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.",
|
|
212
214
|
type: "string"
|
|
213
215
|
},
|
|
214
216
|
content: {
|
|
215
|
-
description: "
|
|
217
|
+
description: "Complete TypeScript code for the Payload type interface in {Role}Payload\nformat (e.g., AdminPayload, UserPayload). Must include: id field with\nUUID format validation, type field as role discriminator, and proper\ntypia tags for validation. This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator and serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
216
218
|
type: "string"
|
|
217
219
|
}
|
|
218
220
|
},
|
|
@@ -223,18 +225,14 @@ const claude = {
|
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
},
|
|
226
|
-
validate: (() => { const _io0 = input => "string" === typeof input.error_analysis && "string" === typeof input.
|
|
228
|
+
validate: (() => { const _io0 = input => "string" === typeof input.error_analysis && "string" === typeof input.solution_guidance && ("object" === typeof input.provider && null !== input.provider && _io1(input.provider)) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload)); const _io1 = input => "string" === typeof input.name && "string" === typeof input.content; const _io2 = input => "string" === typeof input.name && "string" === typeof input.content; const _io3 = input => "string" === typeof input.name && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.error_analysis || _report(_exceptionable, {
|
|
227
229
|
path: _path + ".error_analysis",
|
|
228
230
|
expected: "string",
|
|
229
231
|
value: input.error_analysis
|
|
230
|
-
}), "string" === typeof input.
|
|
231
|
-
path: _path + ".
|
|
232
|
+
}), "string" === typeof input.solution_guidance || _report(_exceptionable, {
|
|
233
|
+
path: _path + ".solution_guidance",
|
|
232
234
|
expected: "string",
|
|
233
|
-
value: input.
|
|
234
|
-
}), "string" === typeof input.validation_summary || _report(_exceptionable, {
|
|
235
|
-
path: _path + ".validation_summary",
|
|
236
|
-
expected: "string",
|
|
237
|
-
value: input.validation_summary
|
|
235
|
+
value: input.solution_guidance
|
|
238
236
|
}), ("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
|
|
239
237
|
path: _path + ".provider",
|
|
240
238
|
expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
|
|
@@ -330,15 +328,11 @@ const collection = {
|
|
|
330
328
|
type: "object",
|
|
331
329
|
properties: {
|
|
332
330
|
error_analysis: {
|
|
333
|
-
description: "Step 1: TypeScript compilation error analysis and diagnosis.\n\nAI identifies all compilation errors (type mismatches
|
|
334
|
-
type: "string"
|
|
335
|
-
},
|
|
336
|
-
corrected_implementation: {
|
|
337
|
-
description: "Step 2: Corrected implementation with all compilation errors resolved.\n\nAI generates fixed versions of provider, decorator, and payload code.\nMaintains original functionality while ensuring TypeScript compilation\nsuccess and proper NestJS/Prisma framework integration.",
|
|
331
|
+
description: "Step 1: TypeScript compilation error analysis and diagnosis.\n\nAI identifies and categorizes all compilation errors (type mismatches,\nimport issues, syntax errors) by component (providers/decorator/payload).\nLists specific error messages with their locations and types for\nsystematic troubleshooting.",
|
|
338
332
|
type: "string"
|
|
339
333
|
},
|
|
340
|
-
|
|
341
|
-
description: "Step
|
|
334
|
+
solution_guidance: {
|
|
335
|
+
description: "Step 2: Solution guidance and fix recommendations.\n\nAI provides clear, actionable instructions on how to resolve each\nidentified error. Includes specific steps like \"add property X to\ninterface Y\", \"update import path from A to B\", or \"change type from C to\nD\". Focus on guidance rather than generating complete code\nimplementations.",
|
|
342
336
|
type: "string"
|
|
343
337
|
},
|
|
344
338
|
provider: {
|
|
@@ -353,8 +347,7 @@ const collection = {
|
|
|
353
347
|
},
|
|
354
348
|
required: [
|
|
355
349
|
"error_analysis",
|
|
356
|
-
"
|
|
357
|
-
"validation_summary",
|
|
350
|
+
"solution_guidance",
|
|
358
351
|
"provider",
|
|
359
352
|
"decorator",
|
|
360
353
|
"payload"
|
|
@@ -369,7 +362,7 @@ const collection = {
|
|
|
369
362
|
type: "string"
|
|
370
363
|
},
|
|
371
364
|
content: {
|
|
372
|
-
description: "Complete TypeScript code for the authentication Provider function
|
|
365
|
+
description: "Complete TypeScript code for the authentication Provider function. Must\ninclude: JWT token verification using jwtAuthorize function, role type\nchecking against payload.type, database query using\nMyGlobal.prisma.{tableName} pattern to verify user existence, and proper\nerror handling with ForbiddenException and UnauthorizedException. The\nfunction should return the authenticated user payload data.",
|
|
373
366
|
type: "string"
|
|
374
367
|
}
|
|
375
368
|
},
|
|
@@ -399,11 +392,11 @@ const collection = {
|
|
|
399
392
|
type: "object",
|
|
400
393
|
properties: {
|
|
401
394
|
name: {
|
|
402
|
-
description: "The name of the
|
|
395
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.",
|
|
403
396
|
type: "string"
|
|
404
397
|
},
|
|
405
398
|
content: {
|
|
406
|
-
description: "
|
|
399
|
+
description: "Complete TypeScript code for the Payload type interface in {Role}Payload\nformat (e.g., AdminPayload, UserPayload). Must include: id field with\nUUID format validation, type field as role discriminator, and proper\ntypia tags for validation. This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator and serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
407
400
|
type: "string"
|
|
408
401
|
}
|
|
409
402
|
},
|
|
@@ -414,18 +407,14 @@ const collection = {
|
|
|
414
407
|
}
|
|
415
408
|
}
|
|
416
409
|
},
|
|
417
|
-
validate: (() => { const _io0 = input => "string" === typeof input.error_analysis && "string" === typeof input.
|
|
410
|
+
validate: (() => { const _io0 = input => "string" === typeof input.error_analysis && "string" === typeof input.solution_guidance && ("object" === typeof input.provider && null !== input.provider && _io1(input.provider)) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.payload && null !== input.payload && _io3(input.payload)); const _io1 = input => "string" === typeof input.name && "string" === typeof input.content; const _io2 = input => "string" === typeof input.name && "string" === typeof input.content; const _io3 = input => "string" === typeof input.name && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.error_analysis || _report(_exceptionable, {
|
|
418
411
|
path: _path + ".error_analysis",
|
|
419
412
|
expected: "string",
|
|
420
413
|
value: input.error_analysis
|
|
421
|
-
}), "string" === typeof input.
|
|
422
|
-
path: _path + ".
|
|
423
|
-
expected: "string",
|
|
424
|
-
value: input.corrected_implementation
|
|
425
|
-
}), "string" === typeof input.validation_summary || _report(_exceptionable, {
|
|
426
|
-
path: _path + ".validation_summary",
|
|
414
|
+
}), "string" === typeof input.solution_guidance || _report(_exceptionable, {
|
|
415
|
+
path: _path + ".solution_guidance",
|
|
427
416
|
expected: "string",
|
|
428
|
-
value: input.
|
|
417
|
+
value: input.solution_guidance
|
|
429
418
|
}), ("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
|
|
430
419
|
path: _path + ".provider",
|
|
431
420
|
expected: "IAutoBeRealizeAuthorizationApplication.IProvider",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeAuthorizationCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeAuthorizationCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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B,CAAiC,KAG1D;IACC,IAAA,qCAAiB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,WAAW,GAA2B,UAAU,CACpD,KAAK,CAAC,KAAK,CACyB,CAAC;IAEvC,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,uBAAuB;QAC7B,WAAW;QACX,OAAO,EAAE;YACP,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE;gBACzB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;SACsD;KAC1D,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AutoBeOpenApi, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
1
|
+
import { AutoBeOpenApi, AutoBeRealizeAuthorization, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
4
|
import { RealizePlannerOutput } from "./orchestrateRealizePlanner";
|
|
5
5
|
import { IAutoBeRealizeCoderApplication } from "./structures/IAutoBeRealizeCoderApplication";
|
|
6
|
+
import { IAutoBeRealizeCompile } from "./structures/IAutoBeRealizeCompile";
|
|
6
7
|
import { FAILED } from "./structures/IAutoBeRealizeFailedSymbol";
|
|
7
8
|
/**
|
|
8
9
|
* Generates a TypeScript function implementation based on the given plan.
|
|
@@ -22,4 +23,4 @@ import { FAILED } from "./structures/IAutoBeRealizeFailedSymbol";
|
|
|
22
23
|
* @param props - Planning result describing what function to generate
|
|
23
24
|
* @returns The generated function name and TypeScript code
|
|
24
25
|
*/
|
|
25
|
-
export declare const orchestrateRealizeCoder: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation, props: RealizePlannerOutput, previous: string | null, total: IAutoBeTypeScriptCompileResult.IDiagnostic[], diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[]) => Promise<
|
|
26
|
+
export declare const orchestrateRealizeCoder: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation, previousCodes: IAutoBeRealizeCompile.Success[], props: RealizePlannerOutput, previous: string | null, total: IAutoBeTypeScriptCompileResult.IDiagnostic[], diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[], authorization?: AutoBeRealizeAuthorization) => Promise<IAutoBeRealizeCoderApplication.RealizeCoderOutput | FAILED>;
|