@autobe/agent 0.20.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 (320) 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/AutoBeMockAgent.js +1 -0
  4. package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
  5. package/lib/agent/src/constants/AutoBeConfigConstant.d.ts +3 -0
  6. package/lib/agent/src/{orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js → constants/AutoBeConfigConstant.js} +1 -1
  7. package/lib/agent/src/constants/AutoBeConfigConstant.js.map +1 -0
  8. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +27 -26
  9. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
  10. package/lib/agent/src/context/AutoBeContext.d.ts +3 -2
  11. package/lib/agent/src/context/AutoBeTokenUsageComponent.js +4 -3
  12. package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
  13. package/lib/agent/src/factory/consentFunctionCall.js +4 -4
  14. package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
  15. package/lib/agent/src/factory/createAutoBeContext.js +16 -11
  16. package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
  17. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
  18. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  19. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
  20. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  21. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +1 -1
  22. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  23. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +6 -6
  24. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +50 -8
  25. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  26. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +4 -4
  27. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
  28. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
  29. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +1 -1
  30. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  31. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +19 -1
  32. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  33. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
  34. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  35. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
  36. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  37. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
  38. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +33 -0
  39. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -0
  40. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
  41. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  42. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  43. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  44. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
  45. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  46. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
  47. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  48. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
  49. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
  50. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  51. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +5 -1
  52. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
  53. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +16 -10
  54. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  55. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
  56. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +3731 -228
  57. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  58. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +5 -3
  59. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  60. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
  61. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +365 -0
  62. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -0
  63. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +43 -63
  64. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  65. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +244 -176
  66. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  67. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +3466 -103
  68. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  69. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
  70. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +3672 -358
  71. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
  72. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
  73. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js +3 -0
  74. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +1 -0
  75. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
  76. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -101
  77. package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
  78. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
  79. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js +1385 -0
  80. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -0
  81. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
  82. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js +78 -0
  83. package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -0
  84. package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
  85. package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js +81 -0
  86. package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js.map +1 -0
  87. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -1
  88. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +1 -1
  89. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  90. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
  91. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
  92. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
  93. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  94. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
  95. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  96. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
  97. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +2 -2
  98. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  99. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +1 -1
  100. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  101. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +2 -2
  102. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  103. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
  104. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +22 -7
  105. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  106. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
  107. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +13 -29
  108. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  109. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
  110. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js +2 -8
  111. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
  112. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +6 -49
  113. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
  114. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +4 -2
  115. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  116. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +5 -3
  117. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  118. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
  119. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +206 -118
  120. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  121. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
  122. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js +2 -2
  123. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
  124. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
  125. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -39
  126. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  127. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
  128. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
  129. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
  130. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
  131. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js +3 -0
  132. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js.map +1 -0
  133. package/{src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts → lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts} +3 -10
  134. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js +3 -0
  135. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js.map +1 -0
  136. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +40 -24
  137. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
  138. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +86 -0
  139. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -0
  140. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
  141. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js +55 -0
  142. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -0
  143. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
  144. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js +20 -0
  145. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -0
  146. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
  147. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js +73 -0
  148. package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -0
  149. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
  150. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +63 -69
  151. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  152. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +15 -14
  153. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
  154. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +1 -1
  155. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
  156. package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
  157. package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js +19 -0
  158. package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js.map +1 -0
  159. package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
  160. package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js +2 -0
  161. package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
  162. package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
  163. package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js +21 -0
  164. package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js.map +1 -0
  165. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +4 -2
  166. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +40 -25
  167. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  168. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +5 -4
  169. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  170. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
  171. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +137 -96
  172. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  173. package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -0
  174. package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
  175. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
  176. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +126 -72
  177. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  178. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +54 -48
  179. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  180. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +122 -43
  181. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  182. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
  183. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
  184. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js +3 -0
  185. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js.map +1 -0
  186. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
  187. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
  188. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
  189. package/lib/agent/src/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
  190. package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js +28 -0
  191. package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js.map +1 -0
  192. package/lib/agent/src/structures/IAutoBeConfig.d.ts +2 -0
  193. package/lib/constants/AutoBeConfigConstant.d.ts +3 -0
  194. package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -26
  195. package/lib/context/AutoBeContext.d.ts +3 -2
  196. package/lib/index.mjs +13778 -3055
  197. package/lib/index.mjs.map +1 -1
  198. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
  199. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
  200. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
  201. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
  202. package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
  203. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
  204. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
  205. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
  206. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
  207. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -101
  208. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
  209. package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
  210. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
  211. package/lib/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
  212. package/lib/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
  213. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
  214. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
  215. package/lib/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
  216. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
  217. package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
  218. package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
  219. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
  220. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
  221. package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
  222. package/lib/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
  223. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +36 -0
  224. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +40 -24
  225. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
  226. package/lib/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
  227. package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
  228. package/lib/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
  229. package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
  230. package/lib/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
  231. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
  232. package/lib/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
  233. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +4 -2
  234. package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
  235. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
  236. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
  237. package/lib/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
  238. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
  239. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
  240. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
  241. package/lib/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
  242. package/lib/structures/IAutoBeConfig.d.ts +2 -0
  243. package/package.json +6 -6
  244. package/src/AutoBeAgent.ts +2 -0
  245. package/src/AutoBeMockAgent.ts +1 -0
  246. package/src/constants/AutoBeConfigConstant.ts +3 -0
  247. package/src/constants/AutoBeSystemPromptConstant.ts +27 -26
  248. package/src/context/AutoBeContext.ts +3 -0
  249. package/src/context/AutoBeTokenUsageComponent.ts +3 -3
  250. package/src/factory/consentFunctionCall.ts +2 -0
  251. package/src/factory/createAutoBeContext.ts +145 -135
  252. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +6 -0
  253. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +4 -0
  254. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +19 -1
  255. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +39 -0
  256. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +1 -4
  257. package/src/orchestrate/interface/orchestrateInterface.ts +15 -4
  258. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -5
  259. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +58 -19
  260. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +5 -1
  261. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +95 -0
  262. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -11
  263. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +7 -3
  264. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +33 -91
  265. package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +72 -95
  266. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +65 -0
  267. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +0 -39
  268. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +50 -104
  269. package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +31 -27
  270. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +171 -0
  271. package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +83 -0
  272. package/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.ts +90 -0
  273. package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +2 -2
  274. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -2
  275. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +30 -15
  276. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -49
  277. package/src/orchestrate/realize/internal/compileRealizeFiles.ts +4 -11
  278. package/src/orchestrate/realize/orchestrateRealize.ts +19 -75
  279. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +1 -1
  280. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +114 -25
  281. package/src/orchestrate/realize/orchestrateRealizeScenario.ts +9 -5
  282. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +11 -15
  283. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +17 -0
  284. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +20 -0
  285. package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +40 -74
  286. package/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.ts +9 -0
  287. package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +45 -0
  288. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +43 -27
  289. package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +97 -0
  290. package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +64 -0
  291. package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +29 -0
  292. package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +82 -0
  293. package/src/orchestrate/realize/utils/replaceImportStatements.ts +101 -111
  294. package/src/orchestrate/test/compile/completeTestCode.ts +15 -26
  295. package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +3 -0
  296. package/src/orchestrate/test/compile/getTestImportStatements.ts +25 -0
  297. package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +6 -1
  298. package/src/orchestrate/test/compile/getTestTemplateCode.ts +25 -0
  299. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +48 -36
  300. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +6 -5
  301. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +43 -4
  302. package/src/orchestrate/test/orchestrateTest.ts +6 -0
  303. package/src/orchestrate/test/orchestrateTestCorrect.ts +46 -11
  304. package/src/orchestrate/test/orchestrateTestScenario.ts +52 -48
  305. package/src/orchestrate/test/orchestrateTestWrite.ts +24 -6
  306. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +49 -46
  307. package/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.ts +8 -0
  308. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +28 -1
  309. package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +1 -0
  310. package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +14 -0
  311. package/src/orchestrate/test/utils/getReferenceIds.ts +25 -0
  312. package/src/structures/IAutoBeConfig.ts +3 -0
  313. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
  314. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js.map +0 -1
  315. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
  316. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +0 -75
  317. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +0 -1
  318. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
  319. package/lib/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
  320. package/src/orchestrate/test/histories/transformTestHistories.ts +0 -78
