@autobe/agent 0.9.1 → 0.10.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.
Files changed (185) hide show
  1. package/lib/AutoBeAgent.js +16 -5
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/constants/AutoBeSystemPromptConstant.d.ts +6 -4
  4. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  5. package/lib/context/AutoBeTokenUsage.d.ts +15 -1
  6. package/lib/context/AutoBeTokenUsage.js +56 -1
  7. package/lib/context/AutoBeTokenUsage.js.map +1 -1
  8. package/lib/context/IAutoBeApplicationProps.d.ts +0 -61
  9. package/lib/factory/createAutoBeApplication.js +298 -773
  10. package/lib/factory/createAutoBeApplication.js.map +1 -1
  11. package/lib/index.mjs +5116 -7271
  12. package/lib/index.mjs.map +1 -1
  13. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +82 -319
  14. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
  15. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +0 -1
  16. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -1
  17. package/lib/orchestrate/analyze/orchestrateAnalyze.js +97 -294
  18. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  19. package/lib/orchestrate/facade/transformFacadeStateMessage.js +2 -2
  20. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  21. package/lib/orchestrate/index.d.ts +2 -2
  22. package/lib/orchestrate/index.js +4 -4
  23. package/lib/orchestrate/index.js.map +1 -1
  24. package/lib/orchestrate/interface/orchestrateInterface.js +9 -3
  25. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  26. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +56 -142
  27. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  28. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +195 -199
  29. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
  30. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +75 -172
  31. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  32. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +772 -1097
  33. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  34. package/lib/orchestrate/interface/transformInterfaceHistories.js +2 -0
  35. package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
  36. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +64 -175
  37. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  38. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +552 -1073
  39. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  40. package/lib/orchestrate/prisma/orchestratePrismaSchema.js +571 -1119
  41. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
  42. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +9 -0
  43. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
  44. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +8 -0
  45. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
  46. package/lib/orchestrate/realize/orchestrateRealize.d.ts +11 -0
  47. package/lib/orchestrate/realize/orchestrateRealize.js +109 -0
  48. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -0
  49. package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +25 -0
  50. package/lib/orchestrate/realize/orchestrateRealizeCoder.js +337 -0
  51. package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -0
  52. package/lib/orchestrate/realize/orchestrateRealizeIntegrator.d.ts +52 -0
  53. package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js +57 -0
  54. package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js.map +1 -0
  55. package/lib/orchestrate/realize/orchestrateRealizePlanner.d.ts +80 -0
  56. package/lib/orchestrate/realize/orchestrateRealizePlanner.js +53 -0
  57. package/lib/orchestrate/realize/orchestrateRealizePlanner.js.map +1 -0
  58. package/lib/orchestrate/realize/orchestrateRealizeValidator.d.ts +46 -0
  59. package/lib/orchestrate/realize/orchestrateRealizeValidator.js +37 -0
  60. package/lib/orchestrate/realize/orchestrateRealizeValidator.js.map +1 -0
  61. package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +33 -0
  62. package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js +3 -0
  63. package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +1 -0
  64. package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +5 -0
  65. package/lib/orchestrate/realize/transformRealizeCoderHistories.js +127 -0
  66. package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -0
  67. package/lib/orchestrate/test/compile/completeTestCode.d.ts +2 -0
  68. package/lib/orchestrate/test/compile/completeTestCode.js +21 -0
  69. package/lib/orchestrate/test/compile/completeTestCode.js.map +1 -0
  70. package/lib/orchestrate/test/{filterTestFileName.js → compile/filterTestFileName.js} +1 -1
  71. package/lib/orchestrate/test/compile/filterTestFileName.js.map +1 -0
  72. package/lib/orchestrate/test/compile/getTestExternalDeclarations.d.ts +3 -0
  73. package/lib/orchestrate/test/compile/getTestExternalDeclarations.js +27 -0
  74. package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -0
  75. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +5 -0
  76. package/lib/orchestrate/test/{compileTestScenario.js → compile/getTestScenarioArtifacts.js} +11 -5
  77. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -0
  78. package/lib/orchestrate/test/orchestrateTest.js +14 -9
  79. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  80. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +3 -2
  81. package/lib/orchestrate/test/orchestrateTestCorrect.js +150 -349
  82. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  83. package/lib/orchestrate/test/orchestrateTestScenario.js +323 -566
  84. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  85. package/lib/orchestrate/test/orchestrateTestWrite.d.ts +3 -2
  86. package/lib/orchestrate/test/orchestrateTestWrite.js +139 -76
  87. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  88. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +121 -0
  89. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js +3 -0
  90. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +1 -0
  91. package/lib/orchestrate/test/structures/IAutoBeTestFunction.d.ts +8 -0
  92. package/lib/{utils/types/BackoffOptions.js → orchestrate/test/structures/IAutoBeTestFunction.js} +1 -1
  93. package/lib/orchestrate/test/structures/IAutoBeTestFunction.js.map +1 -0
  94. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +32 -22
  95. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +2 -0
  96. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +112 -0
  97. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js +3 -0
  98. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +1 -0
  99. package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.d.ts +7 -0
  100. package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js +3 -0
  101. package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +1 -0
  102. package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +3 -2
  103. package/lib/orchestrate/test/transformTestCorrectHistories.js +28 -41
  104. package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
  105. package/lib/orchestrate/test/transformTestWriteHistories.d.ts +5 -4
  106. package/lib/orchestrate/test/transformTestWriteHistories.js +169 -32
  107. package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
  108. package/lib/structures/IAutoBeConfig.d.ts +11 -0
  109. package/lib/structures/IAutoBeProps.d.ts +12 -1
  110. package/lib/utils/backoffRetry.d.ts +4 -7
  111. package/lib/utils/backoffRetry.js +19 -37
  112. package/lib/utils/backoffRetry.js.map +1 -1
  113. package/lib/utils/forceRetry.d.ts +1 -0
  114. package/lib/{orchestrate/orchestrateRealize.js → utils/forceRetry.js} +15 -8
  115. package/lib/utils/forceRetry.js.map +1 -0
  116. package/package.json +8 -8
  117. package/src/AutoBeAgent.ts +26 -4
  118. package/src/constants/AutoBeSystemPromptConstant.ts +6 -4
  119. package/src/context/AutoBeTokenUsage.ts +85 -1
  120. package/src/context/IAutoBeApplicationProps.ts +0 -62
  121. package/src/factory/createAutoBeApplication.ts +2 -3
  122. package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +8 -3
  123. package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +0 -1
  124. package/src/orchestrate/analyze/orchestrateAnalyze.ts +8 -37
  125. package/src/orchestrate/facade/transformFacadeStateMessage.ts +2 -1
  126. package/src/orchestrate/index.ts +2 -2
  127. package/src/orchestrate/interface/orchestrateInterface.ts +7 -0
  128. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +4 -3
  129. package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +26 -23
  130. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +6 -4
  131. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +14 -11
  132. package/src/orchestrate/interface/transformInterfaceHistories.ts +2 -0
  133. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +10 -5
  134. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +11 -5
  135. package/src/orchestrate/prisma/orchestratePrismaSchema.ts +16 -8
  136. package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +9 -0
  137. package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +8 -0
  138. package/src/orchestrate/realize/orchestrateRealize.ts +169 -0
  139. package/src/orchestrate/realize/orchestrateRealizeCoder.ts +156 -0
  140. package/src/orchestrate/realize/orchestrateRealizeIntegrator.ts +75 -0
  141. package/src/orchestrate/realize/orchestrateRealizePlanner.ts +115 -0
  142. package/src/orchestrate/realize/orchestrateRealizeValidator.ts +64 -0
  143. package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +36 -0
  144. package/src/orchestrate/realize/transformRealizeCoderHistories.ts +136 -0
  145. package/src/orchestrate/test/compile/completeTestCode.ts +35 -0
  146. package/src/orchestrate/test/{filterTestFileName.ts → compile/filterTestFileName.ts} +1 -1
  147. package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +24 -0
  148. package/src/orchestrate/test/{compileTestScenario.ts → compile/getTestScenarioArtifacts.ts} +17 -8
  149. package/src/orchestrate/test/experimental/orchestrateTestCorrect.ast +240 -0
  150. package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +316 -0
  151. package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +52 -0
  152. package/src/orchestrate/test/orchestrateTest.ts +38 -16
  153. package/src/orchestrate/test/orchestrateTestCorrect.ts +111 -338
  154. package/src/orchestrate/test/orchestrateTestScenario.ts +114 -69
  155. package/src/orchestrate/test/orchestrateTestWrite.ts +55 -153
  156. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +126 -0
  157. package/src/orchestrate/test/structures/IAutoBeTestFunction.ts +10 -0
  158. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +32 -22
  159. package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +3 -0
  160. package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +117 -0
  161. package/src/orchestrate/test/structures/IAutoBeTestWriteResult.ts +9 -0
  162. package/src/orchestrate/test/transformTestCorrectHistories.ts +38 -43
  163. package/src/orchestrate/test/transformTestWriteHistories.ts +89 -35
  164. package/src/structures/IAutoBeConfig.ts +9 -0
  165. package/src/structures/IAutoBeProps.ts +17 -1
  166. package/src/utils/backoffRetry.ts +25 -36
  167. package/src/utils/forceRetry.ts +13 -0
  168. package/lib/factory/invertOpenApiDocument.d.ts +0 -3
  169. package/lib/factory/invertOpenApiDocument.js +0 -51
  170. package/lib/factory/invertOpenApiDocument.js.map +0 -1
  171. package/lib/orchestrate/orchestrateRealize.d.ts +0 -5
  172. package/lib/orchestrate/orchestrateRealize.js.map +0 -1
  173. package/lib/orchestrate/test/compileTestScenario.d.ts +0 -5
  174. package/lib/orchestrate/test/compileTestScenario.js.map +0 -1
  175. package/lib/orchestrate/test/filterTestFileName.js.map +0 -1
  176. package/lib/utils/StringUtil.d.ts +0 -4
  177. package/lib/utils/StringUtil.js +0 -43
  178. package/lib/utils/StringUtil.js.map +0 -1
  179. package/lib/utils/types/BackoffOptions.d.ts +0 -12
  180. package/lib/utils/types/BackoffOptions.js.map +0 -1
  181. package/src/factory/invertOpenApiDocument.ts +0 -63
  182. package/src/orchestrate/orchestrateRealize.ts +0 -18
  183. package/src/utils/StringUtil.ts +0 -45
  184. package/src/utils/types/BackoffOptions.ts +0 -15
  185. /package/lib/orchestrate/test/{filterTestFileName.d.ts → compile/filterTestFileName.d.ts} +0 -0
