@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.
Files changed (47) hide show
  1. package/lib/AutoBeAgent.js +2 -0
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/AutoBeMockAgent.js +1 -1
  4. package/lib/AutoBeMockAgent.js.map +1 -1
  5. package/lib/factory/consentFunctionCall.js +2 -0
  6. package/lib/factory/consentFunctionCall.js.map +1 -1
  7. package/lib/factory/createAutoBeContext.js +2 -0
  8. package/lib/factory/createAutoBeContext.js.map +1 -1
  9. package/lib/factory/supportMistral.d.ts +4 -0
  10. package/lib/factory/supportMistral.js +112 -0
  11. package/lib/factory/supportMistral.js.map +1 -0
  12. package/lib/index.mjs +1997 -1422
  13. package/lib/index.mjs.map +1 -1
  14. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +1 -0
  15. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +370 -275
  16. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  17. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
  18. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +370 -275
  19. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
  20. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +304 -221
  21. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  22. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +303 -220
  23. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  24. package/lib/orchestrate/test/orchestrateTestCorrect.js +17 -22
  25. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  26. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +372 -277
  27. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  28. package/lib/orchestrate/test/orchestrateTestWrite.js +322 -350
  29. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  30. package/lib/utils/validateEmptyCode.d.ts +8 -0
  31. package/lib/utils/validateEmptyCode.js +35 -0
  32. package/lib/utils/validateEmptyCode.js.map +1 -0
  33. package/package.json +5 -5
  34. package/src/AutoBeAgent.ts +2 -0
  35. package/src/AutoBeMockAgent.ts +1 -1
  36. package/src/factory/consentFunctionCall.ts +3 -0
  37. package/src/factory/createAutoBeContext.ts +2 -0
  38. package/src/factory/supportMistral.ts +122 -0
  39. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +52 -10
  40. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -1
  41. package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +58 -17
  42. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +51 -15
  43. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +46 -12
  44. package/src/orchestrate/test/orchestrateTestCorrect.ts +17 -24
  45. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +57 -10
  46. package/src/orchestrate/test/orchestrateTestWrite.ts +41 -10
  47. package/src/utils/validateEmptyCode.ts +41 -0
@@ -47,11 +47,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.orchestrateTestWrite = orchestrateTestWrite;
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 typia_1 = __importDefault(require("typia"));
51
52
  const NamingConvention_1 = require("typia/lib/utils/NamingConvention");
52
53
  const uuid_1 = require("uuid");
53
54
  const assertSchemaModel_1 = require("../../context/assertSchemaModel");
54
55
  const executeCachedBatch_1 = require("../../utils/executeCachedBatch");
56
+ const validateEmptyCode_1 = require("../../utils/validateEmptyCode");
55
57
  const completeTestCode_1 = require("./compile/completeTestCode");
56
58
  const getTestScenarioArtifacts_1 = require("./compile/getTestScenarioArtifacts");
57
59
  const transformTestWriteHistories_1 = require("./histories/transformTestWriteHistories");
@@ -107,6 +109,7 @@ function process(ctx, props) {
107
109
  }),
