@autobe/agent 0.18.0 → 0.19.1

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 (281) hide show
  1. package/lib/AutoBeMockAgent.d.ts +2 -10
  2. package/lib/agent/src/AutoBeAgent.js +5 -0
  3. package/lib/agent/src/AutoBeAgent.js.map +1 -1
  4. package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
  5. package/lib/agent/src/AutoBeMockAgent.js +7 -2
  6. package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
  7. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +23 -29
  8. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
  9. package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +1 -0
  10. package/lib/agent/src/context/AutoBeTokenUsageComponent.js +14 -0
  11. package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
  12. package/lib/agent/src/factory/consentFunctionCall.d.ts +10 -0
  13. package/lib/agent/src/factory/consentFunctionCall.js +212 -0
  14. package/lib/agent/src/factory/consentFunctionCall.js.map +1 -0
  15. package/lib/agent/src/factory/createAgenticaHistory.js +1 -0
  16. package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -1
  17. package/lib/agent/src/factory/createAutoBeContext.js +71 -14
  18. package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
  19. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
  20. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +4 -4
  21. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +1 -1
  22. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
  23. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
  24. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +16 -4
  25. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  26. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +8 -3
  27. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  28. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
  29. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +7 -7
  30. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  31. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +24 -37
  32. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  33. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -3
  34. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  35. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
  36. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
  37. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +1 -0
  38. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
  39. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
  40. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  41. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
  42. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  43. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +2 -10
  44. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  45. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
  46. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  47. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  48. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  49. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +3 -3
  50. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  51. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
  52. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  53. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +9 -3
  54. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  55. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +29 -9
  56. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
  57. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
  58. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +1565 -1142
  59. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  60. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +22 -4
  61. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  62. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
  63. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +11 -15
  64. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  65. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +32 -26
  66. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  67. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
  68. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +135 -124
  69. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  70. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +371 -209
  71. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  72. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +185 -179
  73. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
  74. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
  75. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
  76. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
  77. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
  78. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
  79. package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
  80. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
  81. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +35 -0
  82. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -0
  83. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +11 -17
  84. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  85. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
  86. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
  87. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
  88. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  89. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
  90. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  91. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +13 -4
  92. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  93. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
  94. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +6 -10
  95. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  96. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +35 -2
  97. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  98. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +44 -3
  99. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  100. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +40 -3
  101. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  102. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +2 -2
  103. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  104. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +5 -5
  105. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  106. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
  107. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +2 -2
  108. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  109. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
  110. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +278 -0
  111. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
  112. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
  113. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +12 -20
  114. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  115. package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +3 -3
  116. package/lib/agent/src/orchestrate/realize/internal/compile.js +9 -26
  117. package/lib/agent/src/orchestrate/realize/internal/compile.js.map +1 -1
  118. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +59 -42
  119. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
  120. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +6 -6
  121. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  122. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +6 -6
  123. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
  124. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +17 -16
  125. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  126. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
  127. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -19
  128. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  129. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
  130. package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeCoderApplication.js → IAutoBeRealizeCorrectApplication.js} +1 -1
  131. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
  132. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
  133. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +5 -1
  134. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  135. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
  136. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  137. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
  138. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +95 -50
  139. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  140. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
  141. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  142. package/lib/agent/src/orchestrate/test/orchestrateTest.js +12 -0
  143. package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
  144. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +4 -4
  145. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +119 -16
  146. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  147. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  148. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
  149. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
  150. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
  151. package/lib/agent/src/orchestrate/{internal/IProgress.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
  152. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
  153. package/lib/agent/src/utils/predicateStateMessage.d.ts +4 -0
  154. package/lib/agent/src/utils/predicateStateMessage.js +87 -0
  155. package/lib/agent/src/utils/predicateStateMessage.js.map +1 -0
  156. package/lib/constants/AutoBeSystemPromptConstant.d.ts +23 -29
  157. package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
  158. package/lib/factory/consentFunctionCall.d.ts +10 -0
  159. package/lib/index.mjs +3036 -1648
  160. package/lib/index.mjs.map +1 -1
  161. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
  162. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
  163. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
  164. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
  165. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
  166. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
  167. package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
  168. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
  169. package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
  170. package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
  171. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
  172. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
  173. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
  174. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
  175. package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
  176. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
  177. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
  178. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
  179. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
  180. package/lib/orchestrate/realize/internal/compile.d.ts +3 -3
  181. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
  182. package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
  183. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
  184. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
  185. package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
  186. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
  187. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
  188. package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
  189. package/lib/utils/predicateStateMessage.d.ts +4 -0
  190. package/package.json +6 -6
  191. package/src/AutoBeAgent.ts +14 -0
  192. package/src/AutoBeMockAgent.ts +9 -11
  193. package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
  194. package/src/context/AutoBeTokenUsageComponent.ts +20 -0
  195. package/src/factory/consentFunctionCall.ts +128 -0
  196. package/src/factory/createAgenticaHistory.ts +1 -0
  197. package/src/factory/createAutoBeContext.ts +99 -14
  198. package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +11 -4
  199. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +26 -4
  200. package/src/orchestrate/analyze/orchestrateAnalyze.ts +19 -14
  201. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +3 -3
  202. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +8 -32
  203. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -3
  204. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +16 -16
  205. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +5 -5
  206. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +1 -0
  207. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -10
  208. package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +1 -1
  209. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +9 -3
  210. package/src/orchestrate/interface/orchestrateInterface.ts +51 -12
  211. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +126 -23
  212. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +6 -19
  213. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +32 -27
  214. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +49 -32
  215. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +127 -33
  216. package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +67 -65
  217. package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +39 -0
  218. package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +16 -16
  219. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +62 -14
  220. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +38 -1
  221. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +47 -14
  222. package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +18 -24
  223. package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +41 -0
  224. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +9 -16
  225. package/src/orchestrate/prisma/orchestratePrisma.ts +15 -6
  226. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -19
  227. package/src/orchestrate/prisma/orchestratePrismaReview.ts +15 -9
  228. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +1 -1
  229. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +19 -23
  230. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +4 -2
  231. package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +285 -0
  232. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -27
  233. package/src/orchestrate/realize/internal/compile.ts +28 -45
  234. package/src/orchestrate/realize/orchestrateRealize.ts +71 -67
  235. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +3 -3
  236. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +19 -15
  237. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +23 -15
  238. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
  239. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +19 -16
  240. package/src/orchestrate/realize/utils/replaceImportStatements.ts +7 -0
  241. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +110 -59
  242. package/src/orchestrate/test/orchestrateTest.ts +12 -0
  243. package/src/orchestrate/test/orchestrateTestScenario.ts +155 -19
  244. package/src/orchestrate/test/orchestrateTestWrite.ts +3 -3
  245. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +6 -5
  246. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
  247. package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
  248. package/src/utils/predicateStateMessage.ts +107 -0
  249. package/lib/agent/src/orchestrate/internal/IProgress.d.ts +0 -4
  250. package/lib/agent/src/orchestrate/internal/IProgress.js.map +0 -1
  251. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
  252. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js +0 -213
  253. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +0 -1
  254. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
  255. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
  256. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
  257. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js +0 -3
  258. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
  259. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
  260. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -5
  261. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
  262. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +0 -3
  263. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +0 -1
  264. package/lib/agent/src/utils/pipe.d.ts +0 -5
  265. package/lib/agent/src/utils/pipe.js +0 -14
  266. package/lib/agent/src/utils/pipe.js.map +0 -1
  267. package/lib/orchestrate/internal/IProgress.d.ts +0 -4
  268. package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
  269. package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
  270. package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
  271. package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
  272. package/lib/utils/pipe.d.ts +0 -5
  273. package/src/orchestrate/internal/IProgress.ts +0 -4
  274. package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
  275. package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +0 -358
  276. package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +0 -70
  277. package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +0 -2
  278. package/src/utils/pipe.ts +0 -39
  279. /package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
  280. /package/lib/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
  281. /package/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.ts → IAutoBeRealizeCorrectApplication.ts} +0 -0
