@autobe/agent 0.21.0 → 0.22.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 (291) hide show
  1. package/lib/agent/src/AutoBeAgent.js +2 -2
  2. package/lib/agent/src/AutoBeAgent.js.map +1 -1
  3. package/lib/agent/src/constants/AutoBeConfigConstant.d.ts +3 -0
  4. package/lib/agent/src/{orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js → constants/AutoBeConfigConstant.js} +1 -1
  5. package/lib/agent/src/constants/AutoBeConfigConstant.js.map +1 -0
  6. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +27 -27
  7. package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
  8. package/lib/agent/src/context/AutoBeTokenUsageComponent.js +4 -3
  9. package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
  10. package/lib/agent/src/factory/consentFunctionCall.js +4 -4
  11. package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
  12. package/lib/agent/src/factory/createAutoBeContext.js +13 -10
  13. package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
  14. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
  15. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  16. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
  17. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  18. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +1 -1
  19. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  20. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +6 -6
  21. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +50 -8
  22. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  23. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +4 -4
  24. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
  25. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
  26. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +1 -1
  27. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  28. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +19 -1
  29. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  30. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
  31. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  32. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
  33. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  34. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +2 -2
  35. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  36. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
  37. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  38. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  39. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  40. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
  41. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  42. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
  43. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  44. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
  45. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
  46. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  47. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +5 -1
  48. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
  49. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +16 -10
  50. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  51. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
  52. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +3731 -228
  53. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  54. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +2 -2
  55. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +2 -2
  56. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +43 -63
  57. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  58. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1261 -1628
  59. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  60. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +3466 -103
  61. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  62. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
  63. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +3672 -358
  64. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
  65. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
  66. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
  67. package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
  68. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
  69. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js +1385 -0
  70. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -0
  71. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
  72. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js +78 -0
  73. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -0
  74. package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
  75. package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js +81 -0
  76. package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js.map +1 -0
  77. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -1
  78. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +1 -1
  79. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  80. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
  81. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
  82. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
  83. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  84. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
  85. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  86. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
  87. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +2 -2
  88. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  89. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +1 -1
  90. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  91. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +2 -2
  92. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  93. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
  94. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +22 -7
  95. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  96. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
  97. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +13 -29
  98. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  99. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
  100. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js +2 -8
  101. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
  102. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +6 -49
  103. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
  104. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +4 -2
  105. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  106. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +5 -3
  107. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  108. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
  109. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +206 -118
  110. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  111. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
  112. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
  113. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
  114. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -39
  115. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  116. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
  117. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
  118. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
  119. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
  120. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js +3 -0
  121. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js.map +1 -0
  122. package/{src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts → lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts} +2 -13
  123. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js +3 -0
  124. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js.map +1 -0
  125. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
  126. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
  127. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +86 -0
  128. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -0
  129. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
  130. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js +55 -0
  131. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -0
  132. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
  133. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js +20 -0
  134. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -0
  135. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
  136. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js +73 -0
  137. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -0
  138. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
  139. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +63 -69
  140. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  141. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +15 -14
  142. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
  143. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +1 -1
  144. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
  145. package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
  146. package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js +19 -0
  147. package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js.map +1 -0
  148. package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
  149. package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js +2 -0
  150. package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
  151. package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
  152. package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js +21 -0
  153. package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js.map +1 -0
  154. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
  155. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +16 -17
  156. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  157. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +5 -4
  158. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  159. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +21 -2
  160. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  161. package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -0
  162. package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
  163. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
  164. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +126 -72
  165. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  166. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +46 -40
  167. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  168. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +121 -42
  169. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  170. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
  171. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
  172. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js +3 -0
  173. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js.map +1 -0
  174. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
  175. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
  176. package/lib/agent/src/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
  177. package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js +28 -0
  178. package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js.map +1 -0
  179. package/lib/agent/src/structures/IAutoBeConfig.d.ts +2 -0
  180. package/lib/constants/AutoBeConfigConstant.d.ts +3 -0
  181. package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -27
  182. package/lib/context/AutoBeContext.d.ts +1 -0
  183. package/lib/index.mjs +13805 -3871
  184. package/lib/index.mjs.map +1 -1
  185. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
  186. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
  187. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
  188. package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
  189. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
  190. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
  191. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
  192. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
  193. package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
  194. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
  195. package/lib/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
  196. package/lib/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
  197. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
  198. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
  199. package/lib/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
  200. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
  201. package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
  202. package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
  203. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
  204. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
  205. package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
  206. package/lib/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
  207. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +36 -0
  208. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
  209. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
  210. package/lib/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
  211. package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
  212. package/lib/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
  213. package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
  214. package/lib/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
  215. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
  216. package/lib/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
  217. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
  218. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
  219. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
  220. package/lib/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
  221. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
  222. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
  223. package/lib/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
  224. package/lib/structures/IAutoBeConfig.d.ts +2 -0
  225. package/package.json +5 -5
  226. package/src/AutoBeAgent.ts +2 -0
  227. package/src/constants/AutoBeConfigConstant.ts +3 -0
  228. package/src/constants/AutoBeSystemPromptConstant.ts +27 -27
  229. package/src/context/AutoBeContext.ts +1 -0
  230. package/src/context/AutoBeTokenUsageComponent.ts +3 -3
  231. package/src/factory/consentFunctionCall.ts +2 -0
  232. package/src/factory/createAutoBeContext.ts +145 -136
  233. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +6 -0
  234. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +4 -0
  235. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +19 -1
  236. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +1 -4
  237. package/src/orchestrate/interface/orchestrateInterface.ts +15 -4
  238. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -5
  239. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +58 -19
  240. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -11
  241. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +13 -117
  242. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +33 -91
  243. package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +72 -95
  244. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +0 -39
  245. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +50 -146
  246. package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +31 -27
  247. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +171 -0
  248. package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +83 -0
  249. package/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.ts +90 -0
  250. package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +2 -2
  251. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -2
  252. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +30 -15
  253. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -49
  254. package/src/orchestrate/realize/internal/compileRealizeFiles.ts +4 -11
  255. package/src/orchestrate/realize/orchestrateRealize.ts +19 -75
  256. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +1 -1
  257. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +114 -25
  258. package/src/orchestrate/realize/orchestrateRealizeScenario.ts +2 -2
  259. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +11 -15
  260. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +17 -0
  261. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +20 -0
  262. package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +40 -74
  263. package/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.ts +9 -0
  264. package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +45 -0
  265. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +33 -22
  266. package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +97 -0
  267. package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +64 -0
  268. package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +29 -0
  269. package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +82 -0
  270. package/src/orchestrate/realize/utils/replaceImportStatements.ts +101 -111
  271. package/src/orchestrate/test/compile/completeTestCode.ts +15 -26
  272. package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +1 -0
  273. package/src/orchestrate/test/compile/getTestImportStatements.ts +25 -0
  274. package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +6 -1
  275. package/src/orchestrate/test/compile/getTestTemplateCode.ts +25 -0
  276. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +26 -26
  277. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +6 -5
  278. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +19 -0
  279. package/src/orchestrate/test/orchestrateTest.ts +6 -0
  280. package/src/orchestrate/test/orchestrateTestCorrect.ts +46 -15
  281. package/src/orchestrate/test/orchestrateTestScenario.ts +52 -48
  282. package/src/orchestrate/test/orchestrateTestWrite.ts +23 -5
  283. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +49 -46
  284. package/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.ts +8 -0
  285. package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +1 -0
  286. package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +14 -0
  287. package/src/orchestrate/test/utils/getReferenceIds.ts +25 -0
  288. package/src/structures/IAutoBeConfig.ts +3 -0
  289. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
  290. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js.map +0 -1
  291. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
