@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
@@ -1,79 +1,39 @@
1
- import { IAutoBeRealizeWriteApplication } from "./IAutoBeRealizeWriteApplication";
2
1
  export interface IAutoBeRealizeCorrectApplication {
2
+ /**
3
+ * Reviews and corrects TypeScript compilation errors.
4
+ *
5
+ * Fixes TypeScript compilation errors while preserving original business
6
+ * logic, applying minimal intervention principle.
7
+ *
8
+ * @param props Properties containing the multi-phase error correction process
9
+ */
3
10
  review: (props: IAutoBeRealizeCorrectApplication.IProps) => void;
4
11
  }
5
12
  export declare namespace IAutoBeRealizeCorrectApplication {
6
- interface IProps extends IAutoBeRealizeWriteApplication.IProps {
7
- /**
8
- * Compilation Error Analysis and Resolution Strategy
9
- *
10
- * This field contains a detailed analysis of TypeScript compilation errors
11
- * that occurred during the previous compilation attempt, along with
12
- * specific strategies to resolve each error.
13
- *
14
- * The analysis MUST include:
15
- *
16
- * 📊 ERROR BREAKDOWN:
17
- *
18
- * - List of all TypeScript error codes encountered (e.g., TS2339, TS2345)
19
- * - Exact error messages and the lines/files where they occurred
20
- * - Categorization of errors by type (type mismatch, missing property, etc.)
21
- *
22
- * 🔍 ROOT CAUSE ANALYSIS:
23
- *
24
- * - Why each error occurred (e.g., incorrect type assumptions, missing
25
- * fields)
26
- * - Relationship between errors (e.g., cascading errors from a single issue)
27
- * - Common patterns identified across multiple errors
28
- *
29
- * 🛠 RESOLUTION STRATEGY:
30
- *
31
- * - Specific fixes for each error type
32
- * - Priority order for addressing errors (fix critical errors first)
33
- * - Alternative approaches if the direct fix is not possible
34
- *
35
- * 📝 SCHEMA VERIFICATION:
36
- *
37
- * - Re-verification of Prisma schema fields actually available
38
- * - Identification of assumed fields that don't exist
39
- * - Correct field types and relationships
40
- *
41
- * ⚠️ COMMON ERROR PATTERNS TO CHECK:
42
- *
43
- * - Using non-existent fields (e.g., deleted_at, created_by)
44
- * - Type mismatches in Prisma operations
45
- * - Incorrect date handling (using Date instead of string)
46
- * - Missing required fields in create/update operations
47
- * - Incorrect relation handling in nested operations
48
- *
49
- * 🎯 CORRECTION APPROACH:
50
- *
51
- * - Remove references to non-existent fields
52
- * - Fix type conversions (especially dates with toISOStringSafe())
53
- * - Simplify complex nested operations into separate queries
54
- * - Add missing required fields
55
- * - Use correct Prisma input types
56
- *
57
- * Example structure:
58
- *
59
- * Errors Found:
60
- * 1. TS2339: Property 'deleted_at' does not exist on type 'User'
61
- * - Cause: Field assumed but not in schema
62
- * - Fix: Remove all deleted_at references
63
- *
64
- * 2. TS2345: Type 'Date' is not assignable to type 'string'
65
- * - Cause: Direct Date assignment without conversion
66
- * - Fix: Use toISOStringSafe() for all date values
67
- *
68
- * Resolution Plan:
69
- * 1. First, remove all non-existent field references
70
- * 2. Then, fix all date type conversions
71
- * 3. Finally, adjust Prisma query structures
72
- *
73
- * This analysis ensures the review process addresses all compilation errors
74
- * systematically and produces error-free code in the corrected
75
- * implementation.
76
- */
77
- errorAnalysis: string;
13
+ /**
14
+ * Properties for error correction following Chain of Thinking (CoT).
15
+ *
16
+ * All phases are wrapped in a `revise` object for systematic error
17
+ * resolution.
18
+ */
19
+ interface IProps {
20
+ /** Revision process containing all error correction phases. */
21
+ revise: IRevise;
22
+ }
23
+ interface IRevise {
24
+ /** Step 1: Compilation error analysis and resolution strategy. */
25
+ errorAnalysis?: string;
26
+ /** Step 2: Provider function implementation plan. */
27
+ plan?: string;
28
+ /** Step 3: Relevant Prisma schema definitions. */
29
+ prismaSchemas?: string;
30
+ /** Step 4: Initial draft without using native Date type. */
31
+ draftWithoutDateType?: string;
32
+ /** Step 5: Refined version with improved completeness. */
33
+ review?: string;
34
+ /** Step 6: Corrected implementation after compiler feedback. */
35
+ withCompilerFeedback?: string;
36
+ /** Step 7: Final complete TypeScript function implementation. */
37
+ implementationCode: string;
78
38
  }
79
39
  }
@@ -0,0 +1,5 @@
1
+ import { AutoBeRealizeFunction, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
2
+ export interface IAutoBeRealizeFunctionFailure {
3
+ function: AutoBeRealizeFunction;
4
+ diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[];
5
+ }
@@ -0,0 +1,36 @@
1
+ import { AutoBeOpenApi, AutoBeRealizeAuthorization, AutoBeTestFile } from "@autobe/interface";
2
+ export interface IAutoBeRealizeScenarioResult {
3
+ /** The OpenAPI operation to be realized. */
4
+ operation: AutoBeOpenApi.IOperation;
5
+ /**
6
+ * The name of the function to be generated.
7
+ *
8
+ * Derived from the Swagger path and method. The function name must be
9
+ * written in snake_case. It serves as the entry point in both code
10
+ * generation and test code.
11
+ *
12
+ * Once the function is generated, the function name and file name will be
13
+ * the same. The generated file will be located at
14
+ * `src/providers/${function_name}.ts`.
15
+ */
16
+ functionName: string;
17
+ /** For example, `src/providers/${function_name}.ts`. */
18
+ location: string;
19
+ /**
20
+ * List of scenario descriptions for test code generation.
21
+ *
22
+ * Each scenario describes the expected behavior of the function under
23
+ * certain conditions. Used as a basis for TDD-style automated test
24
+ * generation.
25
+ */
26
+ testFiles: AutoBeTestFile[];
27
+ /**
28
+ * Optional decorator event for customizing code generation behavior.
29
+ *
30
+ * Provides additional metadata or instructions that can modify how the
31
+ * function implementation is generated. Can include custom annotations,
32
+ * middleware configurations, or special handling directives that affect the
33
+ * final code output.
34
+ */
35
+ decoratorEvent?: AutoBeRealizeAuthorization;
36
+ }
@@ -1,10 +1,34 @@
1
1
  export interface IAutoBeRealizeWriteApplication {
2
+ /**
3
+ * Generates provider function implementation through multi-phase development.
4
+ *
5
+ * This method implements a systematic approach to generate NestJS provider
6
+ * functions that handle business logic for API operations. It follows a
7
+ * schema-first approach with multiple refinement phases to ensure type-safe,
8
+ * error-free code generation.
9
+ *
10
+ * The generation process includes:
11
+ * 1. Strategic planning based on Prisma schema analysis
12
+ * 2. Initial draft without Date type usage
13
+ * 3. Review and refinement for completeness
14
+ * 4. Compiler feedback integration if errors detected
15
+ * 5. Final implementation with all validations and type safety
16
+ *
17
+ * @param next Properties containing the multi-phase implementation plan and code
18
+ */
2
19
  coding: (next: IAutoBeRealizeWriteApplication.IProps) => void;
3
20
  }
4
21
  export declare namespace IAutoBeRealizeWriteApplication {
22
+ /**
23
+ * Properties for the Realize Write Application following Chain of Thinking (CoT).
24
+ *
25
+ * Each field represents a distinct phase in the reasoning and implementation process,
26
+ * building upon the previous step to create a complete, error-free implementation.
27
+ * This structured approach ensures clarity, debuggability, and systematic thinking.
28
+ */
5
29
  interface IProps {
6
30
  /**
7
- * Step 1.
31
+ * Step 1 - Planning Phase (CoT: Initial Reasoning)
8
32
  *
9
33
  * 🧠 Provider Function Implementation Plan
10
34
  *
@@ -21,12 +45,14 @@ export declare namespace IAutoBeRealizeWriteApplication {
21
45
  * - Examine the actual Prisma schema model definition
22
46
  * - List EVERY field that exists in the model with exact types
23
47
  * - Explicitly note fields that DO NOT exist
48
+ * - Verify database compatibility (PostgreSQL AND SQLite)
24
49
  *
25
50
  * DO NOT:
26
51
  *
27
52
  * - Assume common fields exist without verification
28
53
  * - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active
29
54
  * without checking
55
+ * - Use PostgreSQL-specific features like mode: "insensitive"
30
56
  *
31
57
  * 📋 STEP 2 - FIELD INVENTORY:
32
58
  *
@@ -134,7 +160,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
134
160
  */
135
161
  plan: string;
136
162
  /**
137
- * Step 2.
163
+ * Step 2 - Schema Definition (CoT: Context Establishment)
138
164
  *
139
165
  * The Prisma schema string that will be used to validate the implementation
140
166
  * logic in this file.
@@ -155,7 +181,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
155
181
  */
156
182
  prisma_schemas: string;
157
183
  /**
158
- * Step 3.
184
+ * Step 3 - Initial Draft (CoT: First Implementation Attempt)
159
185
  *
160
186
  * Draft WITHOUT using native Date type.
161
187
  *
@@ -191,7 +217,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
191
217
  */
192
218
  draft_without_date_type: string;
193
219
  /**
194
- * Step 4.
220
+ * Step 4 - Review and Refinement (CoT: Self-Reflection)
195
221
  *
196
222
  * A refined version of the draft with improved completeness.
197
223
  *
@@ -205,27 +231,11 @@ export declare namespace IAutoBeRealizeWriteApplication {
205
231
  * - Avoid unsafe `as` casts unless only for branding or literal narrowing.
206
232
  * - Use `toISOStringSafe()` for all date conversions (NOT `.toISOString()`).
207
233
  * - Ensure all object keys strictly conform to the expected type definitions.
234
+ * - NEVER use `mode: "insensitive"` in string operations (breaks SQLite).
208
235
  */
209
236
  review: string;
210
237
  /**
211
- * 🛠 Phase 4-2: With compiler feedback (optional)
212
- *
213
- * A correction pass that applies fixes for compile-time errors that arose
214
- * during the review stage (if any).
215
- *
216
- * ✅ Must:
217
- *
218
- * - Only include this field if TypeScript errors are detected in the Review
219
- * phase.
220
- * - Resolve all TypeScript errors without using `as any`.
221
- * - Provide safe brand casting only if required (e.g., `as string &
222
- * tags.Format<'uuid'>`).
223
- * - If no TypeScript errors exist, this field MUST contain the text: "No
224
- * TypeScript errors detected - skipping this phase"
225
- */
226
- withCompilerFeedback: string;
227
- /**
228
- * Step 5.
238
+ * Step 5 - Complete Implementation (CoT: Final Synthesis)
229
239
  *
230
240
  * The complete and fully correct TypeScript function implementation.
231
241
  *
@@ -237,6 +247,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
237
247
  * - Uses only allowed imports (e.g., from `../api/structures` and
238
248
  * `MyGlobal.prisma`).
239
249
  * - NEVER creates intermediate variables for Prisma operations.
250
+ * - NEVER uses `mode: "insensitive"` (PostgreSQL-only, breaks SQLite).
240
251
  *
241
252
  * ⚠️ Fallback Behavior:
242
253
  *
@@ -0,0 +1,31 @@
1
+ import { AutoBeOpenApi, AutoBeRealizeAuthorization } from "@autobe/interface";
2
+ import { IAutoBeRealizeScenarioResult } from "../structures/IAutoBeRealizeScenarioResult";
3
+ /**
4
+ * Generate a TypeScript function template for the Realize Agent to complete
5
+ *
6
+ * This utility creates a function skeleton with proper imports, parameters, and
7
+ * return type that the AI needs to implement. The template includes:
8
+ *
9
+ * - Import statements for required dependencies
10
+ * - Function signature with all parameters
11
+ * - Return type specification
12
+ *
13
+ * @example
14
+ * // Returns a template like:
15
+ * ```typescript
16
+ * import { MyGlobal } from "../MyGlobal";
17
+ * // ... other imports
18
+ *
19
+ * async function post__users_create(
20
+ * body: IUserCreateRequest
21
+ * ): Promise<IUserResponse> {
22
+ * ...
23
+ * }
24
+ * ```;
25
+ *
26
+ * @param scenario - The realize scenario containing function metadata
27
+ * @param operation - OpenAPI operation definition
28
+ * @param authorization - Authorization context if endpoint is authenticated
29
+ * @returns Complete TypeScript code template as a formatted string
30
+ */
31
+ export declare function getRealizeWriteCodeTemplate(scenario: IAutoBeRealizeScenarioResult, operation: AutoBeOpenApi.IOperation, authorization: AutoBeRealizeAuthorization | null): string;
@@ -0,0 +1,4 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+ import { ILlmSchema } from "@samchon/openapi";
3
+ import { AutoBeContext } from "../../../context/AutoBeContext";
4
+ export declare function getRealizeWriteDto<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation): Promise<Record<string, string>>;
@@ -0,0 +1,2 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+ export declare function getRealizeWriteImportStatements(operation: AutoBeOpenApi.IOperation): string[];
@@ -0,0 +1,30 @@
1
+ import { AutoBeOpenApi, AutoBeRealizeAuthorization } from "@autobe/interface";
2
+ /**
3
+ * Generate TypeScript type definition string for provider function props
4
+ *
5
+ * This utility creates the exact props interface that the Realize Agent's
6
+ * generated provider functions must accept. It combines:
7
+ *
8
+ * - Authentication context (user/admin/member from authorization)
9
+ * - URL path parameters (e.g., id, boardId, postId)
10
+ * - Request body type (if applicable)
11
+ *
12
+ * The output is injected into REALIZE_WRITE_ARTIFACT.md template to tell the AI
13
+ * exactly what parameter type the function should accept.
14
+ *
15
+ * @example
16
+ * // For DELETE /posts/:id (authenticated)
17
+ * // Returns: "props: { user: IUser; id: string & tags.Format<'uuid'>; }"
18
+ *
19
+ * @example
20
+ * // For GET /public/info (no auth, no params)
21
+ * // Returns: "// No props parameter needed - function should have no parameters"
22
+ *
23
+ * @param operation - OpenAPI operation definition containing parameters and
24
+ * auth requirements
25
+ * @param authorization - Authorization context with user/role information (if
26
+ * authenticated endpoint)
27
+ * @returns TypeScript interface string like "props: { user: IUser; id: string;
28
+ * body: IRequest; }"
29
+ */
30
+ export declare function getRealizeWriteInputType(operation: AutoBeOpenApi.IOperation, authorization: AutoBeRealizeAuthorization | null): string;
@@ -1,4 +1,8 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
1
2
  import { ILlmSchema } from "@samchon/openapi";
2
3
  import { AutoBeContext } from "../../../context/AutoBeContext";
3
- import { IAutoBeTestScenarioArtifacts } from "../../test/structures/IAutoBeTestScenarioArtifacts";
4
- export declare function replaceImportStatements<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>): (artifacts: IAutoBeTestScenarioArtifacts, code: string, decoratorType?: string) => Promise<string>;
4
+ export declare function replaceImportStatements<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
5
+ operation: AutoBeOpenApi.IOperation;
6
+ code: string;
7
+ decoratorType?: string;
8
+ }): Promise<string>;
@@ -0,0 +1,2 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+ export declare const getTestImportStatements: (document: AutoBeOpenApi.IDocument) => string;
@@ -2,4 +2,4 @@ import { AutoBeTestScenario } from "@autobe/interface";
2
2
  import { ILlmSchema } from "@samchon/openapi";
