@autobe/agent 0.5.2 → 0.7.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 +5 -2
- package/lib/constants/AutoBeSystemPromptConstant.js.map +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 +17 -17
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +6228 -4563
- package/lib/index.mjs.map +1 -1
- package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.d.ts +4 -8
- package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.js +25 -20
- 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 +8 -5
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyze.d.ts +31 -0
- package/lib/orchestrate/{orchestrateAnalyze.js → analyze/orchestrateAnalyze.js} +200 -59
- 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 +8 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +6 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +3 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.js +41 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -5
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +28 -1
- 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/orchestrate/{orchestrateTest.d.ts → test/orchestrateTest.d.ts} +2 -2
- package/lib/orchestrate/test/orchestrateTest.js +70 -0
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js +543 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTestProgress.d.ts +4 -0
- package/lib/orchestrate/test/orchestrateTestProgress.js +403 -0
- package/lib/orchestrate/test/orchestrateTestProgress.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +4 -0
- package/lib/orchestrate/test/orchestrateTestScenario.js +700 -0
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.js +47 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -0
- package/lib/orchestrate/test/transformTestHistories.d.ts +3 -0
- package/lib/orchestrate/test/transformTestHistories.js +74 -0
- package/lib/orchestrate/test/transformTestHistories.js.map +1 -0
- package/lib/orchestrate/test/transformTestProgressHistories.d.ts +2 -0
- package/lib/orchestrate/test/transformTestProgressHistories.js +47 -0
- package/lib/orchestrate/test/transformTestProgressHistories.js.map +1 -0
- package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +4 -0
- package/lib/orchestrate/test/transformTestScenarioHistories.js +176 -0
- package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -0
- package/lib/structures/IAutoBeVendor.d.ts +45 -2
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +5 -3
- package/src/constants/AutoBeSystemPromptConstant.ts +5 -2
- 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 +2 -2
- package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.ts +38 -36
- package/src/orchestrate/analyze/AutoBeAnalyzePointer.ts +10 -0
- package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeReviewer.ts +9 -6
- package/src/orchestrate/{orchestrateAnalyze.ts → analyze/orchestrateAnalyze.ts} +91 -39
- package/src/orchestrate/index.ts +3 -3
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +8 -1
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +6 -1
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +3 -1
- package/src/orchestrate/interface/transformInterfaceHistories.ts +40 -0
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -1
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +28 -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/orchestrate/test/orchestrateTest.ts +86 -0
- package/src/orchestrate/test/orchestrateTestCorrect.ts +368 -0
- package/src/orchestrate/test/orchestrateTestProgress.ts +264 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +178 -0
- package/src/orchestrate/test/transformTestCorrectHistories.ts +51 -0
- package/src/orchestrate/test/transformTestHistories.ts +77 -0
- package/src/orchestrate/test/transformTestProgressHistories.ts +51 -0
- package/src/orchestrate/test/transformTestScenarioHistories.ts +184 -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.d.ts +0 -6
- package/lib/orchestrate/orchestrateAnalyze.js.map +0 -1
- package/lib/orchestrate/orchestrateTest.js +0 -19
- package/lib/orchestrate/orchestrateTest.js.map +0 -1
- package/src/analyze/AnalyzeAgent.ts +0 -183
- package/src/orchestrate/orchestrateTest.ts +0 -18
- /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
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.orchestrateTestProgress = orchestrateTestProgress;
|
|
49
|
+
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
+
const core_1 = require("@agentica/core");
|
|
51
|
+
const typia_1 = __importDefault(require("typia"));
|
|
52
|
+
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
53
|
+
const transformTestProgressHistories_1 = require("./transformTestProgressHistories");
|
|
54
|
+
function orchestrateTestProgress(ctx, scenarios) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const start = new Date();
|
|
57
|
+
let complete = 0;
|
|
58
|
+
const events = yield Promise.all(
|
|
59
|
+
/**
|
|
60
|
+
* Generate test code for each scenario. Maps through scenarios array to
|
|
61
|
+
* create individual test code implementations. Each scenario is processed
|
|
62
|
+
* to generate corresponding test code and progress events.
|
|
63
|
+
*/
|
|
64
|
+
scenarios.map((scenario) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
const code = yield process(ctx, scenario);
|
|
67
|
+
const event = {
|
|
68
|
+
type: "testProgress",
|
|
69
|
+
created_at: start.toISOString(),
|
|
70
|
+
filename: `${code.domain}/${scenario.functionName}.ts`,
|
|
71
|
+
content: code.content,
|
|
72
|
+
completed: ++complete,
|
|
73
|
+
total: scenarios.length,
|
|
74
|
+
step: (_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
75
|
+
};
|
|
76
|
+
ctx.dispatch(event);
|
|
77
|
+
return event;
|
|
78
|
+
})));
|
|
79
|
+
return events;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Process function that generates test code for each individual scenario. Takes
|
|
84
|
+
* the AutoBeContext and scenario information as input and uses MicroAgentica to
|
|
85
|
+
* generate appropriate test code through LLM interaction.
|
|
86
|
+
*
|
|
87
|
+
* @param ctx - The AutoBeContext containing model, vendor and configuration
|
|
88
|
+
* @param scenario - The test scenario information to generate code for
|
|
89
|
+
* @returns Promise resolving to ICreateTestCodeProps containing the generated
|
|
90
|
+
* test code
|
|
91
|
+
*/
|
|
92
|
+
function process(ctx, scenario) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
var _a, _b, _c, _d, _e;
|
|
95
|
+
const pointer = {
|
|
96
|
+
value: null,
|
|
97
|
+
};
|
|
98
|
+
const apiFiles = Object.entries((_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : {})
|
|
99
|
+
.filter(([filename]) => {
|
|
100
|
+
return filename.startsWith("src/api/");
|
|
101
|
+
})
|
|
102
|
+
.reduce((acc, [filename, content]) => {
|
|
103
|
+
return Object.assign(acc, { [filename]: content });
|
|
104
|
+
}, {});
|
|
105
|
+
const dtoFiles = Object.entries((_d = (_c = ctx.state().interface) === null || _c === void 0 ? void 0 : _c.files) !== null && _d !== void 0 ? _d : {})
|
|
106
|
+
.filter(([filename]) => {
|
|
107
|
+
return filename.startsWith("src/api/structures/");
|
|
108
|
+
})
|
|
109
|
+
.reduce((acc, [filename, content]) => {
|
|
110
|
+
return Object.assign(acc, { [filename]: content });
|
|
111
|
+
}, {});
|
|
112
|
+
const agentica = new core_1.MicroAgentica({
|
|
113
|
+
model: ctx.model,
|
|
114
|
+
vendor: ctx.vendor,
|
|
115
|
+
config: Object.assign({}, ((_e = ctx.config) !== null && _e !== void 0 ? _e : {})),
|
|
116
|
+
histories: (0, transformTestProgressHistories_1.transformTestProgressHistories)(apiFiles, dtoFiles),
|
|
117
|
+
controllers: [
|
|
118
|
+
createApplication({
|
|
119
|
+
model: ctx.model,
|
|
120
|
+
build: (next) => {
|
|
121
|
+
pointer.value = next;
|
|
122
|
+
},
|
|
123
|
+
}),
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
agentica.on("request", (event) => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
if (event.body.tools)
|
|
128
|
+
event.body.tool_choice = "required";
|
|
129
|
+
}));
|
|
130
|
+
yield agentica.conversate([
|
|
131
|
+
"Create test code for below scenario:",
|
|
132
|
+
"",
|
|
133
|
+
"```json",
|
|
134
|
+
JSON.stringify(scenario, null, 2),
|
|
135
|
+
"```",
|
|
136
|
+
].join("\n"));
|
|
137
|
+
if (pointer.value === null)
|
|
138
|
+
throw new Error("Failed to create test code.");
|
|
139
|
+
return pointer.value;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function createApplication(props) {
|
|
143
|
+
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
144
|
+
const application = collection[props.model];
|
|
145
|
+
return {
|
|
146
|
+
protocol: "class",
|
|
147
|
+
name: "Create Test Code",
|
|
148
|
+
application,
|
|
149
|
+
execute: {
|
|
150
|
+
createTestCode: (next) => {
|
|
151
|
+
props.build(next);
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
const claude = {
|
|
157
|
+
model: "claude",
|
|
158
|
+
options: {
|
|
159
|
+
reference: true,
|
|
160
|
+
separate: null
|
|
161
|
+
},
|
|
162
|
+
functions: [
|
|
163
|
+
{
|
|
164
|
+
name: "createTestCode",
|
|
165
|
+
parameters: {
|
|
166
|
+
description: "Current Type: {@link ICreateTestCodeProps}",
|
|
167
|
+
type: "object",
|
|
168
|
+
properties: {
|
|
169
|
+
plan: {
|
|
170
|
+
title: "Strategic approach for test implementation",
|
|
171
|
+
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 scenarios\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 scenarios (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the plan if it doesn't follow the Test Generation\n Guildelines.",
|
|
172
|
+
type: "string"
|
|
173
|
+
},
|
|
174
|
+
domain: {
|
|
175
|
+
title: "Functional domain classification for test organization",
|
|
176
|
+
description: "Functional domain classification for test organization.\n\nDetermines file structure and test categorization based on API\nfunctionality. Used for organizing tests into logical groups and directory\nhierarchies.\n\n### Naming Rules:\n\n- Lowercase English words only\n- Singular nouns (e.g., \"article\", \"user\", \"comment\")\n- Kebab-case for compound words (e.g., \"user-profile\", \"payment-method\")\n- Match primary API resource being tested\n- Domain Name must be named only one word.\n\n### Domain Examples:\n\n- `article` \u2192 Article management operations\n- `comment` \u2192 Comment-related functionality\n- `auth` \u2192 Authentication and authorization\n- `user` \u2192 User management operations\n- `payment` \u2192 Payment processing\n- `notification` \u2192 Notification system",
|
|
177
|
+
type: "string"
|
|
178
|
+
},
|
|
179
|
+
content: {
|
|
180
|
+
title: "Complete TypeScript E2E test implementation",
|
|
181
|
+
description: "Complete TypeScript E2E test implementation.\n\nGenerate fully functional, compilation-error-free test code following",
|
|
182
|
+
type: "string"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
required: [
|
|
186
|
+
"plan",
|
|
187
|
+
"domain",
|
|
188
|
+
"content"
|
|
189
|
+
],
|
|
190
|
+
additionalProperties: false,
|
|
191
|
+
$defs: {}
|
|
192
|
+
},
|
|
193
|
+
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
|
|
194
|
+
path: _path + ".plan",
|
|
195
|
+
expected: "string",
|
|
196
|
+
value: input.plan
|
|
197
|
+
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
198
|
+
path: _path + ".domain",
|
|
199
|
+
expected: "string",
|
|
200
|
+
value: input.domain
|
|
201
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
202
|
+
path: _path + ".content",
|
|
203
|
+
expected: "string",
|
|
204
|
+
value: input.content
|
|
205
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
206
|
+
if (false === __is(input)) {
|
|
207
|
+
errors = [];
|
|
208
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
209
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
210
|
+
path: _path + "",
|
|
211
|
+
expected: "ICreateTestCodeProps",
|
|
212
|
+
value: input
|
|
213
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
214
|
+
path: _path + "",
|
|
215
|
+
expected: "ICreateTestCodeProps",
|
|
216
|
+
value: input
|
|
217
|
+
}))(input, "$input", true);
|
|
218
|
+
const success = 0 === errors.length;
|
|
219
|
+
return success ? {
|
|
220
|
+
success,
|
|
221
|
+
data: input
|
|
222
|
+
} : {
|
|
223
|
+
success,
|
|
224
|
+
errors,
|
|
225
|
+
data: input
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
success: true,
|
|
230
|
+
data: input
|
|
231
|
+
};
|
|
232
|
+
}; })()
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
};
|
|
236
|
+
const collection = {
|
|
237
|
+
chatgpt: {
|
|
238
|
+
model: "chatgpt",
|
|
239
|
+
options: {
|
|
240
|
+
reference: true,
|
|
241
|
+
strict: false,
|
|
242
|
+
separate: null
|
|
243
|
+
},
|
|
244
|
+
functions: [
|
|
245
|
+
{
|
|
246
|
+
name: "createTestCode",
|
|
247
|
+
parameters: {
|
|
248
|
+
description: "Current Type: {@link ICreateTestCodeProps}",
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
plan: {
|
|
252
|
+
title: "Strategic approach for test implementation",
|
|
253
|
+
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 scenarios\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 scenarios (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the plan if it doesn't follow the Test Generation\n Guildelines.",
|
|
254
|
+
type: "string"
|
|
255
|
+
},
|
|
256
|
+
domain: {
|
|
257
|
+
title: "Functional domain classification for test organization",
|
|
258
|
+
description: "Functional domain classification for test organization.\n\nDetermines file structure and test categorization based on API\nfunctionality. Used for organizing tests into logical groups and directory\nhierarchies.\n\n### Naming Rules:\n\n- Lowercase English words only\n- Singular nouns (e.g., \"article\", \"user\", \"comment\")\n- Kebab-case for compound words (e.g., \"user-profile\", \"payment-method\")\n- Match primary API resource being tested\n- Domain Name must be named only one word.\n\n### Domain Examples:\n\n- `article` \u2192 Article management operations\n- `comment` \u2192 Comment-related functionality\n- `auth` \u2192 Authentication and authorization\n- `user` \u2192 User management operations\n- `payment` \u2192 Payment processing\n- `notification` \u2192 Notification system",
|
|
259
|
+
type: "string"
|
|
260
|
+
},
|
|
261
|
+
content: {
|
|
262
|
+
title: "Complete TypeScript E2E test implementation",
|
|
263
|
+
description: "Complete TypeScript E2E test implementation.\n\nGenerate fully functional, compilation-error-free test code following",
|
|
264
|
+
type: "string"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
required: [
|
|
268
|
+
"plan",
|
|
269
|
+
"domain",
|
|
270
|
+
"content"
|
|
271
|
+
],
|
|
272
|
+
additionalProperties: false,
|
|
273
|
+
$defs: {}
|
|
274
|
+
},
|
|
275
|
+
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
|
|
276
|
+
path: _path + ".plan",
|
|
277
|
+
expected: "string",
|
|
278
|
+
value: input.plan
|
|
279
|
+
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
280
|
+
path: _path + ".domain",
|
|
281
|
+
expected: "string",
|
|
282
|
+
value: input.domain
|
|
283
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
284
|
+
path: _path + ".content",
|
|
285
|
+
expected: "string",
|
|
286
|
+
value: input.content
|
|
287
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
288
|
+
if (false === __is(input)) {
|
|
289
|
+
errors = [];
|
|
290
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
291
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
292
|
+
path: _path + "",
|
|
293
|
+
expected: "ICreateTestCodeProps",
|
|
294
|
+
value: input
|
|
295
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
296
|
+
path: _path + "",
|
|
297
|
+
expected: "ICreateTestCodeProps",
|
|
298
|
+
value: input
|
|
299
|
+
}))(input, "$input", true);
|
|
300
|
+
const success = 0 === errors.length;
|
|
301
|
+
return success ? {
|
|
302
|
+
success,
|
|
303
|
+
data: input
|
|
304
|
+
} : {
|
|
305
|
+
success,
|
|
306
|
+
errors,
|
|
307
|
+
data: input
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
success: true,
|
|
312
|
+
data: input
|
|
313
|
+
};
|
|
314
|
+
}; })()
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
claude,
|
|
319
|
+
llama: claude,
|
|
320
|
+
deepseek: claude,
|
|
321
|
+
"3.1": claude,
|
|
322
|
+
"3.0": {
|
|
323
|
+
model: "3.0",
|
|
324
|
+
options: {
|
|
325
|
+
constraint: true,
|
|
326
|
+
recursive: 3,
|
|
327
|
+
separate: null
|
|
328
|
+
},
|
|
329
|
+
functions: [
|
|
330
|
+
{
|
|
331
|
+
name: "createTestCode",
|
|
332
|
+
parameters: {
|
|
333
|
+
type: "object",
|
|
334
|
+
properties: {
|
|
335
|
+
plan: {
|
|
336
|
+
type: "string",
|
|
337
|
+
title: "Strategic approach for test implementation",
|
|
338
|
+
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 scenarios\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 scenarios (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the plan if it doesn't follow the Test Generation\n Guildelines."
|
|
339
|
+
},
|
|
340
|
+
domain: {
|
|
341
|
+
type: "string",
|
|
342
|
+
title: "Functional domain classification for test organization",
|
|
343
|
+
description: "Functional domain classification for test organization.\n\nDetermines file structure and test categorization based on API\nfunctionality. Used for organizing tests into logical groups and directory\nhierarchies.\n\n### Naming Rules:\n\n- Lowercase English words only\n- Singular nouns (e.g., \"article\", \"user\", \"comment\")\n- Kebab-case for compound words (e.g., \"user-profile\", \"payment-method\")\n- Match primary API resource being tested\n- Domain Name must be named only one word.\n\n### Domain Examples:\n\n- `article` \u2192 Article management operations\n- `comment` \u2192 Comment-related functionality\n- `auth` \u2192 Authentication and authorization\n- `user` \u2192 User management operations\n- `payment` \u2192 Payment processing\n- `notification` \u2192 Notification system"
|
|
344
|
+
},
|
|
345
|
+
content: {
|
|
346
|
+
type: "string",
|
|
347
|
+
title: "Complete TypeScript E2E test implementation",
|
|
348
|
+
description: "Complete TypeScript E2E test implementation.\n\nGenerate fully functional, compilation-error-free test code following"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
required: [
|
|
352
|
+
"plan",
|
|
353
|
+
"domain",
|
|
354
|
+
"content"
|
|
355
|
+
],
|
|
356
|
+
description: "Current Type: {@link ICreateTestCodeProps}",
|
|
357
|
+
additionalProperties: false
|
|
358
|
+
},
|
|
359
|
+
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
|
|
360
|
+
path: _path + ".plan",
|
|
361
|
+
expected: "string",
|
|
362
|
+
value: input.plan
|
|
363
|
+
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
364
|
+
path: _path + ".domain",
|
|
365
|
+
expected: "string",
|
|
366
|
+
value: input.domain
|
|
367
|
+
}), "string" === typeof input.content || _report(_exceptionable, {
|
|
368
|
+
path: _path + ".content",
|
|
369
|
+
expected: "string",
|
|
370
|
+
value: input.content
|
|
371
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
372
|
+
if (false === __is(input)) {
|
|
373
|
+
errors = [];
|
|
374
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
375
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
376
|
+
path: _path + "",
|
|
377
|
+
expected: "ICreateTestCodeProps",
|
|
378
|
+
value: input
|
|
379
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
380
|
+
path: _path + "",
|
|
381
|
+
expected: "ICreateTestCodeProps",
|
|
382
|
+
value: input
|
|
383
|
+
}))(input, "$input", true);
|
|
384
|
+
const success = 0 === errors.length;
|
|
385
|
+
return success ? {
|
|
386
|
+
success,
|
|
387
|
+
data: input
|
|
388
|
+
} : {
|
|
389
|
+
success,
|
|
390
|
+
errors,
|
|
391
|
+
data: input
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
return {
|
|
395
|
+
success: true,
|
|
396
|
+
data: input
|
|
397
|
+
};
|
|
398
|
+
}; })()
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
//# sourceMappingURL=orchestrateTestProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrateTestProgress.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestProgress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AutoBeTestScenarioEvent } from "@autobe/interface/src/events/AutoBeTestScenarioEvent";
|
|
2
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
+
export declare function orchestrateTestScenario<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>): Promise<AutoBeTestScenarioEvent>;
|