@@ -45,233 +45,96 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.orchestrateTestCorrect = orchestrateTestCorrect;
48
+ exports.orchestrateTestCorrect = void 0;
49
49
  const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
50
50
  const core_1 = require("@agentica/core");
51
51
  const typia_1 = __importDefault(require("typia"));
52
52
  const assertSchemaModel_1 = require("../../context/assertSchemaModel");
53
- const backoffRetry_1 = require("../../utils/backoffRetry");
54
53
  const enforceToolCall_1 = require("../../utils/enforceToolCall");
55
- const compileTestScenario_1 = require("./compileTestScenario");
56
- const filterTestFileName_1 = require("./filterTestFileName");
54
+ const forceRetry_1 = require("../../utils/forceRetry");
55
+ const completeTestCode_1 = require("./compile/completeTestCode");
57
56
  const transformTestCorrectHistories_1 = require("./transformTestCorrectHistories");
58
- function orchestrateTestCorrect(ctx_1, codes_1, scenarios_1) {
59
- return __awaiter(this, arguments, void 0, function* (ctx, codes, scenarios, life = 4) {
60
- var _a, _b;
61
- const files = codes.map(({ filename, content }, index) => {
62
- const scenario = scenarios[index];
63
- return { location: filename, content, scenario };
64
- });
65
- // 1) Build map of new test files from progress events
66
- const testFiles = Object.fromEntries(codes.map((c) => [c.filename, c.content]));
67
- // 2) Keep only files outside the test directory from current state
68
- const retainedFiles = Object.fromEntries(Object.entries((_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : {}).filter(([key]) => (0, filterTestFileName_1.filterTestFileName)(key)));
69
- // 3) Merge and filter: keep .ts/.json, drop anything under "benchmark"
70
- const external = (location) => __awaiter(this, void 0, void 0, function* () {
71
- const content = yield ctx.compiler.typescript.getExternal(location);
72
- if (content === undefined)
73
- throw new Error(`File not found: ${location}`);
74
- return { [location]: content };
57
+ const orchestrateTestCorrect = (ctx_1, writeResult_1, ...args_1) => __awaiter(void 0, [ctx_1, writeResult_1, ...args_1], void 0, function* (ctx, writeResult, life = 4) {
58
+ return Promise.all(writeResult.map((w) => (0, forceRetry_1.forceRetry)(() => __awaiter(void 0, void 0, void 0, function* () {
59
+ const event = yield compile(ctx, {
60
+ artifacts: w.artifacts,
61
+ scenario: w.scenario,
62
+ location: w.event.location,
63
+ script: w.event.final,
75
64
  });
76
- const mergedFiles = Object.assign(Object.assign(Object.assign(Object.assign({}, retainedFiles), testFiles), (yield external("node_modules/@nestia/e2e/lib/TestValidator.d.ts"))), (yield external("node_modules/@nestia/fetcher/lib/IConnection.d.ts")));
77
- // 4) Ask the LLM to correct the filtered file set
78
- const response = yield step(ctx, mergedFiles, files, life);
79
- // 5) Combine original + corrected files and dispatch event
80
- const event = Object.assign(Object.assign({}, response), { type: "testValidate", files: [
81
- ...Object.entries(mergedFiles).map(([filename, content]) => {
82
- return {
83
- location: filename,
84
- content,
85
- };
86
- }),
87
- ...response.files,
88
- ] });
89
- return event;
65
+ return predicate(ctx, {
66
+ artifacts: w.artifacts,
67
+ scenario: w.scenario,
68
+ location: w.event.location,
69
+ script: w.event.final,
70
+ }, event, life);
71
+ }))));
72
+ });
73
+ exports.orchestrateTestCorrect = orchestrateTestCorrect;
74
+ const compile = (ctx, func) => __awaiter(void 0, void 0, void 0, function* () {
75
+ var _a, _b;
76
+ const compiled = yield ctx.compiler.test.compile({
77
+ files: Object.assign(Object.assign(Object.assign({}, func.artifacts.dto), func.artifacts.sdk), { [func.location]: func.script }),
90
78
  });
91
- }
92
- /**
93
- * Modifies test code for each file and checks for compilation errors. When
94
- * compilation errors occur, it uses LLM to fix the code and attempts
95
- * recompilation. This process repeats up to the maximum retry count until
96
- * compilation succeeds.
97
- *
98
- * The function is a critical part of the test generation pipeline that ensures
99
- * all generated test files are syntactically correct and compilable.
100
- *
101
- * @param ctx AutoBe context object
102
- * @param entireFiles Map of all files to compile (filename: content)
103
- * @param testFiles Map of files to compile (filename: content)
104
- * @param life Number of remaining retry attempts
105
- * @returns Event object containing successful compilation result and modified
106
- * files
107
- */
108
- function step(ctx, entireFiles, testFiles, life) {
109
- return __awaiter(this, void 0, void 0, function* () {
110
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
111
- // COMPILE TEST CODE
112
- const result = yield ctx.compiler.typescript.compile({
113
- files: entireFiles,
114
- });
115
- if (result.type === "success") {
116
- // SUCCESS
117
- return {
118
- type: "testValidate",
119
- created_at: new Date().toISOString(),
120
- files: testFiles,
121
- result,
122
- step: (_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
123
- };
124
- }
125
- // EXCEPTION ERROR
126
- if (result.type === "exception") {
127
- ctx.dispatch({
128
- type: "testValidate",
129
- created_at: new Date().toISOString(),
130
- files: testFiles,
131
- result,
132
- step: (_d = (_c = ctx.state().interface) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
133
- });
134
- throw new Error(JSON.stringify(result.error, null, 2));
135
- }
136
- // Make the diagnostics object (e.g. { "test/features/api/article.ts": [error1, error2] })
137
- const diagnostics = {};
138
- result.diagnostics.forEach((d) => {
139
- var _a;
140
- if (d.file === null)
141
- return;
142
- diagnostics[d.file] = (_a = diagnostics[d.file]) !== null && _a !== void 0 ? _a : [];
143
- diagnostics[d.file].push(d);
144
- });
145
- if (Object.keys(diagnostics).length === 0) {
146
- /**
147
- * SUCCESS (Because typescript compiler can't success to compile the json
148
- * files, so result could be failure. but it's success to compile the ts
149
- * files.)
150
- */
151
- return {
152
- type: "testValidate",
153
- created_at: new Date().toISOString(),
154
- files: testFiles,
155
- result: Object.assign(Object.assign({}, result), { type: "success" }),
156
- step: (_f = (_e = ctx.state().interface) === null || _e === void 0 ? void 0 : _e.step) !== null && _f !== void 0 ? _f : 0,
157
- };
158
- }
159
- // Compile Failed
160
- ctx.dispatch({
161
- type: "testValidate",
162
- created_at: new Date().toISOString(),
163
- files: testFiles,
164
- result,
165
- step: (_h = (_g = ctx.state().interface) === null || _g === void 0 ? void 0 : _g.step) !== null && _h !== void 0 ? _h : 0,
166
- });
167
- if (life <= 0)
168
- return {
169
- type: "testValidate",
170
- created_at: new Date().toISOString(),
171
- files: testFiles,
172
- result,
173
- step: (_k = (_j = ctx.state().interface) === null || _j === void 0 ? void 0 : _j.step) !== null && _k !== void 0 ? _k : 0,
174
- };
175
- // VALIDATION FAILED
176
- const validatedFiles = yield Promise.all(Object.entries(diagnostics).map((_a) => __awaiter(this, [_a], void 0, function* ([filename, d]) {
177
- var _b, _c;
178
- const file = testFiles.find((f) => f.location === filename);
179
- const code = file === null || file === void 0 ? void 0 : file.content;
180
- const scenario = file === null || file === void 0 ? void 0 : file.scenario;
181
- const response = yield process(ctx, d, code, scenario);
182
- ctx.dispatch({
183
- type: "testCorrect",
184
- created_at: new Date().toISOString(),
185
- files: Object.assign(Object.assign({}, testFiles), { [filename]: response.content }),
186
- result,
187
- solution: response.solution,
188
- think_without_compile_error: response.think_without_compile_error,
189
- think_again_with_compile_error: response.think_again_with_compile_error,
190
- step: (_c = (_b = ctx.state().interface) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
191
- });
192
- return { location: filename, content: code, scenario: scenario };
193
- })));
194
- return step(ctx, entireFiles, testFiles.map((f) => {
195
- const validated = validatedFiles.find((v) => v.location === f.location);
196
- return validated ? validated : f;
197
- }), life - 1);
79
+ return {
80
+ type: "testValidate",
81
+ file: {
82
+ scenario: func.scenario,
83
+ location: func.location,
84
+ content: func.script,
85
+ },
86
+ result: compiled,
87
+ created_at: new Date().toISOString(),
88
+ step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
89
+ };
90
+ });
91
+ const predicate = (ctx, content, event, life) => __awaiter(void 0, void 0, void 0, function* () {
92
+ ctx.dispatch(event);
93
+ return event.result.type === "failure"
94
+ ? correct(ctx, content, event, life - 1)
95
+ : event;
96
+ });
97
+ const correct = (ctx, content, validate, life) => __awaiter(void 0, void 0, void 0, function* () {
98
+ var _a, _b, _c;
99
+ if (validate.result.type !== "failure")
100
+ return validate;
101
+ else if (--life <= 0)
102
+ return validate;
103
+ const pointer = {
104
+ value: null,
105
+ };
106
+ const agentica = new core_1.MicroAgentica({
107
+ model: ctx.model,
108
+ vendor: ctx.vendor,
109
+ config: Object.assign(Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})), { executor: {
110
+ describe: null,
111
+ }, retry: 4 }),
112
+ histories: (0, transformTestCorrectHistories_1.transformTestCorrectHistories)(content, validate.result),
113
+ controllers: [
114
+ createApplication({
115
+ model: ctx.model,
116
+ artifacts: content.artifacts,
117
+ build: (next) => {
118
+ pointer.value = next;
119
+ },
120
+ }),
121
+ ],
198
122
  });
199
- }
200
- /**
201
- * Modifies the code of test files where errors occurred. This function
202
- * processes TypeScript compiler diagnostics and attempts to fix compilation
203
- * errors.
204
- *
205
- * @param ctx The AutoBeContext containing application state and configuration
206
- * @param diagnostics Array of TypeScript compiler diagnostics for the errors
207
- * @param code The source code content to be fixed
208
- * @returns Promise resolving to corrected test function properties
209
- */
210
- function process(ctx, diagnostics, code, scenario) {
211
- return __awaiter(this, void 0, void 0, function* () {
212
- var _a;
213
- const pointer = {
214
- value: null,
215
- };
216
- const artifacts = yield (0, compileTestScenario_1.compileTestScenario)(ctx, scenario);
217
- const agentica = new core_1.MicroAgentica({
218
- model: ctx.model,
219
- vendor: Object.assign({}, ctx.vendor),
220
- config: Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})),
221
- histories: (0, transformTestCorrectHistories_1.transformTestCorrectHistories)(artifacts),
222
- controllers: [
223
- createApplication({
224
- model: ctx.model,
225
- build: (next) => {
226
- pointer.value = next;
227
- },
228
- }),
229
- ],
230
- tokenUsage: ctx.usage(),
231
- });
232
- (0, enforceToolCall_1.enforceToolCall)(agentica);
233
- yield (0, backoffRetry_1.randomBackoffRetry)(() => __awaiter(this, void 0, void 0, function* () {
234
- yield agentica.conversate([
235
- "Fix the compilation error in the provided code.",
236
- "",
237
- "## Original Code",
238
- "```typescript",
239
- code,
240
- "```",
241
- "",
242
- diagnostics.map((diagnostic) => {
243
- if (diagnostic.start === undefined || diagnostic.length === undefined)
244
- return "";
245
- const checkDtoRegexp = `Cannot find module '@ORGANIZATION/template-api/lib/structures/IBbsArticleComment' or its corresponding type declarations.`;
246
- const [group] = [
247
- ...checkDtoRegexp.matchAll(/Cannot find module '(.*lib\/structures\/.*)'/g),
248
- ];
249
- const [_, filename] = group !== null && group !== void 0 ? group : [];
250
- return [
251
- "## Error Information",
252
- `- Position: Characters ${diagnostic.start} to ${diagnostic.start + diagnostic.length}`,
253
- `- Error Message: ${diagnostic.messageText}`,
254
- `- Problematic Code: \`${code.substring(diagnostic.start, diagnostic.start + diagnostic.length)}\``,
255
- filename
256
- ? `The type files located under **/lib/structures are declared in '@ORGANIZATION/PROJECT-api/lib/structures'.\n` +
257
- `Note: '@ORGANIZATION/PROJECT-api' must be written exactly as is and should not be replaced.\n`
258
- : "",
259
- ].join("\n");
260
- }),
261
- "## Instructions",
262
- "1. Focus on the specific error location and message",
263
- "2. Provide the corrected TypeScript code",
264
- "3. Ensure the fix resolves the compilation error",
265
- "",
266
- "Return only the fixed code without explanations.",
267
- ].join("\n"));
268
- }));
269
- if (pointer.value === null)
270
- throw new Error("Failed to modify test code.");
271
- return pointer.value;
123
+ (0, enforceToolCall_1.enforceToolCall)(agentica);
124
+ yield agentica
125
+ .conversate("Fix the `AutoBeTest.IFunction` data to resolve the compilation error.")
126
+ .finally(() => {
127
+ const tokenUsage = agentica.getTokenUsage();
128
+ ctx.usage().record(tokenUsage, ["test"]);
272
129
  });
273
- }
274
- function createApplication(props) {
130
+ if (pointer.value === null)
131
+ throw new Error("Failed to modify test code.");
132
+ ctx.dispatch(Object.assign({ type: "testCorrect", created_at: new Date().toISOString(), file: validate.file, result: validate.result, step: (_c = (_b = ctx.state().analyze) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0 }, pointer.value));
133
+ const newContent = Object.assign(Object.assign({}, content), { script: pointer.value.final });
134
+ const newValidate = yield compile(ctx, newContent);
135
+ return predicate(ctx, newContent, newValidate, life);
136
+ });
137
+ const createApplication = (props) => {
275
138
  (0, assertSchemaModel_1.assertSchemaModel)(props.model);
276
139
  const application = collection[props.model];
277
140
  return {
@@ -279,12 +142,14 @@ function createApplication(props) {
279
142
  name: "Modify Test Code",
280
143
  application,
281
144
  execute: {
282
- correctTestCode: (next) => {
145
+ rewrite: (next) => {
146
+ next.draft = (0, completeTestCode_1.completeTestCode)(props.artifacts, next.draft);
147
+ next.final = (0, completeTestCode_1.completeTestCode)(props.artifacts, next.final);
283
148
  props.build(next);
284
149
  },
285
150
  },
286
151
  };
287
- }
152
+ };
288
153
  const claude = {
289
154
  model: "claude",
290
155
  options: {
@@ -293,40 +158,48 @@ const claude = {
293
158
  },
294
159
  functions: [
295
160
  {
296
- name: "correctTestCode",
161
+ name: "rewrite",
297
162
  parameters: {
298
- description: "Current Type: {@link ICorrectTestFunctionProps}",
163
+ description: " Complete specification for error correction workflow including\nanalysis steps, draft implementation, review process, and final code\ngeneration\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestCorrectApplication.IProps}",
299
164
  type: "object",
300
165
  properties: {
301
166
  think_without_compile_error: {
302
- description: "Step 1: Initial self-reflection on the source code without compiler error\ncontext.\n\nThe AI agent analyzes the previously generated test code to identify\npotential issues, relying solely on its understanding of TypeScript syntax,\ntesting patterns, and best practices.\n\nThis encourages the agent to develop independent debugging skills before\nbeing influenced by external error messages.",
167
+ description: "Step 1: Initial analysis and understanding without compilation error\ncontext.\n\nAI analyzes the original test scenario, business requirements, and\nintended functionality without being influenced by compilation errors.\nThis clean analysis establishes a clear understanding of what the test\nshould accomplish, the expected business workflow, and the correct API\nintegration patterns.\n\nThis step ensures that error correction doesn't lose sight of the\noriginal test purpose and helps maintain the intended business logic\nwhile addressing technical compilation issues. The AI develops a\ncomprehensive understanding of the test requirements before diving into\nerror-specific details.\n\nWorkflow: Scenario understanding \u2192 Business logic analysis \u2192 Intended\nfunctionality mapping",
303
168
  type: "string"
304
169
  },
305
170
  think_again_with_compile_error: {
306
- description: "Step 2: Re-evaluation of the code with compiler error messages as\nadditional context.\n\nAfter the initial analysis, the AI agent reviews the same code again, this\ntime incorporating the specific TypeScript compiler error messages.\n\nThis allows the agent to correlate its initial observations with concrete\ncompilation failures and refine its understanding of what went wrong.",
171
+ title: "Step 2: Compilation error analysis and root cause identification",
172
+ description: "Step 2: Compilation error analysis and root cause identification.\n\nAI re-analyzes the scenario and implementation with full awareness of\ncompilation errors and diagnostic information. This step involves\nsystematic examination of error messages, identification of error\npatterns, and understanding of how compilation issues relate to the\nintended functionality.\n\nThe AI correlates compilation diagnostics with the original requirements\nto understand where the implementation diverged from correct TypeScript\nusage while maintaining the business logic intent. This analysis forms\nthe foundation for targeted error correction strategies.\n\nWorkflow: Error diagnostic analysis \u2192 Root cause identification \u2192\nCorrection strategy planning",
173
+ type: "string"
174
+ },
175
+ draft: {
176
+ title: "Step 3: Draft corrected TypeScript E2E test code implementation",
177
+ description: "Step 3: Draft corrected TypeScript E2E test code implementation.\n\nAI generates the first corrected version of the test code based on error\nanalysis and correction strategies. This draft addresses all identified\ncompilation errors while preserving the original business logic and test\nworkflow. The code must be compilation-error-free and follow all\nestablished conventions.\n\nThe implementation incorporates lessons learned from error analysis to\nproduce properly typed, syntactically correct code that maintains the\nintended test functionality. All type safety requirements and framework\nconventions must be followed in this corrected implementation.\n\nWorkflow: Error correction \u2192 TypeScript implementation \u2192 Functional\npreservation Critical: Must resolve all compilation errors while\nmaintaining original test intent",
307
178
  type: "string"
308
179
  },
309
- solution: {
310
- title: "Step 3: Concrete action plan for fixing the identified issues",
311
- description: "Step 3: Concrete action plan for fixing the identified issues.\n\nBased on the analysis from steps 1 and 2, the AI agent formulates a\nspecific, step-by-step solution strategy.\n\nThis should include what changes need to be made, why those changes are\nnecessary, and how they will resolve the compilation errors while\nmaintaining the test's intended functionality.",
180
+ review: {
181
+ title: "Step 4: Code review and correction validation",
182
+ description: "Step 4: Code review and correction validation.\n\nAI performs a comprehensive review of the corrected draft implementation,\nvalidating that all compilation errors have been resolved and that the\ncode maintains the original functionality. This review examines both\ntechnical correctness and business logic preservation.\n\nThe review process includes verification of TypeScript compilation\ncompatibility, API integration correctness, test workflow completeness,\nand adherence to all quality standards. Any remaining issues or potential\nimprovements are identified for incorporation into the final\nimplementation.\n\nWorkflow: Draft validation \u2192 Compilation verification \u2192 Functionality\nreview \u2192 Quality assessment",
312
183
  type: "string"
313
184
  },
314
- content: {
315
- title: "Step 4: The corrected TypeScript test code",
316
- description: "Step 4: The corrected TypeScript test code.\n\nThe final, properly fixed TypeScript code that should compile without\nerrors.\n\nThis represents the implementation of the solution plan from step 3,\ncontaining all necessary corrections to make the test code syntactically\nvalid and functionally correct.",
185
+ final: {
186
+ title: "Step 5: Final production-ready corrected test code",
187
+ description: "Step 5: Final production-ready corrected test code.\n\nAI produces the final, polished version of the corrected test code\nincorporating all review feedback and validation results. This code\nrepresents the completed error correction, guaranteed to compile\nsuccessfully while preserving all original test functionality and\nbusiness logic.\n\nThe final implementation resolves all compilation issues, maintains\nstrict type safety, follows all established conventions, and delivers a\nproduction-ready test that accurately validates the intended API\nbehaviors and user workflows.\n\nWorkflow: Review integration \u2192 Final refinement \u2192 Production-ready\nimplementation This is the ultimate deliverable that will replace the\ncompilation-failed code.",
317
188
  type: "string"
318
189
  }
319
190
  },
320
191
  required: [
321
192
  "think_without_compile_error",
322
193
  "think_again_with_compile_error",
323
- "solution",
324
- "content"
194
+ "draft",
195
+ "review",
196
+ "final"
325
197
  ],
326
198
  additionalProperties: false,
327
199
  $defs: {}
328
200
  },
329
- validate: (() => { const _io0 = input => "string" === typeof input.think_without_compile_error && "string" === typeof input.think_again_with_compile_error && "string" === typeof input.solution && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think_without_compile_error || _report(_exceptionable, {
201
+ description: "Main entry point for AI Function Call - analyzes compilation errors and\ngenerates corrected E2E test code.\n\nThe AI executes this function to perform the complete error correction\nworkflow: error-free analysis \u2192 compilation error analysis \u2192 draft\ncorrection \u2192 code review \u2192 final corrected implementation. This multi-step\nprocess ensures systematic error resolution while preserving original test\nfunctionality and maintaining code quality.\n\nThe corrector first analyzes the scenario without considering compilation\nerrors to understand the intended functionality, then incorporates\ncompilation diagnostics to identify specific issues, and finally produces\ncorrected code through iterative refinement with comprehensive review and\nvalidation.",
202
+ validate: (() => { const _io0 = input => "string" === typeof input.think_without_compile_error && "string" === typeof input.think_again_with_compile_error && "string" === typeof input.draft && "string" === typeof input.review && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think_without_compile_error || _report(_exceptionable, {
330
203
  path: _path + ".think_without_compile_error",
331
204
  expected: "string",
332
205
  value: input.think_without_compile_error
@@ -334,25 +207,29 @@ const claude = {
334
207
  path: _path + ".think_again_with_compile_error",
335
208
  expected: "string",
336
209
  value: input.think_again_with_compile_error
337
- }), "string" === typeof input.solution || _report(_exceptionable, {
338
- path: _path + ".solution",
210
+ }), "string" === typeof input.draft || _report(_exceptionable, {
211
+ path: _path + ".draft",
212
+ expected: "string",
213
+ value: input.draft
214
+ }), "string" === typeof input.review || _report(_exceptionable, {
215
+ path: _path + ".review",
339
216
  expected: "string",
340
- value: input.solution
341
- }), "string" === typeof input.content || _report(_exceptionable, {
342
- path: _path + ".content",
217
+ value: input.review
218
+ }), "string" === typeof input.final || _report(_exceptionable, {
219
+ path: _path + ".final",
343
220
  expected: "string",
344
- value: input.content
221
+ value: input.final
345
222
  })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
346
223
  if (false === __is(input)) {
347
224
  errors = [];
348
225
  _report = __typia_transform__validateReport._validateReport(errors);
349
226
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
350
227
  path: _path + "",
351
- expected: "ICorrectTestFunctionProps",
228
+ expected: "IAutoBeTestCorrectApplication.IProps",
352
229
  value: input
353
230
  })) && _vo0(input, _path + "", true) || _report(true, {
354
231
  path: _path + "",
355
- expected: "ICorrectTestFunctionProps",
232
+ expected: "IAutoBeTestCorrectApplication.IProps",
356
233
  value: input
357
234
  }))(input, "$input", true);
358
235
  const success = 0 === errors.length;
@@ -383,40 +260,48 @@ const collection = {
383
260
  },
384
261
  functions: [
385
262
  {
386
- name: "correctTestCode",
263
+ name: "rewrite",
387
264
  parameters: {
388
- description: "Current Type: {@link ICorrectTestFunctionProps}",
265
+ description: " Complete specification for error correction workflow including\nanalysis steps, draft implementation, review process, and final code\ngeneration\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestCorrectApplication.IProps}",
389
266
  type: "object",
390
267
  properties: {
391
268
  think_without_compile_error: {
392
- description: "Step 1: Initial self-reflection on the source code without compiler error\ncontext.\n\nThe AI agent analyzes the previously generated test code to identify\npotential issues, relying solely on its understanding of TypeScript syntax,\ntesting patterns, and best practices.\n\nThis encourages the agent to develop independent debugging skills before\nbeing influenced by external error messages.",
269
+ description: "Step 1: Initial analysis and understanding without compilation error\ncontext.\n\nAI analyzes the original test scenario, business requirements, and\nintended functionality without being influenced by compilation errors.\nThis clean analysis establishes a clear understanding of what the test\nshould accomplish, the expected business workflow, and the correct API\nintegration patterns.\n\nThis step ensures that error correction doesn't lose sight of the\noriginal test purpose and helps maintain the intended business logic\nwhile addressing technical compilation issues. The AI develops a\ncomprehensive understanding of the test requirements before diving into\nerror-specific details.\n\nWorkflow: Scenario understanding \u2192 Business logic analysis \u2192 Intended\nfunctionality mapping",
393
270
  type: "string"
394
271
  },
395
272
  think_again_with_compile_error: {
396
- description: "Step 2: Re-evaluation of the code with compiler error messages as\nadditional context.\n\nAfter the initial analysis, the AI agent reviews the same code again, this\ntime incorporating the specific TypeScript compiler error messages.\n\nThis allows the agent to correlate its initial observations with concrete\ncompilation failures and refine its understanding of what went wrong.",
273
+ title: "Step 2: Compilation error analysis and root cause identification",
274
+ description: "Step 2: Compilation error analysis and root cause identification.\n\nAI re-analyzes the scenario and implementation with full awareness of\ncompilation errors and diagnostic information. This step involves\nsystematic examination of error messages, identification of error\npatterns, and understanding of how compilation issues relate to the\nintended functionality.\n\nThe AI correlates compilation diagnostics with the original requirements\nto understand where the implementation diverged from correct TypeScript\nusage while maintaining the business logic intent. This analysis forms\nthe foundation for targeted error correction strategies.\n\nWorkflow: Error diagnostic analysis \u2192 Root cause identification \u2192\nCorrection strategy planning",
397
275
  type: "string"
398
276
  },
399
- solution: {
400
- title: "Step 3: Concrete action plan for fixing the identified issues",
401
- description: "Step 3: Concrete action plan for fixing the identified issues.\n\nBased on the analysis from steps 1 and 2, the AI agent formulates a\nspecific, step-by-step solution strategy.\n\nThis should include what changes need to be made, why those changes are\nnecessary, and how they will resolve the compilation errors while\nmaintaining the test's intended functionality.",
277
+ draft: {
278
+ title: "Step 3: Draft corrected TypeScript E2E test code implementation",
279
+ description: "Step 3: Draft corrected TypeScript E2E test code implementation.\n\nAI generates the first corrected version of the test code based on error\nanalysis and correction strategies. This draft addresses all identified\ncompilation errors while preserving the original business logic and test\nworkflow. The code must be compilation-error-free and follow all\nestablished conventions.\n\nThe implementation incorporates lessons learned from error analysis to\nproduce properly typed, syntactically correct code that maintains the\nintended test functionality. All type safety requirements and framework\nconventions must be followed in this corrected implementation.\n\nWorkflow: Error correction \u2192 TypeScript implementation \u2192 Functional\npreservation Critical: Must resolve all compilation errors while\nmaintaining original test intent",
402
280
  type: "string"
403
281
  },
404
- content: {
405
- title: "Step 4: The corrected TypeScript test code",
406
- description: "Step 4: The corrected TypeScript test code.\n\nThe final, properly fixed TypeScript code that should compile without\nerrors.\n\nThis represents the implementation of the solution plan from step 3,\ncontaining all necessary corrections to make the test code syntactically\nvalid and functionally correct.",
282
+ review: {
283
+ title: "Step 4: Code review and correction validation",
284
+ description: "Step 4: Code review and correction validation.\n\nAI performs a comprehensive review of the corrected draft implementation,\nvalidating that all compilation errors have been resolved and that the\ncode maintains the original functionality. This review examines both\ntechnical correctness and business logic preservation.\n\nThe review process includes verification of TypeScript compilation\ncompatibility, API integration correctness, test workflow completeness,\nand adherence to all quality standards. Any remaining issues or potential\nimprovements are identified for incorporation into the final\nimplementation.\n\nWorkflow: Draft validation \u2192 Compilation verification \u2192 Functionality\nreview \u2192 Quality assessment",
285
+ type: "string"
286
+ },
287
+ final: {
288
+ title: "Step 5: Final production-ready corrected test code",
289
+ description: "Step 5: Final production-ready corrected test code.\n\nAI produces the final, polished version of the corrected test code\nincorporating all review feedback and validation results. This code\nrepresents the completed error correction, guaranteed to compile\nsuccessfully while preserving all original test functionality and\nbusiness logic.\n\nThe final implementation resolves all compilation issues, maintains\nstrict type safety, follows all established conventions, and delivers a\nproduction-ready test that accurately validates the intended API\nbehaviors and user workflows.\n\nWorkflow: Review integration \u2192 Final refinement \u2192 Production-ready\nimplementation This is the ultimate deliverable that will replace the\ncompilation-failed code.",
407
290
  type: "string"
408
291
  }
409
292
  },
410
293
  required: [
411
294
  "think_without_compile_error",
412
295
  "think_again_with_compile_error",
413
- "solution",
414
- "content"
296
+ "draft",
297
+ "review",
298
+ "final"
415
299
  ],
416
300
  additionalProperties: false,
417
301
  $defs: {}
418
302
  },
419
- validate: (() => { const _io0 = input => "string" === typeof input.think_without_compile_error && "string" === typeof input.think_again_with_compile_error && "string" === typeof input.solution && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think_without_compile_error || _report(_exceptionable, {
303
+ description: "Main entry point for AI Function Call - analyzes compilation errors and\ngenerates corrected E2E test code.\n\nThe AI executes this function to perform the complete error correction\nworkflow: error-free analysis \u2192 compilation error analysis \u2192 draft\ncorrection \u2192 code review \u2192 final corrected implementation. This multi-step\nprocess ensures systematic error resolution while preserving original test\nfunctionality and maintaining code quality.\n\nThe corrector first analyzes the scenario without considering compilation\nerrors to understand the intended functionality, then incorporates\ncompilation diagnostics to identify specific issues, and finally produces\ncorrected code through iterative refinement with comprehensive review and\nvalidation.",
304
+ validate: (() => { const _io0 = input => "string" === typeof input.think_without_compile_error && "string" === typeof input.think_again_with_compile_error && "string" === typeof input.draft && "string" === typeof input.review && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think_without_compile_error || _report(_exceptionable, {
420
305
  path: _path + ".think_without_compile_error",
421
306
  expected: "string",
422
307
  value: input.think_without_compile_error
@@ -424,25 +309,29 @@ const collection = {
424
309
  path: _path + ".think_again_with_compile_error",
425
310
  expected: "string",
426
311
  value: input.think_again_with_compile_error
427
- }), "string" === typeof input.solution || _report(_exceptionable, {
428
- path: _path + ".solution",
312
+ }), "string" === typeof input.draft || _report(_exceptionable, {
313
+ path: _path + ".draft",
314
+ expected: "string",
315
+ value: input.draft
316
+ }), "string" === typeof input.review || _report(_exceptionable, {
317
+ path: _path + ".review",
429
318
  expected: "string",
430
- value: input.solution
431
- }), "string" === typeof input.content || _report(_exceptionable, {
432
- path: _path + ".content",
319
+ value: input.review
320
+ }), "string" === typeof input.final || _report(_exceptionable, {
321
+ path: _path + ".final",
433
322
  expected: "string",
434
- value: input.content
323
+ value: input.final
435
324
  })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
436
325
  if (false === __is(input)) {
437
326
  errors = [];
438
327
  _report = __typia_transform__validateReport._validateReport(errors);
439
328
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
440
329
  path: _path + "",
441
- expected: "ICorrectTestFunctionProps",
330
+ expected: "IAutoBeTestCorrectApplication.IProps",
442
331
  value: input
443
332
  })) && _vo0(input, _path + "", true) || _report(true, {
444
333
  path: _path + "",
445
- expected: "ICorrectTestFunctionProps",
334
+ expected: "IAutoBeTestCorrectApplication.IProps",
446
335
  value: input
447
336
  }))(input, "$input", true);
448
337
  const success = 0 === errors.length;
@@ -467,93 +356,5 @@ const collection = {
467
356
  llama: claude,
468
357
  deepseek: claude,
469
358
  "3.1": claude,
470
- "3.0": {
471
- model: "3.0",
472
- options: {
473
- constraint: true,
474
- recursive: 3,
475
- separate: null
476
- },
477
- functions: [
478
- {
479
- name: "correctTestCode",
480
- parameters: {
481
- type: "object",
482
- properties: {
483
- think_without_compile_error: {
484
- type: "string",
485
- description: "Step 1: Initial self-reflection on the source code without compiler error\ncontext.\n\nThe AI agent analyzes the previously generated test code to identify\npotential issues, relying solely on its understanding of TypeScript syntax,\ntesting patterns, and best practices.\n\nThis encourages the agent to develop independent debugging skills before\nbeing influenced by external error messages."
486
- },
487
- think_again_with_compile_error: {
488
- type: "string",
489
- description: "Step 2: Re-evaluation of the code with compiler error messages as\nadditional context.\n\nAfter the initial analysis, the AI agent reviews the same code again, this\ntime incorporating the specific TypeScript compiler error messages.\n\nThis allows the agent to correlate its initial observations with concrete\ncompilation failures and refine its understanding of what went wrong."
490
- },
491
- solution: {
492
- type: "string",
493
- title: "Step 3: Concrete action plan for fixing the identified issues",
494
- description: "Step 3: Concrete action plan for fixing the identified issues.\n\nBased on the analysis from steps 1 and 2, the AI agent formulates a\nspecific, step-by-step solution strategy.\n\nThis should include what changes need to be made, why those changes are\nnecessary, and how they will resolve the compilation errors while\nmaintaining the test's intended functionality."
495
- },
496
- content: {
497
- type: "string",
498
- title: "Step 4: The corrected TypeScript test code",
499
- description: "Step 4: The corrected TypeScript test code.\n\nThe final, properly fixed TypeScript code that should compile without\nerrors.\n\nThis represents the implementation of the solution plan from step 3,\ncontaining all necessary corrections to make the test code syntactically\nvalid and functionally correct."
500
- }
501
- },
502
- required: [
503
- "think_without_compile_error",
504
- "think_again_with_compile_error",
505
- "solution",
506
- "content"
507
- ],
508
- description: "Current Type: {@link ICorrectTestFunctionProps}",
509
- additionalProperties: false
510
- },
511
- validate: (() => { const _io0 = input => "string" === typeof input.think_without_compile_error && "string" === typeof input.think_again_with_compile_error && "string" === typeof input.solution && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think_without_compile_error || _report(_exceptionable, {
512
- path: _path + ".think_without_compile_error",
513
- expected: "string",
514
- value: input.think_without_compile_error
515
- }), "string" === typeof input.think_again_with_compile_error || _report(_exceptionable, {
516
- path: _path + ".think_again_with_compile_error",
517
- expected: "string",
518
- value: input.think_again_with_compile_error
519
- }), "string" === typeof input.solution || _report(_exceptionable, {
520
- path: _path + ".solution",
521
- expected: "string",
522
- value: input.solution
523
- }), "string" === typeof input.content || _report(_exceptionable, {
524
- path: _path + ".content",
525
- expected: "string",
526
- value: input.content
527
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
528
- if (false === __is(input)) {
529
- errors = [];
530
- _report = __typia_transform__validateReport._validateReport(errors);
531
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
532
- path: _path + "",
533
- expected: "ICorrectTestFunctionProps",
534
- value: input
535
- })) && _vo0(input, _path + "", true) || _report(true, {
536
- path: _path + "",
537
- expected: "ICorrectTestFunctionProps",
538
- value: input
539
- }))(input, "$input", true);
540
- const success = 0 === errors.length;
541
- return success ? {
542
- success,
543
- data: input
544
- } : {
545
- success,
546
- errors,
547
- data: input
548
- };
549
- }
550
- return {
551
- success: true,
552
- data: input
553
- };
554
- }; })()
555
- }
556
- ]
557
- },
558
359
  };
559
360
  //# sourceMappingURL=orchestrateTestCorrect.js.map