3
3
  import { AutoBeContext } from "../../../context/AutoBeContext";
4
4
  import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
5
- export declare function getTestScenarioArtifacts<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenario: Pick<AutoBeTestScenario, "endpoint" | "dependencies">): Promise<IAutoBeTestScenarioArtifacts>;
5
+ export declare function getTestScenarioArtifacts<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenario: Pick<AutoBeTestScenario, "endpoint" | "dependencies" | "functionName">): Promise<IAutoBeTestScenarioArtifacts>;
@@ -0,0 +1,2 @@
1
+ import { AutoBeOpenApi, AutoBeTestScenario } from "@autobe/interface";
2
+ export declare const getTestTemplateCode: (scenario: Pick<AutoBeTestScenario, "endpoint" | "dependencies" | "functionName">, document: AutoBeOpenApi.IDocument) => string;
@@ -1,6 +1,6 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
3
2
  import { ILlmSchema } from "@samchon/openapi";
4
3
  import { AutoBeContext } from "../../../context/AutoBeContext";
5
4
  import { IAutoBeTestFunction } from "../structures/IAutoBeTestFunction";
6
- export declare const transformTestCorrectHistories: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, func: IAutoBeTestFunction, failure: IAutoBeTypeScriptCompileResult.IFailure) => Promise<Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>>;
5
+ import { IAutoBeTestFunctionFailure } from "../structures/IAutoBeTestFunctionFailure";
6
+ export declare const transformTestCorrectHistories: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, func: IAutoBeTestFunction, failures: IAutoBeTestFunctionFailure[]) => Promise<Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>>;
@@ -2,4 +2,4 @@ import { AutoBeTestValidateEvent } from "@autobe/interface";
2
2
  import { ILlmSchema } from "@samchon/openapi";