@@ -2,13 +2,13 @@ import { IAgenticaController } from "@agentica/core";
2
2
  import {
3
3
  AutoBeInterfaceOperationsReviewEvent,
4
4
  AutoBeOpenApi,
5
+ AutoBeProgressEventBase,
5
6
  } from "@autobe/interface";
6
7
  import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
7
8
  import { IPointer } from "tstl";
8
9
  import typia from "typia";
9
10
 
10
11
  import { AutoBeContext } from "../../context/AutoBeContext";
11
- import { IProgress } from "../internal/IProgress";
12
12
  import { transformInterfaceOperationsReviewHistories } from "./histories/transformInterfaceOperationsReviewHistories";
13
13
  import { IAutoBeInterfaceOperationsReviewApplication } from "./structures/IAutoBeInterfaceOperationsReviewApplication";
14
14
 
@@ -17,39 +17,56 @@ export async function orchestrateInterfaceOperationsReview<
17
17
  >(
18
18
  ctx: AutoBeContext<Model>,
19
19
  operations: AutoBeOpenApi.IOperation[],
20
- progress: IProgress,
20
+ progress: AutoBeProgressEventBase,
21
21
  ): Promise<AutoBeOpenApi.IOperation[]> {
22
- const pointer: IPointer<IAutoBeInterfaceOperationsReviewApplication.IProps | null> =
23
- {
24
- value: null,
25
- };
26
- const { tokenUsage } = await ctx.conversate({
27
- source: "interfaceOperationsReview",
28
- histories: transformInterfaceOperationsReviewHistories(ctx, operations),
29
- controller: createReviewController({
30
- model: ctx.model,
31
- build: (next: IAutoBeInterfaceOperationsReviewApplication.IProps) => {
32
- pointer.value = next;
33
- },
34
- }),
35
- enforceFunctionCall: false,
36
- message: "Review the operations",
37
- });
38
- if (pointer.value === null) throw new Error("Failed to review operations.");
22
+ try {
23
+ const pointer: IPointer<IAutoBeInterfaceOperationsReviewApplication.IProps | null> =
24
+ {
25
+ value: null,
26
+ };
27
+ const { tokenUsage } = await ctx.conversate({
28
+ source: "interfaceOperationsReview",
29
+ histories: transformInterfaceOperationsReviewHistories(ctx, operations),
30
+ controller: createReviewController({
31
+ model: ctx.model,
32
+ build: (next: IAutoBeInterfaceOperationsReviewApplication.IProps) => {
33
+ pointer.value = next;
34
+ },
35
+ }),
36
+ enforceFunctionCall: false,
37
+ message: "Review the operations",
38
+ });
39
+ if (pointer.value === null) {
40
+ console.error("Failed to review operations.");
41
+ progress.completed += operations.length;
42
+ return [];
43
+ }
44
+
45
+ const content: AutoBeOpenApi.IOperation[] = pointer.value.content.map(
46
+ (op) => ({
47
+ ...op,
48
+ authorizationType: null,
49
+ }),
50
+ );
39
51
 
40
- ctx.dispatch({
41
- type: "interfaceOperationsReview",
42
- operations: pointer.value.content,
43
- review: pointer.value.review,
44
- plan: pointer.value.plan,
45
- content: pointer.value.content,
46
- tokenUsage,
47
- created_at: new Date().toISOString(),
48
- step: ctx.state().analyze?.step ?? 0,
49
- total: progress.total,
50
- completed: ++progress.completed,
51
- } satisfies AutoBeInterfaceOperationsReviewEvent);
52
- return pointer.value.content;
52
+ ctx.dispatch({
53
+ type: "interfaceOperationsReview",
54
+ operations: content,
55
+ review: pointer.value.review,
56
+ plan: pointer.value.plan,
57
+ content,
58
+ tokenUsage,
59
+ created_at: new Date().toISOString(),
60
+ step: ctx.state().analyze?.step ?? 0,
61
+ total: progress.total,
62
+ completed: ++progress.completed,
63
+ } satisfies AutoBeInterfaceOperationsReviewEvent);
64
+ return content;
65
+ } catch (error) {
66
+ console.error("Error occurred during interface operations review:", error);
67
+ ++progress.completed;
68
+ return [];
69
+ }
53
70
  }
