@autobe/agent 0.25.3 → 0.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.js +2 -0
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +1 -1
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/factory/consentFunctionCall.js +2 -0
- package/lib/factory/consentFunctionCall.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +2 -0
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/factory/supportMistral.d.ts +4 -0
- package/lib/factory/supportMistral.js +112 -0
- package/lib/factory/supportMistral.js.map +1 -0
- package/lib/index.mjs +1997 -1422
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +1 -0
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +370 -275
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +370 -275
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +304 -221
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +303 -220
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +17 -22
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +372 -277
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +322 -350
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/utils/validateEmptyCode.d.ts +8 -0
- package/lib/utils/validateEmptyCode.js +35 -0
- package/lib/utils/validateEmptyCode.js.map +1 -0
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +2 -0
- package/src/AutoBeMockAgent.ts +1 -1
- package/src/factory/consentFunctionCall.ts +3 -0
- package/src/factory/createAutoBeContext.ts +2 -0
- package/src/factory/supportMistral.ts +122 -0
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +52 -10
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -1
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +58 -17
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +51 -15
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +46 -12
- package/src/orchestrate/test/orchestrateTestCorrect.ts +17 -24
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +57 -10
- package/src/orchestrate/test/orchestrateTestWrite.ts +41 -10
- package/src/utils/validateEmptyCode.ts +41 -0
|
@@ -47,10 +47,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.orchestrateTestCorrectInvalidRequest = void 0;
|
|
49
49
|
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
+
const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize.js"));
|
|
50
51
|
const utils_1 = require("@autobe/utils");
|
|
51
52
|
const typia_1 = __importDefault(require("typia"));
|
|
52
53
|
const uuid_1 = require("uuid");
|
|
53
54
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
55
|
+
const validateEmptyCode_1 = require("../../utils/validateEmptyCode");
|
|
54
56
|
const completeTestCode_1 = require("./compile/completeTestCode");
|
|
55
57
|
const transformTestCorrectInvalidRequestHistories_1 = require("./histories/transformTestCorrectInvalidRequestHistories");
|
|
56
58
|
const orchestrateTestCorrectInvalidRequest = (ctx, compile, write) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -79,6 +81,7 @@ const correct = (ctx, compile, write, event, life) => __awaiter(void 0, void 0,
|
|
|
79
81
|
histories: yield (0, transformTestCorrectInvalidRequestHistories_1.transformTestCorrectInvalidRequestHistories)(null, event.result.diagnostics),
|
|
80
82
|
controller: createController({
|
|
81
83
|
model: ctx.model,
|
|
84
|
+
functionName: write.scenario.functionName,
|
|
82
85
|
then: (next) => {
|
|
83
86
|
pointer.value = next;
|
|
84
87
|
},
|
|
@@ -129,7 +132,75 @@ const correct = (ctx, compile, write, event, life) => __awaiter(void 0, void 0,
|
|
|
129
132
|
});
|
|
130
133
|
const createController = (props) => {
|
|
131
134
|
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
132
|
-
const
|
|
135
|
+
const validate = (input) => {
|
|
136
|
+
const result = (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
137
|
+
path: _path + ".think",
|
|
138
|
+
expected: "string",
|
|
139
|
+
value: input.think
|
|
140
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
141
|
+
path: _path + ".draft",
|
|
142
|
+
expected: "string",
|
|
143
|
+
value: input.draft
|
|
144
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
145
|
+
path: _path + ".revise",
|
|
146
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
147
|
+
value: input.revise
|
|
148
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
149
|
+
path: _path + ".revise",
|
|
150
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
151
|
+
value: input.revise
|
|
152
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
153
|
+
path: _path + ".review",
|
|
154
|
+
expected: "string",
|
|
155
|
+
value: input.review
|
|
156
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
157
|
+
path: _path + ".final",
|
|
158
|
+
expected: "(null | string)",
|
|
159
|
+
value: input.final
|
|
160
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
161
|
+
if (false === __is(input)) {
|
|
162
|
+
errors = [];
|
|
163
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
164
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
165
|
+
path: _path + "",
|
|
166
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
167
|
+
value: input
|
|
168
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
169
|
+
path: _path + "",
|
|
170
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
171
|
+
value: input
|
|
172
|
+
}))(input, "$input", true);
|
|
173
|
+
const success = 0 === errors.length;
|
|
174
|
+
return success ? {
|
|
175
|
+
success,
|
|
176
|
+
data: input
|
|
177
|
+
} : {
|
|
178
|
+
success,
|
|
179
|
+
errors,
|
|
180
|
+
data: input
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
success: true,
|
|
185
|
+
data: input
|
|
186
|
+
};
|
|
187
|
+
}; })()(input);
|
|
188
|
+
if (result.success === false)
|
|
189
|
+
return result;
|
|
190
|
+
const errors = (0, validateEmptyCode_1.validateEmptyCode)({
|
|
191
|
+
functionName: props.functionName,
|
|
192
|
+
draft: result.data.draft,
|
|
193
|
+
revise: result.data.revise,
|
|
194
|
+
});
|
|
195
|
+
return errors.length
|
|
196
|
+
? {
|
|
197
|
+
success: false,
|
|
198
|
+
errors,
|
|
199
|
+
data: result.data,
|
|
200
|
+
}
|
|
201
|
+
: result;
|
|
202
|
+
};
|
|
203
|
+
const application = collection[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
133
204
|
return {
|
|
134
205
|
protocol: "class",
|
|
135
206
|
name: "correctInvalidRequest",
|
|
@@ -145,299 +216,323 @@ const createController = (props) => {
|
|
|
145
216
|
};
|
|
146
217
|
};
|
|
147
218
|
const collection = {
|
|
148
|
-
chatgpt: {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
219
|
+
chatgpt: (validate) => (() => {
|
|
220
|
+
const application = {
|
|
221
|
+
model: "chatgpt",
|
|
222
|
+
options: {
|
|
223
|
+
reference: true,
|
|
224
|
+
strict: false,
|
|
225
|
+
separate: null
|
|
226
|
+
},
|
|
227
|
+
functions: [
|
|
228
|
+
{
|
|
229
|
+
name: "rewrite",
|
|
230
|
+
parameters: {
|
|
231
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nDescription of the current {@link IAutoBeTestCorrectInvalidRequestApplication.IProps} type:\n\n> Properties for the rewrite function containing the analysis and correction\n> workflow.\n> \n> This follows a three-phase approach: think \u2192 draft \u2192 revise, ensuring\n> systematic removal of invalid type testing code while maintaining the\n> integrity of valid E2E tests.\n\n### Description of {@link revise} property:\n\n> Review and finalization phase.\n> \n> Contains the review of changes made and the final cleaned code that\n> should compile without the invalid API request errors. This ensures the\n> correction is complete and accurate.",
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
think: {
|
|
235
|
+
description: "Initial analysis phase.\n\nContains the agent's analysis of what specific invalid request pattern\nwas found in the code and how it's causing the compilation error. This\nshould identify:\n\n- The exact pattern (as any, satisfies, TestValidator.error, etc.)\n- Line numbers and locations of violations\n- The TypeScript error codes being triggered\n- Why this constitutes invalid type testing\n\nExample: \"Detected TestValidator.error() call at line 45 with 'as any'\ncasting on request body containing deliberately wrong types (number for\nemail field). This is causing TS2345 compilation error.\"",
|
|
236
|
+
type: "string"
|
|
237
|
+
},
|
|
238
|
+
draft: {
|
|
239
|
+
description: "Draft correction phase.\n\nThe initial corrected code with the problematic API request sections\ncompletely removed while preserving all valid test code.\n\nRules for drafting:\n\n- Remove entire test functions containing type violations\n- Do not comment out code - delete it completely\n- Preserve test suite structure and valid tests\n- Maintain proper indentation and formatting\n- Keep imports that are still needed by remaining code",
|
|
240
|
+
type: "string"
|
|
241
|
+
},
|
|
242
|
+
revise: {
|
|
243
|
+
$ref: "#/$defs/IAutoBeTestCorrectInvalidRequestApplication.IReviseProps"
|
|
244
|
+
}
|
|
169
245
|
},
|
|
170
|
-
|
|
171
|
-
|
|
246
|
+
required: [
|
|
247
|
+
"think",
|
|
248
|
+
"draft",
|
|
249
|
+
"revise"
|
|
250
|
+
],
|
|
251
|
+
additionalProperties: false,
|
|
252
|
+
$defs: {
|
|
253
|
+
"IAutoBeTestCorrectInvalidRequestApplication.IReviseProps": {
|
|
254
|
+
description: "Properties for the revision phase of the correction process.\n\nThis phase ensures that the removal was complete and the remaining code is\nvalid and compilable.",
|
|
255
|
+
type: "object",
|
|
256
|
+
properties: {
|
|
257
|
+
review: {
|
|
258
|
+
description: "Review of the changes made.\n\nBrief explanation of what invalid API request code was removed and\nverification that valid test code was preserved. Should confirm:\n\n- Which patterns were found and removed\n- Line ranges that were deleted\n- Verification that valid tests remain intact\n- Confirmation that no partial fixes were applied\n\nExample: \"Removed lines 43-52 containing TestValidator.error with invalid\ntype casting. Verified remaining tests are valid and unaffected.\"",
|
|
259
|
+
type: "string"
|
|
260
|
+
},
|
|
261
|
+
final: {
|
|
262
|
+
description: "Final corrected code.\n\nThe complete, cleaned test code with all invalid API request sections\nremoved, ready for compilation. When the draft already successfully\nremoves all problematic code with no additional issues found during\nreview, this value can be null, indicating the draft deletion was\nsufficient and requires no further changes.\n\nThis code must:\n\n- Compile without TypeScript errors\n- Contain only valid business logic tests\n- Have no `as any` or similar type violations\n- Maintain the original file structure\n- Be production-ready E2E test code\n\nA null value indicates the draft successfully removed all invalid code\nand needs no additional modifications.",
|
|
263
|
+
anyOf: [
|
|
264
|
+
{
|
|
265
|
+
type: "null"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: "string"
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
required: [
|
|
274
|
+
"review",
|
|
275
|
+
"final"
|
|
276
|
+
]
|
|
277
|
+
}
|
|
172
278
|
}
|
|
173
279
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
280
|
+
description: "Rewrite function to remove code containing invalid type API requests.\n\nThis function is called when the agent detects code that attempts to send\nAPI requests with deliberately wrong types, causing TypeScript compilation\nerrors. The agent will remove the problematic code sections while\npreserving valid test code.\n\nCommon patterns that trigger this function:\n\n- TestValidator.error calls testing type violations\n- Missing required fields with type assertions\n- Wrong type assignments with satisfies operator\n- Nested type violations in complex objects\n- Partial type testing with invalid structures\n\nThe rationale for deletion:\n\n- Type validation is the server's responsibility, not E2E tests\n- TypeScript compiler should enforce type safety at compile time\n- Invalid type testing breaks the entire test suite compilation\n- E2E tests should focus on business logic, not type system violations",
|
|
281
|
+
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
282
|
+
path: _path + ".think",
|
|
283
|
+
expected: "string",
|
|
284
|
+
value: input.think
|
|
285
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
286
|
+
path: _path + ".draft",
|
|
287
|
+
expected: "string",
|
|
288
|
+
value: input.draft
|
|
289
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
290
|
+
path: _path + ".revise",
|
|
291
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
292
|
+
value: input.revise
|
|
293
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
294
|
+
path: _path + ".revise",
|
|
295
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
296
|
+
value: input.revise
|
|
297
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
298
|
+
path: _path + ".review",
|
|
299
|
+
expected: "string",
|
|
300
|
+
value: input.review
|
|
301
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
302
|
+
path: _path + ".final",
|
|
303
|
+
expected: "(null | string)",
|
|
304
|
+
value: input.final
|
|
305
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
306
|
+
if (false === __is(input)) {
|
|
307
|
+
errors = [];
|
|
308
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
309
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
310
|
+
path: _path + "",
|
|
311
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
312
|
+
value: input
|
|
313
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
314
|
+
path: _path + "",
|
|
315
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
316
|
+
value: input
|
|
317
|
+
}))(input, "$input", true);
|
|
318
|
+
const success = 0 === errors.length;
|
|
319
|
+
return success ? {
|
|
320
|
+
success,
|
|
321
|
+
data: input
|
|
322
|
+
} : {
|
|
323
|
+
success,
|
|
324
|
+
errors,
|
|
325
|
+
data: input
|
|
326
|
+
};
|
|
205
327
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
description: "Rewrite function to remove code containing invalid type API requests.\n\nThis function is called when the agent detects code that attempts to send\nAPI requests with deliberately wrong types, causing TypeScript compilation\nerrors. The agent will remove the problematic code sections while\npreserving valid test code.\n\nCommon patterns that trigger this function:\n\n- TestValidator.error calls testing type violations\n- Missing required fields with type assertions\n- Wrong type assignments with satisfies operator\n- Nested type violations in complex objects\n- Partial type testing with invalid structures\n\nThe rationale for deletion:\n\n- Type validation is the server's responsibility, not E2E tests\n- TypeScript compiler should enforce type safety at compile time\n- Invalid type testing breaks the entire test suite compilation\n- E2E tests should focus on business logic, not type system violations",
|
|
209
|
-
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
210
|
-
path: _path + ".think",
|
|
211
|
-
expected: "string",
|
|
212
|
-
value: input.think
|
|
213
|
-
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
214
|
-
path: _path + ".draft",
|
|
215
|
-
expected: "string",
|
|
216
|
-
value: input.draft
|
|
217
|
-
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
218
|
-
path: _path + ".revise",
|
|
219
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
220
|
-
value: input.revise
|
|
221
|
-
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
222
|
-
path: _path + ".revise",
|
|
223
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
224
|
-
value: input.revise
|
|
225
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
226
|
-
path: _path + ".review",
|
|
227
|
-
expected: "string",
|
|
228
|
-
value: input.review
|
|
229
|
-
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
230
|
-
path: _path + ".final",
|
|
231
|
-
expected: "(null | string)",
|
|
232
|
-
value: input.final
|
|
233
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
234
|
-
if (false === __is(input)) {
|
|
235
|
-
errors = [];
|
|
236
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
237
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
238
|
-
path: _path + "",
|
|
239
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
240
|
-
value: input
|
|
241
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
242
|
-
path: _path + "",
|
|
243
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
244
|
-
value: input
|
|
245
|
-
}))(input, "$input", true);
|
|
246
|
-
const success = 0 === errors.length;
|
|
247
|
-
return success ? {
|
|
248
|
-
success,
|
|
249
|
-
data: input
|
|
250
|
-
} : {
|
|
251
|
-
success,
|
|
252
|
-
errors,
|
|
328
|
+
return {
|
|
329
|
+
success: true,
|
|
253
330
|
data: input
|
|
254
331
|
};
|
|
255
|
-
}
|
|
256
|
-
return {
|
|
257
|
-
success: true,
|
|
258
|
-
data: input
|
|
259
|
-
};
|
|
260
|
-
}; })()
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
name: "reject",
|
|
264
|
-
parameters: {
|
|
265
|
-
type: "object",
|
|
266
|
-
properties: {},
|
|
267
|
-
additionalProperties: false,
|
|
268
|
-
required: [],
|
|
269
|
-
$defs: {}
|
|
332
|
+
}; })()
|
|
270
333
|
},
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
errors
|
|
334
|
+
{
|
|
335
|
+
name: "reject",
|
|
336
|
+
parameters: {
|
|
337
|
+
type: "object",
|
|
338
|
+
properties: {},
|
|
339
|
+
additionalProperties: false,
|
|
340
|
+
required: [],
|
|
341
|
+
$defs: {}
|
|
342
|
+
},
|
|
343
|
+
description: "Reject function when no invalid type API requests are detected.\n\nThis function is called when the compilation error is not related to\ninvalid API request types, indicating the agent should not intervene.\n\nCommon scenarios for rejection:\n\n- Syntax errors unrelated to type violations\n- Legitimate type mismatches that need fixing (not deletion)\n- Framework-specific compilation issues\n- Configuration or environment problems\n\nWhen called, this indicates that another specialized agent should handle\nthe compilation error, as it's outside this agent's domain.",
|
|
344
|
+
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
345
|
+
if (false === __is(input)) {
|
|
346
|
+
errors = [];
|
|
347
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
348
|
+
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
349
|
+
const success = 0 === errors.length;
|
|
350
|
+
return success ? {
|
|
351
|
+
success,
|
|
352
|
+
data: input
|
|
353
|
+
} : {
|
|
354
|
+
success,
|
|
355
|
+
errors,
|
|
356
|
+
data: input
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
success: true,
|
|
284
361
|
data: input
|
|
285
362
|
};
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
363
|
+
}; })()
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
};
|
|
367
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
|
|
368
|
+
validate: {
|
|
369
|
+
rewrite: validate,
|
|
370
|
+
reject: () => ({
|
|
371
|
+
success: true,
|
|
372
|
+
data: undefined,
|
|
373
|
+
}),
|
|
374
|
+
},
|
|
375
|
+
}), { equals: false }));
|
|
376
|
+
return application;
|
|
377
|
+
})(),
|
|
378
|
+
claude: (validate) => (() => {
|
|
379
|
+
const application = {
|
|
380
|
+
model: "claude",
|
|
381
|
+
options: {
|
|
382
|
+
reference: true,
|
|
383
|
+
separate: null
|
|
384
|
+
},
|
|
385
|
+
functions: [
|
|
386
|
+
{
|
|
387
|
+
name: "rewrite",
|
|
388
|
+
parameters: {
|
|
389
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nDescription of the current {@link IAutoBeTestCorrectInvalidRequestApplication.IProps} type:\n\n> Properties for the rewrite function containing the analysis and correction\n> workflow.\n> \n> This follows a three-phase approach: think \u2192 draft \u2192 revise, ensuring\n> systematic removal of invalid type testing code while maintaining the\n> integrity of valid E2E tests.",
|
|
390
|
+
type: "object",
|
|
391
|
+
properties: {
|
|
392
|
+
think: {
|
|
393
|
+
description: "Initial analysis phase.\n\nContains the agent's analysis of what specific invalid request pattern\nwas found in the code and how it's causing the compilation error. This\nshould identify:\n\n- The exact pattern (as any, satisfies, TestValidator.error, etc.)\n- Line numbers and locations of violations\n- The TypeScript error codes being triggered\n- Why this constitutes invalid type testing\n\nExample: \"Detected TestValidator.error() call at line 45 with 'as any'\ncasting on request body containing deliberately wrong types (number for\nemail field). This is causing TS2345 compilation error.\"",
|
|
394
|
+
type: "string"
|
|
395
|
+
},
|
|
396
|
+
draft: {
|
|
397
|
+
description: "Draft correction phase.\n\nThe initial corrected code with the problematic API request sections\ncompletely removed while preserving all valid test code.\n\nRules for drafting:\n\n- Remove entire test functions containing type violations\n- Do not comment out code - delete it completely\n- Preserve test suite structure and valid tests\n- Maintain proper indentation and formatting\n- Keep imports that are still needed by remaining code",
|
|
398
|
+
type: "string"
|
|
399
|
+
},
|
|
400
|
+
revise: {
|
|
401
|
+
description: "Review and finalization phase.\n\nContains the review of changes made and the final cleaned code that\nshould compile without the invalid API request errors. This ensures the\ncorrection is complete and accurate.",
|
|
402
|
+
$ref: "#/$defs/IAutoBeTestCorrectInvalidRequestApplication.IReviseProps"
|
|
403
|
+
}
|
|
315
404
|
},
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
405
|
+
required: [
|
|
406
|
+
"think",
|
|
407
|
+
"draft",
|
|
408
|
+
"revise"
|
|
409
|
+
],
|
|
410
|
+
additionalProperties: false,
|
|
411
|
+
$defs: {
|
|
412
|
+
"IAutoBeTestCorrectInvalidRequestApplication.IReviseProps": {
|
|
413
|
+
description: "Properties for the revision phase of the correction process.\n\nThis phase ensures that the removal was complete and the remaining code is\nvalid and compilable.",
|
|
414
|
+
type: "object",
|
|
415
|
+
properties: {
|
|
416
|
+
review: {
|
|
417
|
+
description: "Review of the changes made.\n\nBrief explanation of what invalid API request code was removed and\nverification that valid test code was preserved. Should confirm:\n\n- Which patterns were found and removed\n- Line ranges that were deleted\n- Verification that valid tests remain intact\n- Confirmation that no partial fixes were applied\n\nExample: \"Removed lines 43-52 containing TestValidator.error with invalid\ntype casting. Verified remaining tests are valid and unaffected.\"",
|
|
418
|
+
type: "string"
|
|
419
|
+
},
|
|
420
|
+
final: {
|
|
421
|
+
description: "Final corrected code.\n\nThe complete, cleaned test code with all invalid API request sections\nremoved, ready for compilation. When the draft already successfully\nremoves all problematic code with no additional issues found during\nreview, this value can be null, indicating the draft deletion was\nsufficient and requires no further changes.\n\nThis code must:\n\n- Compile without TypeScript errors\n- Contain only valid business logic tests\n- Have no `as any` or similar type violations\n- Maintain the original file structure\n- Be production-ready E2E test code\n\nA null value indicates the draft successfully removed all invalid code\nand needs no additional modifications.",
|
|
422
|
+
oneOf: [
|
|
423
|
+
{
|
|
424
|
+
type: "null"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
type: "string"
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
required: [
|
|
433
|
+
"review",
|
|
434
|
+
"final"
|
|
435
|
+
]
|
|
436
|
+
}
|
|
319
437
|
}
|
|
320
438
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
439
|
+
description: "Rewrite function to remove code containing invalid type API requests.\n\nThis function is called when the agent detects code that attempts to send\nAPI requests with deliberately wrong types, causing TypeScript compilation\nerrors. The agent will remove the problematic code sections while\npreserving valid test code.\n\nCommon patterns that trigger this function:\n\n- TestValidator.error calls testing type violations\n- Missing required fields with type assertions\n- Wrong type assignments with satisfies operator\n- Nested type violations in complex objects\n- Partial type testing with invalid structures\n\nThe rationale for deletion:\n\n- Type validation is the server's responsibility, not E2E tests\n- TypeScript compiler should enforce type safety at compile time\n- Invalid type testing breaks the entire test suite compilation\n- E2E tests should focus on business logic, not type system violations",
|
|
440
|
+
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
441
|
+
path: _path + ".think",
|
|
442
|
+
expected: "string",
|
|
443
|
+
value: input.think
|
|
444
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
445
|
+
path: _path + ".draft",
|
|
446
|
+
expected: "string",
|
|
447
|
+
value: input.draft
|
|
448
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
449
|
+
path: _path + ".revise",
|
|
450
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
451
|
+
value: input.revise
|
|
452
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
453
|
+
path: _path + ".revise",
|
|
454
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
455
|
+
value: input.revise
|
|
456
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
457
|
+
path: _path + ".review",
|
|
458
|
+
expected: "string",
|
|
459
|
+
value: input.review
|
|
460
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
461
|
+
path: _path + ".final",
|
|
462
|
+
expected: "(null | string)",
|
|
463
|
+
value: input.final
|
|
464
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
465
|
+
if (false === __is(input)) {
|
|
466
|
+
errors = [];
|
|
467
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
468
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
469
|
+
path: _path + "",
|
|
470
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
471
|
+
value: input
|
|
472
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
473
|
+
path: _path + "",
|
|
474
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
475
|
+
value: input
|
|
476
|
+
}))(input, "$input", true);
|
|
477
|
+
const success = 0 === errors.length;
|
|
478
|
+
return success ? {
|
|
479
|
+
success,
|
|
480
|
+
data: input
|
|
481
|
+
} : {
|
|
482
|
+
success,
|
|
483
|
+
errors,
|
|
484
|
+
data: input
|
|
485
|
+
};
|
|
352
486
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
description: "Rewrite function to remove code containing invalid type API requests.\n\nThis function is called when the agent detects code that attempts to send\nAPI requests with deliberately wrong types, causing TypeScript compilation\nerrors. The agent will remove the problematic code sections while\npreserving valid test code.\n\nCommon patterns that trigger this function:\n\n- TestValidator.error calls testing type violations\n- Missing required fields with type assertions\n- Wrong type assignments with satisfies operator\n- Nested type violations in complex objects\n- Partial type testing with invalid structures\n\nThe rationale for deletion:\n\n- Type validation is the server's responsibility, not E2E tests\n- TypeScript compiler should enforce type safety at compile time\n- Invalid type testing breaks the entire test suite compilation\n- E2E tests should focus on business logic, not type system violations",
|
|
356
|
-
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
357
|
-
path: _path + ".think",
|
|
358
|
-
expected: "string",
|
|
359
|
-
value: input.think
|
|
360
|
-
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
361
|
-
path: _path + ".draft",
|
|
362
|
-
expected: "string",
|
|
363
|
-
value: input.draft
|
|
364
|
-
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
365
|
-
path: _path + ".revise",
|
|
366
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
367
|
-
value: input.revise
|
|
368
|
-
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
369
|
-
path: _path + ".revise",
|
|
370
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
371
|
-
value: input.revise
|
|
372
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
373
|
-
path: _path + ".review",
|
|
374
|
-
expected: "string",
|
|
375
|
-
value: input.review
|
|
376
|
-
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
377
|
-
path: _path + ".final",
|
|
378
|
-
expected: "(null | string)",
|
|
379
|
-
value: input.final
|
|
380
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
381
|
-
if (false === __is(input)) {
|
|
382
|
-
errors = [];
|
|
383
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
384
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
385
|
-
path: _path + "",
|
|
386
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
387
|
-
value: input
|
|
388
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
389
|
-
path: _path + "",
|
|
390
|
-
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
391
|
-
value: input
|
|
392
|
-
}))(input, "$input", true);
|
|
393
|
-
const success = 0 === errors.length;
|
|
394
|
-
return success ? {
|
|
395
|
-
success,
|
|
396
|
-
data: input
|
|
397
|
-
} : {
|
|
398
|
-
success,
|
|
399
|
-
errors,
|
|
487
|
+
return {
|
|
488
|
+
success: true,
|
|
400
489
|
data: input
|
|
401
490
|
};
|
|
402
|
-
}
|
|
403
|
-
return {
|
|
404
|
-
success: true,
|
|
405
|
-
data: input
|
|
406
|
-
};
|
|
407
|
-
}; })()
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
name: "reject",
|
|
411
|
-
parameters: {
|
|
412
|
-
type: "object",
|
|
413
|
-
properties: {},
|
|
414
|
-
additionalProperties: false,
|
|
415
|
-
required: [],
|
|
416
|
-
$defs: {}
|
|
491
|
+
}; })()
|
|
417
492
|
},
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
errors
|
|
493
|
+
{
|
|
494
|
+
name: "reject",
|
|
495
|
+
parameters: {
|
|
496
|
+
type: "object",
|
|
497
|
+
properties: {},
|
|
498
|
+
additionalProperties: false,
|
|
499
|
+
required: [],
|
|
500
|
+
$defs: {}
|
|
501
|
+
},
|
|
502
|
+
description: "Reject function when no invalid type API requests are detected.\n\nThis function is called when the compilation error is not related to\ninvalid API request types, indicating the agent should not intervene.\n\nCommon scenarios for rejection:\n\n- Syntax errors unrelated to type violations\n- Legitimate type mismatches that need fixing (not deletion)\n- Framework-specific compilation issues\n- Configuration or environment problems\n\nWhen called, this indicates that another specialized agent should handle\nthe compilation error, as it's outside this agent's domain.",
|
|
503
|
+
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
504
|
+
if (false === __is(input)) {
|
|
505
|
+
errors = [];
|
|
506
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
507
|
+
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
508
|
+
const success = 0 === errors.length;
|
|
509
|
+
return success ? {
|
|
510
|
+
success,
|
|
511
|
+
data: input
|
|
512
|
+
} : {
|
|
513
|
+
success,
|
|
514
|
+
errors,
|
|
515
|
+
data: input
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
return {
|
|
519
|
+
success: true,
|
|
431
520
|
data: input
|
|
432
521
|
};
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
522
|
+
}; })()
|
|
523
|
+
}
|
|
524
|
+
]
|
|
525
|
+
};
|
|
526
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
|
|
527
|
+
validate: {
|
|
528
|
+
rewrite: validate,
|
|
529
|
+
reject: () => ({
|
|
530
|
+
success: true,
|
|
531
|
+
data: undefined,
|
|
532
|
+
}),
|
|
533
|
+
},
|
|
534
|
+
}), { equals: false }));
|
|
535
|
+
return application;
|
|
536
|
+
})(),
|
|
442
537
|
};
|
|
443
538
|
//# sourceMappingURL=orchestrateTestCorrectInvalidRequest.js.map
|