@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
@@ -12,8 +12,13 @@ import { v7 } from "uuid";
12
12
 
13
13
  import { AutoBeContext } from "../../context/AutoBeContext";
14
14
  import { assertSchemaModel } from "../../context/assertSchemaModel";
15
+ import { divideArray } from "../../utils/divideArray";
16
+ import { executeCachedBatch } from "../../utils/executeCachedBatch";
15
17
  import { transformInterfaceSchemasReviewHistories } from "./histories/transformInterfaceSchemasReviewHistories";
16
18
  import { IAutoBeInterfaceSchemasReviewApplication } from "./structures/IAutobeInterfaceSchemasReviewApplication";
19
+ import { JsonSchemaFactory } from "./utils/JsonSchemaFactory";
20
+ import { JsonSchemaNamingConvention } from "./utils/JsonSchemaNamingConvention";
21
+ import { fulfillJsonSchemaErrorMessages } from "./utils/fulfillJsonSchemaErrorMessages";
17
22
  import { validateAuthorizationSchema } from "./utils/validateAuthorizationSchema";
18
23
 
19
24
  export async function orchestrateInterfaceSchemasReview<
@@ -21,11 +26,53 @@ export async function orchestrateInterfaceSchemasReview<
21
26
  >(
22
27
  ctx: AutoBeContext<Model>,
23
28
  operations: AutoBeOpenApi.IOperation[],
24
- schemas: Record<
25
- string,
26
- AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
27
- >,
29
+ schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
30
+ ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
31
+ const a = Object.entries(schemas).map(([key, schema]) => {
32
+ return { [key]: schema };
33
+ });
34
+
35
+ const matrix: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>[][] =
36
+ divideArray({
37
+ array: a,
38
+ capacity: 8,
39
+ });
40
+ const progress: IProgress = {
41
+ total: matrix.length,
42
+ completed: 0,
43
+ };
44
+
45
+ const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
46
+ for (const y of await executeCachedBatch(
47
+ matrix.map((it) => async (promptCacheKey) => {
48
+ const row: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
49
+ await divideAndConquer(ctx, operations, it, progress, promptCacheKey);
50
+ return row;
51
+ }),
52
+ )) {
53
+ JsonSchemaNamingConvention.schemas(operations, x, y);
54
+ Object.assign(x, y);
55
+ }
56
+ return x;
57
+ }
58
+
59
+ async function divideAndConquer<Model extends ILlmSchema.Model>(
60
+ ctx: AutoBeContext<Model>,
61
+ operations: AutoBeOpenApi.IOperation[],
62
+ schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>[],
63
+ progress: AutoBeProgressEventBase,
64
+ promptCacheKey: string,
65
+ ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
66
+ const schema = schemas.reduce((acc, cur) => Object.assign(acc, cur), {});
67
+ return step(ctx, operations, schema, progress, promptCacheKey);
68
+ }
69
+
70
+ export async function step<Model extends ILlmSchema.Model>(
71
+ ctx: AutoBeContext<Model>,
72
+ operations: AutoBeOpenApi.IOperation[],
73
+ schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
28
74
  progress: AutoBeProgressEventBase,
75
+ promptCacheKey: string,
29
76
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
30
77
  try {
31
78
  const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
@@ -46,6 +93,7 @@ export async function orchestrateInterfaceSchemasReview<
46
93
  schemas,
47
94
  ),
48
95
  enforceFunctionCall: true,
96
+ promptCacheKey,
49
97
  message: "Review type schemas.",
50
98
  });
51
99
  if (pointer.value === null) {
@@ -54,18 +102,18 @@ export async function orchestrateInterfaceSchemasReview<
54
102
  return {};
55
103
  }
56
104
 