@@ -17,13 +17,13 @@ import { completeTestCode } from "./compile/completeTestCode";
17
17
  import { transformTestCorrectHistories } from "./histories/transformTestCorrectHistories";
18
18
  import { IAutoBeTestCorrectApplication } from "./structures/IAutoBeTestCorrectApplication";
19
19
  import { IAutoBeTestFunction } from "./structures/IAutoBeTestFunction";
20
+ import { IAutoBeTestFunctionFailure } from "./structures/IAutoBeTestFunctionFailure";
20
21
  import { IAutoBeTestScenarioArtifacts } from "./structures/IAutoBeTestScenarioArtifacts";
21
22
  import { IAutoBeTestWriteResult } from "./structures/IAutoBeTestWriteResult";
22
23
 
23
24
  export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
24
25
  ctx: AutoBeContext<Model>,
25
26
  writeResult: IAutoBeTestWriteResult[],
26
- life: number = 4,
27
27
  ): Promise<AutoBeTestValidateEvent[]> => {
28
28
  const result: Array<AutoBeTestValidateEvent | null> =
29
29
  await executeCachedBatch(
@@ -33,7 +33,7 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
33
33
  artifacts: w.artifacts,
34
34
  scenario: w.scenario,
35
35
  location: w.event.location,
36
- script: w.event.final,
36
+ script: w.event.final ?? w.event.draft,
37
37
  });