@@ -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
  *
@@ -17,13 +41,18 @@ export declare namespace IAutoBeRealizeWriteApplication {
17
41
  * 📋 STEP 1 - PRISMA SCHEMA VERIFICATION:
18
42
  *
19
43
  * DO:
44
+ *
20
45
  * - Examine the actual Prisma schema model definition
21
46
  * - List EVERY field that exists in the model with exact types
22
47
  * - Explicitly note fields that DO NOT exist
48
+ * - Verify database compatibility (PostgreSQL AND SQLite)
23
49
  *
24
50
  * DO NOT:
51
+ *
25
52
  * - Assume common fields exist without verification
26
- * - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active without checking
53
+ * - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active
54
+ * without checking
55
+ * - Use PostgreSQL-specific features like mode: "insensitive"
27
56
  *
28
57
  * 📋 STEP 2 - FIELD INVENTORY:
29
58
  *
@@ -131,7 +160,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
131
160
  */
132
161
  plan: string;
133
162
  /**
134
- * Step 2.
163
+ * Step 2 - Schema Definition (CoT: Context Establishment)
135
164
  *
136
165
  * The Prisma schema string that will be used to validate the implementation
137
166
  * logic in this file.
@@ -152,7 +181,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
152
181
  */
153
182
  prisma_schemas: string;
154
183
  /**
155
- * Step 3.
184
+ * Step 3 - Initial Draft (CoT: First Implementation Attempt)
156
185
  *
157
186
  * Draft WITHOUT using native Date type.
158
187
  *
@@ -171,10 +200,12 @@ export declare namespace IAutoBeRealizeWriteApplication {
171
200
  * Import rules:
172
201
  *
173
202
  * DO NOT:
203
+ *
174
204
  * - Add any new import statements manually
175
205
  * - Write import statements directly (this causes compile errors)
176
206
  *
177
- * Note: All necessary imports are provided globally or by the system automatically.
207
+ * Note: All necessary imports are provided globally or by the system
208
+ * automatically.
178
209
  *
179
210
  * ✅ Requirements:
180
211
  *
@@ -186,7 +217,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
186
217
  */
187
218
  draft_without_date_type: string;
188
219
  /**
189
- * Step 4.
220
+ * Step 4 - Review and Refinement (CoT: Self-Reflection)
190
221
  *
191
222
  * A refined version of the draft with improved completeness.
192
223
  *
@@ -200,27 +231,11 @@ export declare namespace IAutoBeRealizeWriteApplication {
200
231
  * - Avoid unsafe `as` casts unless only for branding or literal narrowing.
201
232
  * - Use `toISOStringSafe()` for all date conversions (NOT `.toISOString()`).
202
233
  * - Ensure all object keys strictly conform to the expected type definitions.
234
+ * - NEVER use `mode: "insensitive"` in string operations (breaks SQLite).
203
235
  */
204
236
  review: string;
205
237
  /**
206
- * 🛠 Phase 4-2: With compiler feedback (optional)
207
- *
208
- * A correction pass that applies fixes for compile-time errors that arose
209
- * during the review stage (if any).
210
- *
211
- * ✅ Must:
212
- *
213
- * - Only include this field if TypeScript errors are detected in the Review
214
- * phase.
215
- * - Resolve all TypeScript errors without using `as any`.
216
- * - Provide safe brand casting only if required (e.g., `as string &
217
- * tags.Format<'uuid'>`).
218
- * - If no TypeScript errors exist, this field MUST contain the text: "No
219
- * TypeScript errors detected - skipping this phase"
220
- */
221
- withCompilerFeedback: string;
222
- /**
223
- * Step 5.
238
+ * Step 5 - Complete Implementation (CoT: Final Synthesis)
224
239
  *
225
240
  * The complete and fully correct TypeScript function implementation.
226
241
  *
@@ -232,6 +247,7 @@ export declare namespace IAutoBeRealizeWriteApplication {
232
247
  * - Uses only allowed imports (e.g., from `../api/structures` and
233
248
  * `MyGlobal.prisma`).
234
249
  * - NEVER creates intermediate variables for Prisma operations.
250
+ * - NEVER uses `mode: "insensitive"` (PostgreSQL-only, breaks SQLite).
235
251
  *
236
252
  * ⚠️ Fallback Behavior:
237
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,4 +1,6 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
2
+ import { ILlmSchema } from "@samchon/openapi";
3
+ import { AutoBeContext } from "../../../context/AutoBeContext";
3
4
  import { IAutoBeTestFunction } from "../structures/IAutoBeTestFunction";
4
- export declare const transformTestCorrectHistories: (func: IAutoBeTestFunction, failure: IAutoBeTypeScriptCompileResult.IFailure) => 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>>;
@@ -1,7 +1,9 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
2
  import { AutoBeTestScenario } from "@autobe/interface";
3
+ import { ILlmSchema } from "@samchon/openapi";
4
+ import { AutoBeContext } from "../../../context/AutoBeContext";
3
5
  import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
4
- export declare function transformTestWriteHistories(scenario: AutoBeTestScenario, artifacts: IAutoBeTestScenarioArtifacts): Array<IAgenticaHistoryJson.ISystemMessage>;
6
+ export declare function transformTestWriteHistories<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenario: AutoBeTestScenario, artifacts: IAutoBeTestScenarioArtifacts): Promise<Array<IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage>>;
5
7
  export declare namespace transformTestWriteHistories {
6
8
  function structures(artifacts: IAutoBeTestScenarioArtifacts): string;
7
9
  function functional(artifacts: IAutoBeTestScenarioArtifacts): string;
@@ -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
+ }
@@ -28,6 +28,18 @@ export declare namespace IAutoBeTestScenarioApplication {
28
28
  *
29
29
  * Each scenario represents a specific test case for the same `path` and
30
30
  * `method`.
31
+ *
32
+ * IMPORTANT: Each scenario must be actually implementable. A scenario's
33
+ * implementability is determined by the existence of ALL APIs (endpoints)
34
+ * required to test it. This includes not only the primary endpoint being
35
+ * tested, but also ALL dependency endpoints needed for setup,
36
+ * authentication, and data preparation. If even one required dependency API
37
+ * is missing from the available operations, the scenario cannot be
38
+ * implemented and should not be generated.
39
+ *
40
+ * Example: A "test banned user login" scenario requires both a login API
41
+ * AND a ban user API. If the ban API doesn't exist, this scenario is not
42
+ * implementable regardless of database schema fields.
31
43
  */
32
44
  scenarios: IScenario[] & tags.MinItems<1>;
33
45
  }