108
110
  controller: createController({
109
111
  model: ctx.model,
112
+ functionName: props.scenario.functionName,
110
113
  build: (next) => {
111
114
  next.domain = NamingConvention_1.NamingConvention.snake(next.domain);
112
115
  pointer.value = next;
@@ -142,7 +145,79 @@ function process(ctx, props) {
142
145
  }
143
146
  function createController(props) {
144
147
  (0, assertSchemaModel_1.assertSchemaModel)(props.model);
145
- const application = collection[props.model];
148
+ const validate = (input) => {
149
+ const result = (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "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.scenario || _report(_exceptionable, {
150
+ path: _path + ".scenario",
151
+ expected: "string",
152
+ value: input.scenario
153
+ }), "string" === typeof input.domain || _report(_exceptionable, {
154
+ path: _path + ".domain",
155
+ expected: "string",
156
+ value: input.domain
157
+ }), "string" === typeof input.draft || _report(_exceptionable, {
158
+ path: _path + ".draft",
159
+ expected: "string",
160
+ value: input.draft
161
+ }), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
162
+ path: _path + ".revise",
163
+ expected: "IAutoBeTestWriteApplication.IReviseProps",
164
+ value: input.revise
165
+ })) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
166
+ path: _path + ".revise",
167
+ expected: "IAutoBeTestWriteApplication.IReviseProps",
168
+ value: input.revise
169
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
170
+ path: _path + ".review",
171
+ expected: "string",
172
+ value: input.review
173
+ }), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
174
+ path: _path + ".final",
175
+ expected: "(null | string)",
176
+ value: input.final
177
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
178
+ if (false === __is(input)) {
179
+ errors = [];
180
+ _report = __typia_transform__validateReport._validateReport(errors);
181
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
182
+ path: _path + "",
183
+ expected: "IAutoBeTestWriteApplication.IProps",
184
+ value: input
185
+ })) && _vo0(input, _path + "", true) || _report(true, {
186
+ path: _path + "",
187
+ expected: "IAutoBeTestWriteApplication.IProps",
188
+ value: input
189
+ }))(input, "$input", true);
190
+ const success = 0 === errors.length;
191
+ return success ? {
192
+ success,
193
+ data: input
194
+ } : {
195
+ success,
196
+ errors,
197
+ data: input
198
+ };
199
+ }
200
+ return {
201
+ success: true,
202
+ data: input
203
+ };
204
+ }; })()(input);
205
+ if (result.success === false)
206
+ return result;
207
+ const errors = (0, validateEmptyCode_1.validateEmptyCode)({
208
+ functionName: props.functionName,
209
+ draft: result.data.draft,
210
+ revise: result.data.revise,
211
+ });
212
+ return errors.length
213
+ ? {
214
+ success: false,
215
+ errors,
216
+ data: result.data,
217
+ }
218
+ : result;
219
+ };
220
+ const application = collection[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
146
221
  return {
147
222
  protocol: "class",
148
223
  name: "Create Test Code",
@@ -154,373 +229,270 @@ function createController(props) {
154
229
  },
155
230
  };
156
231
  }