38
38
  return await predicate(
39
39
  ctx,
@@ -41,10 +41,11 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
41
41
  artifacts: w.artifacts,
42
42
  scenario: w.scenario,
43
43
  location: w.event.location,
44
- script: w.event.final,
44
+ script: w.event.final ?? w.event.draft,
45
45
  },
46
+ [],
46
47
  event,
47
- life,
48
+ ctx.retry,
48
49
  );
49
50
  } catch {
50
51
  return null;
@@ -83,18 +84,20 @@ const compile = async <Model extends ILlmSchema.Model>(
83
84
  const predicate = async <Model extends ILlmSchema.Model>(
84
85
  ctx: AutoBeContext<Model>,
85
86
  content: IAutoBeTestFunction,
87
+ failures: IAutoBeTestFunctionFailure[],
86
88
  event: AutoBeTestValidateEvent,
87
89
  life: number,
88
90
  ): Promise<AutoBeTestValidateEvent> => {
89
91
  if (event.result.type === "failure") ctx.dispatch(event);
90
92
  return event.result.type === "failure"
91
- ? await correct(ctx, content, event, life - 1)
93
+ ? await correct(ctx, content, failures, event, life - 1)
92
94
  : event;
93
95
  };
94
96
 
95
97
  const correct = async <Model extends ILlmSchema.Model>(
96
98
  ctx: AutoBeContext<Model>,
97
99
  content: IAutoBeTestFunction,
100
+ failures: IAutoBeTestFunctionFailure[],
98
101
  validate: AutoBeTestValidateEvent,
99
102
  life: number,
100
103
  ): Promise<AutoBeTestValidateEvent> => {
@@ -106,11 +109,13 @@ const correct = async <Model extends ILlmSchema.Model>(
106
109
  };
107
110
  const { tokenUsage } = await ctx.conversate({
108
111
  source: "testCorrect",
109
- histories: await transformTestCorrectHistories(
110
- ctx,
111
- content,
112
- validate.result,
113
- ),
112
+ histories: await transformTestCorrectHistories(ctx, content, [
113
+ ...failures,
114
+ {
115
+ function: content,
116
+ failure: validate.result,
117
+ },
118
+ ]),
114
119
  controller: createController({
115
120
  model: ctx.model,
116
121
  artifacts: content.artifacts,
@@ -129,7 +134,14 @@ const correct = async <Model extends ILlmSchema.Model>(
129
134
  if (pointer.value === null) throw new Error("Failed to modify test code.");
130
135
 
131
136
  const compiler: IAutoBeCompiler = await ctx.compiler();
132
- pointer.value.final = await compiler.typescript.beautify(pointer.value.final);
137
+ if (pointer.value.revise)
138
+ pointer.value.revise.final = await compiler.typescript.beautify(
139
+ pointer.value.revise.final,
140
+ );
141
+ else
142
+ pointer.value.draft = await compiler.typescript.beautify(
143
+ pointer.value.draft,
144
+ );
133
145
 
134
146
  ctx.dispatch({
135
147
  type: "testCorrect",
@@ -139,14 +151,29 @@ const correct = async <Model extends ILlmSchema.Model>(
139
151
  result: validate.result,
140
152
  tokenUsage,
141
153
  step: ctx.state().analyze?.step ?? 0,
142
- ...pointer.value,
154
+ think: pointer.value.think,
155
+ draft: pointer.value.draft,
156
+ review: pointer.value.revise?.review,
157
+ final: pointer.value.revise?.final,
143
158
  });
144
159
  const newContent: IAutoBeTestFunction = {
145
160
  ...content,
146
- script: pointer.value.final,
161
+ script: pointer.value.revise?.final ?? pointer.value.draft,
147
162
  };
148
163
  const newValidate: AutoBeTestValidateEvent = await compile(ctx, newContent);
149
- return predicate(ctx, newContent, newValidate, life);
164
+ return predicate(
165
+ ctx,
166
+ newContent,
167
+ [
168
+ ...failures,
169
+ {
170
+ function: content,
171
+ failure: validate.result,
172
+ },
173
+ ],
174
+ newValidate,
175
+ life,
176
+ );
150
177
  };
151
178
 
152
179
  const createController = <Model extends ILlmSchema.Model>(props: {
@@ -166,7 +193,11 @@ const createController = <Model extends ILlmSchema.Model>(props: {
166
193
  execute: {
167
194
  rewrite: (next) => {
168
195
  next.draft = completeTestCode(props.artifacts, next.draft);
169
- next.final = completeTestCode(props.artifacts, next.final);
196
+ if (next.revise)
197
+ next.revise.final = completeTestCode(
198
+ props.artifacts,
199
+ next.revise.final,
200
+ );
170
201
  props.build(next);
171
202
  },
172
203
  } satisfies IAutoBeTestCorrectApplication,
@@ -64,7 +64,7 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
64
64
  do {
65
65
  const matrix: AutoBeOpenApi.IOperation[][] = divideArray({
66
66
  array: include,
67
- capacity: 5,
67
+ capacity: 4,
68
68
  });
69
69
  await executeCachedBatch(
70
70
  matrix.map((include) => async (promptCacheKey) => {
@@ -121,56 +121,60 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
121
121
  const pointer: IPointer<IAutoBeTestScenarioApplication.IScenarioGroup[]> = {
122
122
  value: [],
123
123
  };
124
-
125
124
  const authorizations: AutoBeInterfaceAuthorization[] =
126
125
  ctx.state().interface?.authorizations ?? [];
127
126
 
128
- const { tokenUsage } = await ctx.conversate({
129
- source: "testScenarios",
130
- histories: transformTestScenarioHistories(
131
- ctx.state(),
132
- props.entire,
133
- props.include,
134
- props.exclude,
135
- ),
136
- controller: createController({
137
- model: ctx.model,
138
- endpointNotFound: props.endpointNotFound,
139
- dict: props.dict,
140
- authorizations,
141
- build: (next) => {
142
- pointer.value ??= [];
143
- pointer.value.push(...next.scenarioGroups);
144
- },
145
- }),
146
- enforceFunctionCall: true,
147
- promptCacheKey: props.promptCacheKey,
148
- message: `Create e2e test scenarios.`,
149
- });
150
- if (pointer.value.length === 0) return [];
151
- ctx.dispatch({
152
- type: "testScenarios",
153
- id: v7(),
154
- tokenUsage,
155
- scenarios: pointer.value
156
- .map((v) =>
157
- v.scenarios.map(
158
- (s) =>
159
- ({
160
- endpoint: v.endpoint,
161
- draft: s.draft,
162
- functionName: s.functionName,
163
- dependencies: s.dependencies,
164
- }) satisfies AutoBeTestScenario,
165
- ),
166
- )
167
- .flat(),
168
- completed: ++props.progress.completed,
169
- total: props.progress.total,
170
- step: ctx.state().interface?.step ?? 0,
171
- created_at: new Date().toISOString(),
172
- });
173
- return pointer.value;
127
+ try {
128
+ const { tokenUsage } = await ctx.conversate({
129
+ source: "testScenarios",
130
+ histories: transformTestScenarioHistories(
131
+ ctx.state(),
132
+ props.entire,
133
+ props.include,
134
+ props.exclude,
135
+ ),
136
+ controller: createController({
137
+ model: ctx.model,
138
+ endpointNotFound: props.endpointNotFound,
139
+ dict: props.dict,
140
+ authorizations,
141
+ build: (next) => {
142
+ pointer.value ??= [];
143
+ pointer.value.push(...next.scenarioGroups);
144
+ },
145
+ }),
146
+ enforceFunctionCall: true,
147
+ promptCacheKey: props.promptCacheKey,
148
+ message: `Create e2e test scenarios.`,
149
+ });
150
+ if (pointer.value.length === 0) return [];
151
+ ctx.dispatch({
152
+ type: "testScenarios",
153
+ id: v7(),
154
+ tokenUsage,
155
+ scenarios: pointer.value
156
+ .map((v) =>
157
+ v.scenarios.map(
158
+ (s) =>
159
+ ({
160
+ endpoint: v.endpoint,
161
+ draft: s.draft,
162
+ functionName: s.functionName,
163
+ dependencies: s.dependencies,
164
+ }) satisfies AutoBeTestScenario,
165
+ ),
166
+ )
167
+ .flat(),
168
+ completed: (props.progress.completed += pointer.value.length),
169
+ total: props.progress.total,
170
+ step: ctx.state().interface?.step ?? 0,
171
+ created_at: new Date().toISOString(),
172
+ });
173
+ return pointer.value;
174
+ } catch {
175
+ console.log("test scenario, failed to function call", props.include);
176
+ return [];
177
+ }
174
178
  };
175
179
 
176
180
  function createController<Model extends ILlmSchema.Model>(props: {
@@ -50,7 +50,7 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
50
50
  artifacts,
51
51
  event,
52
52
  };
53
- } catch {
53
+ } catch (error) {
54
54
  return null;
55
55
  }
56
56
  }),
@@ -85,16 +85,30 @@ async function process<Model extends ILlmSchema.Model>(
85
85
  promptCacheKey,
86
86
  message: "Create e2e test functions.",
87
87
  });
88
- if (pointer.value === null) throw new Error("Failed to create test code.");
88
+ if (pointer.value === null) {
89
+ ++progress.completed;
90
+ throw new Error("Failed to create test code.");
91
+ }
89
92
 
90
93
  const compiler: IAutoBeCompiler = await ctx.compiler();
91
- pointer.value.final = await compiler.typescript.beautify(pointer.value.final);
94
+ if (pointer.value.revise)
95
+ pointer.value.revise.final = await compiler.typescript.beautify(
96
+ pointer.value.revise.final,
97
+ );
98
+ else
99
+ pointer.value.draft = await compiler.typescript.beautify(
100
+ pointer.value.draft,
101
+ );
92
102
  return {
93
103
  type: "testWrite",
94
104
  id: v7(),
95
105
  created_at: new Date().toISOString(),
96
106
  location: `test/features/api/${pointer.value.domain}/${scenario.functionName}.ts`,
97
- ...pointer.value,
107
+ scenario: pointer.value.scenario,
108
+ domain: pointer.value.domain,
109
+ draft: pointer.value.draft,
110
+ review: pointer.value.revise?.review,
111
+ final: pointer.value.revise?.final,
98
112
  tokenUsage,
99
113
  completed: ++progress.completed,
100
114
  total: progress.total,
@@ -119,7 +133,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
119
133
  execute: {
120
134
  write: (next) => {
121
135
  next.draft = completeTestCode(props.artifacts, next.draft);
122
- next.final = completeTestCode(props.artifacts, next.final);
136
+ if (next.revise)
137
+ next.revise.final = completeTestCode(
138
+ props.artifacts,
139
+ next.revise.final,
140
+ );
123
141
  props.build(next);
124
142
  },
125
143
  } satisfies IAutoBeTestWriteApplication,
@@ -4,16 +4,14 @@ export interface IAutoBeTestCorrectApplication {
4
4
  * generates corrected E2E test code.
5
5
  *
6
6
  * The AI executes this function to perform the complete error correction
7
- * workflow: error-free analysis → compilation error analysis draft
8
- * correction → code review → final corrected implementation. This multi-step
9
- * process ensures systematic error resolution while preserving original test
10
- * functionality and maintaining code quality.
7
+ * workflow: compilation error analysis → draft correction code review
8
+ * final corrected implementation. This multi-step process ensures systematic
9
+ * error resolution while preserving original test functionality and
10
+ * maintaining code quality.
11
11
  *
12
- * The corrector first analyzes the scenario without considering compilation
13
- * errors to understand the intended functionality, then incorporates
14
- * compilation diagnostics to identify specific issues, and finally produces
15
- * corrected code through iterative refinement with comprehensive review and
16
- * validation.
12
+ * The corrector analyzes compilation diagnostics to identify specific issues,
13
+ * develops correction strategies, and produces corrected code through
14
+ * iterative refinement with comprehensive review and validation.
17
15
  *
18
16
  * @param props Complete specification for error correction workflow including
19
17
  * analysis steps, draft implementation, review process, and final code
@@ -25,47 +23,30 @@ export interface IAutoBeTestCorrectApplication {
25
23
  export namespace IAutoBeTestCorrectApplication {
26
24
  export interface IProps {
27
25
  /**
28
- * Step 1: Initial analysis and understanding without compilation error
29
- * context.
30
- *
31
- * AI analyzes the original test scenario, business requirements, and
32
- * intended functionality without being influenced by compilation errors.
33
- * This clean analysis establishes a clear understanding of what the test
34
- * accomplishes, the expected business workflow, and the correct API
35
- * integration patterns.
36
- *
37
- * This step ensures that error correction doesn't lose sight of the
38
- * original test purpose and helps maintain the intended business logic
39
- * while addressing technical compilation issues. The AI develops a
40
- * comprehensive understanding of the test requirements before diving into
41
- * error-specific details.
42
- *
43
- * Workflow: Scenario understanding → Business logic analysis → Intended
44
- * functionality mapping
45
- */
46
- think_without_compile_error: string;
47
-
48
- /**
49
- * Step 2: Compilation error analysis and root cause identification.
26
+ * Step 1: Deep compilation error analysis and correction strategy.
27
+ *
28
+ * AI performs comprehensive analysis of compilation errors to develop
29
+ * targeted correction strategies. This step involves deep examination of
30
+ * error messages, identification of error patterns, understanding root
31
+ * causes, and planning systematic corrections.
50
32
  *
51
- * AI re-analyzes the scenario and implementation with full awareness of
52
- * compilation errors and diagnostic information. This step involves
53
- * systematic examination of error messages, identification of error
54
- * patterns, and understanding of how compilation issues relate to the
55
- * intended functionality.
33
+ * The AI examines each compilation diagnostic to understand where the
34
+ * implementation diverged from correct TypeScript usage, identifies the
35
+ * business logic intent behind the failed code, and formulates strategies
36
+ * to fix errors while preserving the original test purpose. This analysis
37
+ * correlates error patterns with code structure to ensure corrections
38
+ * address root causes rather than symptoms.
56
39
  *
57
- * The AI correlates compilation diagnostics with the original requirements
58
- * to understand where the implementation diverged from correct TypeScript
59
- * usage while maintaining the business logic intent. This analysis forms
60
- * the foundation for targeted error correction strategies.
40
+ * This deep analysis forms the foundation for all subsequent correction
41
+ * efforts, ensuring a methodical approach to resolving compilation issues.
61
42
  *
62
43
  * Workflow: Error diagnostic analysis → Root cause identification →
63
- * Correction strategy planning
44
+ * Correction strategy planning → Business logic preservation strategy
64
45
  */
65
- think_again_with_compile_error: string;
46
+ think: string;
66
47
 
67
48
  /**
68
- * Step 3: Draft corrected TypeScript E2E test code implementation.
49
+ * Step 2: Draft corrected TypeScript E2E test code implementation.
69
50
  *
70
51
  * AI generates the first corrected version of the test code based on error
71
52
  * analysis and correction strategies. This draft addresses all identified
@@ -86,7 +67,29 @@ export namespace IAutoBeTestCorrectApplication {
86
67
  draft: string;
87
68
 
88
69
  /**
89
- * Step 4: Code review and correction validation.
70
+ * Step 3-4: Review and finalization process.
71
+ *
72
+ * Encapsulates the review and final implementation phases into a single
73
+ * revision process. This structured approach ensures systematic validation
74
+ * and refinement of the corrected code through comprehensive review
75
+ * followed by production-ready implementation.
76
+ *
77
+ * The revision process maintains clear separation between review feedback
78
+ * and final deliverable while ensuring all corrections are properly
79
+ * validated and integrated.
80
+ */
81
+ revise: IReviseProps;
82
+ }
83
+
84
+ /**
85
+ * Revision properties for the final review and implementation phases.
86
+ *
87
+ * This interface encapsulates the final two steps of the error correction
88
+ * workflow, ensuring systematic review and production-ready code delivery.
89
+ */
90
+ export interface IReviseProps {
91
+ /**
92
+ * Step 3: Code review and correction validation.
90
93
  *
91
94
  * AI performs a comprehensive review of the corrected draft implementation,
92
95
  * validating that all compilation errors have been resolved and that the
@@ -105,7 +108,7 @@ export namespace IAutoBeTestCorrectApplication {
105
108
  review: string;
106
109
 
107
110
  /**
108
- * Step 5: Final production-ready corrected test code.
111
+ * Step 4: Final production-ready corrected test code.
109
112
  *
110
113
  * AI produces the final, polished version of the corrected test code
111
114
  * incorporating all review feedback and validation results. This code
@@ -119,7 +122,7 @@ export namespace IAutoBeTestCorrectApplication {
119
122
  * behaviors and user workflows.
120
123
  *
121
124
  * Workflow: Review integration → Final refinement → Production-ready
122
- * implementation This is the ultimate deliverable that will replace the
125
+ * implementation. This is the ultimate deliverable that will replace the
123
126
  * compilation-failed code.
124
127
  */
125
128
  final: string;
@@ -0,0 +1,8 @@
1
+ import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
2
+
3
+ import { IAutoBeTestFunction } from "./IAutoBeTestFunction";
4
+
5
+ export interface IAutoBeTestFunctionFailure {
6
+ function: IAutoBeTestFunction;
7
+ failure: IAutoBeTypeScriptCompileResult.IFailure;
8
+ }
@@ -5,4 +5,5 @@ export interface IAutoBeTestScenarioArtifacts {
5
5
  sdk: Record<string, string>;
6
6
  dto: Record<string, string>;
7
7
  e2e: Record<string, string>;
8
+ template: string;
8
9
  }
@@ -60,6 +60,20 @@ export namespace IAutoBeTestWriteApplication {
60
60
  */
61
61
  draft: string;
62
62
 
63
+ /**
64
+ * Steps 4-5: Code review and final refinement process.
65
+ *
66
+ * Contains the iterative improvement workflow that transforms the initial
67
+ * draft into production-ready test code. This two-phase process ensures
68
+ * systematic quality enhancement through comprehensive review followed by
69
+ * targeted refinement based on identified issues.
70
+ *
71
+ * Workflow: Draft → Review analysis → Final implementation
72
+ */
73
+ revise: IReviseProps;
74
+ }
75
+
76
+ export interface IReviseProps {
63
77
  /**
64
78
  * Step 4: Code review and quality assessment.
65
79
  *
@@ -0,0 +1,25 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+ import { OpenApiTypeChecker } from "@samchon/openapi";
3
+
4
+ export const getReferenceIds = (props: {
5
+ document: AutoBeOpenApi.IDocument;
6
+ operation: AutoBeOpenApi.IOperation;
7
+ }): string[] => {
8
+ const result: Set<string> = new Set();
9
+ const emplace = (key: string) => {
10
+ if (key.endsWith("_id")) result.add(key);
11
+ };
12
+
13
+ props.operation.parameters.forEach((p) => emplace(p.name));
14
+ if (props.operation.requestBody) {
15
+ OpenApiTypeChecker.visit({
16
+ components: props.document.components,
17
+ schema: { $ref: props.operation.requestBody.typeName },
18
+ closure: (schema) => {
19
+ if (OpenApiTypeChecker.isObject(schema) === false) return;
20
+ for (const key of Object.keys(schema.properties ?? {})) emplace(key);
21
+ },
22
+ });
23
+ }
24
+ return Array.from(result);
25
+ };
@@ -16,6 +16,9 @@
16
16
  * @author Samchon
17
17
  */
18
18
  export interface IAutoBeConfig {
19
+ /** @default 4 */
20
+ retry?: number;
21
+
19
22
  /**
20
23
  * Language and cultural locale preference for AI agent communication.
21
24
  *
@@ -1,38 +0,0 @@
1
- import { AutoBeOpenApi, AutoBeRealizeAuthorization, AutoBeTestFile } from "@autobe/interface";
2
- export declare namespace IAutoBeRealizeScenarioApplication {
3
- interface IProps {
4
- /** The OpenAPI operation to be realized. */
5
- operation: AutoBeOpenApi.IOperation;
6
- /**
7
- * The name of the function to be generated.
8
- *
9
- * Derived from the Swagger path and method. The function name must be
10
- * written in snake_case. It serves as the entry point in both code
11
- * generation and test code.
12
- *
13
- * Once the function is generated, the function name and file name will be
14
- * the same. The generated file will be located at
15
- * `src/providers/${function_name}.ts`.
16
- */
17
- functionName: string;
18
- /** For example, `src/providers/${function_name}.ts`. */
19
- location: string;
20
- /**
21
- * List of scenario descriptions for test code generation.
22
- *
23
- * Each scenario describes the expected behavior of the function under
24
- * certain conditions. Used as a basis for TDD-style automated test
25
- * generation.
26
- */
27
- testFiles: AutoBeTestFile[];
28
- /**
29
- * Optional decorator event for customizing code generation behavior.
30
- *
31
- * Provides additional metadata or instructions that can modify how the
32
- * function implementation is generated. Can include custom annotations,
33
- * middleware configurations, or special handling directives that affect the
34
- * final code output.
35
- */
36
- decoratorEvent?: AutoBeRealizeAuthorization;
37
- }
38
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"IAutoBeRealizeScenarioApplication.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts"],"names":[],"mappings":""}
@@ -1,38 +0,0 @@
1
- import { AutoBeOpenApi, AutoBeRealizeAuthorization, AutoBeTestFile } from "@autobe/interface";
2
- export declare namespace IAutoBeRealizeScenarioApplication {
3
- interface IProps {
4
- /** The OpenAPI operation to be realized. */
5
- operation: AutoBeOpenApi.IOperation;
6
- /**
7
- * The name of the function to be generated.
8
- *
9
- * Derived from the Swagger path and method. The function name must be
10
- * written in snake_case. It serves as the entry point in both code
11
- * generation and test code.
12
- *
13
- * Once the function is generated, the function name and file name will be
14
- * the same. The generated file will be located at
15
- * `src/providers/${function_name}.ts`.
16
- */
17
- functionName: string;
18
- /** For example, `src/providers/${function_name}.ts`. */
19
- location: string;
20
- /**
21
- * List of scenario descriptions for test code generation.
22
- *
23
- * Each scenario describes the expected behavior of the function under
24
- * certain conditions. Used as a basis for TDD-style automated test
25
- * generation.
26
- */
27
- testFiles: AutoBeTestFile[];
28
- /**
29
- * Optional decorator event for customizing code generation behavior.
30
- *
31
- * Provides additional metadata or instructions that can modify how the
32
- * function implementation is generated. Can include custom annotations,
33
- * middleware configurations, or special handling directives that affect the
34
- * final code output.
35
- */
36
- decoratorEvent?: AutoBeRealizeAuthorization;
37
- }
38
- }