@@ -37,6 +49,11 @@ export declare namespace IAutoBeTestScenarioApplication {
37
49
  * This interface defines a structured, user-centric test draft that includes
38
50
  * a descriptive function name, a detailed scenario draft, and logical
39
51
  * dependencies on other endpoints required for context or setup.
52
+ *
53
+ * CRITICAL: All referenced endpoints MUST exist in the provided API
54
+ * operations. Do NOT create scenarios for non-existent APIs, even if database
55
+ * schema fields suggest their existence. Test scenarios must be implementable
56
+ * with available APIs only.
40
57
  */
41
58
  interface IScenario {
42
59
  /**
@@ -113,11 +130,21 @@ export declare namespace IAutoBeTestScenarioApplication {
113
130
  * authentication, resource creation, or data setup, that are relevant to
114
131
  * the test. This list is not a strict execution order — if ordering is
115
132
  * important, it must be described explicitly in the `purpose`.
133
+ *
134
+ * WARNING: Every endpoint referenced here MUST exist in the provided API
135
+ * operations. Do NOT reference endpoints that are not explicitly available,
136
+ * even if they seem logically necessary based on database schema or
137
+ * business logic.
116
138
  */
117
139
  dependencies: IDependencies[];
118
140
  }
119
141
  interface IDependencies {
120
- /** Target API endpoint that this scenario depends on. */
142
+ /**
143
+ * Target API endpoint that this scenario depends on.
144
+ *
145
+ * This endpoint MUST exist in the available API operations list.
146
+ * Non-existent endpoints will cause test implementation failures.
147
+ */
121
148
  endpoint: AutoBeOpenApi.IEndpoint;
122
149
  /**
123
150
  * A concise explanation of why this API call is relevant or required for
@@ -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
  }