3
3
  import { AutoBeContext } from "../../context/AutoBeContext";
4
4
  import { IAutoBeTestWriteResult } from "./structures/IAutoBeTestWriteResult";
5
- export declare const orchestrateTestCorrect: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, writeResult: IAutoBeTestWriteResult[], life?: number) => Promise<AutoBeTestValidateEvent[]>;
5
+ export declare const orchestrateTestCorrect: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, writeResult: IAutoBeTestWriteResult[]) => Promise<AutoBeTestValidateEvent[]>;
@@ -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
@@ -24,45 +22,29 @@ export interface IAutoBeTestCorrectApplication {
24
22
  export declare namespace IAutoBeTestCorrectApplication {
25
23
  interface IProps {
26
24
  /**
27
- * Step 1: Initial analysis and understanding without compilation error
28
- * context.
29
- *
30
- * AI analyzes the original test scenario, business requirements, and
31
- * intended functionality without being influenced by compilation errors.
32
- * This clean analysis establishes a clear understanding of what the test
33
- * accomplishes, the expected business workflow, and the correct API
34
- * integration patterns.
35
- *
36
- * This step ensures that error correction doesn't lose sight of the
37
- * original test purpose and helps maintain the intended business logic
38
- * while addressing technical compilation issues. The AI develops a
39
- * comprehensive understanding of the test requirements before diving into
40
- * error-specific details.
41
- *
42
- * Workflow: Scenario understanding → Business logic analysis → Intended
43
- * functionality mapping
44
- */
45
- think_without_compile_error: string;
46
- /**
47
- * Step 2: Compilation error analysis and root cause identification.
25
+ * Step 1: Deep compilation error analysis and correction strategy.
26
+ *
27
+ * AI performs comprehensive analysis of compilation errors to develop
28
+ * targeted correction strategies. This step involves deep examination of
29
+ * error messages, identification of error patterns, understanding root
30
+ * causes, and planning systematic corrections.
48
31
  *
49
- * AI re-analyzes the scenario and implementation with full awareness of
50
- * compilation errors and diagnostic information. This step involves
51
- * systematic examination of error messages, identification of error
52
- * patterns, and understanding of how compilation issues relate to the
53
- * intended functionality.
32
+ * The AI examines each compilation diagnostic to understand where the
33
+ * implementation diverged from correct TypeScript usage, identifies the
34
+ * business logic intent behind the failed code, and formulates strategies
35
+ * to fix errors while preserving the original test purpose. This analysis
36
+ * correlates error patterns with code structure to ensure corrections
37
+ * address root causes rather than symptoms.
54
38
  *
55
- * The AI correlates compilation diagnostics with the original requirements
56
- * to understand where the implementation diverged from correct TypeScript
57
- * usage while maintaining the business logic intent. This analysis forms
58
- * the foundation for targeted error correction strategies.
39
+ * This deep analysis forms the foundation for all subsequent correction
40
+ * efforts, ensuring a methodical approach to resolving compilation issues.
59
41
  *
60
42
  * Workflow: Error diagnostic analysis → Root cause identification →
61
- * Correction strategy planning
43
+ * Correction strategy planning → Business logic preservation strategy
62
44
  */
63
- think_again_with_compile_error: string;
45
+ think: string;
64
46
  /**
65
- * Step 3: Draft corrected TypeScript E2E test code implementation.
47
+ * Step 2: Draft corrected TypeScript E2E test code implementation.
66
48
  *
67
49
  * AI generates the first corrected version of the test code based on error
68
50
  * analysis and correction strategies. This draft addresses all identified
@@ -82,7 +64,28 @@ export declare namespace IAutoBeTestCorrectApplication {
82
64
  */
83
65
  draft: string;
84
66
  /**
85
- * Step 4: Code review and correction validation.
67
+ * Step 3-4: Review and finalization process.
68
+ *
69
+ * Encapsulates the review and final implementation phases into a single
70
+ * revision process. This structured approach ensures systematic validation
71
+ * and refinement of the corrected code through comprehensive review
72
+ * followed by production-ready implementation.
73
+ *
74
+ * The revision process maintains clear separation between review feedback
75
+ * and final deliverable while ensuring all corrections are properly
76
+ * validated and integrated.
77
+ */
78
+ revise: IReviseProps;
79
+ }
80
+ /**
81
+ * Revision properties for the final review and implementation phases.
82
+ *
83
+ * This interface encapsulates the final two steps of the error correction
84
+ * workflow, ensuring systematic review and production-ready code delivery.
85
+ */
86
+ interface IReviseProps {
87
+ /**
88
+ * Step 3: Code review and correction validation.
86
89
  *
87
90
  * AI performs a comprehensive review of the corrected draft implementation,
88
91
  * validating that all compilation errors have been resolved and that the
@@ -100,7 +103,7 @@ export declare namespace IAutoBeTestCorrectApplication {
100
103
  */
101
104
  review: string;
102
105
  /**
103
- * Step 5: Final production-ready corrected test code.
106
+ * Step 4: Final production-ready corrected test code.
104
107
  *
105
108
  * AI produces the final, polished version of the corrected test code
106
109
  * incorporating all review feedback and validation results. This code
@@ -114,7 +117,7 @@ export declare namespace IAutoBeTestCorrectApplication {
114
117
  * behaviors and user workflows.
115
118
  *
116
119
  * Workflow: Review integration → Final refinement → Production-ready
117
- * implementation This is the ultimate deliverable that will replace the
120
+ * implementation. This is the ultimate deliverable that will replace the
118
121
  * compilation-failed code.
119
122
  */
120
123
  final: string;
@@ -0,0 +1,6 @@
1
+ import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
2
+ import { IAutoBeTestFunction } from "./IAutoBeTestFunction";
3
+ export interface IAutoBeTestFunctionFailure {
4
+ function: IAutoBeTestFunction;
5
+ failure: IAutoBeTypeScriptCompileResult.IFailure;
6
+ }
@@ -4,4 +4,5 @@ export interface IAutoBeTestScenarioArtifacts {
4
4
  sdk: Record<string, string>;
5
5
  dto: Record<string, string>;
6
6
  e2e: Record<string, string>;
7
+ template: string;
7
8
  }
@@ -55,6 +55,19 @@ export declare namespace IAutoBeTestWriteApplication {
55
55
  * Critical: NO import statements, start directly with 'export async function'
56
56
  */
57
57
  draft: string;
58
+ /**
59
+ * Steps 4-5: Code review and final refinement process.
60
+ *
61
+ * Contains the iterative improvement workflow that transforms the initial
62
+ * draft into production-ready test code. This two-phase process ensures
63
+ * systematic quality enhancement through comprehensive review followed by
64
+ * targeted refinement based on identified issues.
65
+ *
66
+ * Workflow: Draft → Review analysis → Final implementation
67
+ */
68
+ revise: IReviseProps;
69
+ }
70
+ interface IReviseProps {
58
71
  /**
59
72
  * Step 4: Code review and quality assessment.
60
73
  *
@@ -0,0 +1,5 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+ export declare const getReferenceIds: (props: {
3
+ document: AutoBeOpenApi.IDocument;
4
+ operation: AutoBeOpenApi.IOperation;
5
+ }) => string[];
@@ -16,6 +16,8 @@
16
16
  * @author Samchon
17
17
  */
18
18
  export interface IAutoBeConfig {
19
+ /** @default 4 */
20
+ retry?: number;
19
21
  /**
20
22
  * Language and cultural locale preference for AI agent communication.
21
23
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobe/agent",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "AI backend server code generator",
5
5
  "main": "lib/index.js",
6
6
  "author": "Wrtn Technologies",
@@ -27,8 +27,8 @@
27
27
  "tstl": "^3.0.0",
28
28
  "typia": "^9.7.2",
29
29
  "uuid": "^11.1.0",
30
- "@autobe/utils": "^0.21.0",
31
- "@autobe/interface": "^0.21.0"
30
+ "@autobe/utils": "^0.22.0",
31
+ "@autobe/interface": "^0.22.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@rollup/plugin-json": "^6.1.0",
@@ -40,8 +40,8 @@
40
40
  "ts-node": "^10.9.2",
41
41
  "ts-patch": "^3.3.0",
42
42
  "typescript": "~5.9.2",
43
- "@autobe/filesystem": "^0.21.0",
44
- "@autobe/compiler": "^0.21.0"
43
+ "@autobe/compiler": "^0.22.0",
44
+ "@autobe/filesystem": "^0.22.0"
45
45
  },
46
46
  "keywords": [
47
47
  "ai",
@@ -16,6 +16,7 @@ import { Semaphore, Singleton } from "tstl";
16
16
  import { v7 } from "uuid";
17
17
 
18
18
  import { AutoBeAgentBase } from "./AutoBeAgentBase";
19
+ import { AutoBeConfigConstant } from "./constants/AutoBeConfigConstant";
19
20
  import { AutoBeContext } from "./context/AutoBeContext";
20
21
  import { AutoBeState } from "./context/AutoBeState";
21
22
  import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
@@ -143,6 +144,7 @@ export class AutoBeAgent<Model extends ILlmSchema.Model>
143
144
  model: props.model,
144
145
  config: {
145
146
  ...(props.config ?? {}),
147
+ retry: props.config?.retry ?? AutoBeConfigConstant.DEFAULT_RETRY,
146
148
  executor: {
147
149
  describe: null,
148
150
  },
@@ -0,0 +1,3 @@
1
+ export const enum AutoBeConfigConstant {
2
+ DEFAULT_RETRY = 4,
3
+ }