57
- const content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
58
- (
59
- OpenApiV3_1Emender.convertComponents({
60
- schemas: pointer.value.content,
61
- }) as AutoBeOpenApi.IComponents
62
- ).schemas ?? {};
105
+ const content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = ((
106
+ OpenApiV3_1Emender.convertComponents({
107
+ schemas: pointer.value.content,
108
+ }) as AutoBeOpenApi.IComponents
109
+ ).schemas ?? {}) as Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
110
+
63
111
  ctx.dispatch({
64
112
  type: "interfaceSchemasReview",
65
113
  id: v7(),
66
114
  schemas: schemas,
67
- review: pointer.value.review,
68
- plan: pointer.value.plan,
115
+ review: pointer.value.think.review,
116
+ plan: pointer.value.think.plan,
69
117
  content,
70
118
  tokenUsage,
71
119
  step: ctx.state().analyze?.step ?? 0,
@@ -85,19 +133,21 @@ function createController<Model extends ILlmSchema.Model>(props: {
85
133
  model: Model;
86
134
  pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null>;
87
135
  operations: AutoBeOpenApi.IOperation[];
88
- schemas: Record<
89
- string,
90
- AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
91
- >;
136
+ schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
92
137
  }): IAgenticaController.IClass<Model> {
93
138
  assertSchemaModel(props.model);
94
139
 
95
140
  const validate = (
96
141
  next: unknown,
97
142
  ): IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps> => {
143
+ JsonSchemaFactory.fix("content", next);
144
+
98
145
  const result: IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps> =
99
146
  typia.validate<IAutoBeInterfaceSchemasReviewApplication.IProps>(next);
100
- if (result.success === false) return result;
147
+ if (result.success === false) {
148
+ fulfillJsonSchemaErrorMessages(result.errors);
149
+ return result;
150
+ }
101
151
 
102
152
  const errors: IValidation.IError[] = [];
103
153
  validateAuthorizationSchema({
@@ -105,90 +155,12 @@ function createController<Model extends ILlmSchema.Model>(props: {
105
155
  schemas: result.data.content,
106
156
  path: "$input.content",
107
157
  });
108
-
109
- Object.entries(result.data.content).forEach(
110
- ([tagName, jsonDescriptive]) => {
111
- const index: AutoBeOpenApi.IOperation | undefined =
112
- props.operations.find(
113
- (op) =>
114
- op.responseBody?.typeName === tagName &&
115
- op.method === "patch" &&
116
- op.name === "index",
117
- );
118
-
119
- // The index API should return the `IPage<T>` type.
120
- if (index) {
121
- // First check if the schema has the correct object structure
122
- if (
123
- !("type" in jsonDescriptive) ||
124
- jsonDescriptive.type !== "object"
125
- ) {
126
- errors.push({
127
- path: `$input.content.${tagName}`,
128
- expected: `{ type: "object", properties: { ... } }`,
129
- value: jsonDescriptive,
130
- description: `IPage schema must have type: "object". Found: ${JSON.stringify(jsonDescriptive)}`,
131
- });
132
- } else if (!("properties" in jsonDescriptive)) {
133
- errors.push({
134
- path: `$input.content.${tagName}`,
135
- expected: `Schema with "properties" field`,
136
- value: jsonDescriptive,
137
- description: `IPage schema must have a "properties" field containing "pagination" and "data" properties.`,
138
- });
139
- } else if (
140
- typia.is<AutoBeOpenApi.IJsonSchema.IObject>(jsonDescriptive)
141
- ) {
142
- jsonDescriptive.properties ??= {};
143
-
144
- // Check pagination property
145
- const pagination = jsonDescriptive.properties["pagination"];
146
- if (!pagination || !("$ref" in pagination)) {
147
- errors.push({
148
- path: `$input.content.${tagName}.properties.pagination`,
149
- expected: `{ $ref: "#/components/schemas/IPage.IPagination" }`,
150
- value: pagination,
151
- description: `IPage must have a "pagination" property with $ref to IPage.IPagination.`,
152
- });
153
- }
154
-
155
- // Check data property
156
- const data = jsonDescriptive.properties["data"];
157
- if (!typia.is<AutoBeOpenApi.IJsonSchema.IArray>(data)) {
158
- errors.push({
159
- path: `$input.content.${tagName}.properties.data`,
160
- expected: `AutoBeOpenApi.IJsonSchema.IArray`,
161
- value: data,
162
- description: `The 'data' property must be an array for the index operation.`,
163
- });
164
- } else {
165
- // Check if array items have proper type reference (not 'any')
166
- const arraySchema: AutoBeOpenApi.IJsonSchema.IArray = data;
167
- if (
168
- !arraySchema.items ||
169
- !("$ref" in arraySchema.items) ||
170
- arraySchema.items.$ref === "#/components/schemas/any"
171
- ) {
172
- errors.push({
173
- path: `$input.content.${tagName}.properties.data.items`,
174
- expected: `Reference to a specific type (e.g., $ref to ISummary type)`,
175
- value: arraySchema.items,
176
- description: `The 'data' array must have a specific item type, not 'any[]'. Use a proper type reference like '{Entity}.ISummary' for paginated results.`,
177
- });
178
- }
179
- }
180
- }
181
- }
182
- },
183
- );
184
-
185
158
  if (errors.length !== 0)
186
159
  return {
187
160
  success: false,
188
161
  errors,
189
162
  data: next,
190
163
  };
191
-
192
164
  return result;
193
165
  };
194
166
 
@@ -227,3 +199,8 @@ const collection = {
227
199
  type Validator = (
228
200
  input: unknown,
229
201
  ) => IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps>;
202
+
203
+ export interface IProgress {
204
+ total: number;
205
+ completed: number;
206
+ }
@@ -0,0 +1,65 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+
3
+ /**
4
+ * Interface for reviewing and refining API endpoints through holistic analysis.
5
+ *
6
+ * This application performs comprehensive review of all endpoints generated
7
+ * through divide-and-conquer strategy, ensuring consistency, eliminating
8
+ * redundancy, and preventing over-engineering across the entire API surface.
9
+ */
10
+ export interface IAutoBeInterfaceEndpointsReviewApplication {
11
+ /**
12
+ * Reviews and refines the complete collection of API endpoints.
13
+ *
14
+ * This method consolidates all endpoints generated independently by different
15
+ * groups and performs holistic review to:
16
+ * - Ensure naming consistency across all endpoints
17
+ * - Remove duplicate or overlapping endpoints
18
+ * - Eliminate over-engineered solutions
19
+ * - Standardize path structures and HTTP methods
20
+ * - Verify REST API design principles
21
+ *
22
+ * The review process examines the entire API as a cohesive system rather
23
+ * than individual endpoints, ensuring the final API is intuitive, maintainable,
24
+ * and follows best practices.
25
+ *
26
+ * @param next - The review results and refined endpoint collection
27
+ */
28
+ reviewEndpoints(
29
+ next: IAutoBeInterfaceEndpointsReviewApplication.IProps,
30
+ ): void;
31
+ }
32
+
33
+ export namespace IAutoBeInterfaceEndpointsReviewApplication {
34
+ export interface IProps {
35
+ /**
36
+ * Comprehensive review analysis of all collected endpoints.
37
+ *
38
+ * Contains detailed findings from the holistic review including:
39
+ * - Identified inconsistencies in naming conventions
40
+ * - Duplicate endpoints that serve the same purpose
41
+ * - Over-engineered solutions that add unnecessary complexity
42
+ * - Violations of REST API design principles
43
+ * - Recommendations for improvement and standardization
44
+ *
45
+ * The review provides actionable feedback for creating a clean,
46
+ * consistent, and maintainable API structure.
47
+ */
48
+ review: string;
49
+
50
+ /**
51
+ * Refined collection of API endpoints after review and cleanup.
52
+ *
53
+ * The final optimized set of endpoints after:
54
+ * - Removing duplicates and redundant endpoints
55
+ * - Standardizing naming conventions across all paths
56
+ * - Simplifying over-engineered solutions
57
+ * - Ensuring consistent REST patterns
58
+ * - Aligning HTTP methods with their semantic meanings
59
+ *
60
+ * This collection represents the production-ready API structure
61
+ * that balances functionality with simplicity and maintainability.
62
+ */
63
+ endpoints: AutoBeOpenApi.IEndpoint[];
64
+ }
65
+ }
@@ -91,45 +91,6 @@ export namespace IAutoBeInterfaceOperationApplication {
91
91
  AutoBeOpenApi.IOperation,
92
92
  "authorizationRole" | "authorizationType"
93
93
  > {
94
- /**
95
- * Prisma schema models relevant to this operation.
96
- *
97
- * Contains the complete Prisma schema definitions for all entities involved
98
- * in this operation, including their fields, relations, and database
99
- * constraints. This enables comprehensive validation and schema-aware
100
- * operation design.
101
- *
102
- * The schema information serves multiple critical purposes:
103
- *
104
- * - **Field Verification**: Ensures all referenced fields actually exist in
105
- * the database schema and have the correct types
106
- * - **Relationship Validation**: Confirms that entity relationships are
107
- * properly defined and can support the operation's data access patterns
108
- * - **Soft-Delete Detection**: For DELETE operations, identifies whether
109
- * entities have soft-delete fields (deleted_at, is_deleted, etc.) to
110
- * determine if the operation should perform logical deletion instead of
111
- * physical removal
112
- * - **Constraint Awareness**: Understands unique constraints, required
113
- * fields, and default values to generate accurate request/response
114
- * schemas
115
- *
116
- * Example content might include:
117
- *
118
- * ```prisma
119
- * model User {
120
- * id String @id @default(uuid())
121
- * email String @unique
122
- * name String
123
- * deleted_at DateTime? // Indicates soft-delete capability
124
- * posts Post[]
125
- * }
126
- * ```
127
- *
128
- * This schema context ensures operations are fully aligned with the actual
129
- * database structure and business logic requirements.
130
- */
131
- prisma_schemas: string;
132
-
133
94
  /**
134
95
  * Authorization roles required to access this API operation.
135
96
  *
@@ -5,19 +5,21 @@ import { AutoBeOpenApi } from "@autobe/interface";
5
5
  *
6
6
  * Provides functionality to systematically review generated API operations
7
7
  * against business requirements, technical specifications, and OpenAPI
8
- * standards. The review process ensures each operation meets quality criteria
9
- * before proceeding to implementation.
8
+ * standards. The review process outputs a structured thinking process with
9
+ * analytical findings and actionable improvements, along with the final
10
+ * enhanced operations ready for implementation.
10
11
  */
11
12
  export interface IAutoBeInterfaceOperationsReviewApplication {
12
13
  /**
13
14
  * Reviews a batch of API operations for quality and correctness.
14
15
  *
15
- * Validates each operation's request/response schemas, authentication
16
- * handling, error responses, and documentation completeness. Operations are
17
- * marked as passed or failed based on compliance with enterprise standards.
16
+ * Analyzes operations for security vulnerabilities, schema compliance,
17
+ * logical consistency, and standard adherence. Outputs a structured thinking
18
+ * process containing review findings and improvement plans, plus the final
19
+ * production-ready operations with all critical issues resolved.
18
20
  *
19
- * @param input Collection of operations to review with their validation
20
- * results
21
+ * @param input Properties containing the thinking process (review & plan)
22
+ * and the enhanced operations content
21
23
  */
22
24
  reviewOperations(
23
25
  input: IAutoBeInterfaceOperationsReviewApplication.IProps,
@@ -33,6 +35,47 @@ export namespace IAutoBeInterfaceOperationsReviewApplication {
33
35
  * of the AutoBeInterfaceOperationsReviewEvent.
34
36
  */
35
37
  export interface IProps {
38
+ /**
39
+ * Comprehensive thinking process for API operation review.
40
+ *
41
+ * Encapsulates the agent's analytical review findings and actionable
42
+ * improvement plan. This structured thinking process ensures systematic
43
+ * evaluation of API operations against AutoBE's quality standards before
44
+ * generating the final enhanced operations.
45
+ */
46
+ think: IThink;
47
+
48
+ /**
49
+ * Production-ready operations with all critical issues resolved.
50
+ *
51
+ * Final API operations after systematic enhancement:
52
+ *
53
+ * - **Security Fixes Applied**: All authentication boundaries enforced,
54
+ * sensitive data removed from responses, proper authorization
55
+ * implemented
56
+ * - **Logic Corrections Made**: Return types match operation intent, HTTP
57
+ * methods align with semantics, parameters properly utilized
58
+ * - **Schema Alignment Verified**: All fields exist in Prisma schema, types
59
+ * correctly mapped, relationships properly defined
60
+ * - **Quality Improvements Added**: Enhanced documentation, format
61
+ * specifications, validation rules, consistent naming patterns
62
+ *
63
+ * If no issues were found during review, this contains the exact original
64
+ * operations unchanged. These operations are validated and ready for schema
65
+ * generation and subsequent implementation phases.
66
+ */
67
+ content: AutoBeOpenApi.IOperation[];
68
+ }
69
+
70
+ /**
71
+ * Structured thinking process for comprehensive API operation review.
72
+ *
73
+ * Combines analytical review findings with actionable improvement planning
74
+ * to guide the systematic enhancement of API operations. This thinking
75
+ * structure ensures all aspects of API quality are evaluated and addressed
76
+ * before producing the final operations.
77
+ */
78
+ export interface IThink {
36
79
  /**
37
80
  * Comprehensive review analysis with prioritized findings.
38
81
  *
@@ -77,102 +120,5 @@ export namespace IAutoBeInterfaceOperationsReviewApplication {
77
120
  * needed, and the rationale for the modification.
78
121
  */
79
122
  plan: string;
80
-
81
- /**
82
- * Production-ready operations with all critical issues resolved.
83
- *
84
- * Final API operations after systematic enhancement:
85
- *
86
- * - **Security Fixes Applied**: All authentication boundaries enforced,
87
- * sensitive data removed from responses, proper authorization
88
- * implemented
89
- * - **Logic Corrections Made**: Return types match operation intent, HTTP
90
- * methods align with semantics, parameters properly utilized
91
- * - **Schema Alignment Verified**: All fields exist in Prisma schema, types
92
- * correctly mapped, relationships properly defined
93
- * - **Quality Improvements Added**: Enhanced documentation, format
94
- * specifications, validation rules, consistent naming patterns
95
- *
96
- * If no issues were found during review, this contains the exact original
97
- * operations unchanged. These operations are validated and ready for schema
98
- * generation and subsequent implementation phases.
99
- */
100
- content: IOperation[];
101
- }
102
-
103
- /**
104
- * Operation of the Restful API.
105
- *
106
- * This interface defines a single API endpoint with its HTTP {@link method},
107
- * {@link path}, {@link parameters path parameters},
108
- * {@link requestBody request body}, and {@link responseBody} structure. It
109
- * corresponds to an individual operation in the paths section of an OpenAPI
110
- * document.
111
- *
112
- * Each operation requires a detailed explanation of its purpose through the
113
- * reason and description fields, making it clear why the API was designed and
114
- * how it should be used.
115
- *
116
- * All request bodies and responses for this operation must be object types
117
- * and must reference named types defined in the components section. The
118
- * content-type is always `application/json`. For file upload/download
119
- * operations, use `string & tags.Format<"uri">` in the appropriate schema
120
- * instead of binary data formats.
121
- *
122
- * In OpenAPI, this might represent:
123
- *
124
- * ```json
125
- * {
126
- * "/shoppings/customers/orders": {
127
- * "post": {
128
- * "description": "Create a new order application from shopping cart...",
129
- * "parameters": [...],
130
- * "requestBody": {...},
131
- * "responses": {...}
132
- * }
133
- * }
134
- * }
135
- * ```
136
- */
137
- export interface IOperation
138
- extends Omit<AutoBeOpenApi.IOperation, "authorizationType"> {
139
- /**
140
- * Prisma schema models relevant to this operation.
141
- *
142
- * Contains the complete Prisma schema definitions for all entities involved
143
- * in this operation, including their fields, relations, and database
144
- * constraints. This enables comprehensive validation and schema-aware
145
- * operation design.
146
- *
147
- * The schema information serves multiple critical purposes:
148
- *
149
- * - **Field Verification**: Ensures all referenced fields actually exist in
150
- * the database schema and have the correct types
151
- * - **Relationship Validation**: Confirms that entity relationships are
152
- * properly defined and can support the operation's data access patterns
153
- * - **Soft-Delete Detection**: For DELETE operations, identifies whether
154
- * entities have soft-delete fields (deleted_at, is_deleted, etc.) to
155
- * determine if the operation should perform logical deletion instead of
156
- * physical removal
157
- * - **Constraint Awareness**: Understands unique constraints, required
158
- * fields, and default values to generate accurate request/response
159
- * schemas
160
- *
161
- * Example content might include:
162
- *
163
- * ```prisma
164
- * model User {
165
- * id String @id @default(uuid())
166
- * email String @unique
167
- * name String
168
- * deleted_at DateTime? // Indicates soft-delete capability
169
- * posts Post[]
170
- * }
171
- * ```
172
- *
173
- * This schema context ensures operations are fully aligned with the actual
174
- * database structure and business logic requirements.
175
- */
176
- prisma_schemas: string;
177
123
  }
178
124
  }
@@ -29,15 +29,44 @@ export namespace IAutoBeInterfaceSchemasReviewApplication {
29
29
  * interface to understand what outputs are required.
30
30
  */
31
31
  export interface IProps {
32
+ think: IThink;
33
+
34
+ /**
35
+ * Final validated and enhanced schemas ready for production use.
36
+ *
37
+ * DO:
38
+ *
39
+ * - Include valid OpenAPI schema definitions
40
+ * - Include all entities that were in the original input
41
+ * - Provide fixed versions if original schemas have issues
42
+ * - Rename entities correctly if names are wrong
43
+ * - Include created variants if schemas are missing them
44
+ *
45
+ * DO NOT:
46
+ *
47
+ * - Return an empty object {} (this will delete all schemas)
48
+ * - Return undefined or null
49
+ * - Include explanations or excuses in schema descriptions
50
+ * - Leave broken schemas unfixed
51
+ *
52
+ * When original schemas are beyond repair, recreate them properly based on
53
+ * entity names and context. This field becomes the final schemas used by
54
+ * the system, so it must always contain complete, valid schemas.
55
+ */
56
+ content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
57
+ }
58
+
59
+ export interface IThink {
32
60
  /**
33
61
  * Issues and problems found during schema analysis.
34
62
  *
35
- * DO: Document only problems that need fixing.
36
- * DO NOT: Include positive feedback, compliments, or confirmations
63
+ * DO: Document only problems that need fixing. DO NOT: Include positive
64
+ * feedback, compliments, or confirmations
37
65
  *
38
66
  * Focus exclusively on issues organized by severity:
39
67
  *
40
68
  * Severity levels:
69
+ *
41
70
  * - Security vulnerabilities (exposed passwords, missing auth boundaries)
42
71
  * - Missing required variants, incorrect type mappings
43
72
  * - Missing format specifications, incomplete relationships
@@ -63,30 +92,5 @@ export namespace IAutoBeInterfaceSchemasReviewApplication {
63
92
  * field.
64
93
  */
65
94
  plan: string;
66
-
67
- /**
68
- * Final validated and enhanced schemas ready for production use.
69
- *
70
- * DO:
71
- * - Include valid OpenAPI schema definitions
72
- * - Include all entities that were in the original input
73
- * - Provide fixed versions if original schemas have issues
74
- * - Rename entities correctly if names are wrong
75
- * - Include created variants if schemas are missing them
76
- *
77
- * DO NOT:
78
- * - Return an empty object {} (this will delete all schemas)
79
- * - Return undefined or null
80
- * - Include explanations or excuses in schema descriptions
81
- * - Leave broken schemas unfixed
82
- *
83
- * When original schemas are beyond repair, recreate them properly based on
84
- * entity names and context. This field becomes the final schemas used by
85
- * the system, so it must always contain complete, valid schemas.
86
- */
87
- content: Record<
88
- string,
89
- AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
90
- >;
91
95
  }
92
96
  }