@autobe/agent 0.8.0 → 0.9.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.d.ts +183 -12
- package/lib/AutoBeAgent.js +245 -65
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +4 -3
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/context/AutoBeContext.d.ts +2 -2
- package/lib/factory/index.d.ts +0 -1
- package/lib/factory/index.js +0 -1
- package/lib/factory/index.js.map +1 -1
- package/lib/index.mjs +976 -633
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +4 -8
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js +89 -57
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestProgress.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestProgress.js +73 -46
- package/lib/orchestrate/test/orchestrateTestProgress.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestScenario.js +616 -237
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +123 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +1 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -1
- package/lib/orchestrate/test/transformTestCorrectHistories.js +14 -10
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestProgressHistories.d.ts +7 -1
- package/lib/orchestrate/test/transformTestProgressHistories.js +20 -20
- package/lib/orchestrate/test/transformTestProgressHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +1 -2
- package/lib/orchestrate/test/transformTestScenarioHistories.js +1 -77
- package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -1
- package/lib/structures/IAutoBeConfig.d.ts +48 -10
- package/lib/structures/IAutoBeProps.d.ts +87 -0
- package/lib/structures/IAutoBeVendor.d.ts +64 -22
- package/lib/utils/backoffRetry.d.ts +7 -0
- package/lib/utils/backoffRetry.js +73 -0
- package/lib/utils/backoffRetry.js.map +1 -0
- package/lib/utils/types/BackoffOptions.d.ts +12 -0
- package/lib/utils/types/BackoffOptions.js +3 -0
- package/lib/utils/types/BackoffOptions.js.map +1 -0
- package/package.json +4 -4
- package/src/AutoBeAgent.ts +248 -52
- package/src/constants/AutoBeSystemPromptConstant.ts +4 -3
- package/src/context/AutoBeContext.ts +7 -2
- package/src/factory/index.ts +0 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +1 -1
- package/src/orchestrate/interface/orchestrateInterface.ts +1 -1
- package/src/orchestrate/prisma/orchestratePrisma.ts +1 -0
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +4 -2
- package/src/orchestrate/test/orchestrateTest.ts +6 -13
- package/src/orchestrate/test/orchestrateTestCorrect.ts +125 -72
- package/src/orchestrate/test/orchestrateTestProgress.ts +86 -42
- package/src/orchestrate/test/orchestrateTestScenario.ts +192 -151
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +132 -0
- package/src/orchestrate/test/transformTestCorrectHistories.ts +14 -10
- package/src/orchestrate/test/transformTestProgressHistories.ts +25 -22
- package/src/orchestrate/test/transformTestScenarioHistories.ts +0 -79
- package/src/structures/IAutoBeConfig.ts +48 -10
- package/src/structures/IAutoBeProps.ts +91 -0
- package/src/structures/IAutoBeVendor.ts +64 -22
- package/src/utils/backoffRetry.ts +84 -0
- package/src/utils/types/BackoffOptions.ts +15 -0
|
@@ -50,24 +50,40 @@ 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 assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
53
|
+
const backoffRetry_1 = require("../../utils/backoffRetry");
|
|
53
54
|
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
55
|
+
const orchestrateTestProgress_1 = require("./orchestrateTestProgress");
|
|
54
56
|
const transformTestCorrectHistories_1 = require("./transformTestCorrectHistories");
|
|
55
|
-
function orchestrateTestCorrect(ctx_1, codes_1) {
|
|
56
|
-
return __awaiter(this, arguments, void 0, function* (ctx, codes, life = 4) {
|
|
57
|
+
function orchestrateTestCorrect(ctx_1, codes_1, scenarios_1) {
|
|
58
|
+
return __awaiter(this, arguments, void 0, function* (ctx, codes, scenarios, life = 4) {
|
|
57
59
|
var _a, _b;
|
|
60
|
+
const scenarioMap = new Map();
|
|
61
|
+
codes.forEach(({ filename }, index) => {
|
|
62
|
+
scenarioMap.set(filename, scenarios[index]);
|
|
63
|
+
});
|
|
58
64
|
// 1) Build map of new test files from progress events
|
|
59
|
-
const testFiles =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
const testFiles = codes
|
|
66
|
+
.map(({ filename, content }) => {
|
|
67
|
+
return {
|
|
68
|
+
[`test/features/api/${filename}`]: content,
|
|
69
|
+
};
|
|
70
|
+
})
|
|
71
|
+
.reduce((acc, cur) => Object.assign(acc, cur), {});
|
|
63
72
|
// 2) Keep only files outside the test directory from current state
|
|
64
|
-
const retainedFiles = Object.
|
|
73
|
+
const retainedFiles = Object.entries((_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : {})
|
|
74
|
+
.filter(([filename]) => {
|
|
75
|
+
return !filename.startsWith("test/features/api");
|
|
76
|
+
})
|
|
77
|
+
.map(([filename, content]) => {
|
|
78
|
+
return { [filename]: content };
|
|
79
|
+
})
|
|
80
|
+
.reduce((acc, cur) => Object.assign(acc, cur), {});
|
|
65
81
|
// 3) Merge and filter: keep .ts/.json, drop anything under "benchmark"
|
|
66
82
|
const mergedFiles = Object.assign(Object.assign({}, retainedFiles), testFiles);
|
|
67
83
|
const files = Object.fromEntries(Object.entries(mergedFiles).filter(([filename]) => (filename.endsWith(".ts") && !filename.startsWith("test/benchmark/")) ||
|
|
68
84
|
filename.endsWith(".json")));
|
|
69
85
|
// 4) Ask the LLM to correct the filtered file set
|
|
70
|
-
const response = yield step(ctx, files, life);
|
|
86
|
+
const response = yield step(ctx, files, scenarioMap, life);
|
|
71
87
|
// 5) Combine original + corrected files and dispatch event
|
|
72
88
|
const event = Object.assign(Object.assign({}, response), { type: "testValidate", files: Object.assign(Object.assign({}, mergedFiles), response.files) });
|
|
73
89
|
return event;
|
|
@@ -88,11 +104,11 @@ function orchestrateTestCorrect(ctx_1, codes_1) {
|
|
|
88
104
|
* @returns Event object containing successful compilation result and modified
|
|
89
105
|
* files
|
|
90
106
|
*/
|
|
91
|
-
function step(ctx, files, life) {
|
|
107
|
+
function step(ctx, files, scenarioMap, life) {
|
|
92
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
94
109
|
// COMPILE TEST CODE
|
|
95
|
-
|
|
110
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
111
|
+
const result = yield ctx.compiler.typescript.compile({
|
|
96
112
|
files,
|
|
97
113
|
});
|
|
98
114
|
if (result.type === "success") {
|
|
@@ -158,8 +174,9 @@ function step(ctx, files, life) {
|
|
|
158
174
|
// VALIDATION FAILED
|
|
159
175
|
const validate = yield Promise.all(Object.entries(diagnostics).map((_a) => __awaiter(this, [_a], void 0, function* ([filename, d]) {
|
|
160
176
|
var _b, _c;
|
|
177
|
+
const scenario = scenarioMap.get(filename);
|
|
161
178
|
const code = files[filename];
|
|
162
|
-
const response = yield process(ctx, d, code);
|
|
179
|
+
const response = yield process(ctx, d, code, scenario);
|
|
163
180
|
ctx.dispatch({
|
|
164
181
|
type: "testCorrect",
|
|
165
182
|
created_at: new Date().toISOString(),
|
|
@@ -174,7 +191,7 @@ function step(ctx, files, life) {
|
|
|
174
191
|
return [filename, response.content];
|
|
175
192
|
})));
|
|
176
193
|
const newFiles = Object.assign(Object.assign({}, files), Object.fromEntries(validate));
|
|
177
|
-
return step(ctx, newFiles, life - 1);
|
|
194
|
+
return step(ctx, newFiles, scenarioMap, life - 1);
|
|
178
195
|
});
|
|
179
196
|
}
|
|
180
197
|
/**
|
|
@@ -187,31 +204,35 @@ function step(ctx, files, life) {
|
|
|
187
204
|
* @param code The source code content to be fixed
|
|
188
205
|
* @returns Promise resolving to corrected test function properties
|
|
189
206
|
*/
|
|
190
|
-
function process(ctx, diagnostics, code) {
|
|
207
|
+
function process(ctx, diagnostics, code, scenario) {
|
|
191
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
-
var _a
|
|
209
|
+
var _a;
|
|
193
210
|
const pointer = {
|
|
194
211
|
value: null,
|
|
195
212
|
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
213
|
+
let document = null;
|
|
214
|
+
if (scenario) {
|
|
215
|
+
document = (0, orchestrateTestProgress_1.filterDocument)(scenario, ctx.state().interface.document);
|
|
216
|
+
}
|
|
217
|
+
// const apiFiles = Object.entries(ctx.state().interface?.files ?? {})
|
|
218
|
+
// .filter(([filename]) => {
|
|
219
|
+
// return filename.startsWith("src/api/");
|
|
220
|
+
// })
|
|
221
|
+
// .reduce<Record<string, string>>((acc, [filename, content]) => {
|
|
222
|
+
// return Object.assign(acc, { [filename]: content });
|
|
223
|
+
// }, {});
|
|
224
|
+
// const dtoFiles = Object.entries(ctx.state().interface?.files ?? {})
|
|
225
|
+
// .filter(([filename]) => {
|
|
226
|
+
// return filename.startsWith("src/api/structures/");
|
|
227
|
+
// })
|
|
228
|
+
// .reduce<Record<string, string>>((acc, [filename, content]) => {
|
|
229
|
+
// return Object.assign(acc, { [filename]: content });
|
|
230
|
+
// }, {});
|
|
210
231
|
const agentica = new core_1.MicroAgentica({
|
|
211
232
|
model: ctx.model,
|
|
212
233
|
vendor: Object.assign({}, ctx.vendor),
|
|
213
|
-
config: Object.assign({}, ((
|
|
214
|
-
histories: (0, transformTestCorrectHistories_1.transformTestCorrectHistories)(
|
|
234
|
+
config: Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})),
|
|
235
|
+
histories: (0, transformTestCorrectHistories_1.transformTestCorrectHistories)(document),
|
|
215
236
|
controllers: [
|
|
216
237
|
createApplication({
|
|
217
238
|
model: ctx.model,
|
|
@@ -220,34 +241,45 @@ function process(ctx, diagnostics, code) {
|
|
|
220
241
|
},
|
|
221
242
|
}),
|
|
222
243
|
],
|
|
244
|
+
tokenUsage: ctx.usage(),
|
|
223
245
|
});
|
|
224
246
|
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
225
|
-
yield
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
yield (0, backoffRetry_1.randomBackoffRetry)(() => __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
yield agentica.conversate([
|
|
249
|
+
"Fix the compilation error in the provided code.",
|
|
250
|
+
"",
|
|
251
|
+
"## Original Code",
|
|
252
|
+
"```typescript",
|
|
253
|
+
code,
|
|
254
|
+
"```",
|
|
255
|
+
"",
|
|
256
|
+
diagnostics.map((diagnostic) => {
|
|
257
|
+
if (diagnostic.start === undefined || diagnostic.length === undefined)
|
|
258
|
+
return "";
|
|
259
|
+
const checkDtoRegexp = `Cannot find module '@ORGANIZATION/template-api/lib/structures/IBbsArticleComment' or its corresponding type declarations.`;
|
|
260
|
+
const [group] = [
|
|
261
|
+
...checkDtoRegexp.matchAll(/Cannot find module '(.*lib\/structures\/.*)'/g),
|
|
262
|
+
];
|
|
263
|
+
const [_, filename] = group !== null && group !== void 0 ? group : [];
|
|
264
|
+
return [
|
|
265
|
+
"## Error Information",
|
|
266
|
+
`- Position: Characters ${diagnostic.start} to ${diagnostic.start + diagnostic.length}`,
|
|
267
|
+
`- Error Message: ${diagnostic.messageText}`,
|
|
268
|
+
`- Problematic Code: \`${code.substring(diagnostic.start, diagnostic.start + diagnostic.length)}\``,
|
|
269
|
+
filename
|
|
270
|
+
? `The type files located under **/lib/structures are declared in '@ORGANIZATION/PROJECT-api/lib/structures'.\n` +
|
|
271
|
+
`Note: '@ORGANIZATION/PROJECT-api' must be written exactly as is and should not be replaced.\n`
|
|
272
|
+
: "",
|
|
273
|
+
].join("\n");
|
|
274
|
+
}),
|
|
275
|
+
"## Instructions",
|
|
276
|
+
"1. Focus on the specific error location and message",
|
|
277
|
+
"2. Provide the corrected TypeScript code",
|
|
278
|
+
"3. Ensure the fix resolves the compilation error",
|
|
279
|
+
"",
|
|
280
|
+
"Return only the fixed code without explanations.",
|
|
281
|
+
].join("\n"));
|
|
282
|
+
}));
|
|
251
283
|
if (pointer.value === null)
|
|
252
284
|
throw new Error("Failed to modify test code.");
|
|
253
285
|
return pointer.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateTestCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateTestCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,wDA4DC;;AA/ED,yCAAoE;AAUpE,kDAA0B;AAG1B,uEAAoE;AACpE,2DAA8D;AAC9D,iEAA8D;AAC9D,uEAA2D;AAC3D,mFAAgF;AAEhF,SAAsB,sBAAsB;yDAC1C,GAAyB,EACzB,KAA6B,EAC7B,SAA8C,EAC9C,OAAe,CAAC;;QAEhB,MAAM,WAAW,GAAmD,IAAI,GAAG,EAAE,CAAC;QAC9E,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE;YACpC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,sDAAsD;QACtD,MAAM,SAAS,GAA2B,KAAK;aAC5C,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;YAC7B,OAAO;gBACL,CAAC,qBAAqB,QAAQ,EAAE,CAAC,EAAE,OAAO;aAC3C,CAAC;QACJ,CAAC,CAAC;aACD,MAAM,CAAyB,CAAC,GAAG,EAAE,GAAG,E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AAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;SACqB;KACzB,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;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AutoBeOpenApi, AutoBeTestScenarioEvent, AutoBeTestWriteEvent } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestrateTestProgress<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenarios:
|
|
4
|
+
export declare function orchestrateTestProgress<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenarios: AutoBeTestScenarioEvent.IScenario[]): Promise<AutoBeTestWriteEvent[]>;
|
|
5
|
+
export declare function filterDocument(scenario: AutoBeTestScenarioEvent.IScenario, document: AutoBeOpenApi.IDocument): AutoBeOpenApi.IDocument;
|
|
@@ -46,8 +46,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.orchestrateTestProgress = orchestrateTestProgress;
|
|
49
|
+
exports.filterDocument = filterDocument;
|
|
49
50
|
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
51
|
const core_1 = require("@agentica/core");
|
|
52
|
+
const openapi_1 = require("@samchon/openapi");
|
|
51
53
|
const typia_1 = __importDefault(require("typia"));
|
|
52
54
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
53
55
|
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
@@ -58,15 +60,15 @@ function orchestrateTestProgress(ctx, scenarios) {
|
|
|
58
60
|
let complete = 0;
|
|
59
61
|
const events = yield Promise.all(
|
|
60
62
|
/**
|
|
61
|
-
* Generate test code for each scenario. Maps through
|
|
62
|
-
*
|
|
63
|
-
*
|
|
63
|
+
* Generate test code for each scenario. Maps through plans array to create
|
|
64
|
+
* individual test code implementations. Each scenario is processed to
|
|
65
|
+
* generate corresponding test code and progress events.
|
|
64
66
|
*/
|
|
65
67
|
scenarios.map((scenario) => __awaiter(this, void 0, void 0, function* () {
|
|
66
68
|
var _a, _b;
|
|
67
69
|
const code = yield process(ctx, scenario);
|
|
68
70
|
const event = {
|
|
69
|
-
type: "
|
|
71
|
+
type: "testWrite",
|
|
70
72
|
created_at: start.toISOString(),
|
|
71
73
|
filename: `${code.domain}/${scenario.functionName}.ts`,
|
|
72
74
|
content: code.content,
|
|
@@ -92,29 +94,23 @@ function orchestrateTestProgress(ctx, scenarios) {
|
|
|
92
94
|
*/
|
|
93
95
|
function process(ctx, scenario) {
|
|
94
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
var _a
|
|
97
|
+
var _a;
|
|
96
98
|
const pointer = {
|
|
97
99
|
value: null,
|
|
98
100
|
};
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
})
|
|
103
|
-
.reduce((acc, [filename, content]) => {
|
|
104
|
-
return Object.assign(acc, { [filename]: content });
|
|
105
|
-
}, {});
|
|
106
|
-
const dtoFiles = Object.entries((_d = (_c = ctx.state().interface) === null || _c === void 0 ? void 0 : _c.files) !== null && _d !== void 0 ? _d : {})
|
|
107
|
-
.filter(([filename]) => {
|
|
108
|
-
return filename.startsWith("src/api/structures/");
|
|
109
|
-
})
|
|
110
|
-
.reduce((acc, [filename, content]) => {
|
|
111
|
-
return Object.assign(acc, { [filename]: content });
|
|
112
|
-
}, {});
|
|
101
|
+
const document = filterDocument(scenario, ctx.state().interface.document);
|
|
102
|
+
const files = Object.entries(yield ctx.compiler.interface.compile(document));
|
|
103
|
+
const filter = (prefix) => Object.fromEntries(files.filter(([key]) => key.startsWith(prefix)));
|
|
113
104
|
const agentica = new core_1.MicroAgentica({
|
|
114
105
|
model: ctx.model,
|
|
115
106
|
vendor: ctx.vendor,
|
|
116
|
-
config: Object.assign({}, ((
|
|
117
|
-
histories: (0, transformTestProgressHistories_1.transformTestProgressHistories)(
|
|
107
|
+
config: Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})),
|
|
108
|
+
histories: (0, transformTestProgressHistories_1.transformTestProgressHistories)({
|
|
109
|
+
scenario: scenario,
|
|
110
|
+
dto: filter("src/api/structures"),
|
|
111
|
+
sdk: filter("src/api/functional"),
|
|
112
|
+
e2e: filter("test/features"),
|
|
113
|
+
}),
|
|
118
114
|
controllers: [
|
|
119
115
|
createApplication({
|
|
120
116
|
model: ctx.model,
|
|
@@ -123,20 +119,51 @@ function process(ctx, scenario) {
|
|
|
123
119
|
},
|
|
124
120
|
}),
|
|
125
121
|
],
|
|
122
|
+
tokenUsage: ctx.usage(),
|
|
126
123
|
});
|
|
127
124
|
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
128
|
-
yield agentica.conversate(
|
|
129
|
-
"Create test code for below scenario:",
|
|
130
|
-
"",
|
|
131
|
-
"```json",
|
|
132
|
-
JSON.stringify(scenario, null, 2),
|
|
133
|
-
"```",
|
|
134
|
-
].join("\n"));
|
|
125
|
+
yield agentica.conversate("Create e2e test functions.");
|
|
135
126
|
if (pointer.value === null)
|
|
136
127
|
throw new Error("Failed to create test code.");
|
|
137
128
|
return pointer.value;
|
|
138
129
|
});
|
|
139
130
|
}
|
|
131
|
+
function filterDocument(scenario, document) {
|
|
132
|
+
const operations = document.operations.filter((op) => {
|
|
133
|
+
if (scenario.endpoint.method === op.method &&
|
|
134
|
+
scenario.endpoint.path === op.path) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
else if (scenario.dependencies.some((dp) => dp.endpoint.method === op.method && dp.endpoint.path === op.path)) {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
const components = {
|
|
142
|
+
schemas: {},
|
|
143
|
+
};
|
|
144
|
+
const visit = (typeName) => {
|
|
145
|
+
openapi_1.OpenApiTypeChecker.visit({
|
|
146
|
+
components: document.components,
|
|
147
|
+
schema: { $ref: `#/components/schemas/${typeName}` },
|
|
148
|
+
closure: (s) => {
|
|
149
|
+
if (openapi_1.OpenApiTypeChecker.isReference(s)) {
|
|
150
|
+
const key = s.$ref.split("/").pop();
|
|
151
|
+
components.schemas[key] = document.components.schemas[key];
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
for (const op of operations) {
|
|
157
|
+
if (op.requestBody)
|
|
158
|
+
visit(op.requestBody.typeName);
|
|
159
|
+
if (op.responseBody)
|
|
160
|
+
visit(op.responseBody.typeName);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
operations,
|
|
164
|
+
components,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
140
167
|
function createApplication(props) {
|
|
141
168
|
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
142
169
|
const application = collection[props.model];
|
|
@@ -164,9 +191,9 @@ const claude = {
|
|
|
164
191
|
description: "Current Type: {@link ICreateTestCodeProps}",
|
|
165
192
|
type: "object",
|
|
166
193
|
properties: {
|
|
167
|
-
|
|
194
|
+
scenario: {
|
|
168
195
|
title: "Strategic approach for test implementation",
|
|
169
|
-
description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception
|
|
196
|
+
description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception plans\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error plans (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the scenario if it doesn't follow the Test Generation\n Guildelines.",
|
|
170
197
|
type: "string"
|
|
171
198
|
},
|
|
172
199
|
domain: {
|
|
@@ -181,17 +208,17 @@ const claude = {
|
|
|
181
208
|
}
|
|
182
209
|
},
|
|
183
210
|
required: [
|
|
184
|
-
"
|
|
211
|
+
"scenario",
|
|
185
212
|
"domain",
|
|
186
213
|
"content"
|
|
187
214
|
],
|
|
188
215
|
additionalProperties: false,
|
|
189
216
|
$defs: {}
|
|
190
217
|
},
|
|
191
|
-
validate: (() => { const _io0 = input => "string" === typeof input.
|
|
192
|
-
path: _path + ".
|
|
218
|
+
validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.scenario || _report(_exceptionable, {
|
|
219
|
+
path: _path + ".scenario",
|
|
193
220
|
expected: "string",
|
|
194
|
-
value: input.
|
|
221
|
+
value: input.scenario
|
|
195
222
|
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
196
223
|
path: _path + ".domain",
|
|
197
224
|
expected: "string",
|
|
@@ -246,9 +273,9 @@ const collection = {
|
|
|
246
273
|
description: "Current Type: {@link ICreateTestCodeProps}",
|
|
247
274
|
type: "object",
|
|
248
275
|
properties: {
|
|
249
|
-
|
|
276
|
+
scenario: {
|
|
250
277
|
title: "Strategic approach for test implementation",
|
|
251
|
-
description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception
|
|
278
|
+
description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception plans\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error plans (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the scenario if it doesn't follow the Test Generation\n Guildelines.",
|
|
252
279
|
type: "string"
|
|
253
280
|
},
|
|
254
281
|
domain: {
|
|
@@ -263,17 +290,17 @@ const collection = {
|
|
|
263
290
|
}
|
|
264
291
|
},
|
|
265
292
|
required: [
|
|
266
|
-
"
|
|
293
|
+
"scenario",
|
|
267
294
|
"domain",
|
|
268
295
|
"content"
|
|
269
296
|
],
|
|
270
297
|
additionalProperties: false,
|
|
271
298
|
$defs: {}
|
|
272
299
|
},
|
|
273
|
-
validate: (() => { const _io0 = input => "string" === typeof input.
|
|
274
|
-
path: _path + ".
|
|
300
|
+
validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.scenario || _report(_exceptionable, {
|
|
301
|
+
path: _path + ".scenario",
|
|
275
302
|
expected: "string",
|
|
276
|
-
value: input.
|
|
303
|
+
value: input.scenario
|
|
277
304
|
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
278
305
|
path: _path + ".domain",
|
|
279
306
|
expected: "string",
|
|
@@ -330,10 +357,10 @@ const collection = {
|
|
|
330
357
|
parameters: {
|
|
331
358
|
type: "object",
|
|
332
359
|
properties: {
|
|
333
|
-
|
|
360
|
+
scenario: {
|
|
334
361
|
type: "string",
|
|
335
362
|
title: "Strategic approach for test implementation",
|
|
336
|
-
description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception
|
|
363
|
+
description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception plans\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error plans (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the scenario if it doesn't follow the Test Generation\n Guildelines."
|
|
337
364
|
},
|
|
338
365
|
domain: {
|
|
339
366
|
type: "string",
|
|
@@ -347,17 +374,17 @@ const collection = {
|
|
|
347
374
|
}
|
|
348
375
|
},
|
|
349
376
|
required: [
|
|
350
|
-
"
|
|
377
|
+
"scenario",
|
|
351
378
|
"domain",
|
|
352
379
|
"content"
|
|
353
380
|
],
|
|
354
381
|
description: "Current Type: {@link ICreateTestCodeProps}",
|
|
355
382
|
additionalProperties: false
|
|
356
383
|
},
|
|
357
|
-
validate: (() => { const _io0 = input => "string" === typeof input.
|
|
358
|
-
path: _path + ".
|
|
384
|
+
validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.scenario || _report(_exceptionable, {
|
|
385
|
+
path: _path + ".scenario",
|
|
359
386
|
expected: "string",
|
|
360
|
-
value: input.
|
|
387
|
+
value: input.scenario
|
|
361
388
|
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
362
389
|
path: _path + ".domain",
|
|
363
390
|
expected: "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateTestProgress.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestProgress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateTestProgress.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestProgress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,0DA8BC;AA0DD,wCA4CC;;AAvJD,yCAAoE;AAMpE,8CAI0B;AAE1B,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,qFAAkF;AAElF,SAAsB,uBAAuB,CAC3C,GAAyB,EACzB,SAA8C;;QAE9C,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,IAAI,QAAQ,GAAW,CAAC,CAAC;QAEzB,MAAM,MAAM,GAA2B,MAAM,OAAO,CAAC,GAAG;QACtD;;;;WAIG;QACH,SAAS,CAAC,GAAG,CAAC,CAAO,QAAQ,EAAE,EAAE;;YAC/B,MAAM,IAAI,GAAyB,MAAM,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAChE,MAAM,KAAK,GAAyB;gBAClC,IAAI,EAAE,WAAW;gBACjB,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;gBAC/B,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,YAAY,KAAK;gBACtD,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,SAAS,EAAE,EAAE,QAAQ;gBACrB,KAAK,EAAE,SAAS,CAAC,MAAM;gBACvB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK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AAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutoBeTestScenarioEvent } from "@autobe/interface
|
|
1
|
+
import { AutoBeTestScenarioEvent } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestrateTestScenario<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model
|
|
4
|
+
export declare function orchestrateTestScenario<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>): Promise<AutoBeTestScenarioEvent>;
|