@autobe/agent 0.19.1 → 0.21.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 (259) hide show
  1. package/lib/agent/src/AutoBeAgent.js +3 -2
  2. package/lib/agent/src/AutoBeAgent.js.map +1 -1
  3. package/lib/agent/src/AutoBeMockAgent.js +4 -3
  4. package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
  5. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +12 -11
  6. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
  7. package/lib/agent/src/context/AutoBeContext.d.ts +3 -2
  8. package/lib/agent/src/factory/consentFunctionCall.js +3 -2
  9. package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
  10. package/lib/agent/src/factory/createAutoBeContext.js +11 -6
  11. package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
  12. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
  13. package/lib/agent/src/orchestrate/analyze/histories/{transformAnalyzeReviewerHistories.js → transformAnalyzeReviewHistories.js} +24 -29
  14. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -0
  15. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -9
  16. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  17. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +31 -29
  18. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  19. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +19 -5
  20. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  21. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
  22. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +9 -6
  23. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  24. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +11 -9
  25. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  26. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
  27. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -1
  28. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  29. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +45 -46
  30. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
  31. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +13 -13
  32. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  33. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -30
  34. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  35. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +23 -22
  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/transformInterfaceOperationHistories.js +27 -26
  42. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  43. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +13 -12
  44. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  45. package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +4 -4
  46. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +11 -10
  47. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  48. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +32 -31
  49. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  50. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +3 -1
  51. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
  52. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +28 -24
  53. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  54. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +2 -0
  55. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  56. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +11 -5
  57. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  58. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
  59. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +365 -0
  60. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -0
  61. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +2 -0
  62. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  63. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +80 -54
  64. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  65. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1635 -1180
  66. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  67. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +30 -24
  68. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  69. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
  70. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +178 -0
  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 +38 -0
  76. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +78 -0
  77. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +54 -54
  78. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  79. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +18 -29
  80. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
  81. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +37 -34
  82. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  83. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +38 -25
  84. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  85. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +3 -1
  86. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  87. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +2 -0
  88. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  89. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +3 -0
  90. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  91. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +19 -9
  92. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  93. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +28 -21
  94. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  95. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +24 -21
  96. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  97. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +58 -56
  98. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  99. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +17 -13
  100. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  101. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +12 -3
  102. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
  103. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +35 -30
  104. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  105. package/lib/{orchestrate/realize/internal/compile.d.ts → agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
  106. package/lib/agent/src/orchestrate/realize/internal/{compile.js → compileRealizeFiles.js} +6 -6
  107. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
  108. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +26 -12
  109. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
  110. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +9 -3
  111. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  112. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +3 -1
  113. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  114. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
  115. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +12 -8
  116. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  117. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
  118. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js +2 -2
  119. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
  120. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
  121. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +25 -21
  122. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  123. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
  124. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
  125. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +13 -10
  126. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
  127. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +1 -1
  128. package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
  129. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
  130. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +44 -27
  131. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  132. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +63 -60
  133. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  134. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
  135. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +118 -96
  136. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  137. package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -5
  138. package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
  139. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +17 -8
  140. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  141. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +30 -18
  142. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  143. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +18 -18
  144. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  145. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
  146. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
  147. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
  148. package/lib/agent/src/utils/executeCachedBatch.d.ts +1 -0
  149. package/lib/agent/src/utils/executeCachedBatch.js +23 -0
  150. package/lib/agent/src/utils/executeCachedBatch.js.map +1 -0
  151. package/lib/constants/AutoBeSystemPromptConstant.d.ts +12 -11
  152. package/lib/context/AutoBeContext.d.ts +3 -2
  153. package/lib/index.mjs +3265 -1702
  154. package/lib/index.mjs.map +1 -1
  155. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
  156. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
  157. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
  158. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +4 -0
  159. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +10 -0
  160. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
  161. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +60 -0
  162. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
  163. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +78 -0
  164. package/lib/{agent/src/orchestrate/realize/internal/compile.d.ts → orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
  165. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
  166. package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
  167. package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
  168. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +2 -2
  169. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +7 -2
  170. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -1
  171. package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +3 -1
  172. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
  173. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +28 -1
  174. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
  175. package/lib/utils/executeCachedBatch.d.ts +1 -0
  176. package/package.json +7 -7
  177. package/src/AutoBeAgent.ts +4 -3
  178. package/src/AutoBeMockAgent.ts +5 -4
  179. package/src/constants/AutoBeSystemPromptConstant.ts +12 -11
  180. package/src/context/AutoBeContext.ts +3 -0
  181. package/src/factory/consentFunctionCall.ts +4 -3
  182. package/src/factory/createAutoBeContext.ts +11 -7
  183. package/src/orchestrate/analyze/histories/{transformAnalyzeReviewerHistories.ts → transformAnalyzeReviewHistories.ts} +23 -30
  184. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +13 -10
  185. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +60 -61
  186. package/src/orchestrate/analyze/orchestrateAnalyze.ts +20 -13
  187. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +20 -9
  188. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +13 -11
  189. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +10 -5
  190. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +47 -48
  191. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +14 -14
  192. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +31 -30
  193. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +20 -19
  194. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +39 -0
  195. package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +3 -3
  196. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +23 -22
  197. package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +12 -11
  198. package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +5 -5
  199. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +11 -10
  200. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +31 -30
  201. package/src/orchestrate/interface/orchestrateInterface.ts +4 -2
  202. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +36 -29
  203. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -0
  204. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +18 -10
  205. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +95 -0
  206. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +2 -0
  207. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +53 -50
  208. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +120 -10
  209. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +47 -23
  210. package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +85 -1
  211. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +65 -0
  212. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +39 -0
  213. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +82 -1
  214. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +57 -55
  215. package/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.ts +19 -30
  216. package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +38 -35
  217. package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +36 -23
  218. package/src/orchestrate/prisma/orchestratePrisma.ts +4 -2
  219. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +2 -0
  220. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +3 -0
  221. package/src/orchestrate/prisma/orchestratePrismaReview.ts +26 -13
  222. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +25 -17
  223. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +24 -21
  224. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +42 -40
  225. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +17 -13
  226. package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +14 -5
  227. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +35 -30
  228. package/src/orchestrate/realize/internal/{compile.ts → compileRealizeFiles.ts} +15 -11
  229. package/src/orchestrate/realize/orchestrateRealize.ts +59 -40
  230. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +19 -10
  231. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -0
  232. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +10 -10
  233. package/src/orchestrate/realize/orchestrateRealizeScenario.ts +7 -77
  234. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +24 -23
  235. package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts +6 -2
  236. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +10 -5
  237. package/src/orchestrate/test/compile/completeTestCode.ts +17 -13
  238. package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +2 -0
  239. package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
  240. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +50 -37
  241. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +62 -57
  242. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +27 -7
  243. package/src/orchestrate/test/orchestrateTest.ts +7 -9
  244. package/src/orchestrate/test/orchestrateTestCorrect.ts +39 -25
  245. package/src/orchestrate/test/orchestrateTestScenario.ts +28 -21
  246. package/src/orchestrate/test/orchestrateTestWrite.ts +17 -18
  247. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +3 -3
  248. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +28 -1
  249. package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +2 -2
  250. package/src/utils/executeCachedBatch.ts +15 -0
  251. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
  252. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +0 -1
  253. package/lib/agent/src/orchestrate/realize/internal/compile.js.map +0 -1
  254. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
  255. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +0 -74
  256. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +0 -1
  257. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
  258. package/lib/orchestrate/test/histories/transformTestHistories.d.ts +0 -3
  259. package/src/orchestrate/test/histories/transformTestHistories.ts +0 -77
@@ -2,11 +2,13 @@ import { IAgenticaController } from "@agentica/core";
2
2
  import {
3
3
  AutoBeInterfaceOperationsReviewEvent,
4
4
  AutoBeOpenApi,
5
+ AutoBePrisma,
5
6
  AutoBeProgressEventBase,
6
7
  } from "@autobe/interface";
7
- import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
8
+ import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
8
9
  import { IPointer } from "tstl";
9
10
  import typia from "typia";
11
+ import { v7 } from "uuid";
10
12
 
11
13
  import { AutoBeContext } from "../../context/AutoBeContext";
12
14
  import { transformInterfaceOperationsReviewHistories } from "./histories/transformInterfaceOperationsReviewHistories";
@@ -20,6 +22,7 @@ export async function orchestrateInterfaceOperationsReview<
20
22
  progress: AutoBeProgressEventBase,
21
23
  ): Promise<AutoBeOpenApi.IOperation[]> {
22
24
  try {
25
+ const files: AutoBePrisma.IFile[] = ctx.state().prisma?.result.data.files!;
23
26
  const pointer: IPointer<IAutoBeInterfaceOperationsReviewApplication.IProps | null> =
24
27
  {
25
28
  value: null,
@@ -29,6 +32,7 @@ export async function orchestrateInterfaceOperationsReview<
29
32
  histories: transformInterfaceOperationsReviewHistories(ctx, operations),
30
33
  controller: createReviewController({
31
34
  model: ctx.model,
35
+ prismaSchemas: files,
32
36
  build: (next: IAutoBeInterfaceOperationsReviewApplication.IProps) => {
33
37
  pointer.value = next;
34
38
  },
@@ -51,6 +55,7 @@ export async function orchestrateInterfaceOperationsReview<
51
55
 
52
56
  ctx.dispatch({
53
57
  type: "interfaceOperationsReview",
58
+ id: v7(),
54
59
  operations: content,
55
60
  review: pointer.value.review,
56
61
  plan: pointer.value.plan,
@@ -71,11 +76,102 @@ export async function orchestrateInterfaceOperationsReview<
71
76
 
72
77
  function createReviewController<Model extends ILlmSchema.Model>(props: {
73
78
  model: Model;
79
+ prismaSchemas: AutoBePrisma.IFile[];
74
80
  build: (reviews: IAutoBeInterfaceOperationsReviewApplication.IProps) => void;
75
81
  }): IAgenticaController.IClass<Model> {
82
+ const validate = (
83
+ next: unknown,
84
+ ): IValidation<IAutoBeInterfaceOperationsReviewApplication.IProps> => {
85
+ const result: IValidation<IAutoBeInterfaceOperationsReviewApplication.IProps> =
86
+ typia.validate<IAutoBeInterfaceOperationsReviewApplication.IProps>(next);
87
+ if (result.success === false) return result;
88
+ const errors: IValidation.IError[] = [];
89
+
90
+ const models: AutoBePrisma.IModel[] = props.prismaSchemas.flatMap(
91
+ (schema) => schema.models,
92
+ );
93
+
94
+ result.data.content.forEach((op, index) => {
95
+ // Check if summary or description mentions soft delete
96
+ const mentionsSoftDelete =
97
+ (op.summary && /soft[\s-]?delet/i.test(op.summary)) ||
98
+ (op.description && /soft[\s-]?delet/i.test(op.description));
99
+
100
+ if (op.method === "delete") {
101
+ const model = models.find((model) => model.name === op.model_name);
102
+
103
+ if (mentionsSoftDelete) {
104
+ // If soft delete is mentioned but no soft_delete_column is specified
105
+ if (!op.soft_delete_column) {
106
+ // Check if any soft-delete capable column exists in the model
107
+ const hasSoftDeleteCapableColumn = model?.plainFields.some(
108
+ (field) =>
109
+ /delete|deleted|deleted_at|deletedAt|is_deleted|isDeleted/i.test(
110
+ field.name,
111
+ ),
112
+ );
113
+
114
+ if (hasSoftDeleteCapableColumn) {
115
+ errors.push({
116
+ expected: `Soft delete column to be specified or summary/description to not mention soft delete`,
117
+ value: "null",
118
+ description: `Mismatch: Operation mentions soft delete but soft_delete_column is not specified, while model has soft-delete capable columns`,
119
+ path: `$input.content[${index}].soft_delete_column`,
120
+ });
121
+ } else {
122
+ errors.push({
123
+ expected: `Summary/description to not mention soft delete when model lacks soft-delete capability`,
124
+ value: `${op.summary || ""} ${op.description || ""}`,
125
+ description: `Mismatch: Operation mentions soft delete but model '${op.model_name}' has no soft-delete capable columns`,
126
+ path: `$input.content[${index}].summary || $input.content[${index}].description`,
127
+ });
128
+ }
129
+ } else {
130
+ // If soft_delete_column is specified, check if it exists in the model
131
+ const column = model?.plainFields.find(
132
+ (el) => el.name === op.soft_delete_column,
133
+ );
134
+
135
+ if (!column) {
136
+ errors.push({
137
+ expected: `Field '${op.soft_delete_column}' to exist in model or operation to not mention soft delete`,
138
+ value: "undefined",
139
+ description: `Mismatch: Either the field '${op.soft_delete_column}' should exist in model '${op.model_name}', or the operation should not mention soft delete`,
140
+ path: `$input.content[${index}].soft_delete_column || $input.content[${index}].summary || $input.content[${index}].description`,
141
+ });
142
+ }
143
+ }
144
+ }
145
+
146
+ // Also check if soft_delete_column is specified without mentioning soft delete
147
+ if (op.soft_delete_column && !mentionsSoftDelete) {
148
+ errors.push({
149
+ expected: `Consistency between soft_delete_column and operation description`,
150
+ value: `soft_delete_column: ${op.soft_delete_column}`,
151
+ description: `Mismatch: soft_delete_column is specified but soft delete is not mentioned in summary/description`,
152
+ path: `$input.content[${index}]`,
153
+ });
154
+ }
155
+ }
156
+ });
157
+
158
+ // not implemented
159
+ if (errors.length !== 0) {
160
+ console.log(JSON.stringify(errors, null, 2));
161
+ return {
162
+ success: false,
163
+ errors,
164
+ data: next,
165
+ };
166
+ }
167
+ return result;
168
+ };
169
+
76
170
  const application: ILlmApplication<Model> = collection[
77
171
  props.model === "chatgpt" ? "chatgpt" : "claude"
78
- ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
172
+ ](
173
+ validate,
174
+ ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
79
175
 
80
176
  return {
81
177
  protocol: "class",
@@ -90,12 +186,26 @@ function createReviewController<Model extends ILlmSchema.Model>(props: {
90
186
  }
91
187
 
92
188
  const collection = {
93
- chatgpt: typia.llm.application<
94
- IAutoBeInterfaceOperationsReviewApplication,
95
- "chatgpt"
96
- >(),
97
- claude: typia.llm.application<
98
- IAutoBeInterfaceOperationsReviewApplication,
99
- "claude"
100
- >(),
189
+ chatgpt: (validate: Validator) =>
190
+ typia.llm.application<
191
+ IAutoBeInterfaceOperationsReviewApplication,
192
+ "chatgpt"
193
+ >({
194
+ validate: {
195
+ reviewOperations: validate,
196
+ },
197
+ }),
198
+ claude: (validate: Validator) =>
199
+ typia.llm.application<
200
+ IAutoBeInterfaceOperationsReviewApplication,
201
+ "claude"
202
+ >({
203
+ validate: {
204
+ reviewOperations: validate,
205
+ },
206
+ }),
101
207
  };
208
+
209
+ type Validator = (
210
+ input: unknown,
211
+ ) => IValidation<IAutoBeInterfaceOperationsReviewApplication.IProps>;
@@ -4,14 +4,17 @@ import {
4
4
  AutoBeOpenApi,
5
5
  AutoBeProgressEventBase,
6
6
  } from "@autobe/interface";
7
+ import { StringUtil } from "@autobe/utils";
7
8
  import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
8
9
  import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
9
10
  import { IPointer } from "tstl";
10
11
  import typia, { tags } from "typia";
12
+ import { v7 } from "uuid";
11
13
 
12
14
  import { AutoBeContext } from "../../context/AutoBeContext";
13
15
  import { assertSchemaModel } from "../../context/assertSchemaModel";
14
16
  import { divideArray } from "../../utils/divideArray";
17
+ import { executeCachedBatch } from "../../utils/executeCachedBatch";
15
18
  import { transformInterfaceSchemaHistories } from "./histories/transformInterfaceSchemaHistories";
16
19
  import { orchestrateInterfaceSchemasReview } from "./orchestrateInterfaceSchemasReview";
17
20
  import { IAutoBeInterfaceSchemaApplication } from "./structures/IAutoBeInterfaceSchemaApplication";
@@ -50,10 +53,17 @@ export async function orchestrateInterfaceSchemas<
50
53
  IAuthorizationToken: authTokenSchema,
51
54
  }
52
55
  : {};
53
- for (const y of await Promise.all(
54
- matrix.map(async (it) => {
56
+ for (const y of await executeCachedBatch(
57
+ matrix.map((it) => async (promptCacheKey) => {
55
58
  const row: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
56
- await divideAndConquer(ctx, operations, it, 3, progress);
59
+ await divideAndConquer(
60
+ ctx,
61
+ operations,
62
+ it,
63
+ 3,
64
+ progress,
65
+ promptCacheKey,
66
+ );
57
67
  const newbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
58
68
  await orchestrateInterfaceSchemasReview(
59
69
  ctx,
@@ -76,13 +86,21 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
76
86
  typeNames: string[],
77
87
  retry: number,
78
88
  progress: AutoBeProgressEventBase,
89
+ promptCacheKey: string,
79
90
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
80
91
  const remained: Set<string> = new Set(typeNames);
81
92
  const schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
82
93
  for (let i: number = 0; i < retry; ++i) {
83
94
  if (remained.size === 0) break;
84
95
  const newbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
85
- await process(ctx, operations, schemas, remained, progress);
96
+ await process(
97
+ ctx,
98
+ operations,
99
+ schemas,
100
+ remained,
101
+ progress,
102
+ promptCacheKey,
103
+ );
86
104
  for (const key of Object.keys(newbie)) {
87
105
  schemas[key] = newbie[key];
88
106
  remained.delete(key);
@@ -97,6 +115,7 @@ async function process<Model extends ILlmSchema.Model>(
97
115
  oldbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
98
116
  remained: Set<string>,
99
117
  progress: AutoBeProgressEventBase,
118
+ promptCacheKey: string,
100
119
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
101
120
  const already: string[] = Object.keys(oldbie);
102
121
  const pointer: IPointer<Record<
@@ -117,25 +136,29 @@ async function process<Model extends ILlmSchema.Model>(
117
136
  pointer,
118
137
  }),
119
138
  enforceFunctionCall: true,
120
- message: [
121
- "Make type components please.",
122
- "",
123
- "Here is the list of request/response bodies' type names from",
124
- "OpenAPI operations. Make type components of them. If more object",
125
- "types are required during making the components, please make them",
126
- "too.",
127
- "",
128
- ...Array.from(remained).map((k) => `- \`${k}\``),
129
- ...(already.length !== 0
130
- ? [
131
- "",
132
- "> By the way, here is the list of components schemas what you've",
133
- "> already made. So, you don't need to make them again.",
134
- ">",
135
- ...already.map((k) => `> - \`${k}\``),
136
- ]
137
- : []),
138
- ].join("\n"),
139
+ promptCacheKey,
140
+ message: StringUtil.trim`
141
+ Make type components please.
142
+
143
+ Here is the list of request/response bodies' type names from
144
+ OpenAPI operations. Make type components of them. If more object
145
+ types are required during making the components, please make them
146
+ too.
147
+
148
+ ${Array.from(remained)
149
+ .map((k) => ` - \`${k}\``)
150
+ .join("\n")}${
151
+ already.length !== 0
152
+ ? StringUtil.trim`
153
+
154
+ > By the way, here is the list of components schemas what you've
155
+ > already made. So, you don't need to make them again.
156
+ >
157
+ ${already.map((k) => `> - \`${k}\``).join("\n")}
158
+ `
159
+ : ""
160
+ }
161
+ `,
139
162
  });
140
163
  if (pointer.value === null) throw new Error("Failed to create components.");
141
164
 
@@ -147,6 +170,7 @@ async function process<Model extends ILlmSchema.Model>(
147
170
  ).schemas ?? {};
148
171
  ctx.dispatch({
149
172
  type: "interfaceSchemas",
173
+ id: v7(),
150
174
  schemas,
151
175
  tokenUsage,
152
176
  completed: (progress.completed += Object.keys(schemas).length),
@@ -2,11 +2,13 @@ import { IAgenticaController } from "@agentica/core";
2
2
  import {
3
3
  AutoBeInterfaceSchemasReviewEvent,
4
4
  AutoBeOpenApi,
5
+ AutoBeProgressEventBase,
5
6
  } from "@autobe/interface";
6
7
  import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
7
8
  import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
8
9
  import { IPointer } from "tstl";
9
10
  import typia from "typia";
11
+ import { v7 } from "uuid";
10
12
 
11
13
  import { AutoBeContext } from "../../context/AutoBeContext";
12
14
  import { assertSchemaModel } from "../../context/assertSchemaModel";
@@ -23,7 +25,7 @@ export async function orchestrateInterfaceSchemasReview<
23
25
  string,
24
26
  AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
25
27
  >,
26
- progress: { total: number; completed: number },
28
+ progress: AutoBeProgressEventBase,
27
29
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
28
30
  try {
29
31
  const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
@@ -35,6 +37,7 @@ export async function orchestrateInterfaceSchemasReview<
35
37
  controller: createController({
36
38
  model: ctx.model,
37
39
  pointer,
40
+ operations,
38
41
  schemas,
39
42
  }),
40
43
  histories: transformInterfaceSchemasReviewHistories(
@@ -59,6 +62,7 @@ export async function orchestrateInterfaceSchemasReview<
59
62
  ).schemas ?? {};
60
63
  ctx.dispatch({
61
64
  type: "interfaceSchemasReview",
65
+ id: v7(),
62
66
  schemas: schemas,
63
67
  review: pointer.value.review,
64
68
  plan: pointer.value.plan,
@@ -80,6 +84,7 @@ export async function orchestrateInterfaceSchemasReview<
80
84
  function createController<Model extends ILlmSchema.Model>(props: {
81
85
  model: Model;
82
86
  pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null>;
87
+ operations: AutoBeOpenApi.IOperation[];
83
88
  schemas: Record<
84
89
  string,
85
90
  AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
@@ -100,14 +105,93 @@ function createController<Model extends ILlmSchema.Model>(props: {
100
105
  schemas: result.data.content,
101
106
  path: "$input.content",
102
107
  });
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
+
103
185
  if (errors.length !== 0)
104
186
  return {
105
187
  success: false,
106
188
  errors,
107
189
  data: next,
108
190
  };
191
+
109
192
  return result;
110
193
  };
194
+
111
195
  const application: ILlmApplication<Model> = collection[
112
196
  props.model === "chatgpt" ? "chatgpt" : "claude"
113
197
  ](
@@ -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,6 +91,45 @@ 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
+
94
133
  /**
95
134
  * Authorization roles required to access this API operation.
96
135
  *
@@ -135,5 +135,86 @@ export namespace IAutoBeInterfaceOperationsReviewApplication {
135
135
  * ```
136
136
  */
137
137
  export interface IOperation
138
- extends Omit<AutoBeOpenApi.IOperation, "authorizationType"> {}
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
+
178
+ /**
179
+ * Primary Prisma model name for this operation.
180
+ *
181
+ * Identifies the main database table/model that this operation targets.
182
+ * This must match exactly with the Prisma model name defined in the schema.
183
+ * When soft deletion is specified, this model name indicates which table
184
+ * should be soft-deleted.
185
+ *
186
+ * For example:
187
+ * - In a "GET /users/:id" operation, this would be "User"
188
+ * - In a "POST /articles" operation, this would be "Article"
189
+ * - In a "DELETE /comments/:id" with soft delete, this specifies the "Comment" model to soft-delete
190
+ *
191
+ * This property is essential for:
192
+ * - Determining the primary entity for CRUD operations
193
+ * - Identifying which table to apply soft deletion to
194
+ * - Validating operations against the correct Prisma model
195
+ * - Generating appropriate database queries and validations
196
+ */
197
+ model_name: string;
198
+
199
+ /**
200
+ * Soft delete column name for the Prisma models.
201
+ *
202
+ * Specifies the column name used for soft deletion in the database tables
203
+ * associated with this operation. When set to a non-null value, it indicates
204
+ * that the related entities support soft deletion through this column
205
+ * (typically a timestamp field like `deleted_at` or `deletedAt`).
206
+ *
207
+ * When null, it means the entities involved in this operation use hard
208
+ * deletion or don't support deletion at all. This information is crucial
209
+ * for generating appropriate CRUD operations and ensuring data integrity
210
+ * policies are correctly implemented.
211
+ *
212
+ * Common soft delete patterns:
213
+ * - `"deleted_at"`: Records deletion timestamp
214
+ * - `"deletedAt"`: Camel-cased deletion timestamp
215
+ * - `"is_deleted"`: Boolean flag for deletion status
216
+ * - `null`: No soft deletion (hard delete only)
217
+ */
218
+ soft_delete_column: string | null;
219
+ }
139
220
  }