157
- const claude = {
158
- model: "claude",
159
- options: {
160
- reference: true,
161
- separate: null
162
- },
163
- functions: [
164
- {
165
- name: "write",
166
- parameters: {
167
- description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}",
168
- type: "object",
169
- properties: {
170
- scenario: {
171
- description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario \u2192 Strategic analysis \u2192 Detailed test plan",
172
- type: "string"
173
- },
174
- domain: {
175
- description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis \u2192 Domain identification \u2192 Test organization\nstructure",
176
- type: "string"
177
- },
178
- draft: {
179
- description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow",
180
- type: "string"
181
- },
182
- revise: {
183
- description: "Steps 4-5: Code review and final refinement process.\n\nContains the iterative improvement workflow that transforms the initial\ndraft into production-ready test code. The review phase identifies issues\nto fix or code to delete, followed by the final phase that produces the\npolished, production-ready test implementation.\n\nWorkflow: Draft \u2192 Review analysis \u2192 Final implementation",
184
- $ref: "#/$defs/IAutoBeTestWriteApplication.IReviseProps"
185
- }
186
- },
187
- required: [
188
- "scenario",
189
- "domain",
190
- "draft",
191
- "revise"
192
- ],
193
- additionalProperties: false,
194
- $defs: {
195
- "IAutoBeTestWriteApplication.IReviseProps": {
232
+ const collection = {
233
+ chatgpt: (validate) => (() => {
234
+ const application = {
235
+ model: "chatgpt",
236
+ options: {
237
+ reference: true,
238
+ strict: false,
239
+ separate: null
240
+ },
241
+ functions: [
242
+ {
243
+ name: "write",
244
+ parameters: {
245
+ description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Steps 4-5: Code review and final refinement process.\n> \n> Contains the iterative improvement workflow that transforms the initial\n> draft into production-ready test code. The review phase identifies issues\n> to fix or code to delete, followed by the final phase that produces the\n> polished, production-ready test implementation.\n> \n> Workflow: Draft \u2192 Review analysis \u2192 Final implementation",
196
246
  type: "object",
197
247
  properties: {
198
- review: {
199
- description: "Step 4: Code review and quality assessment.\n\n**\uD83D\uDEA8 TWO TYPES OF REVISIONS: FIX AND DELETE \uD83D\uDEA8**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
248
+ scenario: {
249
+ description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario \u2192 Strategic analysis \u2192 Detailed test plan",
200
250
  type: "string"
201
251
  },
202
- final: {
203
- description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**\uD83D\uDEA8 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW \uD83D\uDEA8**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback \u2192 Apply FIXES \u2192 Apply DELETIONS \u2192\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
204
- oneOf: [
205
- {
206
- type: "null"
207
- },
208
- {
252
+ domain: {
253
+ description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis \u2192 Domain identification \u2192 Test organization\nstructure",
254
+ type: "string"
255
+ },
256
+ draft: {
257
+ description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow",
258
+ type: "string"
259
+ },
260
+ revise: {
261
+ $ref: "#/$defs/IAutoBeTestWriteApplication.IReviseProps"
262
+ }
263
+ },
264
+ required: [
265
+ "scenario",
266
+ "domain",
267
+ "draft",
268
+ "revise"
269
+ ],
270
+ additionalProperties: false,
271
+ $defs: {
272
+ "IAutoBeTestWriteApplication.IReviseProps": {
273
+ type: "object",
274
+ properties: {
275
+ review: {
276
+ description: "Step 4: Code review and quality assessment.\n\n**\uD83D\uDEA8 TWO TYPES OF REVISIONS: FIX AND DELETE \uD83D\uDEA8**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
209
277
  type: "string"
278
+ },
279
+ final: {
280
+ description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**\uD83D\uDEA8 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW \uD83D\uDEA8**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback \u2192 Apply FIXES \u2192 Apply DELETIONS \u2192\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
281
+ anyOf: [
282
+ {
283
+ type: "null"
284
+ },
285
+ {
286
+ type: "string"
287
+ }
288
+ ]
210
289
  }
290
+ },
291
+ required: [
292
+ "review",
293
+ "final"
211
294
  ]
212
295
  }
213
- },
214
- required: [
215
- "review",
216
- "final"
217
- ]
218
- }
219
- }
220
- },
221
- description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis \u2192 draft implementation \u2192 code review \u2192 final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
222
- validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "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.scenario || _report(_exceptionable, {
223
- path: _path + ".scenario",
224
- expected: "string",
225
- value: input.scenario
226
- }), "string" === typeof input.domain || _report(_exceptionable, {
227
- path: _path + ".domain",
228
- expected: "string",
229
- value: input.domain
230
- }), "string" === typeof input.draft || _report(_exceptionable, {
231
- path: _path + ".draft",
232
- expected: "string",
233
- value: input.draft
234
- }), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
235
- path: _path + ".revise",
236
- expected: "IAutoBeTestWriteApplication.IReviseProps",
237
- value: input.revise
238
- })) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
239
- path: _path + ".revise",
240
- expected: "IAutoBeTestWriteApplication.IReviseProps",
241
- value: input.revise
242
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
243
- path: _path + ".review",
244
- expected: "string",
245
- value: input.review
246
- }), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
247
- path: _path + ".final",
248
- expected: "(null | string)",
249
- value: input.final
250
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
251
- if (false === __is(input)) {
252
- errors = [];
253
- _report = __typia_transform__validateReport._validateReport(errors);
254
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
255
- path: _path + "",
256
- expected: "IAutoBeTestWriteApplication.IProps",
257
- value: input
258
- })) && _vo0(input, _path + "", true) || _report(true, {
259
- path: _path + "",
260
- expected: "IAutoBeTestWriteApplication.IProps",
261
- value: input
262
- }))(input, "$input", true);
263
- const success = 0 === errors.length;
264
- return success ? {
265
- success,
266
- data: input
267
- } : {
268
- success,
269
- errors,
270
- data: input
271
- };
272
- }
273
- return {
274
- success: true,
275
- data: input
276
- };
277
- }; })()
278
- }
279
- ]
280
- };
281
- const collection = {
282
- chatgpt: {
283
- model: "chatgpt",
284
- options: {
285
- reference: true,
286
- strict: false,
287
- separate: null
288
- },
289
- functions: [
290
- {
291
- name: "write",
292
- parameters: {
293
- description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Steps 4-5: Code review and final refinement process.\n> \n> Contains the iterative improvement workflow that transforms the initial\n> draft into production-ready test code. The review phase identifies issues\n> to fix or code to delete, followed by the final phase that produces the\n> polished, production-ready test implementation.\n> \n> Workflow: Draft \u2192 Review analysis \u2192 Final implementation",
294
- type: "object",
295
- properties: {
296
- scenario: {
297
- description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario \u2192 Strategic analysis \u2192 Detailed test plan",
298
- type: "string"
299
- },
300
- domain: {
301
- description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis \u2192 Domain identification \u2192 Test organization\nstructure",
302
- type: "string"
303
- },
304
- draft: {
305
- description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow",
306
- type: "string"
307
- },
308
- revise: {
309
- $ref: "#/$defs/IAutoBeTestWriteApplication.IReviseProps"
310
296
  }
311
297
  },
312
- required: [
313
- "scenario",
314
- "domain",
315
- "draft",
316
- "revise"
317
- ],
318
- additionalProperties: false,
319
- $defs: {
320
- "IAutoBeTestWriteApplication.IReviseProps": {
321
- type: "object",
322
- properties: {
323
- review: {
324
- description: "Step 4: Code review and quality assessment.\n\n**\uD83D\uDEA8 TWO TYPES OF REVISIONS: FIX AND DELETE \uD83D\uDEA8**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
325
- type: "string"
326
- },
327
- final: {
328
- description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**\uD83D\uDEA8 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW \uD83D\uDEA8**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback \u2192 Apply FIXES \u2192 Apply DELETIONS \u2192\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
329
- anyOf: [
330
- {
331
- type: "null"
332
- },
333
- {
334
- type: "string"
335
- }
336
- ]
337
- }
338
- },
339
- required: [
340
- "review",
341
- "final"
342
- ]
298
+ description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis \u2192 draft implementation \u2192 code review \u2192 final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
299
+ validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "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.scenario || _report(_exceptionable, {
300
+ path: _path + ".scenario",
301
+ expected: "string",
302
+ value: input.scenario
303
+ }), "string" === typeof input.domain || _report(_exceptionable, {
304
+ path: _path + ".domain",
305
+ expected: "string",
306
+ value: input.domain
307
+ }), "string" === typeof input.draft || _report(_exceptionable, {
308
+ path: _path + ".draft",
309
+ expected: "string",
310
+ value: input.draft
311
+ }), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
312
+ path: _path + ".revise",
313
+ expected: "IAutoBeTestWriteApplication.IReviseProps",
314
+ value: input.revise
315
+ })) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
316
+ path: _path + ".revise",
317
+ expected: "IAutoBeTestWriteApplication.IReviseProps",
318
+ value: input.revise
319
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
320
+ path: _path + ".review",
321
+ expected: "string",
322
+ value: input.review
323
+ }), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
324
+ path: _path + ".final",
325
+ expected: "(null | string)",
326
+ value: input.final
327
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
328
+ if (false === __is(input)) {
329
+ errors = [];
330
+ _report = __typia_transform__validateReport._validateReport(errors);
331
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
332
+ path: _path + "",
333
+ expected: "IAutoBeTestWriteApplication.IProps",
334
+ value: input
335
+ })) && _vo0(input, _path + "", true) || _report(true, {
336
+ path: _path + "",
337
+ expected: "IAutoBeTestWriteApplication.IProps",
338
+ value: input
339
+ }))(input, "$input", true);
340
+ const success = 0 === errors.length;
341
+ return success ? {
342
+ success,
343
+ data: input
344
+ } : {
345
+ success,
346
+ errors,
347
+ data: input
348
+ };
343
349
  }
