@autobe/agent 0.5.2 → 0.6.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 +4 -4
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +1 -1
- package/lib/context/AutoBeContext.d.ts +2 -2
- package/lib/context/IAutoBeApplicationProps.d.ts +6 -0
- package/lib/factory/createAgenticaHistory.js +1 -0
- package/lib/factory/createAgenticaHistory.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +16 -16
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +3946 -3841
- package/lib/index.mjs.map +1 -1
- package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.d.ts +4 -8
- package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.js +10 -2
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzePointer.d.ts +9 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzePointer.js +3 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzePointer.js.map +1 -0
- package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeReviewer.d.ts +1 -1
- package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeReviewer.js +5 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -0
- package/lib/orchestrate/{orchestrateAnalyze.d.ts → analyze/orchestrateAnalyze.d.ts} +2 -2
- package/lib/orchestrate/{orchestrateAnalyze.js → analyze/orchestrateAnalyze.js} +101 -38
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -0
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/index.d.ts +3 -3
- package/lib/orchestrate/index.js +6 -6
- package/lib/orchestrate/index.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +5 -0
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +3 -0
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.js +15 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +7 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js +9 -0
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaHistories.js +9 -0
- package/lib/orchestrate/prisma/transformPrismaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +7 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/structures/IAutoBeVendor.d.ts +45 -2
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +5 -3
- package/src/constants/AutoBeSystemPromptConstant.ts +1 -1
- package/src/context/AutoBeContext.ts +2 -2
- package/src/context/IAutoBeApplicationProps.ts +6 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeApplication.ts +1 -1
- package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.ts +20 -15
- package/src/orchestrate/analyze/AutoBeAnalyzePointer.ts +10 -0
- package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeReviewer.ts +7 -2
- package/src/orchestrate/{orchestrateAnalyze.ts → analyze/orchestrateAnalyze.ts} +43 -24
- package/src/orchestrate/index.ts +3 -3
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +5 -0
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +3 -0
- package/src/orchestrate/interface/transformInterfaceHistories.ts +15 -0
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +7 -0
- package/src/orchestrate/prisma/transformPrismaCorrectHistories.ts +9 -0
- package/src/orchestrate/prisma/transformPrismaHistories.ts +9 -0
- package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +7 -0
- package/src/structures/IAutoBeVendor.ts +48 -2
- package/lib/analyze/AnalyzeAgent.d.ts +0 -24
- package/lib/analyze/AnalyzeAgent.js +0 -942
- package/lib/analyze/AnalyzeAgent.js.map +0 -1
- package/lib/analyze/AutoBeAnalyzeAgent.js.map +0 -1
- package/lib/analyze/AutoBeAnalyzeFileSystem.js.map +0 -1
- package/lib/analyze/AutoBeAnalyzeReviewer.js.map +0 -1
- package/lib/orchestrate/orchestrateAnalyze.js.map +0 -1
- package/src/analyze/AnalyzeAgent.ts +0 -183
- /package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeFileSystem.d.ts +0 -0
- /package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeFileSystem.js +0 -0
- /package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeFileSystem.ts +0 -0
|
@@ -50,9 +50,9 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
50
50
|
const core_1 = require("@agentica/core");
|
|
51
51
|
const typia_1 = __importDefault(require("typia"));
|
|
52
52
|
const uuid_1 = require("uuid");
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
53
|
+
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
|
+
const AutoBeAnalyzeAgent_1 = require("./AutoBeAnalyzeAgent");
|
|
55
|
+
const AutoBeAnalyzeReviewer_1 = require("./AutoBeAnalyzeReviewer");
|
|
56
56
|
/** @todo Kakasoo */
|
|
57
57
|
const orchestrateAnalyze = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
58
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -116,7 +116,7 @@ const orchestrateAnalyze = (ctx) => (props) => __awaiter(void 0, void 0, void 0,
|
|
|
116
116
|
return history;
|
|
117
117
|
}
|
|
118
118
|
const described = determined.find((el) => el.type === "describe");
|
|
119
|
-
const
|
|
119
|
+
const describedFiles = Array.from(new Set(described
|
|
120
120
|
? described.executes
|
|
121
121
|
.flatMap((el) => {
|
|
122
122
|
if (el.protocol === "class") {
|
|
@@ -126,22 +126,39 @@ const orchestrateAnalyze = (ctx) => (props) => __awaiter(void 0, void 0, void 0,
|
|
|
126
126
|
})
|
|
127
127
|
.filter((el) => el !== null)
|
|
128
128
|
: []));
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
129
|
+
if (describedFiles.length === 0) {
|
|
130
|
+
const history = {
|
|
131
|
+
id: (0, uuid_1.v4)(),
|
|
132
|
+
type: "assistantMessage",
|
|
133
|
+
text: "The current requirements are insufficient, so file generation will be suspended. It would be better to continue the conversation.",
|
|
134
|
+
created_at,
|
|
135
|
+
completed_at: new Date().toISOString(),
|
|
132
136
|
};
|
|
133
|
-
|
|
137
|
+
ctx.dispatch({
|
|
138
|
+
type: "assistantMessage",
|
|
139
|
+
text: "The current requirements are insufficient, so file generation will be suspended. It would be better to continue the conversation.",
|
|
140
|
+
created_at,
|
|
141
|
+
});
|
|
142
|
+
return history;
|
|
143
|
+
}
|
|
144
|
+
const pointers = yield Promise.all(describedFiles.map((_a) => __awaiter(void 0, [_a], void 0, function* ({ filename, reason }) {
|
|
145
|
+
const pointer = { value: null };
|
|
146
|
+
const agent = new AutoBeAnalyzeAgent_1.AutoBeAnalyzeAgent(AutoBeAnalyzeReviewer_1.AutoBeAnalyzeReviewer, ctx, pointer, describedFiles.map((el) => el.filename));
|
|
134
147
|
yield agent.conversate([
|
|
135
|
-
|
|
148
|
+
`# Instruction`,
|
|
149
|
+
`The names of all the files are as follows: ${describedFiles.join(",")}`,
|
|
136
150
|
"Assume that all files are in the same folder. Also, when pointing to the location of a file, go to the relative path.",
|
|
137
151
|
"",
|
|
138
152
|
`Among the various documents, the part you decided to take care of is as follows.: ${filename}`,
|
|
139
153
|
`Only write this document named '${filename}'.`,
|
|
140
154
|
"Never write other documents.",
|
|
141
155
|
"",
|
|
156
|
+
"# User Planning Requirements",
|
|
142
157
|
"```md",
|
|
143
158
|
JSON.stringify(userPlanningRequirements),
|
|
144
159
|
"```",
|
|
160
|
+
"The reason why this document needs to be written is as follows.",
|
|
161
|
+
`- reason: ${reason}`,
|
|
145
162
|
].join("\n"));
|
|
146
163
|
return pointer;
|
|
147
164
|
})));
|
|
@@ -188,11 +205,15 @@ const orchestrateAnalyze = (ctx) => (props) => __awaiter(void 0, void 0, void 0,
|
|
|
188
205
|
exports.orchestrateAnalyze = orchestrateAnalyze;
|
|
189
206
|
class DeterminingFiles {
|
|
190
207
|
/**
|
|
191
|
-
* Determining the Initial File List
|
|
208
|
+
* Determining the Initial File List.
|
|
192
209
|
*
|
|
193
210
|
* Design a list of initial documents that you need to create for that
|
|
194
211
|
* requirement. The list of documents is determined only by the name of the
|
|
195
|
-
* file.
|
|
212
|
+
* file. If you determine from the conversation that the user's requirements
|
|
213
|
+
* have not been fully gathered, you must stop the analysis and continue
|
|
214
|
+
* collecting the remaining requirements. In this case, you do not need to
|
|
215
|
+
* generate any files. Simply pass an empty array to `input.files`, which is
|
|
216
|
+
* the input value for the `determine` tool.
|
|
196
217
|
*
|
|
197
218
|
* @param input
|
|
198
219
|
* @returns
|
|
@@ -231,9 +252,13 @@ const claude = {
|
|
|
231
252
|
files: {
|
|
232
253
|
type: "array",
|
|
233
254
|
items: {
|
|
234
|
-
description: "Description of the current {@link
|
|
255
|
+
description: "Description of the current {@link PickIFilereasonfilename} type:\n\n> From T, pick a set of properties whose keys are in the union K",
|
|
235
256
|
type: "object",
|
|
236
257
|
properties: {
|
|
258
|
+
reason: {
|
|
259
|
+
description: "Describe briefly why you made this document, and if you have any plans for\nthe next one.",
|
|
260
|
+
type: "string"
|
|
261
|
+
},
|
|
237
262
|
filename: {
|
|
238
263
|
title: "Filename to generate or overwrite",
|
|
239
264
|
description: "Filename to generate or overwrite.",
|
|
@@ -242,6 +267,7 @@ const claude = {
|
|
|
242
267
|
}
|
|
243
268
|
},
|
|
244
269
|
required: [
|
|
270
|
+
"reason",
|
|
245
271
|
"filename"
|
|
246
272
|
]
|
|
247
273
|
}
|
|
@@ -259,9 +285,13 @@ const claude = {
|
|
|
259
285
|
files: {
|
|
260
286
|
type: "array",
|
|
261
287
|
items: {
|
|
262
|
-
description: "Description of the current {@link
|
|
288
|
+
description: "Description of the current {@link PickIFilereasonfilename} type:\n\n> From T, pick a set of properties whose keys are in the union K",
|
|
263
289
|
type: "object",
|
|
264
290
|
properties: {
|
|
291
|
+
reason: {
|
|
292
|
+
description: "Describe briefly why you made this document, and if you have any plans for\nthe next one.",
|
|
293
|
+
type: "string"
|
|
294
|
+
},
|
|
265
295
|
filename: {
|
|
266
296
|
title: "Filename to generate or overwrite",
|
|
267
297
|
description: "Filename to generate or overwrite.",
|
|
@@ -270,6 +300,7 @@ const claude = {
|
|
|
270
300
|
}
|
|
271
301
|
},
|
|
272
302
|
required: [
|
|
303
|
+
"reason",
|
|
273
304
|
"filename"
|
|
274
305
|
]
|
|
275
306
|
}
|
|
@@ -279,24 +310,28 @@ const claude = {
|
|
|
279
310
|
"files"
|
|
280
311
|
]
|
|
281
312
|
},
|
|
282
|
-
description: "Determining the Initial File List
|
|
283
|
-
validate: (() => { const _io0 = input => Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.files) || _report(_exceptionable, {
|
|
313
|
+
description: "Determining the Initial File List.\n\nDesign a list of initial documents that you need to create for that\nrequirement. The list of documents is determined only by the name of the\nfile. If you determine from the conversation that the user's requirements\nhave not been fully gathered, you must stop the analysis and continue\ncollecting the remaining requirements. In this case, you do not need to\ngenerate any files. Simply pass an empty array to `input.files`, which is\nthe input value for the `determine` tool.",
|
|
314
|
+
validate: (() => { const _io0 = input => Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.reason && ("string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.files) || _report(_exceptionable, {
|
|
284
315
|
path: _path + ".files",
|
|
285
|
-
expected: "Array<Pick<IFile, \"filename\">>",
|
|
316
|
+
expected: "Array<Pick<IFile, \"reason\" | \"filename\">>",
|
|
286
317
|
value: input.files
|
|
287
318
|
})) && input.files.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
288
319
|
path: _path + ".files[" + _index2 + "]",
|
|
289
|
-
expected: "Pick<IFile, \"filename\">",
|
|
320
|
+
expected: "Pick<IFile, \"reason\" | \"filename\">",
|
|
290
321
|
value: elem
|
|
291
322
|
})) && _vo1(elem, _path + ".files[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
292
323
|
path: _path + ".files[" + _index2 + "]",
|
|
293
|
-
expected: "Pick<IFile, \"filename\">",
|
|
324
|
+
expected: "Pick<IFile, \"reason\" | \"filename\">",
|
|
294
325
|
value: elem
|
|
295
326
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
296
327
|
path: _path + ".files",
|
|
297
|
-
expected: "Array<Pick<IFile, \"filename\">>",
|
|
328
|
+
expected: "Array<Pick<IFile, \"reason\" | \"filename\">>",
|
|
298
329
|
value: input.files
|
|
299
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.
|
|
330
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.reason || _report(_exceptionable, {
|
|
331
|
+
path: _path + ".reason",
|
|
332
|
+
expected: "string",
|
|
333
|
+
value: input.reason
|
|
334
|
+
}), "string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename) || _report(_exceptionable, {
|
|
300
335
|
path: _path + ".filename",
|
|
301
336
|
expected: "`${string}.md`",
|
|
302
337
|
value: input.filename
|
|
@@ -348,9 +383,13 @@ const collection = {
|
|
|
348
383
|
files: {
|
|
349
384
|
type: "array",
|
|
350
385
|
items: {
|
|
351
|
-
description: "Description of the current {@link
|
|
386
|
+
description: "Description of the current {@link PickIFilereasonfilename} type:\n\n> From T, pick a set of properties whose keys are in the union K",
|
|
352
387
|
type: "object",
|
|
353
388
|
properties: {
|
|
389
|
+
reason: {
|
|
390
|
+
description: "Describe briefly why you made this document, and if you have any plans for\nthe next one.",
|
|
391
|
+
type: "string"
|
|
392
|
+
},
|
|
354
393
|
filename: {
|
|
355
394
|
title: "Filename to generate or overwrite",
|
|
356
395
|
description: "Filename to generate or overwrite.\n\n\n@pattern ((.*)\\.md)$",
|
|
@@ -358,6 +397,7 @@ const collection = {
|
|
|
358
397
|
}
|
|
359
398
|
},
|
|
360
399
|
required: [
|
|
400
|
+
"reason",
|
|
361
401
|
"filename"
|
|
362
402
|
]
|
|
363
403
|
}
|
|
@@ -375,9 +415,13 @@ const collection = {
|
|
|
375
415
|
files: {
|
|
376
416
|
type: "array",
|
|
377
417
|
items: {
|
|
378
|
-
description: "Description of the current {@link
|
|
418
|
+
description: "Description of the current {@link PickIFilereasonfilename} type:\n\n> From T, pick a set of properties whose keys are in the union K",
|
|
379
419
|
type: "object",
|
|
380
420
|
properties: {
|
|
421
|
+
reason: {
|
|
422
|
+
description: "Describe briefly why you made this document, and if you have any plans for\nthe next one.",
|
|
423
|
+
type: "string"
|
|
424
|
+
},
|
|
381
425
|
filename: {
|
|
382
426
|
title: "Filename to generate or overwrite",
|
|
383
427
|
description: "Filename to generate or overwrite.\n\n\n@pattern ((.*)\\.md)$",
|
|
@@ -385,6 +429,7 @@ const collection = {
|
|
|
385
429
|
}
|
|
386
430
|
},
|
|
387
431
|
required: [
|
|
432
|
+
"reason",
|
|
388
433
|
"filename"
|
|
389
434
|
]
|
|
390
435
|
}
|
|
@@ -394,24 +439,28 @@ const collection = {
|
|
|
394
439
|
"files"
|
|
395
440
|
]
|
|
396
441
|
},
|
|
397
|
-
description: "Determining the Initial File List
|
|
398
|
-
validate: (() => { const _io0 = input => Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.files) || _report(_exceptionable, {
|
|
442
|
+
description: "Determining the Initial File List.\n\nDesign a list of initial documents that you need to create for that\nrequirement. The list of documents is determined only by the name of the\nfile. If you determine from the conversation that the user's requirements\nhave not been fully gathered, you must stop the analysis and continue\ncollecting the remaining requirements. In this case, you do not need to\ngenerate any files. Simply pass an empty array to `input.files`, which is\nthe input value for the `determine` tool.",
|
|
443
|
+
validate: (() => { const _io0 = input => Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.reason && ("string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.files) || _report(_exceptionable, {
|
|
399
444
|
path: _path + ".files",
|
|
400
|
-
expected: "Array<Pick<IFile, \"filename\">>",
|
|
445
|
+
expected: "Array<Pick<IFile, \"reason\" | \"filename\">>",
|
|
401
446
|
value: input.files
|
|
402
447
|
})) && input.files.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
403
448
|
path: _path + ".files[" + _index2 + "]",
|
|
404
|
-
expected: "Pick<IFile, \"filename\">",
|
|
449
|
+
expected: "Pick<IFile, \"reason\" | \"filename\">",
|
|
405
450
|
value: elem
|
|
406
451
|
})) && _vo1(elem, _path + ".files[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
407
452
|
path: _path + ".files[" + _index2 + "]",
|
|
408
|
-
expected: "Pick<IFile, \"filename\">",
|
|
453
|
+
expected: "Pick<IFile, \"reason\" | \"filename\">",
|
|
409
454
|
value: elem
|
|
410
455
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
411
456
|
path: _path + ".files",
|
|
412
|
-
expected: "Array<Pick<IFile, \"filename\">>",
|
|
457
|
+
expected: "Array<Pick<IFile, \"reason\" | \"filename\">>",
|
|
413
458
|
value: input.files
|
|
414
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.
|
|
459
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.reason || _report(_exceptionable, {
|
|
460
|
+
path: _path + ".reason",
|
|
461
|
+
expected: "string",
|
|
462
|
+
value: input.reason
|
|
463
|
+
}), "string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename) || _report(_exceptionable, {
|
|
415
464
|
path: _path + ".filename",
|
|
416
465
|
expected: "`${string}.md`",
|
|
417
466
|
value: input.filename
|
|
@@ -468,6 +517,10 @@ const collection = {
|
|
|
468
517
|
items: {
|
|
469
518
|
type: "object",
|
|
470
519
|
properties: {
|
|
520
|
+
reason: {
|
|
521
|
+
type: "string",
|
|
522
|
+
description: "Describe briefly why you made this document, and if you have any plans for\nthe next one."
|
|
523
|
+
},
|
|
471
524
|
filename: {
|
|
472
525
|
type: "string",
|
|
473
526
|
pattern: "((.*)\\.md)$",
|
|
@@ -476,9 +529,10 @@ const collection = {
|
|
|
476
529
|
}
|
|
477
530
|
},
|
|
478
531
|
required: [
|
|
532
|
+
"reason",
|
|
479
533
|
"filename"
|
|
480
534
|
],
|
|
481
|
-
description: "Description of the current {@link
|
|
535
|
+
description: "Description of the current {@link PickIFilereasonfilename} type:\n\n> From T, pick a set of properties whose keys are in the union K",
|
|
482
536
|
additionalProperties: false
|
|
483
537
|
}
|
|
484
538
|
}
|
|
@@ -496,6 +550,10 @@ const collection = {
|
|
|
496
550
|
items: {
|
|
497
551
|
type: "object",
|
|
498
552
|
properties: {
|
|
553
|
+
reason: {
|
|
554
|
+
type: "string",
|
|
555
|
+
description: "Describe briefly why you made this document, and if you have any plans for\nthe next one."
|
|
556
|
+
},
|
|
499
557
|
filename: {
|
|
500
558
|
type: "string",
|
|
501
559
|
pattern: "((.*)\\.md)$",
|
|
@@ -504,9 +562,10 @@ const collection = {
|
|
|
504
562
|
}
|
|
505
563
|
},
|
|
506
564
|
required: [
|
|
565
|
+
"reason",
|
|
507
566
|
"filename"
|
|
508
567
|
],
|
|
509
|
-
description: "Description of the current {@link
|
|
568
|
+
description: "Description of the current {@link PickIFilereasonfilename} type:\n\n> From T, pick a set of properties whose keys are in the union K",
|
|
510
569
|
additionalProperties: false
|
|
511
570
|
}
|
|
512
571
|
}
|
|
@@ -516,24 +575,28 @@ const collection = {
|
|
|
516
575
|
],
|
|
517
576
|
additionalProperties: false
|
|
518
577
|
},
|
|
519
|
-
description: "Determining the Initial File List
|
|
520
|
-
validate: (() => { const _io0 = input => Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.files) || _report(_exceptionable, {
|
|
578
|
+
description: "Determining the Initial File List.\n\nDesign a list of initial documents that you need to create for that\nrequirement. The list of documents is determined only by the name of the\nfile. If you determine from the conversation that the user's requirements\nhave not been fully gathered, you must stop the analysis and continue\ncollecting the remaining requirements. In this case, you do not need to\ngenerate any files. Simply pass an empty array to `input.files`, which is\nthe input value for the `determine` tool.",
|
|
579
|
+
validate: (() => { const _io0 = input => Array.isArray(input.files) && input.files.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.reason && ("string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.files) || _report(_exceptionable, {
|
|
521
580
|
path: _path + ".files",
|
|
522
|
-
expected: "Array<Pick<IFile, \"filename\">>",
|
|
581
|
+
expected: "Array<Pick<IFile, \"reason\" | \"filename\">>",
|
|
523
582
|
value: input.files
|
|
524
583
|
})) && input.files.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
525
584
|
path: _path + ".files[" + _index2 + "]",
|
|
526
|
-
expected: "Pick<IFile, \"filename\">",
|
|
585
|
+
expected: "Pick<IFile, \"reason\" | \"filename\">",
|
|
527
586
|
value: elem
|
|
528
587
|
})) && _vo1(elem, _path + ".files[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
529
588
|
path: _path + ".files[" + _index2 + "]",
|
|
530
|
-
expected: "Pick<IFile, \"filename\">",
|
|
589
|
+
expected: "Pick<IFile, \"reason\" | \"filename\">",
|
|
531
590
|
value: elem
|
|
532
591
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
533
592
|
path: _path + ".files",
|
|
534
|
-
expected: "Array<Pick<IFile, \"filename\">>",
|
|
593
|
+
expected: "Array<Pick<IFile, \"reason\" | \"filename\">>",
|
|
535
594
|
value: input.files
|
|
536
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.
|
|
595
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.reason || _report(_exceptionable, {
|
|
596
|
+
path: _path + ".reason",
|
|
597
|
+
expected: "string",
|
|
598
|
+
value: input.reason
|
|
599
|
+
}), "string" === typeof input.filename && RegExp(/(.*)\.md$/).test(input.filename) || _report(_exceptionable, {
|
|
537
600
|
path: _path + ".filename",
|
|
538
601
|
expected: "`${string}.md`",
|
|
539
602
|
value: input.filename
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrateAnalyze.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/orchestrateAnalyze.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoE;AAMpE,kD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;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAkD;CACxD,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.transformFacadeStateMessage = transformFacadeStateMessage;
|
|
|
4
4
|
const StringUtil_1 = require("../../utils/StringUtil");
|
|
5
5
|
function transformFacadeStateMessage(state) {
|
|
6
6
|
const currentState = getCurrentState(state);
|
|
7
|
-
return "# AutoBE Main Agent System Prompt\n\nYou are the AutoBE Main Agent, an orchestrator for backend server development automation. Your role is to manage the conversation with users about their backend requirements and coordinate the execution of five specialized functional agents through function calling.\n\n## Core Responsibilities\n\n1. **Requirements Gathering**: Engage in detailed conversations with users to understand their backend server needs, asking clarifying questions about business logic, data models, API endpoints, and technical requirements.\n\n2. **Agent Orchestration**: Execute the appropriate functional agents in the correct sequence based on the development stage and user needs.\n\n3. **Progress Communication**: Keep users informed about the current development stage, what has been completed, and what steps remain.\n\n## Functional Agents Overview\n\nYou have access to five functional agents that must be executed in a specific order:\n\n1. **Analyze Agent** - Converts conversations into structured requirements specifications\n2. **Prisma Agent** - Generates database schemas and ERD documentation\n3. **Interface Agent** - Creates API interfaces with OpenAPI schemas and TypeScript code\n4. **Test Agent** - Generates comprehensive E2E test suites\n5. **Realize Agent** - Implements actual business logic for service providers\n\n## Execution Rules\n\n### 1. Sequential Dependencies\n\n- **analyze()**: Can only be called when sufficient requirements have been gathered
|
|
7
|
+
return "# AutoBE Main Agent System Prompt\n\nYou are the AutoBE Main Agent, an orchestrator for backend server development automation. Your role is to manage the conversation with users about their backend requirements and coordinate the execution of five specialized functional agents through function calling.\n\n## Core Responsibilities\n\n1. **Requirements Gathering**: Engage in detailed conversations with users to understand their backend server needs, asking clarifying questions about business logic, data models, API endpoints, and technical requirements.\n\n2. **Agent Orchestration**: Execute the appropriate functional agents in the correct sequence based on the development stage and user needs.\n\n3. **Progress Communication**: Keep users informed about the current development stage, what has been completed, and what steps remain.\n\n## Functional Agents Overview\n\nYou have access to five functional agents that must be executed in a specific order:\n\n1. **Analyze Agent** - Converts conversations into structured requirements specifications\n2. **Prisma Agent** - Generates database schemas and ERD documentation\n3. **Interface Agent** - Creates API interfaces with OpenAPI schemas and TypeScript code\n4. **Test Agent** - Generates comprehensive E2E test suites\n5. **Realize Agent** - Implements actual business logic for service providers\n\n## Execution Rules\n\n### 1. Sequential Dependencies\n\n- **analyze()**: Can only be called when sufficient requirements have been gathered.\n- **prisma()**: Requires successful completion of analyze()\n- **interface()**: Requires successful completion of prisma()\n- **test()**: Requires successful completion of interface()\n- **realize()**: Requires successful completion of interface()\n\n### 2. Requirements Gathering and analyze() Calling Criteria\n\n- Since users are not developers, it is okay if they do not understand technical terms like \u201Cendpoints\u201D or \u201Cdata models.\u201D \n\n- Your job is to help users clearly express their intended **features** by asking many questions. \n\n- Use examples and simple questions to guide them if they have trouble explaining. \n\n- Break down features into smaller steps if needed to complete the planning gradually. \n\n- For instance, ask questions like \u201CWhat tasks do you want to automate?\u201D, \u201CWhat roles do users have?\u201D, \u201CWhat screens or actions are involved?\u201D \n\n- Even if the system requires many or complex APIs, it is not necessary to know all of them upfront. Focus on gathering core requirements step by step. \n\n#### Conditions for Calling analyze() \n- Call analyze() only when the user has clearly stated sufficient **features** and **requirements**, or \n- The user explicitly delegates the planning to you by saying things like \u201CI\u2019ll leave the planning to you\u201D or \u201CPlease proceed as you see fit.\u201D \n\n#### Pre-call Checks \n- If requirements are insufficient for some features, do **not** call analyze() and keep asking questions until the specifications are complete. \n- Continue asking actively and explain any technical terms in an easy-to-understand way.\n\n### 3. Requirements Gathering Phase\n\nBefore calling analyze(), ensure you have discussed:\n\n- System purpose and overall goals\n- Core features and functionalities\n- User roles and permissions\n- Main data entities and their relationships\n- Key business rules and constraints\n- API endpoints needed\n- Any specific technical requirements\n\nIf these aspects are unclear, continue the conversation to gather more details.\n\n### 4. Development Workflow\n\n1. Start by understanding the user's needs through conversation\n2. When requirements are sufficiently detailed, execute analyze()\n3. Review the analysis results with the user\n4. If approved, proceed with prisma() \u2192 interface() \u2192 test() \u2192 realize()\n5. At each stage, present results and get user confirmation before proceeding\n\n### 5. Handling Changes\n\n- If users request changes after agents have been executed, first understand the scope\n- For minor adjustments, you may re-run specific agents\n- For major changes, consider re-running analyze() to update the specification\n- Always explain the impact of changes on already generated code\n\n## Communication Guidelines\n\n1. **Be Transparent**: Clearly explain which agent is being executed and why\n2. **Show Progress**: Indicate completed steps and remaining work\n3. **Confirm Understanding**: Summarize requirements before executing agents\n4. **Request Approval**: Get user confirmation before moving to the next stage\n5. **Explain Results**: Briefly describe what each agent has generated\n\n## Current State\n\n{% STATE %}" /* AutoBeSystemPromptConstant.FACADE */.replace("{% STATE %}", StringUtil_1.StringUtil.trim `
|
|
8
8
|
## Current State
|
|
9
9
|
|
|
10
10
|
The current execution status of each functional agent is shown below.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformFacadeStateMessage.js","sourceRoot":"","sources":["../../../src/orchestrate/facade/transformFacadeStateMessage.ts"],"names":[],"mappings":";;AAIA,kEA0BC;AA5BD,uDAAoD;AAEpD,SAAgB,2BAA2B,CAAC,KAAkB;IAC5D,MAAM,YAAY,GAAkB,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"transformFacadeStateMessage.js","sourceRoot":"","sources":["../../../src/orchestrate/facade/transformFacadeStateMessage.ts"],"names":[],"mappings":";;AAIA,kEA0BC;AA5BD,uDAAoD;AAEpD,SAAgB,2BAA2B,CAAC,KAAkB;IAC5D,MAAM,YAAY,GAAkB,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,0qJAAkC,OAAO,CAC9C,aAAa,EACb,uBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;mBAeA,YAAY,CAAC,OAAO;kBACrB,YAAY,CAAC,MAAM;qBAChB,YAAY,CAAC,SAAS;gBAC3B,YAAY,CAAC,IAAI;mBACd,YAAY,CAAC,OAAO;KAClC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkB;IACzC,MAAM,KAAK,GAAG,CACZ,GAEQ,EACR,EAAE;QACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC;aACrD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI;YAAE,OAAO,YAAY,CAAC;;YACzD,OAAO,aAAa,CAAC;IAC5B,CAAC,CAAC;IACF,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY;QACvD,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3B,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;QACvB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { orchestrateAnalyze as analyze } from "./orchestrateAnalyze";
|
|
1
|
+
export { orchestrateAnalyze as analyze } from "./analyze/orchestrateAnalyze";
|
|
2
2
|
export { orchestrateInterface as interface } from "./interface/orchestrateInterface";
|
|
3
|
-
export { orchestratePrisma as prisma } from "./prisma/orchestratePrisma";
|
|
4
|
-
export { orchestrateTest as test } from "./orchestrateTest";
|
|
5
3
|
export { orchestrateRealize as realize } from "./orchestrateRealize";
|
|
4
|
+
export { orchestrateTest as test } from "./orchestrateTest";
|
|
5
|
+
export { orchestratePrisma as prisma } from "./prisma/orchestratePrisma";
|
package/lib/orchestrate/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var orchestrateAnalyze_1 = require("./orchestrateAnalyze");
|
|
3
|
+
exports.prisma = exports.test = exports.realize = exports.interface = exports.analyze = void 0;
|
|
4
|
+
var orchestrateAnalyze_1 = require("./analyze/orchestrateAnalyze");
|
|
5
5
|
Object.defineProperty(exports, "analyze", { enumerable: true, get: function () { return orchestrateAnalyze_1.orchestrateAnalyze; } });
|
|
6
6
|
var orchestrateInterface_1 = require("./interface/orchestrateInterface");
|
|
7
7
|
Object.defineProperty(exports, "interface", { enumerable: true, get: function () { return orchestrateInterface_1.orchestrateInterface; } });
|
|
8
|
-
var orchestratePrisma_1 = require("./prisma/orchestratePrisma");
|
|
9
|
-
Object.defineProperty(exports, "prisma", { enumerable: true, get: function () { return orchestratePrisma_1.orchestratePrisma; } });
|
|
10
|
-
var orchestrateTest_1 = require("./orchestrateTest");
|
|
11
|
-
Object.defineProperty(exports, "test", { enumerable: true, get: function () { return orchestrateTest_1.orchestrateTest; } });
|
|
12
8
|
var orchestrateRealize_1 = require("./orchestrateRealize");
|
|
13
9
|
Object.defineProperty(exports, "realize", { enumerable: true, get: function () { return orchestrateRealize_1.orchestrateRealize; } });
|
|
10
|
+
var orchestrateTest_1 = require("./orchestrateTest");
|
|
11
|
+
Object.defineProperty(exports, "test", { enumerable: true, get: function () { return orchestrateTest_1.orchestrateTest; } });
|
|
12
|
+
var orchestratePrisma_1 = require("./prisma/orchestratePrisma");
|
|
13
|
+
Object.defineProperty(exports, "prisma", { enumerable: true, get: function () { return orchestratePrisma_1.orchestratePrisma; } });
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestrate/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestrate/index.ts"],"names":[],"mappings":";;;AAAA,mEAA6E;AAApE,6GAAA,kBAAkB,OAAW;AACtC,yEAAqF;AAA5E,iHAAA,oBAAoB,OAAa;AAC1C,2DAAqE;AAA5D,6GAAA,kBAAkB,OAAW;AACtC,qDAA4D;AAAnD,uGAAA,eAAe,OAAQ;AAChC,gEAAyE;AAAhE,2GAAA,iBAAiB,OAAU"}
|
|
@@ -52,6 +52,7 @@ const core_1 = require("@agentica/core");
|
|
|
52
52
|
const openapi_1 = require("@samchon/openapi");
|
|
53
53
|
const OpenApiV3_1Emender_1 = require("@samchon/openapi/lib/converters/OpenApiV3_1Emender");
|
|
54
54
|
const typia_1 = __importDefault(require("typia"));
|
|
55
|
+
const uuid_1 = require("uuid");
|
|
55
56
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
56
57
|
const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
|
|
57
58
|
function orchestrateInterfaceComplement(ctx, document, retry = 8) {
|
|
@@ -75,6 +76,8 @@ function step(ctx, document, retry) {
|
|
|
75
76
|
histories: [
|
|
76
77
|
...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# OpenAPI Schema Complement Agent\n\nYou are an AI agent specialized in complementing missing schema definitions in OpenAPI documents. Your primary responsibility is to identify and fill in schema types that are referenced via `$ref` but not yet defined in the `components.schemas` section.\n\n## Your Role\n\nYou analyze OpenAPI documents to find missing schema definitions and generate complete, accurate JSON Schema definitions for those missing types. You work as part of a larger OpenAPI document generation workflow, specifically handling the final step of ensuring all referenced schemas are properly defined.\n\n## Key Responsibilities\n\n1. **Identify Missing Schemas**: Scan the OpenAPI document for `$ref` references pointing to `#/components/schemas/[ISchemaName]` that don't have corresponding definitions\n2. **Generate Schema Definitions**: Create complete JSON Schema definitions for missing types based on context clues from API operations, database schemas, and usage patterns\n3. **Handle Nested References**: When creating new schemas, identify any new `$ref` references introduced in those schemas and ensure they are also defined\n4. **Iterative Completion**: Continue the process recursively until all referenced schemas (including nested ones) are properly defined\n5. **Ensure Completeness**: Make sure all generated schemas follow JSON Schema specifications and are consistent with OpenAPI 3.0+ standards\n\n## Function Calling\n\nYou have access to the `complementComponents` function which you should call when you identify missing schemas:\n\n```typescript\ncomplementComponents({\n schemas: {\n ISchemaName: {\n // Complete JSON Schema definition\n description: \"Description must be clear and detailed\"\n }\n }\n})\n```\n\n## Guidelines for Schema Generation\n\n1. **Type Inference**: Infer appropriate types based on context (API operations, database fields, naming conventions)\n2. **Property Requirements**: Determine which properties should be required vs optional based on usage patterns\n3. **Data Formats**: Apply appropriate formats (email, date-time, uri, etc.) when evident from context\n4. **Nested References**: Handle schemas that reference other schemas appropriately\n5. **Validation Rules**: Include reasonable validation constraints (minLength, maxLength, pattern, etc.) when applicable\n6. **Recursive Schema Detection**: When creating new schemas, scan them for additional `$ref` references and ensure those referenced schemas are also created\n7. **Dependency Chain Completion**: Continue generating schemas until no more missing references exist in the entire schema dependency chain\n8. **Comprehensive Descriptions**: Add detailed, clear descriptions to every schema and property that explain:\n - What the schema/property represents\n - Its purpose and usage context\n - Any business logic or constraints\n - Examples of valid values when helpful\n - Relationships to other entities or concepts\n\n## Response Format\n\n- Analyze the provided OpenAPI document systematically\n- Identify all missing schema references (including those in newly created schemas)\n- Generate appropriate schema definitions for all missing references\n- Recursively check for new `$ref` references introduced in generated schemas\n- Call the `complementComponents` function with all missing schemas (may require multiple calls if nested dependencies are discovered)\n- Provide a brief summary of what schemas were added and any dependency chains that were resolved\n\n## Quality Standards\n\n- Ensure all generated schemas are valid JSON Schema\n- Maintain consistency with existing schema patterns in the document\n- Use descriptive and clear property names\n- **Add comprehensive descriptions**: Every schema object and property must include detailed descriptions that are:\n - Clear and understandable to anyone reading the API documentation\n - Specific about the purpose and usage of each field\n - Include examples or context when helpful\n - Explain any business rules or constraints\n - Describe relationships between different entities\n- Follow OpenAPI best practices for schema design\n- Make the API documentation self-explanatory through excellent descriptions\n\nFocus on accuracy, completeness, and maintaining the integrity of the OpenAPI specification." /* AutoBeSystemPromptConstant.INTERFACE_COMPLEMENT */),
|
|
77
78
|
{
|
|
79
|
+
id: (0, uuid_1.v4)(),
|
|
80
|
+
created_at: new Date().toISOString(),
|
|
78
81
|
type: "assistantMessage",
|
|
79
82
|
text: [
|
|
80
83
|
"Here is the OpenAPI document what you've made:",
|
|
@@ -85,6 +88,8 @@ function step(ctx, document, retry) {
|
|
|
85
88
|
].join("\n"),
|
|
86
89
|
},
|
|
87
90
|
{
|
|
91
|
+
id: (0, uuid_1.v4)(),
|
|
92
|
+
created_at: new Date().toISOString(),
|
|
88
93
|
type: "assistantMessage",
|
|
89
94
|
text: [
|
|
90
95
|
"You have missed below schema types in the document.components.schemas:",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateInterfaceComplement.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComplement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateInterfaceComplement.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComplement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,wEAMC;;;AAvBD,yCAAoE;AAEpE,8CAI0B;AAC1B,2FAAwF;AAExF,kDAA0B;AAC1B,+BAA0B;AAI1B,uEAAoE;AACpE,+EAA4E;AAE5E,SAAgB,8BAA8B,CAC5C,GAAyB,EACzB,QAAiC,EACjC,QAAgB,CAAC;IAEjB,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED,SAAe,IAAI,CACjB,GAAyB,EACzB,QAAiC,EACjC,KAAa;;;QAEb,MAAM,MAA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AAE;gBAC7B,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC;SACqB;KACzB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -51,6 +51,7 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
51
51
|
const core_1 = require("@agentica/core");
|
|
52
52
|
const OpenApiV3_1Emender_1 = require("@samchon/openapi/lib/converters/OpenApiV3_1Emender");
|
|
53
53
|
const typia_1 = __importDefault(require("typia"));
|
|
54
|
+
const uuid_1 = require("uuid");
|
|
54
55
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
55
56
|
const divideArray_1 = require("../../utils/divideArray");
|
|
56
57
|
const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
|
|
@@ -129,6 +130,8 @@ function process(ctx, operations, oldbie, remained) {
|
|
|
129
130
|
histories: [
|
|
130
131
|
...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema components for OpenAPI specifications in the `AutoBeOpenApi.IDocument` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of component schemas that accurately represent all entities and their relationships in the system.\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive component schemas for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Components**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding component schemas\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema components\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the components.schemas section and referenced using $ref\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container (use the standard IPage structure)\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the components.schemas section\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n\n### 3.3. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination indformation.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - Define `.IUpdate` types with all fields made optional for updates\n - Build `.ISummary` types with essential fields for list views\n - Define `.IRequest` types with search/filter/sort parameters\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Output Format\n\nYour output should be the complete `components` section of the OpenAPI document:\n\n```typescript\nconst components: OpenApi.IComponents = {\n schemas: {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n // Variant types\n \"IEntityName.ICreate\": { ... },\n \"IEntityName.IUpdate\": { ... },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n }\n}\n```\n\n## 7. Critical Success Factors\n\n### 7.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema components.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 7.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 7.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the components.schemas section and referenced by name.\n\n## 8. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n\n2. **Schema Development**:\n - Systematically define schema components for each entity and its variants\n - Document all components and properties thoroughly\n\n3. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n\n4. **Output Generation**:\n - Produce the complete `components` section in the required format\n - Verify the output meets all quality and completeness requirements\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 9. Integration with Previous Phases\n\n- Ensure your schema components align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 10. Final Output Format\n\nYour final output should be the complete `components` section that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema components that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define components for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */),
|
|
131
132
|
{
|
|
133
|
+
id: (0, uuid_1.v4)(),
|
|
134
|
+
created_at: new Date().toISOString(),
|
|
132
135
|
type: "assistantMessage",
|
|
133
136
|
text: [
|
|
134
137
|
"Here is the OpenAPI operations generated by phase 2.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateInterfaceComponents.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComponents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateInterfaceComponents.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComponents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,wEA+CC;;;AA7DD,yCAAoE;AAGpE,2FAAwF;AAExF,kDAA0B;AAC1B,+BAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformInterfaceHistories = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
4
5
|
const transformInterfaceHistories = (state, systemMessage) => {
|
|
5
6
|
if (state.analyze === null)
|
|
6
7
|
return [
|
|
7
8
|
{
|
|
9
|
+
id: (0, uuid_1.v4)(),
|
|
10
|
+
created_at: new Date().toISOString(),
|
|
8
11
|
type: "systemMessage",
|
|
9
12
|
text: [
|
|
10
13
|
"Requirement analysis is not yet completed.",
|
|
@@ -16,6 +19,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
|
|
|
16
19
|
else if (state.prisma === null)
|
|
17
20
|
return [
|
|
18
21
|
{
|
|
22
|
+
id: (0, uuid_1.v4)(),
|
|
23
|
+
created_at: new Date().toISOString(),
|
|
19
24
|
type: "systemMessage",
|
|
20
25
|
text: [
|
|
21
26
|
"Prisma DB schema generation is not yet completed.",
|
|
@@ -27,6 +32,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
|
|
|
27
32
|
else if (state.analyze.step !== state.prisma.step)
|
|
28
33
|
return [
|
|
29
34
|
{
|
|
35
|
+
id: (0, uuid_1.v4)(),
|
|
36
|
+
created_at: new Date().toISOString(),
|
|
30
37
|
type: "systemMessage",
|
|
31
38
|
text: [
|
|
32
39
|
"Prisma DB schema generation has not been updated",
|
|
@@ -39,6 +46,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
|
|
|
39
46
|
else if (state.prisma.compiled.type !== "success")
|
|
40
47
|
return [
|
|
41
48
|
{
|
|
49
|
+
id: (0, uuid_1.v4)(),
|
|
50
|
+
created_at: new Date().toISOString(),
|
|
42
51
|
type: "systemMessage",
|
|
43
52
|
text: [
|
|
44
53
|
"Prisma DB schema generation has not been updated",
|
|
@@ -50,10 +59,14 @@ const transformInterfaceHistories = (state, systemMessage) => {
|
|
|
50
59
|
];
|
|
51
60
|
return [
|
|
52
61
|
{
|
|
62
|
+
id: (0, uuid_1.v4)(),
|
|
63
|
+
created_at: new Date().toISOString(),
|
|
53
64
|
type: "systemMessage",
|
|
54
65
|
text: systemMessage,
|
|
55
66
|
},
|
|
56
67
|
{
|
|
68
|
+
id: (0, uuid_1.v4)(),
|
|
69
|
+
created_at: new Date().toISOString(),
|
|
57
70
|
type: "assistantMessage",
|
|
58
71
|
text: [
|
|
59
72
|
"Requirement analysis and Prisma DB schema generation are ready.",
|
|
@@ -75,6 +88,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
|
|
|
75
88
|
].join("\n"),
|
|
76
89
|
},
|
|
77
90
|
{
|
|
91
|
+
id: (0, uuid_1.v4)(),
|
|
92
|
+
created_at: new Date().toISOString(),
|
|
78
93
|
type: "assistantMessage",
|
|
79
94
|
text: [
|
|
80
95
|
"Database schema and entity relationship diagrams are ready.",
|