54
71
 
55
72
  function createReviewController<Model extends ILlmSchema.Model>(props: {
@@ -1,24 +1,28 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
- import { AutoBeInterfaceSchemasEvent, AutoBeOpenApi } from "@autobe/interface";
3
- import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
2
+ import {
3
+ AutoBeInterfaceSchemasEvent,
4
+ AutoBeOpenApi,
5
+ AutoBeProgressEventBase,
6
+ } from "@autobe/interface";
7
+ import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
4
8
  import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
5
9
  import { IPointer } from "tstl";
6
- import typia from "typia";
10
+ import typia, { tags } from "typia";
7
11
 
8
12
  import { AutoBeContext } from "../../context/AutoBeContext";
9
13
  import { assertSchemaModel } from "../../context/assertSchemaModel";
10
14
  import { divideArray } from "../../utils/divideArray";
11
- import { IProgress } from "../internal/IProgress";
12
15
  import { transformInterfaceSchemaHistories } from "./histories/transformInterfaceSchemaHistories";
13
16
  import { orchestrateInterfaceSchemasReview } from "./orchestrateInterfaceSchemasReview";
14
17
  import { IAutoBeInterfaceSchemaApplication } from "./structures/IAutoBeInterfaceSchemaApplication";
18
+ import { validateAuthorizationSchema } from "./utils/validateAuthorizationSchema";
15
19
 
16
20
  export async function orchestrateInterfaceSchemas<
17
21
  Model extends ILlmSchema.Model,
18
22
  >(
19
23
  ctx: AutoBeContext<Model>,
20
24
  operations: AutoBeOpenApi.IOperation[],
21
- capacity: number = 12,
25
+ capacity: number = 8,
22
26
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
23
27
  const typeNames: Set<string> = new Set();
24
28
  for (const op of operations) {
@@ -29,29 +33,40 @@ export async function orchestrateInterfaceSchemas<
29
33
  array: Array.from(typeNames),
30
34
  capacity,
31
35
  });
32
- const progress: IProgress = {
36
+ const progress: AutoBeProgressEventBase = {
33
37
  total: typeNames.size,
34
38
  completed: 0,
35
39
  };
36
- const reviewProgress: IProgress = {
40
+ const reviewProgress: AutoBeProgressEventBase = {
37
41
  total: matrix.length,
38
42
  completed: 0,
39
43
  };
40
- const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
44
+ const roles: string[] =
45
+ ctx.state().analyze?.roles.map((role) => role.name) ?? [];
46
+
47
+ const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
48
+ roles.length > 0
49
+ ? {
50
+ IAuthorizationToken: authTokenSchema,
51
+ }
52
+ : {};
41
53
  for (const y of await Promise.all(
42
54
  matrix.map(async (it) => {
43
55
  const row: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
44
56
  await divideAndConquer(ctx, operations, it, 3, progress);
45
- return orchestrateInterfaceSchemasReview(
46
- ctx,
47
- operations,
48
- row,
49
- reviewProgress,
50
- );
57
+ const newbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
58
+ await orchestrateInterfaceSchemasReview(
59
+ ctx,
60
+ operations,
61
+ row,
62
+ reviewProgress,
63
+ );
64
+ return { ...row, ...newbie };
51
65
  }),
52
66
  )) {
53
67
  Object.assign(x, y);
54
68
  }
69
+ if (x.IAuthorizationToken) x.IAuthorizationToken = authTokenSchema;
55
70
  return x;
56
71
  }
57
72
 
@@ -60,7 +75,7 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
60
75
  operations: AutoBeOpenApi.IOperation[],
61
76
  typeNames: string[],
62
77
  retry: number,
63
- progress: IProgress,
78
+ progress: AutoBeProgressEventBase,
64
79
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
65
80
  const remained: Set<string> = new Set(typeNames);
66
81
  const schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
@@ -81,7 +96,7 @@ async function process<Model extends ILlmSchema.Model>(
81
96
  operations: AutoBeOpenApi.IOperation[],
82
97
  oldbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
83
98
  remained: Set<string>,
84
- progress: IProgress,
99
+ progress: AutoBeProgressEventBase,
85
100
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
86
101
  const already: string[] = Object.keys(oldbie);
87
102
  const pointer: IPointer<Record<
@@ -134,10 +149,10 @@ async function process<Model extends ILlmSchema.Model>(
134
149
  type: "interfaceSchemas",
135
150
  schemas,
136
151
  tokenUsage,
137
- completed: (progress.completed += Object.keys(schemas).filter(
138
- (k) => oldbie[k] === undefined,
152
+ completed: (progress.completed += Object.keys(schemas).length),
153
+ total: (progress.total += Object.keys(schemas).filter(
154
+ (k) => remained.has(k) === false,
139
155
  ).length),
140
- total: progress.total,
141
156
  step: ctx.state().prisma?.step ?? 0,
142
157
  created_at: new Date().toISOString(),
143
158
  } satisfies AutoBeInterfaceSchemasEvent);
@@ -156,9 +171,34 @@ function createController<Model extends ILlmSchema.Model>(props: {
156
171
  }): IAgenticaController.IClass<Model> {
157
172
  assertSchemaModel(props.model);
158
173
 
174
+ const validate = (
175
+ next: unknown,
176
+ ): IValidation<IAutoBeInterfaceSchemaApplication.IProps> => {
177
+ const result: IValidation<IAutoBeInterfaceSchemaApplication.IProps> =
178
+ typia.validate<IAutoBeInterfaceSchemaApplication.IProps>(next);
179
+ if (result.success === false) return result;
180
+
181
+ // Check all IAuthorized types
182
+ const errors: IValidation.IError[] = [];
183
+ validateAuthorizationSchema({
184
+ errors,
185
+ schemas: result.data.schemas,
186
+ path: "$input.schemas",
187
+ });
188
+ if (errors.length !== 0)
189
+ return {
190
+ success: false,
191
+ errors,
192
+ data: next,
193
+ };
194
+ return result;
195
+ };
196
+
159
197
  const application: ILlmApplication<Model> = collection[
160
- props.model
161
- ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
198
+ props.model === "chatgpt" ? "chatgpt" : "claude"
199
+ ](
200
+ validate,
201
+ ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
162
202
  return {
163
203
  protocol: "class",
164
204
  name: "interface",
@@ -171,17 +211,71 @@ function createController<Model extends ILlmSchema.Model>(props: {
171
211
  };
172
212
  }
173
213
 
174
- const claude = typia.llm.application<
175
- IAutoBeInterfaceSchemaApplication,
176
- "claude"
177
- >();
178
214
  const collection = {
179
- chatgpt: typia.llm.application<
180
- IAutoBeInterfaceSchemaApplication,
181
- "chatgpt"
182
- >(),
183
- claude,
184
- llama: claude,
185
- deepseek: claude,
186
- "3.1": claude,
215
+ chatgpt: (validate: Validator) =>
216
+ typia.llm.application<IAutoBeInterfaceSchemaApplication, "chatgpt">({
217
+ validate: {
218
+ makeComponents: validate,
219
+ },
220
+ }),
221
+ claude: (validate: Validator) =>
222
+ typia.llm.application<IAutoBeInterfaceSchemaApplication, "claude">({
223
+ validate: {
224
+ makeComponents: validate,
225
+ },
226
+ }),
187
227
  };
228
+
229
+ type Validator = (
230
+ input: unknown,
231
+ ) => IValidation<IAutoBeInterfaceSchemaApplication.IProps>;
232
+
233
+ /**
234
+ * Authorization token response structure.
235
+ *
236
+ * This interface defines the structure of the authorization token response
237
+ * returned after successful user authentication. It contains both access and
238
+ * refresh tokens along with their expiration information.
239
+ *
240
+ * This token structure is automatically included in API schemas when the system
241
+ * detects authorization roles in the requirements analysis phase. It provides a
242
+ * standard format for JWT-based authentication across the generated backend
243
+ * applications.
244
+ */
245
+ interface IAuthorizationToken {
246
+ /**
247
+ * JWT access token for authenticated requests.
248
+ *
249
+ * This token should be included in the Authorization header for subsequent
250
+ * authenticated API requests as `Bearer {token}`.
251
+ */
252
+ access: string;
253
+
254
+ /**
255
+ * Refresh token for obtaining new access tokens.
256
+ *
257
+ * This token can be used to request new access tokens when the current access
258
+ * token expires, extending the user's session.
259
+ */
260
+ refresh: string;
261
+
262
+ /**
263
+ * Access token expiration timestamp.
264
+ *
265
+ * ISO 8601 date-time string indicating when the access token will expire and
266
+ * can no longer be used for authentication.
267
+ */
268
+ expired_at: string & tags.Format<"date-time">;
269
+
270
+ /**
271
+ * Refresh token expiration timestamp.
272
+ *
273
+ * ISO 8601 date-time string indicating the latest time until which the
274
+ * refresh token can be used to obtain new access tokens.
275
+ */
276
+ refreshable_until: string & tags.Format<"date-time">;
277
+ }
278
+
279
+ const authTokenSchema: AutoBeOpenApi.IJsonSchemaDescriptive =
280
+ typia.json.schema<IAuthorizationToken>().components.schemas!
281
+ .IAuthorizationToken as AutoBeOpenApi.IJsonSchemaDescriptive;
@@ -4,12 +4,15 @@ import {
4
4
  AutoBeOpenApi,
5
5
  } from "@autobe/interface";
6
6
  import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
7
+ import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
7
8
  import { IPointer } from "tstl";
8
9
  import typia from "typia";
9
10
 
10
11
  import { AutoBeContext } from "../../context/AutoBeContext";
12
+ import { assertSchemaModel } from "../../context/assertSchemaModel";
11
13
  import { transformInterfaceSchemasReviewHistories } from "./histories/transformInterfaceSchemasReviewHistories";
12
14
  import { IAutoBeInterfaceSchemasReviewApplication } from "./structures/IAutobeInterfaceSchemasReviewApplication";
15
+ import { validateAuthorizationSchema } from "./utils/validateAuthorizationSchema";
13
16
 
14
17
  export async function orchestrateInterfaceSchemasReview<
15
18
  Model extends ILlmSchema.Model,
@@ -22,42 +25,56 @@ export async function orchestrateInterfaceSchemasReview<
22
25
  >,
23
26
  progress: { total: number; completed: number },
24
27
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
25
- const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
26
- {
27
- value: null,
28
- };
29
-
30
- const { tokenUsage } = await ctx.conversate({
31
- source: "interfaceSchemasReview",
32
- controller: createController({
33
- model: ctx.model,
34
- pointer,
35
- schemas,
36
- }),
37
- histories: transformInterfaceSchemasReviewHistories(
38
- ctx.state(),
39
- operations,
40
- schemas,
41
- ),
42
- enforceFunctionCall: true,
43
- message: "Review type schemas.",
44
- });
45
- if (pointer.value === null)
46
- throw new Error("Failed to extract review information.");
28
+ try {
29
+ const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
30
+ {
31
+ value: null,
32
+ };
33
+ const { tokenUsage } = await ctx.conversate({
34
+ source: "interfaceSchemasReview",
35
+ controller: createController({
36
+ model: ctx.model,
37
+ pointer,
38
+ schemas,
39
+ }),
40
+ histories: transformInterfaceSchemasReviewHistories(
41
+ ctx.state(),
42
+ operations,
43
+ schemas,
44
+ ),
45
+ enforceFunctionCall: true,
46
+ message: "Review type schemas.",
47
+ });
48
+ if (pointer.value === null) {
49
+ console.error("Failed to extract review information.");
50
+ ++progress.completed;
51
+ return {};
52
+ }
47
53
 
48
- ctx.dispatch({
49
- type: "interfaceSchemasReview",
50
- schemas: schemas,
51
- review: pointer.value.review,
52
- plan: pointer.value.plan,
53
- content: pointer.value.content,
54
- tokenUsage,
55
- step: ctx.state().analyze?.step ?? 0,
56
- total: progress.total,
57
- completed: ++progress.completed,
58
- created_at: new Date().toISOString(),
59
- } satisfies AutoBeInterfaceSchemasReviewEvent);
60
- return pointer.value.content;
54
+ const content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
55
+ (
56
+ OpenApiV3_1Emender.convertComponents({
57
+ schemas: pointer.value.content,
58
+ }) as AutoBeOpenApi.IComponents
59
+ ).schemas ?? {};
60
+ ctx.dispatch({
61
+ type: "interfaceSchemasReview",
62
+ schemas: schemas,
63
+ review: pointer.value.review,
64
+ plan: pointer.value.plan,
65
+ content,
66
+ tokenUsage,
67
+ step: ctx.state().analyze?.step ?? 0,
68
+ total: progress.total,
69
+ completed: ++progress.completed,
70
+ created_at: new Date().toISOString(),
71
+ } satisfies AutoBeInterfaceSchemasReviewEvent);
72
+ return content;
73
+ } catch (error) {
74
+ console.error("Error occurred during interface schemas review:", error);
75
+ ++progress.completed;
76
+ return {};
77
+ }
61
78
  }
62
79
 
63
80
  function createController<Model extends ILlmSchema.Model>(props: {
@@ -68,6 +85,8 @@ function createController<Model extends ILlmSchema.Model>(props: {
68
85
  AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
69
86
  >;
70
87
  }): IAgenticaController.IClass<Model> {
88
+ assertSchemaModel(props.model);
89
+
71
90
  const validate = (
72
91
  next: unknown,
73
92
  ): IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps> => {
@@ -76,37 +95,24 @@ function createController<Model extends ILlmSchema.Model>(props: {
76
95
  if (result.success === false) return result;
77
96
 
78
97
  const errors: IValidation.IError[] = [];
79
- if (Object.keys(result.data.content).length === 0) {
80
- console.log();
81
- console.log();
82
- console.log();
83
- console.log(
84
- JSON.stringify({ schemas: props.schemas, ...result.data }, null, 2),
85
- );
86
- errors.push({
87
- path: `$input.content`,
88
- expected: `Content must not be empty. If it's at a level that can't be fixed, please create a schema instead to meet the requirements.`,
89
- value: result.data.content,
90
- });
91
- }
92
-
93
- if (errors.length > 0) {
98
+ validateAuthorizationSchema({
99
+ errors,
100
+ schemas: result.data.content,
101
+ path: "$input.content",
102
+ });
103
+ if (errors.length !== 0)
94
104
  return {
95
105
  success: false,
96
106
  errors,
97
- data: result.data,
107
+ data: next,
98
108
  };
99
- }
100
-
101
109
  return result;
102
110
  };
103
-
104
111
  const application: ILlmApplication<Model> = collection[
105
112
  props.model === "chatgpt" ? "chatgpt" : "claude"
106
113
  ](
107
114
  validate,
108
115
  ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
109
-
110
116
  return {
111
117
  protocol: "class",
112
118
  name: "Reviewer",
@@ -118,12 +124,6 @@ function createController<Model extends ILlmSchema.Model>(props: {
118
124
  } satisfies IAutoBeInterfaceSchemasReviewApplication,
119
125
  };
120
126
  }
121
- const claude = (validate: Validator) =>
122
- typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "claude">({
123
- validate: {
124
- review: validate,
125
- },
126
- });
127
127
 
128
128
  const collection = {
129
129
  chatgpt: (validate: Validator) =>
@@ -132,10 +132,12 @@ const collection = {
132
132
  review: validate,
133
133
  },
134
134
  }),
135
- claude,
136
- llama: claude,
137
- deepseek: claude,
138
- "3.1": claude,
135
+ claude: (validate: Validator) =>
136
+ typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "claude">({
137
+ validate: {
138
+ review: validate,
139
+ },
140
+ }),
139
141
  };
140
142
 
141
143
  type Validator = (
@@ -20,6 +20,45 @@ export interface IAutoBeInterfaceComplementApplication {
20
20
  }
21
21
  export namespace IAutoBeInterfaceComplementApplication {
22
22
  export interface IProps {
23
+ /**
24
+ * TypeScript draft code for complement schema definitions.
25
+ *
26
+ * This property contains TypeScript interface definitions for missing schema
27
+ * types that were referenced but not defined in the initial schema generation.
28
+ * Similar to the main schema draft, this serves as a preliminary TypeScript
29
+ * representation before converting to JSON Schema format.
30
+ *
31
+ * The draft helps ensure that complementary schemas maintain consistency with
32
+ * the existing type system and follow the same conventions as the primary schemas.
33
+ *
34
+ * This draft typically includes:
35
+ * - Missing entity interfaces referenced via $ref
36
+ * - Nested object types used within other schemas
37
+ * - Shared utility types or enumerations
38
+ * - Any transitively referenced types
39
+ *
40
+ * The final schemas in the `schemas` property should be validated against and
41
+ * derived from this TypeScript draft to ensure type safety and consistency
42
+ * across the entire API specification.
43
+ *
44
+ * Example complement draft:
45
+ * ```typescript
46
+ * interface IUserProfile {
47
+ * id: string;
48
+ * userId: string;
49
+ * displayName: string;
50
+ * avatarUrl?: string;
51
+ * }
52
+ *
53
+ * interface IAddress {
54
+ * street: string;
55
+ * city: string;
56
+ * postalCode: string;
57
+ * }
58
+ * ```
59
+ */
60
+ draft: string;
61
+
23
62
  /**
24
63
  * A collection of missing schema definitions that need to be added to the
25
64
  * OpenAPI document's `components.schemas` section.
@@ -5,10 +5,10 @@ export interface IAutoBeInterfaceGroupApplication {
5
5
  * Generate logical groups for organizing API endpoint creation based on
6
6
  * Prisma schema structure.
7
7
  *
8
- * Groups MUST be derived from Prisma schema organization (namespaces, file
9
- * structure, table prefixes) rather than arbitrary business domains. Only
10
- * create new groups when existing schema structure cannot adequately cover
11
- * all requirements.
8
+ * DO: Derive groups from Prisma schema organization (namespaces, file
9
+ * structure, table prefixes) rather than arbitrary business domains.
10
+ * DO: Create new groups only when existing schema structure cannot adequately
11
+ * cover all requirements.
12
12
  *
13
13
  * @param props Properties containing the groups to be created for API
14
14
  * organization
@@ -21,8 +21,8 @@ export namespace IAutoBeInterfaceGroupApplication {
21
21
  /**
22
22
  * Array of API endpoint groups for organizing development.
23
23
  *
24
- * Groups MUST be organized around existing Prisma schema structure and
25
- * provide complete coverage of all entities and requirements without
24
+ * DO: Organize groups around existing Prisma schema structure.
25
+ * DO: Provide complete coverage of all entities and requirements without
26
26
  * overlap.
27
27
  */
28
28
  groups: IGroup[] & tags.MinItems<1>;
@@ -34,10 +34,11 @@ export namespace IAutoBeInterfaceGroupApplication {
34
34
  *
35
35
  * **SCHEMA-BASED GROUP REQUIREMENTS:**
36
36
  *
37
- * Groups MUST be derived from the Prisma schema structure rather than
38
- * arbitrary business domain names. This ensures consistency with the
39
- * underlying data model and prevents misalignment between API organization
40
- * and database structure.
37
+ * DO: Derive groups from the Prisma schema structure rather than arbitrary
38
+ * business domain names.
39
+ *
40
+ * This ensures consistency with the underlying data model and prevents
41
+ * misalignment between API organization and database structure.
41
42
  *
42
43
  * **Primary Group Sources (in order of priority):**
43
44
  *
@@ -51,12 +52,11 @@ export namespace IAutoBeInterfaceGroupApplication {
51
52
  *
52
53
  * **Group Creation Guidelines:**
53
54
  *
54
- * - Each group must cover specific Prisma schema entities without overlap
55
+ * - Each group covers specific Prisma schema entities without overlap
55
56
  * - Size groups appropriately for manageable endpoint generation cycles
56
57
  * - Maintain clear boundaries based on schema organization
57
58
  * - Ensure complete coverage of all database entities and requirements
58
- * - Related database tables within the same schema area should be grouped
59
- * together
59
+ * - Related database tables within the same schema area are grouped together
60
60
  *
61
61
  * **When to Create Schema-Independent Groups:**
62
62
  *
@@ -71,14 +71,14 @@ export namespace IAutoBeInterfaceGroupApplication {
71
71
  * **Naming Standards:**
72
72
  *
73
73
  * - Use PascalCase format (e.g., "Shopping", "BBS", "UserManagement")
74
- * - Names MUST directly reflect Prisma schema structure
74
+ * - Names directly reflect Prisma schema structure
75
75
  * - Keep names concise and schema-derived
76
76
  * - Avoid arbitrary business domain names
77
77
  * - Maintain consistency with schema organization
78
78
  *
79
79
  * **Quality Requirements:**
80
80
  *
81
- * - Groups collectively must cover ALL entities and requirements
81
+ * - Groups collectively cover ALL entities and requirements
82
82
  * - Each database entity belongs to exactly one group
83
83
  * - Clear mapping to specific Prisma schema elements
84
84
  * - Balance group sizes within schema constraints
@@ -88,7 +88,7 @@ export namespace IAutoBeInterfaceGroupApplication {
88
88
  /**
89
89
  * Unique identifier name derived from Prisma schema structure.
90
90
  *
91
- * Must correspond to schema namespaces, file names, table prefixes, or
91
+ * DO: Correspond to schema namespaces, file names, table prefixes, or
92
92
  * organizational annotations rather than arbitrary business domain names.
93
93
  */
94
94
  name: string & tags.MinLength<1>;