344
- }
345
- },
346
- description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis \u2192 draft implementation \u2192 code review \u2192 final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
347
- validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "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.scenario || _report(_exceptionable, {
348
- path: _path + ".scenario",
349
- expected: "string",
350
- value: input.scenario
351
- }), "string" === typeof input.domain || _report(_exceptionable, {
352
- path: _path + ".domain",
353
- expected: "string",
354
- value: input.domain
355
- }), "string" === typeof input.draft || _report(_exceptionable, {
356
- path: _path + ".draft",
357
- expected: "string",
358
- value: input.draft
359
- }), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
360
- path: _path + ".revise",
361
- expected: "IAutoBeTestWriteApplication.IReviseProps",
362
- value: input.revise
363
- })) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
364
- path: _path + ".revise",
365
- expected: "IAutoBeTestWriteApplication.IReviseProps",
366
- value: input.revise
367
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
368
- path: _path + ".review",
369
- expected: "string",
370
- value: input.review
371
- }), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
372
- path: _path + ".final",
373
- expected: "(null | string)",
374
- value: input.final
375
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
376
- if (false === __is(input)) {
377
- errors = [];
378
- _report = __typia_transform__validateReport._validateReport(errors);
379
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
380
- path: _path + "",
381
- expected: "IAutoBeTestWriteApplication.IProps",
382
- value: input
383
- })) && _vo0(input, _path + "", true) || _report(true, {
384
- path: _path + "",
385
- expected: "IAutoBeTestWriteApplication.IProps",
386
- value: input
387
- }))(input, "$input", true);
388
- const success = 0 === errors.length;
389
- return success ? {
390
- success,
391
- data: input
392
- } : {
393
- success,
394
- errors,
350
+ return {
351
+ success: true,
395
352
  data: input
396
353
  };
397
- }
398
- return {
399
- success: true,
400
- data: input
401
- };
402
- }; })()
403
- }
404
- ]
405
- },
406
- claude,
407
- llama: claude,
408
- deepseek: claude,
409
- "3.1": claude,
410
- "3.0": {
411
- model: "3.0",
412
- options: {
413
- recursive: 3,
414
- constraint: true,
415
- separate: null
416
- },
417
- functions: [
418
- {
419
- name: "write",
420
- parameters: {
421
- type: "object",
422
- properties: {
423
- scenario: {
424
- type: "string",
425
- description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario \u2192 Strategic analysis \u2192 Detailed test plan"
426
- },
427
- domain: {
428
- type: "string",
429
- description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis \u2192 Domain identification \u2192 Test organization\nstructure"
430
- },
431
- draft: {
432
- type: "string",
433
- description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow"
354
+ }; })()
355
+ }
356
+ ]
357
+ };
358
+ __typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
359
+ validate: {
360
+ write: validate,
361
+ },
362
+ }), { equals: false }));
363
+ return application;
364
+ })(),
365
+ claude: (validate) => (() => {
366
+ const application = {
367
+ model: "claude",
368
+ options: {
369
+ reference: true,
370
+ separate: null
371
+ },
372
+ functions: [
373
+ {
374
+ name: "write",
375
+ parameters: {
376
+ description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}",
377
+ type: "object",
378
+ properties: {
379
+ scenario: {
380
+ description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario \u2192 Strategic analysis \u2192 Detailed test plan",
381
+ type: "string"
382
+ },
383
+ domain: {
384
+ description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis \u2192 Domain identification \u2192 Test organization\nstructure",
385
+ type: "string"
386
+ },
387
+ draft: {
388
+ description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow",
389
+ type: "string"
390
+ },
391
+ revise: {
392
+ description: "Steps 4-5: Code review and final refinement process.\n\nContains the iterative improvement workflow that transforms the initial\ndraft into production-ready test code. The review phase identifies issues\nto fix or code to delete, followed by the final phase that produces the\npolished, production-ready test implementation.\n\nWorkflow: Draft \u2192 Review analysis \u2192 Final implementation",
393
+ $ref: "#/$defs/IAutoBeTestWriteApplication.IReviseProps"
394
+ }
434
395
  },
435
- revise: {
436
- type: "object",
437
- properties: {
438
- review: {
439
- type: "string",
440
- description: "Step 4: Code review and quality assessment.\n\n**\uD83D\uDEA8 TWO TYPES OF REVISIONS: FIX AND DELETE \uD83D\uDEA8**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-"
396
+ required: [
397
+ "scenario",
398
+ "domain",
399
+ "draft",
400
+ "revise"
401
+ ],
402
+ additionalProperties: false,
403
+ $defs: {
404
+ "IAutoBeTestWriteApplication.IReviseProps": {
405
+ type: "object",
406
+ properties: {
407
+ review: {
408
+ description: "Step 4: Code review and quality assessment.\n\n**\uD83D\uDEA8 TWO TYPES OF REVISIONS: FIX AND DELETE \uD83D\uDEA8**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
409
+ type: "string"
410
+ },
411
+ final: {
412
+ description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**\uD83D\uDEA8 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW \uD83D\uDEA8**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback \u2192 Apply FIXES \u2192 Apply DELETIONS \u2192\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
413
+ oneOf: [
414
+ {
415
+ type: "null"
416
+ },
417
+ {
418
+ type: "string"
419
+ }
420
+ ]
421
+ }
441
422
  },
442
- final: {
443
- type: "string",
444
- nullable: true,
445
- description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**\uD83D\uDEA8 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW \uD83D\uDEA8**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback \u2192 Apply FIXES \u2192 Apply DELETIONS \u2192\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is."
446
- }
447
- },
448
- required: [
449
- "review",
450
- "final"
451
- ],
452
- description: "Steps 4-5: Code review and final refinement process.\n\nContains the iterative improvement workflow that transforms the initial\ndraft into production-ready test code. The review phase identifies issues\nto fix or code to delete, followed by the final phase that produces the\npolished, production-ready test implementation.\n\nWorkflow: Draft \u2192 Review analysis \u2192 Final implementation\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IReviseProps}",
453
- additionalProperties: false
423
+ required: [
424
+ "review",
425
+ "final"
426
+ ]
427
+ }
454
428
  }
455
429
  },
456
- required: [
457
- "scenario",
458
- "domain",
459
- "draft",
460
- "revise"
461
- ],
462
- description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}",
463
- additionalProperties: false
464
- },
465
- description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis \u2192 draft implementation \u2192 code review \u2192 final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
466
- validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "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.scenario || _report(_exceptionable, {
467
- path: _path + ".scenario",
468
- expected: "string",
469
- value: input.scenario
470
- }), "string" === typeof input.domain || _report(_exceptionable, {
471
- path: _path + ".domain",
472
- expected: "string",
473
- value: input.domain
474
- }), "string" === typeof input.draft || _report(_exceptionable, {
475
- path: _path + ".draft",
476
- expected: "string",
477
- value: input.draft
478
- }), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
479
- path: _path + ".revise",
480
- expected: "IAutoBeTestWriteApplication.IReviseProps",
481
- value: input.revise
482
- })) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
483
- path: _path + ".revise",
484
- expected: "IAutoBeTestWriteApplication.IReviseProps",
485
- value: input.revise
486
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
487
- path: _path + ".review",
488
- expected: "string",
489
- value: input.review
490
- }), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
491
- path: _path + ".final",
492
- expected: "(null | string)",
493
- value: input.final
494
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
495
- if (false === __is(input)) {
496
- errors = [];
497
- _report = __typia_transform__validateReport._validateReport(errors);
498
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
499
- path: _path + "",
500
- expected: "IAutoBeTestWriteApplication.IProps",
501
- value: input
502
- })) && _vo0(input, _path + "", true) || _report(true, {
503
- path: _path + "",
504
- expected: "IAutoBeTestWriteApplication.IProps",
505
- value: input
506
- }))(input, "$input", true);
507
- const success = 0 === errors.length;
508
- return success ? {
509
- success,
510
- data: input
511
- } : {
512
- success,
513
- errors,
430
+ description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis \u2192 draft implementation \u2192 code review \u2192 final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
431
+ validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "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.scenario || _report(_exceptionable, {
432
+ path: _path + ".scenario",
433
+ expected: "string",
434
+ value: input.scenario
435
+ }), "string" === typeof input.domain || _report(_exceptionable, {
436
+ path: _path + ".domain",
437
+ expected: "string",
438
+ value: input.domain
439
+ }), "string" === typeof input.draft || _report(_exceptionable, {
440
+ path: _path + ".draft",
441
+ expected: "string",
442
+ value: input.draft
443
+ }), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
444
+ path: _path + ".revise",
445
+ expected: "IAutoBeTestWriteApplication.IReviseProps",
446
+ value: input.revise
447
+ })) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
448
+ path: _path + ".revise",
449
+ expected: "IAutoBeTestWriteApplication.IReviseProps",
450
+ value: input.revise
451
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
452
+ path: _path + ".review",
453
+ expected: "string",
454
+ value: input.review
455
+ }), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
456
+ path: _path + ".final",
457
+ expected: "(null | string)",
458
+ value: input.final
459
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
460
+ if (false === __is(input)) {
461
+ errors = [];
462
+ _report = __typia_transform__validateReport._validateReport(errors);
463
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
464
+ path: _path + "",
465
+ expected: "IAutoBeTestWriteApplication.IProps",
466
+ value: input
467
+ })) && _vo0(input, _path + "", true) || _report(true, {
468
+ path: _path + "",
469
+ expected: "IAutoBeTestWriteApplication.IProps",
470
+ value: input
471
+ }))(input, "$input", true);
472
+ const success = 0 === errors.length;
473
+ return success ? {
474
+ success,
475
+ data: input
476
+ } : {
477
+ success,
478
+ errors,
479
+ data: input
480
+ };
481
+ }
482
+ return {
483
+ success: true,
514
484
  data: input
515
485
  };
516
- }
517
- return {
518
- success: true,
519
- data: input
520
- };
521
- }; })()
522
- }
523
- ]
524
- },
486
+ }; })()
487
+ }
488
+ ]
489
+ };
490
+ __typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
491
+ validate: {
492
+ write: validate,
493
+ },
494
+ }), { equals: false }));
495
+ return application;
496
+ })(),
525
497
  };
526
498
  //# sourceMappingURL=orchestrateTestWrite.js.map