@autobe/agent 0.28.1 → 0.29.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 (531) hide show
  1. package/lib/AutoBeAgent.js +1 -0
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/AutoBeMockAgent.js +1 -0
  4. package/lib/AutoBeMockAgent.js.map +1 -1
  5. package/lib/constants/AutoBeConfigConstant.d.ts +3 -1
  6. package/lib/constants/AutoBeSystemPromptConstant.d.ts +39 -26
  7. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  8. package/lib/context/AutoBeContext.d.ts +1 -1
  9. package/lib/factory/createAutoBeContext.js +5 -3
  10. package/lib/factory/createAutoBeContext.js.map +1 -1
  11. package/lib/index.mjs +43501 -23602
  12. package/lib/index.mjs.map +1 -1
  13. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +7 -2
  14. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +11 -21
  15. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  16. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +2 -2
  17. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -5
  18. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  19. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +2 -2
  20. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +53 -50
  21. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  22. package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -2
  23. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  24. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +855 -258
  25. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  26. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -14
  27. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  28. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -9
  29. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  30. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +110 -36
  31. package/lib/orchestrate/common/AutoBePreliminaryController.d.ts +40 -0
  32. package/lib/orchestrate/common/AutoBePreliminaryController.js +97 -0
  33. package/lib/orchestrate/common/AutoBePreliminaryController.js.map +1 -0
  34. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistory.d.ts +8 -0
  35. package/lib/orchestrate/{realize/histories/transformRealizeCorrectCastingHistories.js → common/histories/transformCommonCorrectCastingHistory.js} +16 -13
  36. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistory.js.map +1 -0
  37. package/lib/orchestrate/common/histories/transformPreliminaryHistory.d.ts +4 -0
  38. package/lib/orchestrate/common/histories/transformPreliminaryHistory.js +285 -0
  39. package/lib/orchestrate/common/histories/transformPreliminaryHistory.js.map +1 -0
  40. package/lib/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.d.ts → transformPreviousAndLatestCorrectHistory.d.ts} +1 -1
  41. package/lib/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.js → transformPreviousAndLatestCorrectHistory.js} +4 -4
  42. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js.map +1 -0
  43. package/lib/orchestrate/common/internal/complementPreliminaryCollection.d.ts +7 -0
  44. package/lib/orchestrate/common/internal/complementPreliminaryCollection.js +99 -0
  45. package/lib/orchestrate/common/internal/complementPreliminaryCollection.js.map +1 -0
  46. package/lib/orchestrate/common/internal/createPreliminaryCollection.d.ts +3 -0
  47. package/lib/orchestrate/common/internal/createPreliminaryCollection.js +20 -0
  48. package/lib/orchestrate/common/internal/createPreliminaryCollection.js.map +1 -0
  49. package/lib/orchestrate/common/internal/validatePreliminary.d.ts +5 -0
  50. package/lib/orchestrate/common/internal/validatePreliminary.js +217 -0
  51. package/lib/orchestrate/common/internal/validatePreliminary.js.map +1 -0
  52. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +10 -22
  53. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  54. package/lib/orchestrate/common/orchestratePreliminary.d.ts +12 -0
  55. package/lib/orchestrate/common/orchestratePreliminary.js +231 -0
  56. package/lib/orchestrate/common/orchestratePreliminary.js.map +1 -0
  57. package/lib/orchestrate/common/structures/AutoBePreliminaryRequest.d.ts +16 -0
  58. package/lib/orchestrate/{realize/structures/IAutoBeRealizeAuthorizationApplication.js → common/structures/AutoBePreliminaryRequest.js} +1 -1
  59. package/lib/orchestrate/common/structures/AutoBePreliminaryRequest.js.map +1 -0
  60. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +1 -4
  61. package/lib/orchestrate/common/structures/IAutoBeOrchestrateResult.d.ts +9 -0
  62. package/lib/orchestrate/{interface/structures/IAutoBeInterfacePrerequisitesApplication.js → common/structures/IAutoBeOrchestrateResult.js} +1 -1
  63. package/lib/orchestrate/common/structures/IAutoBeOrchestrateResult.js.map +1 -0
  64. package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.d.ts +8 -0
  65. package/lib/orchestrate/{interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js → common/structures/IAutoBePreliminaryCollection.js} +1 -1
  66. package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.js.map +1 -0
  67. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.d.ts +27 -0
  68. package/lib/orchestrate/{interface/structures/IAutoBeInterfaceOperationsReviewApplication.js → common/structures/IAutoBePreliminaryGetAnalysisFiles.js} +1 -1
  69. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.js.map +1 -0
  70. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.d.ts +28 -0
  71. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.js +3 -0
  72. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.js.map +1 -0
  73. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.d.ts +27 -0
  74. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.js +3 -0
  75. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.js.map +1 -0
  76. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.d.ts +27 -0
  77. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.js +3 -0
  78. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.js.map +1 -0
  79. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.d.ts +10 -0
  80. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.js +70 -0
  81. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.js.map +1 -0
  82. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistory.d.ts +3 -0
  83. package/lib/orchestrate/interface/histories/{transformInterfaceCommonHistories.js → transformInterfaceCommonHistory.js} +4 -4
  84. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistory.js.map +1 -0
  85. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.d.ts +9 -0
  86. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.js +60 -0
  87. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.js.map +1 -0
  88. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.d.ts +12 -0
  89. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.js +63 -0
  90. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.js.map +1 -0
  91. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.d.ts +7 -0
  92. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.js +36 -0
  93. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.js.map +1 -0
  94. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.d.ts +6 -0
  95. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.js +68 -0
  96. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.js.map +1 -0
  97. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.d.ts +9 -0
  98. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.js +72 -0
  99. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.js.map +1 -0
  100. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.d.ts +7 -0
  101. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.js +38 -0
  102. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.js.map +1 -0
  103. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.d.ts +8 -0
  104. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.js +73 -0
  105. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.js.map +1 -0
  106. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.d.ts +11 -0
  107. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.js +95 -0
  108. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.js.map +1 -0
  109. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.d.ts +5 -0
  110. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.js +54 -0
  111. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.js.map +1 -0
  112. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.d.ts +12 -0
  113. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.js +75 -0
  114. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.js.map +1 -0
  115. package/lib/orchestrate/interface/orchestrateInterface.js +90 -46
  116. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  117. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.d.ts +6 -0
  118. package/lib/orchestrate/interface/{orchestrateInterfaceAuthorizations.js → orchestrateInterfaceAuthorization.js} +1370 -226
  119. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js.map +1 -0
  120. package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -3
  121. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +2807 -532
  122. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  123. package/lib/orchestrate/interface/{orchestrateInterfaceEndpoints.d.ts → orchestrateInterfaceEndpoint.d.ts} +1 -1
  124. package/lib/orchestrate/interface/orchestrateInterfaceEndpoint.js +1356 -0
  125. package/lib/orchestrate/interface/orchestrateInterfaceEndpoint.js.map +1 -0
  126. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.d.ts +4 -0
  127. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js +1337 -0
  128. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js.map +1 -0
  129. package/lib/orchestrate/interface/{orchestrateInterfaceGroups.d.ts → orchestrateInterfaceGroup.d.ts} +1 -2
  130. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js +621 -0
  131. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js.map +1 -0
  132. package/lib/orchestrate/interface/{orchestrateInterfaceOperations.d.ts → orchestrateInterfaceOperation.d.ts} +1 -2
  133. package/lib/orchestrate/interface/{orchestrateInterfaceOperations.js → orchestrateInterfaceOperation.js} +1275 -216
  134. package/lib/orchestrate/interface/orchestrateInterfaceOperation.js.map +1 -0
  135. package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.d.ts +4 -0
  136. package/lib/orchestrate/interface/{orchestrateInterfaceOperationsReview.js → orchestrateInterfaceOperationReview.js} +1421 -247
  137. package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.js.map +1 -0
  138. package/lib/orchestrate/interface/{orchestrateInterfacePrerequisites.d.ts → orchestrateInterfacePrerequisite.d.ts} +1 -1
  139. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js +2159 -0
  140. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js.map +1 -0
  141. package/lib/orchestrate/interface/{orchestrateInterfaceSchemas.d.ts → orchestrateInterfaceSchema.d.ts} +1 -2
  142. package/lib/orchestrate/interface/{orchestrateInterfaceSchemas.js → orchestrateInterfaceSchema.js} +2550 -546
  143. package/lib/orchestrate/interface/orchestrateInterfaceSchema.js.map +1 -0
  144. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +7 -17
  145. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
  146. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +1 -0
  147. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +2823 -548
  148. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
  149. package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.d.ts +56 -5
  150. package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +57 -10
  151. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +55 -10
  152. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.d.ts +96 -0
  153. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.js +3 -0
  154. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.js.map +1 -0
  155. package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -82
  156. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +58 -13
  157. package/lib/orchestrate/interface/structures/{IAutoBeInterfaceOperationsReviewApplication.d.ts → IAutoBeInterfaceOperationReviewApplication.d.ts} +58 -28
  158. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.js +3 -0
  159. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.js.map +1 -0
  160. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.d.ts +98 -0
  161. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.js +3 -0
  162. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.js.map +1 -0
  163. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +56 -15
  164. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +62 -22
  165. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +60 -21
  166. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +61 -19
  167. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +29 -23
  168. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
  169. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.js +67 -61
  170. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -1
  171. package/lib/orchestrate/interface/utils/JsonSchemaValidator.d.ts +2 -1
  172. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +52 -25
  173. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
  174. package/lib/orchestrate/interface/utils/OperationValidator.js +59 -1
  175. package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
  176. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.d.ts +6 -0
  177. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js +98 -0
  178. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js.map +1 -0
  179. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.d.ts +7 -0
  180. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.js +31 -0
  181. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.js.map +1 -0
  182. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.d.ts +7 -0
  183. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.js +38 -0
  184. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.js.map +1 -0
  185. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.d.ts +8 -0
  186. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js +79 -0
  187. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js.map +1 -0
  188. package/lib/orchestrate/prisma/orchestratePrisma.js +9 -6
  189. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  190. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
  191. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +8 -14
  192. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  193. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +2863 -1543
  194. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  195. package/lib/orchestrate/prisma/orchestratePrismaReview.d.ts +1 -1
  196. package/lib/orchestrate/prisma/orchestratePrismaReview.js +2886 -1566
  197. package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  198. package/lib/orchestrate/prisma/{orchestratePrismaSchemas.d.ts → orchestratePrismaSchema.d.ts} +1 -1
  199. package/lib/orchestrate/prisma/orchestratePrismaSchema.js +3068 -0
  200. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -0
  201. package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.d.ts +74 -76
  202. package/lib/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.d.ts +90 -72
  203. package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.d.ts +89 -66
  204. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.d.ts +9 -0
  205. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.js +79 -0
  206. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.js.map +1 -0
  207. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.d.ts +7 -0
  208. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.js +41 -0
  209. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.js.map +1 -0
  210. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.d.ts +12 -0
  211. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.js +67 -0
  212. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.js.map +1 -0
  213. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.d.ts +18 -0
  214. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.js +54 -0
  215. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.js.map +1 -0
  216. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +4 -2
  217. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +140 -106
  218. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  219. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.d.ts +3 -0
  220. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.js +23 -0
  221. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.js.map +1 -0
  222. package/lib/orchestrate/realize/orchestrateRealize.js +4 -4
  223. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  224. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +5 -1
  225. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +1288 -572
  226. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  227. package/lib/orchestrate/realize/{orchestrateRealizeAuthorization.d.ts → orchestrateRealizeAuthorizationWrite.d.ts} +1 -1
  228. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js +1410 -0
  229. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js.map +1 -0
  230. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +664 -140
  231. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  232. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +20 -65
  233. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
  234. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +660 -135
  235. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  236. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +79 -19
  237. package/lib/orchestrate/realize/structures/{IAutoBeRealizeAuthorizationApplication.d.ts → IAutoBeRealizeAuthorizationWriteApplication.d.ts} +60 -27
  238. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.js +3 -0
  239. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.js.map +1 -0
  240. package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +54 -5
  241. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +6 -14
  242. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +54 -6
  243. package/lib/orchestrate/realize/utils/generateRealizeScenario.d.ts +1 -3
  244. package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -7
  245. package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
  246. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -3
  247. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +23 -20
  248. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  249. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.d.ts +4 -0
  250. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.js +36 -0
  251. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.js.map +1 -0
  252. package/lib/orchestrate/test/histories/transformTestScenarioHistory.d.ts +11 -0
  253. package/lib/orchestrate/test/histories/transformTestScenarioHistory.js +95 -0
  254. package/lib/orchestrate/test/histories/transformTestScenarioHistory.js.map +1 -0
  255. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.d.ts +10 -0
  256. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.js +67 -0
  257. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.js.map +1 -0
  258. package/lib/orchestrate/test/histories/{transformTestWriteHistories.d.ts → transformTestWriteHistory.d.ts} +4 -4
  259. package/lib/orchestrate/test/histories/{transformTestWriteHistories.js → transformTestWriteHistory.js} +79 -76
  260. package/lib/orchestrate/test/histories/transformTestWriteHistory.js.map +1 -0
  261. package/lib/orchestrate/test/orchestrateTestCorrect.js +13 -26
  262. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  263. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +3 -15
  264. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  265. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
  266. package/lib/orchestrate/test/orchestrateTestScenario.js +1370 -316
  267. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  268. package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -3
  269. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +1067 -288
  270. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  271. package/lib/orchestrate/test/orchestrateTestWrite.js +8 -15
  272. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  273. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +66 -4
  274. package/lib/orchestrate/test/structures/IAutoBeTestScenarioReviewApplication.d.ts +82 -14
  275. package/lib/structures/IAutoBeOrchestrateHistory.d.ts +5 -0
  276. package/lib/structures/IAutoBeOrchestrateHistory.js +3 -0
  277. package/lib/structures/IAutoBeOrchestrateHistory.js.map +1 -0
  278. package/lib/utils/executeCachedBatch.d.ts +5 -1
  279. package/lib/utils/executeCachedBatch.js +23 -5
  280. package/lib/utils/executeCachedBatch.js.map +1 -1
  281. package/lib/utils/validateEmptyCode.js +2 -2
  282. package/lib/utils/validateEmptyCode.js.map +1 -1
  283. package/package.json +8 -6
  284. package/src/AutoBeAgent.ts +1 -0
  285. package/src/AutoBeMockAgent.ts +1 -0
  286. package/src/constants/AutoBeConfigConstant.ts +2 -0
  287. package/src/constants/AutoBeSystemPromptConstant.ts +39 -26
  288. package/src/context/AutoBeContext.ts +1 -1
  289. package/src/factory/createAutoBeContext.ts +5 -2
  290. package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +17 -28
  291. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +12 -6
  292. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +62 -61
  293. package/src/orchestrate/analyze/orchestrateAnalyze.ts +2 -0
  294. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +97 -48
  295. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +3 -16
  296. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +1 -2
  297. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +114 -36
  298. package/src/orchestrate/common/AutoBePreliminaryController.ts +161 -0
  299. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistory.ts +32 -0
  300. package/src/orchestrate/common/histories/transformPreliminaryHistory.ts +383 -0
  301. package/src/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.ts → transformPreviousAndLatestCorrectHistory.ts} +1 -1
  302. package/src/orchestrate/common/internal/complementPreliminaryCollection.ts +123 -0
  303. package/src/orchestrate/common/internal/createPreliminaryCollection.ts +32 -0
  304. package/src/orchestrate/common/internal/validatePreliminary.ts +315 -0
  305. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +8 -15
  306. package/src/orchestrate/common/orchestratePreliminary.ts +361 -0
  307. package/src/orchestrate/common/structures/AutoBePreliminaryRequest.ts +18 -0
  308. package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +1 -4
  309. package/src/orchestrate/common/structures/IAutoBeOrchestrateResult.ts +13 -0
  310. package/src/orchestrate/common/structures/IAutoBePreliminaryCollection.ts +9 -0
  311. package/src/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.ts +29 -0
  312. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.ts +30 -0
  313. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.ts +29 -0
  314. package/src/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.ts +29 -0
  315. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.ts +77 -0
  316. package/src/orchestrate/interface/histories/{transformInterfaceCommonHistories.ts → transformInterfaceCommonHistory.ts} +1 -1
  317. package/src/orchestrate/interface/histories/{transformInterfaceGroupHistories.ts → transformInterfaceComplementHistory.ts} +35 -21
  318. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistory.ts +74 -0
  319. package/src/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.ts +40 -0
  320. package/src/orchestrate/interface/histories/transformInterfaceGroupHistory.ts +72 -0
  321. package/src/orchestrate/interface/histories/transformInterfaceOperationHistory.ts +79 -0
  322. package/src/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.ts +43 -0
  323. package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.ts +89 -0
  324. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistory.ts +105 -0
  325. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.ts +56 -0
  326. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.ts +88 -0
  327. package/src/orchestrate/interface/orchestrateInterface.ts +115 -51
  328. package/src/orchestrate/interface/{orchestrateInterfaceAuthorizations.ts → orchestrateInterfaceAuthorization.ts} +91 -67
  329. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +174 -78
  330. package/src/orchestrate/interface/orchestrateInterfaceEndpoint.ts +207 -0
  331. package/src/orchestrate/interface/orchestrateInterfaceEndpointReview.ts +139 -0
  332. package/src/orchestrate/interface/orchestrateInterfaceGroup.ts +153 -0
  333. package/src/orchestrate/interface/{orchestrateInterfaceOperations.ts → orchestrateInterfaceOperation.ts} +109 -86
  334. package/src/orchestrate/interface/orchestrateInterfaceOperationReview.ts +186 -0
  335. package/src/orchestrate/interface/{orchestrateInterfacePrerequisites.ts → orchestrateInterfacePrerequisite.ts} +123 -58
  336. package/src/orchestrate/interface/{orchestrateInterfaceSchemas.ts → orchestrateInterfaceSchema.ts} +96 -90
  337. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +10 -11
  338. package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +127 -60
  339. package/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.ts +63 -5
  340. package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +67 -12
  341. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.ts +63 -10
  342. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.ts +106 -0
  343. package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -84
  344. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +65 -13
  345. package/src/orchestrate/interface/structures/{IAutoBeInterfaceOperationsReviewApplication.ts → IAutoBeInterfaceOperationReviewApplication.ts} +65 -30
  346. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.ts +111 -0
  347. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +65 -15
  348. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +71 -24
  349. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +68 -23
  350. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +69 -21
  351. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +31 -23
  352. package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +73 -61
  353. package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +53 -26
  354. package/src/orchestrate/interface/utils/OperationValidator.ts +69 -1
  355. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistory.ts +109 -0
  356. package/src/orchestrate/prisma/histories/{transformPrismaCorrectHistories.ts → transformPrismaCorrectHistory.ts} +13 -22
  357. package/src/orchestrate/prisma/histories/transformPrismaReviewHistory.ts +42 -0
  358. package/src/orchestrate/prisma/histories/{transformPrismaSchemaHistories.ts → transformPrismaSchemaHistory.ts} +7 -8
  359. package/src/orchestrate/prisma/orchestratePrisma.ts +12 -17
  360. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +7 -15
  361. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +129 -64
  362. package/src/orchestrate/prisma/orchestratePrismaReview.ts +115 -59
  363. package/src/orchestrate/prisma/{orchestratePrismaSchemas.ts → orchestratePrismaSchema.ts} +92 -60
  364. package/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.ts +81 -76
  365. package/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.ts +97 -72
  366. package/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.ts +93 -66
  367. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.ts +89 -0
  368. package/src/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.ts +45 -0
  369. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.ts +85 -0
  370. package/src/orchestrate/realize/histories/transformRealizeCorrectHistory.ts +77 -0
  371. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +152 -121
  372. package/src/orchestrate/realize/histories/{transformRealizeWriteAuthorizationsHistories.ts → transformRealizeWriteMembershipHistory.ts} +2 -2
  373. package/src/orchestrate/realize/orchestrateRealize.ts +4 -3
  374. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +155 -97
  375. package/src/orchestrate/realize/orchestrateRealizeAuthorizationWrite.ts +241 -0
  376. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +88 -86
  377. package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +17 -56
  378. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +82 -78
  379. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +85 -22
  380. package/src/orchestrate/realize/structures/{IAutoBeRealizeAuthorizationApplication.ts → IAutoBeRealizeAuthorizationWriteApplication.ts} +64 -29
  381. package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +58 -5
  382. package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +6 -19
  383. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +58 -6
  384. package/src/orchestrate/realize/utils/generateRealizeScenario.ts +2 -20
  385. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +30 -30
  386. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.ts +40 -0
  387. package/src/orchestrate/test/histories/transformTestScenarioHistory.ts +116 -0
  388. package/src/orchestrate/test/histories/transformTestScenarioReviewHistory.ts +85 -0
  389. package/src/orchestrate/test/histories/transformTestWriteHistory.ts +169 -0
  390. package/src/orchestrate/test/orchestrateTestCorrect.ts +13 -19
  391. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +5 -12
  392. package/src/orchestrate/test/orchestrateTestScenario.ts +143 -83
  393. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +93 -76
  394. package/src/orchestrate/test/orchestrateTestWrite.ts +7 -7
  395. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +74 -4
  396. package/src/orchestrate/test/structures/IAutoBeTestScenarioReviewApplication.ts +89 -14
  397. package/src/structures/IAutoBeOrchestrateHistory.ts +6 -0
  398. package/src/utils/executeCachedBatch.ts +33 -7
  399. package/src/utils/validateEmptyCode.ts +2 -2
  400. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.d.ts +0 -8
  401. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +0 -16
  402. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +0 -1
  403. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +0 -1
  404. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.d.ts +0 -3
  405. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +0 -62
  406. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +0 -1
  407. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +0 -8
  408. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +0 -68
  409. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +0 -1
  410. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.d.ts +0 -3
  411. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.js.map +0 -1
  412. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +0 -9
  413. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +0 -74
  414. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +0 -1
  415. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +0 -10
  416. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +0 -61
  417. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +0 -1
  418. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +0 -4
  419. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +0 -34
  420. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +0 -1
  421. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +0 -6
  422. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +0 -52
  423. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +0 -1
  424. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +0 -8
  425. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +0 -71
  426. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +0 -1
  427. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.d.ts +0 -5
  428. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +0 -36
  429. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +0 -1
  430. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +0 -3
  431. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +0 -102
  432. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +0 -1
  433. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +0 -9
  434. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +0 -74
  435. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +0 -1
  436. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +0 -5
  437. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +0 -51
  438. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +0 -1
  439. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +0 -11
  440. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +0 -81
  441. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +0 -1
  442. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +0 -4
  443. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +0 -1
  444. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +0 -508
  445. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +0 -1
  446. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -4
  447. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +0 -488
  448. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +0 -1
  449. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +0 -458
  450. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +0 -1
  451. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +0 -1
  452. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +0 -4
  453. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +0 -1
  454. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +0 -917
  455. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +0 -1
  456. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +0 -1
  457. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +0 -60
  458. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +0 -1
  459. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js.map +0 -1
  460. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +0 -52
  461. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +0 -1
  462. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +0 -6
  463. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +0 -95
  464. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +0 -1
  465. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.d.ts +0 -3
  466. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +0 -41
  467. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +0 -1
  468. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.d.ts +0 -8
  469. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +0 -62
  470. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +0 -1
  471. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +0 -8
  472. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +0 -78
  473. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +0 -1
  474. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +0 -1678
  475. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +0 -1
  476. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +0 -5
  477. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +0 -44
  478. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +0 -1
  479. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.d.ts +0 -5
  480. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +0 -82
  481. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +0 -1
  482. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +0 -5
  483. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +0 -1
  484. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -13
  485. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +0 -29
  486. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +0 -1
  487. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +0 -3
  488. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +0 -23
  489. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +0 -1
  490. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +0 -710
  491. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +0 -1
  492. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +0 -1
  493. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.d.ts +0 -4
  494. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +0 -33
  495. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +0 -1
  496. package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +0 -10
  497. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +0 -101
  498. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +0 -1
  499. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +0 -8
  500. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +0 -72
  501. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +0 -1
  502. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +0 -1
  503. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +0 -25
  504. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +0 -72
  505. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +0 -75
  506. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +0 -82
  507. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -72
  508. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +0 -40
  509. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +0 -78
  510. package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +0 -44
  511. package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +0 -118
  512. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +0 -80
  513. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +0 -55
  514. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +0 -90
  515. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +0 -152
  516. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +0 -98
  517. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +0 -91
  518. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +0 -157
  519. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +0 -65
  520. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +0 -58
  521. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +0 -104
  522. package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +0 -69
  523. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +0 -52
  524. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +0 -95
  525. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +0 -30
  526. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +0 -46
  527. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +0 -185
  528. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +0 -39
  529. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +0 -125
  530. package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +0 -89
  531. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +0 -172
@@ -0,0 +1,153 @@
1
+ import { IAgenticaController } from "@agentica/core";
2
+ import {
3
+ AutoBeEventSource,
4
+ AutoBeInterfaceGroupEvent,
5
+ AutoBePrismaHistory,
6
+ } from "@autobe/interface";
7
+ import { StringUtil } from "@autobe/utils";
8
+ import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
9
+ import { IPointer } from "tstl";
10
+ import typia from "typia";
11
+ import { v7 } from "uuid";
12
+
13
+ import { AutoBeContext } from "../../context/AutoBeContext";
14
+ import { assertSchemaModel } from "../../context/assertSchemaModel";
15
+ import { transformInterfaceGroupHistory } from "./histories/transformInterfaceGroupHistory";
16
+ import { IAutoBeInterfaceGroupApplication } from "./structures/IAutoBeInterfaceGroupApplication";
17
+
18
+ export async function orchestrateInterfaceGroup<Model extends ILlmSchema.Model>(
19
+ ctx: AutoBeContext<Model>,
20
+ props: {
21
+ instruction: string;
22
+ },
23
+ ): Promise<AutoBeInterfaceGroupEvent> {
24
+ const start: Date = new Date();
25
+ const pointer: IPointer<IAutoBeInterfaceGroupApplication.IProps | null> = {
26
+ value: null,
27
+ };
28
+ const prisma: AutoBePrismaHistory | null = ctx.state().prisma;
29
+ const { metric, tokenUsage } = await ctx.conversate({
30
+ source: SOURCE,
31
+ controller: createController({
32
+ model: ctx.model,
33
+ build: (next) => {
34
+ pointer.value = next;
35
+ },
36
+ prismaSchemas: new Set(
37
+ prisma !== null
38
+ ? prisma.result.data.files
39
+ .map((f) => f.models)
40
+ .flat()
41
+ .map((m) => m.name)
42
+ : [],
43
+ ),
44
+ }),
45
+ enforceFunctionCall: true,
46
+ ...transformInterfaceGroupHistory({
47
+ state: ctx.state(),
48
+ instruction: props.instruction,
49
+ }),
50
+ });
51
+ if (pointer.value === null)
52
+ throw new Error("Failed to generate endpoint groups."); // unreachable
53
+ return {
54
+ type: SOURCE,
55
+ id: v7(),
56
+ created_at: start.toISOString(),
57
+ groups: pointer.value.groups,
58
+ metric,
59
+ tokenUsage,
60
+ step: ctx.state().analyze?.step ?? 0,
61
+ } satisfies AutoBeInterfaceGroupEvent;
62
+ }
63
+
64
+ function createController<Model extends ILlmSchema.Model>(props: {
65
+ model: Model;
66
+ build: (next: IAutoBeInterfaceGroupApplication.IProps) => void;
67
+ prismaSchemas: Set<string>;
68
+ }): IAgenticaController.IClass<Model> {
69
+ assertSchemaModel(props.model);
70
+
71
+ const validate: Validator = (input) => {
72
+ const result: IValidation<IAutoBeInterfaceGroupApplication.IProps> =
73
+ typia.validate<IAutoBeInterfaceGroupApplication.IProps>(input);
74
+ if (result.success === false) return result;
75
+ const errors: IValidation.IError[] = [];
76
+ result.data.groups.forEach((group, i) => {
77
+ group.prismaSchemas.forEach((key, j) => {
78
+ if (props.prismaSchemas.has(key) === false)
79
+ errors.push({
80
+ expected: Array.from(props.prismaSchemas)
81
+ .map((s) => JSON.stringify(s))
82
+ .join(" | "),
83
+ value: key,
84
+ path: `groups[${i}].prismaSchemas[${j}]`,
85
+ description: StringUtil.trim`
86
+ The Prisma schema "${key}" does not exist in the current project.
87
+
88
+ Make sure to provide only the valid Prisma schema names that are present in your project.
89
+
90
+ Here is the list of available Prisma schemas in the project:
91
+
92
+ ${Array.from(props.prismaSchemas)
93
+ .map((s) => `- ${s}`)
94
+ .join("\n")}
95
+ `,
96
+ });
97
+ });
98
+ });
99
+ return errors.length === 0
100
+ ? result
101
+ : {
102
+ success: false,
103
+ data: result.data,
104
+ errors,
105
+ };
106
+ };
107
+ const application: ILlmApplication<Model> = collection[
108
+ props.model === "chatgpt"
109
+ ? "chatgpt"
110
+ : props.model === "gemini"
111
+ ? "gemini"
112
+ : "claude"
113
+ ](
114
+ validate,
115
+ ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
116
+ return {
117
+ protocol: "class",
118
+ name: SOURCE,
119
+ application,
120
+ execute: {
121
+ makeGroups: (next) => {
122
+ props.build(next);
123
+ },
124
+ } satisfies IAutoBeInterfaceGroupApplication,
125
+ };
126
+ }
127
+
128
+ const collection = {
129
+ chatgpt: (validate: Validator) =>
130
+ typia.llm.application<IAutoBeInterfaceGroupApplication, "chatgpt">({
131
+ validate: {
132
+ makeGroups: validate,
133
+ },
134
+ }),
135
+ claude: (validate: Validator) =>
136
+ typia.llm.application<IAutoBeInterfaceGroupApplication, "claude">({
137
+ validate: {
138
+ makeGroups: validate,
139
+ },
140
+ }),
141
+ gemini: (validate: Validator) =>
142
+ typia.llm.application<IAutoBeInterfaceGroupApplication, "gemini">({
143
+ validate: {
144
+ makeGroups: validate,
145
+ },
146
+ }),
147
+ };
148
+
149
+ type Validator = (
150
+ input: unknown,
151
+ ) => IValidation<IAutoBeInterfaceGroupApplication.IProps>;
152
+
153
+ const SOURCE = "interfaceGroup" satisfies AutoBeEventSource;
@@ -1,5 +1,6 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
2
  import {
3
+ AutoBeEventSource,
3
4
  AutoBeInterfaceOperationEvent,
4
5
  AutoBeOpenApi,
5
6
  AutoBeProgressEventBase,
@@ -16,24 +17,24 @@ import { AutoBeContext } from "../../context/AutoBeContext";
16
17
  import { assertSchemaModel } from "../../context/assertSchemaModel";
17
18
  import { divideArray } from "../../utils/divideArray";
18
19
  import { executeCachedBatch } from "../../utils/executeCachedBatch";
19
- import { transformInterfaceOperationHistories } from "./histories/transformInterfaceOperationHistories";
20
- import { orchestrateInterfaceOperationsReview } from "./orchestrateInterfaceOperationsReview";
20
+ import { AutoBePreliminaryController } from "../common/AutoBePreliminaryController";
21
+ import { transformInterfaceOperationHistory } from "./histories/transformInterfaceOperationHistory";
22
+ import { orchestrateInterfaceOperationReview } from "./orchestrateInterfaceOperationReview";
21
23
  import { IAutoBeInterfaceOperationApplication } from "./structures/IAutoBeInterfaceOperationApplication";
22
24
  import { OperationValidator } from "./utils/OperationValidator";
23
25
 
24
- export async function orchestrateInterfaceOperations<
26
+ export async function orchestrateInterfaceOperation<
25
27
  Model extends ILlmSchema.Model,
26
28
  >(
27
29
  ctx: AutoBeContext<Model>,
28
30
  props: {
29
31
  instruction: string;
30
32
  endpoints: AutoBeOpenApi.IEndpoint[];
31
- capacity?: number;
32
33
  },
33
34
  ): Promise<AutoBeOpenApi.IOperation[]> {
34
35
  const matrix: AutoBeOpenApi.IEndpoint[][] = divideArray({
35
36
  array: props.endpoints,
36
- capacity: props.capacity ?? AutoBeConfigConstant.INTERFACE_CAPACITY,
37
+ capacity: AutoBeConfigConstant.INTERFACE_CAPACITY,
37
38
  });
38
39
  const progress: AutoBeProgressEventBase = {
39
40
  total: matrix.flat().length,
@@ -45,6 +46,7 @@ export async function orchestrateInterfaceOperations<
45
46
  };
46
47
  return (
47
48
  await executeCachedBatch(
49
+ ctx,
48
50
  matrix.map((it) => async (promptCacheKey) => {
49
51
  const row: AutoBeOpenApi.IOperation[] = await divideAndConquer(ctx, {
50
52
  endpoints: it,
@@ -97,7 +99,7 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
97
99
  }
98
100
  }
99
101
  const newbie: AutoBeOpenApi.IOperation[] =
100
- await orchestrateInterfaceOperationsReview(
102
+ await orchestrateInterfaceOperationReview(
101
103
  ctx,
102
104
  unique.toJSON().map((it) => it.second),
103
105
  props.reviewProgress,
@@ -116,83 +118,96 @@ async function process<Model extends ILlmSchema.Model>(
116
118
  },
117
119
  ): Promise<AutoBeOpenApi.IOperation[]> {
118
120
  const prefix: string = NamingConvention.camel(ctx.state().analyze!.prefix);
119
- const pointer: IPointer<AutoBeOpenApi.IOperation[] | null> = {
120
- value: null,
121
- };
122
- const { metric, tokenUsage } = await ctx.conversate({
123
- source: "interfaceOperation",
124
- histories: transformInterfaceOperationHistories({
125
- state: ctx.state(),
126
- endpoints: props.endpoints.toJSON(),
127
- instruction: props.instruction,
128
- }),
129
- controller: createController({
130
- model: ctx.model,
131
- actors: ctx.state().analyze?.actors.map((it) => it.name) ?? [],
132
- build: (operations) => {
133
- pointer.value ??= [];
134
- const matrix: AutoBeOpenApi.IOperation[][] = operations.map((op) => {
135
- if (op.authorizationActors.length === 0)
136
- return [
137
- {
138
- ...op,
139
- path:
140
- "/" +
141
- [prefix, ...op.path.split("/")]
142
- .filter((it) => it !== "")
143
- .join("/"),
144
- authorizationActor: null,
145
- authorizationType: null,
146
- prerequisites: [],
147
- },
148
- ];
149
- return op.authorizationActors.map((actor) => ({
150
- ...op,
151
- path:
152
- "/" +
153
- [prefix, actor, ...op.path.split("/")]
154
- .filter((it) => it !== "")
155
- .join("/"),
156
- authorizationActor: actor,
157
- authorizationType: null,
158
- prerequisites: [],
159
- }));
160
- });
161
- pointer.value.push(...matrix.flat());
162
- props.progress.completed += matrix.flat().length;
163
- props.progress.total += operations
164
- .map((op) =>
165
- props.endpoints.has({ path: op.path, method: op.method })
166
- ? op.authorizationActors.length === 0
167
- ? 0
168
- : op.authorizationActors.length - 1
169
- : op.authorizationActors.length,
170
- )
171
- .reduce((a, b) => a + b, 0);
172
- },
173
- }),
174
- enforceFunctionCall: true,
175
- promptCacheKey: props.promptCacheKey,
176
- message: "Make API operations",
121
+ const preliminary: AutoBePreliminaryController<
122
+ "analysisFiles" | "prismaSchemas"
123
+ > = new AutoBePreliminaryController({
124
+ application: typia.json.application<IAutoBeInterfaceOperationApplication>(),
125
+ source: SOURCE,
126
+ kinds: ["analysisFiles", "prismaSchemas"],
127
+ state: ctx.state(),
128
+ });
129
+ return await preliminary.orchestrate(ctx, async (out) => {
130
+ const pointer: IPointer<AutoBeOpenApi.IOperation[] | null> = {
131
+ value: null,
132
+ };
133
+ const result: AutoBeContext.IResult<Model> = await ctx.conversate({
134
+ source: SOURCE,
135
+ controller: createController({
136
+ preliminary,
137
+ model: ctx.model,
138
+ actors: ctx.state().analyze?.actors.map((it) => it.name) ?? [],
139
+ build: (operations) => {
140
+ pointer.value ??= [];
141
+ const matrix: AutoBeOpenApi.IOperation[][] = operations.map((op) => {
142
+ if (op.authorizationActors.length === 0)
143
+ return [
144
+ {
145
+ ...op,
146
+ path:
147
+ "/" +
148
+ [prefix, ...op.path.split("/")]
149
+ .filter((it) => it !== "")
150
+ .join("/"),
151
+ authorizationActor: null,
152
+ authorizationType: null,
153
+ prerequisites: [],
154
+ },
155
+ ];
156
+ return op.authorizationActors.map((actor) => ({
157
+ ...op,
158
+ path:
159
+ "/" +
160
+ [prefix, actor, ...op.path.split("/")]
161
+ .filter((it) => it !== "")
162
+ .join("/"),
163
+ authorizationActor: actor,
164
+ authorizationType: null,
165
+ prerequisites: [],
166
+ }));
167
+ });
168
+ pointer.value.push(...matrix.flat());
169
+ props.progress.completed += matrix.flat().length;
170
+ props.progress.total += operations
171
+ .map((op) =>
172
+ props.endpoints.has({ path: op.path, method: op.method })
173
+ ? op.authorizationActors.length === 0
174
+ ? 0
175
+ : op.authorizationActors.length - 1
176
+ : op.authorizationActors.length,
177
+ )
178
+ .reduce((a, b) => a + b, 0);
179
+ },
180
+ }),
181
+ enforceFunctionCall: true,
182
+ promptCacheKey: props.promptCacheKey,
183
+ ...transformInterfaceOperationHistory({
184
+ endpoints: props.endpoints.toJSON(),
185
+ instruction: props.instruction,
186
+ prefix,
187
+ preliminary,
188
+ }),
189
+ });
190
+ if (pointer.value !== null) {
191
+ ctx.dispatch({
192
+ type: SOURCE,
193
+ id: v7(),
194
+ operations: pointer.value,
195
+ metric: result.metric,
196
+ tokenUsage: result.tokenUsage,
197
+ ...props.progress,
198
+ step: ctx.state().analyze?.step ?? 0,
199
+ created_at: new Date().toISOString(),
200
+ } satisfies AutoBeInterfaceOperationEvent);
201
+ return out(result)(pointer.value);
202
+ }
203
+ return out(result)(null);
177
204
  });
178
- if (pointer.value === null) throw new Error("Failed to create operations."); // never be happened
179
-
180
- ctx.dispatch({
181
- type: "interfaceOperation",
182
- id: v7(),
183
- operations: pointer.value,
184
- metric,
185
- tokenUsage,
186
- ...props.progress,
187
- step: ctx.state().analyze?.step ?? 0,
188
- created_at: new Date().toISOString(),
189
- } satisfies AutoBeInterfaceOperationEvent);
190
- return pointer.value;
191
205
  }
192
206
 
193
207
  function createController<Model extends ILlmSchema.Model>(props: {
194
208
  model: Model;
195
209
  actors: string[];
210
+ preliminary: AutoBePreliminaryController<"analysisFiles" | "prismaSchemas">;
196
211
  build: (
197
212
  operations: IAutoBeInterfaceOperationApplication.IOperation[],
198
213
  ) => void;
@@ -205,12 +220,17 @@ function createController<Model extends ILlmSchema.Model>(props: {
205
220
  const result: IValidation<IAutoBeInterfaceOperationApplication.IProps> =
206
221
  typia.validate<IAutoBeInterfaceOperationApplication.IProps>(next);
207
222
  if (result.success === false) return result;
223
+ else if (result.data.request.type !== "complete")
224
+ return props.preliminary.validate({
225
+ thinking: result.data.thinking,
226
+ request: result.data.request,
227
+ });
208
228
 
209
229
  const operations: IAutoBeInterfaceOperationApplication.IOperation[] =
210
- result.data.operations;
230
+ result.data.request.operations;
211
231
  const errors: IValidation.IError[] = [];
212
232
  OperationValidator.validate({
213
- path: "$input.operations",
233
+ path: "$input.request.operations",
214
234
  errors,
215
235
  operations,
216
236
  });
@@ -222,7 +242,7 @@ function createController<Model extends ILlmSchema.Model>(props: {
222
242
  op.authorizationActors.forEach((actor, j) => {
223
243
  if (props.actors.includes(actor) === true) return;
224
244
  errors.push({
225
- path: `$input.operations[${i}].authorizationActors[${j}]`,
245
+ path: `$input.request.operations[${i}].authorizationActors[${j}]`,
226
246
  expected: `null | ${props.actors.map((str) => JSON.stringify(str)).join(" | ")}`,
227
247
  description: StringUtil.trim`
228
248
  Actor "${actor}" is not defined in the roles list.
@@ -255,11 +275,12 @@ function createController<Model extends ILlmSchema.Model>(props: {
255
275
 
256
276
  return {
257
277
  protocol: "class",
258
- name: "interface",
278
+ name: SOURCE,
259
279
  application,
260
280
  execute: {
261
- makeOperations: (next) => {
262
- props.build(next.operations);
281
+ process: (next) => {
282
+ if (next.request.type === "complete")
283
+ props.build(next.request.operations);
263
284
  },
264
285
  } satisfies IAutoBeInterfaceOperationApplication,
265
286
  };
@@ -269,19 +290,19 @@ const collection = {
269
290
  chatgpt: (validate: Validator) =>
270
291
  typia.llm.application<IAutoBeInterfaceOperationApplication, "chatgpt">({
271
292
  validate: {
272
- makeOperations: validate,
293
+ process: validate,
273
294
  },
274
295
  }),
275
296
  claude: (validate: Validator) =>
276
297
  typia.llm.application<IAutoBeInterfaceOperationApplication, "claude">({
277
298
  validate: {
278
- makeOperations: validate,
299
+ process: validate,
279
300
  },
280
301
  }),
281
302
  gemini: (validate: Validator) =>
282
303
  typia.llm.application<IAutoBeInterfaceOperationApplication, "gemini">({
283
304
  validate: {
284
- makeOperations: validate,
305
+ process: validate,
285
306
  },
286
307
  }),
287
308
  };
@@ -289,3 +310,5 @@ const collection = {
289
310
  type Validator = (
290
311
  input: unknown,
291
312
  ) => IValidation<IAutoBeInterfaceOperationApplication.IProps>;
313
+
314
+ const SOURCE = "interfaceOperation" satisfies AutoBeEventSource;
@@ -0,0 +1,186 @@
1
+ import { IAgenticaController } from "@agentica/core";
2
+ import {
3
+ AutoBeEventSource,
4
+ AutoBeInterfaceOperationReviewEvent,
5
+ AutoBeOpenApi,
6
+ AutoBePrisma,
7
+ AutoBeProgressEventBase,
8
+ } from "@autobe/interface";
9
+ import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
10
+ import { IPointer } from "tstl";
11
+ import typia from "typia";
12
+ import { v7 } from "uuid";
13
+
14
+ import { AutoBeContext } from "../../context/AutoBeContext";
15
+ import { AutoBePreliminaryController } from "../common/AutoBePreliminaryController";
16
+ import { transformInterfaceOperationReviewHistory } from "./histories/transformInterfaceOperationReviewHistory";
17
+ import { IAutoBeInterfaceOperationReviewApplication } from "./structures/IAutoBeInterfaceOperationReviewApplication";
18
+ import { OperationValidator } from "./utils/OperationValidator";
19
+
20
+ export async function orchestrateInterfaceOperationReview<
21
+ Model extends ILlmSchema.Model,
22
+ >(
23
+ ctx: AutoBeContext<Model>,
24
+ operations: AutoBeOpenApi.IOperation[],
25
+ progress: AutoBeProgressEventBase,
26
+ ): Promise<AutoBeOpenApi.IOperation[]> {
27
+ try {
28
+ return await process(ctx, operations, progress);
29
+ } catch {
30
+ ++progress.completed;
31
+ return [];
32
+ }
33
+ }
34
+
35
+ async function process<Model extends ILlmSchema.Model>(
36
+ ctx: AutoBeContext<Model>,
37
+ operations: AutoBeOpenApi.IOperation[],
38
+ progress: AutoBeProgressEventBase,
39
+ ): Promise<AutoBeOpenApi.IOperation[]> {
40
+ const files: AutoBePrisma.IFile[] = ctx.state().prisma?.result.data.files!;
41
+ const preliminary: AutoBePreliminaryController<
42
+ "analysisFiles" | "prismaSchemas"
43
+ > = new AutoBePreliminaryController({
44
+ application:
45
+ typia.json.application<IAutoBeInterfaceOperationReviewApplication>(),
46
+ source: SOURCE,
47
+ kinds: ["analysisFiles", "prismaSchemas"],
48
+ state: ctx.state(),
49
+ });
50
+ return await preliminary.orchestrate(ctx, async (out) => {
51
+ const pointer: IPointer<IAutoBeInterfaceOperationReviewApplication.IComplete | null> =
52
+ {
53
+ value: null,
54
+ };
55
+ const result: AutoBeContext.IResult<Model> = await ctx.conversate({
56
+ source: SOURCE,
57
+ controller: createReviewController({
58
+ preliminary,
59
+ model: ctx.model,
60
+ prismaSchemas: files,
61
+ build: (next: IAutoBeInterfaceOperationReviewApplication.IComplete) => {
62
+ pointer.value = next;
63
+ },
64
+ }),
65
+ enforceFunctionCall: false,
66
+ ...transformInterfaceOperationReviewHistory({
67
+ preliminary,
68
+ operations,
69
+ }),
70
+ });
71
+ if (pointer.value !== null) {
72
+ const content: AutoBeOpenApi.IOperation[] = pointer.value.content.map(
73
+ (op) => ({
74
+ ...op,
75
+ authorizationType: null,
76
+ }),
77
+ );
78
+ ctx.dispatch({
79
+ type: SOURCE,
80
+ id: v7(),
81
+ operations: content,
82
+ review: pointer.value.think.review,
83
+ plan: pointer.value.think.plan,
84
+ content,
85
+ metric: result.metric,
86
+ tokenUsage: result.tokenUsage,
87
+ created_at: new Date().toISOString(),
88
+ step: ctx.state().analyze?.step ?? 0,
89
+ total: progress.total,
90
+ completed: ++progress.completed,
91
+ } satisfies AutoBeInterfaceOperationReviewEvent);
92
+ return out(result)(content);
93
+ }
94
+ return out(result)(null);
95
+ });
96
+ }
97
+
98
+ function createReviewController<Model extends ILlmSchema.Model>(props: {
99
+ model: Model;
100
+ preliminary: AutoBePreliminaryController<"analysisFiles" | "prismaSchemas">;
101
+ prismaSchemas: AutoBePrisma.IFile[];
102
+ build: (
103
+ reviews: IAutoBeInterfaceOperationReviewApplication.IComplete,
104
+ ) => void;
105
+ }): IAgenticaController.IClass<Model> {
106
+ const validate = (
107
+ next: unknown,
108
+ ): IValidation<IAutoBeInterfaceOperationReviewApplication.IProps> => {
109
+ const result: IValidation<IAutoBeInterfaceOperationReviewApplication.IProps> =
110
+ typia.validate<IAutoBeInterfaceOperationReviewApplication.IProps>(next);
111
+ if (result.success === false) return result;
112
+ else if (result.data.request.type !== "complete")
113
+ return props.preliminary.validate({
114
+ thinking: result.data.thinking,
115
+ request: result.data.request,
116
+ });
117
+
118
+ const errors: IValidation.IError[] = [];
119
+ OperationValidator.validate({
120
+ path: "$input.request.content",
121
+ operations: result.data.request.content,
122
+ errors,
123
+ });
124
+ if (errors.length !== 0)
125
+ return {
126
+ success: false,
127
+ errors,
128
+ data: next,
129
+ };
130
+ return result;
131
+ };
132
+ const application: ILlmApplication<Model> = collection[
133
+ props.model === "chatgpt"
134
+ ? "chatgpt"
135
+ : props.model === "gemini"
136
+ ? "gemini"
137
+ : "claude"
138
+ ](
139
+ validate,
140
+ ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
141
+
142
+ return {
143
+ protocol: "class",
144
+ name: SOURCE,
145
+ application,
146
+ execute: {
147
+ process: (next) => {
148
+ if (next.request.type === "complete") props.build(next.request);
149
+ },
150
+ } satisfies IAutoBeInterfaceOperationReviewApplication,
151
+ };
152
+ }
153
+
154
+ const collection = {
155
+ chatgpt: (validate: Validator) =>
156
+ typia.llm.application<
157
+ IAutoBeInterfaceOperationReviewApplication,
158
+ "chatgpt"
159
+ >({
160
+ validate: {
161
+ process: validate,
162
+ },
163
+ }),
164
+ claude: (validate: Validator) =>
165
+ typia.llm.application<IAutoBeInterfaceOperationReviewApplication, "claude">(
166
+ {
167
+ validate: {
168
+ process: validate,
169
+ },
170
+ },
171
+ ),
172
+ gemini: (validate: Validator) =>
173
+ typia.llm.application<IAutoBeInterfaceOperationReviewApplication, "gemini">(
174
+ {
175
+ validate: {
176
+ process: validate,
177
+ },
178
+ },
179
+ ),
180
+ };
181
+
182
+ type Validator = (
183
+ input: unknown,
184
+ ) => IValidation<IAutoBeInterfaceOperationReviewApplication.IProps>;
185
+
186
+ const SOURCE = "interfaceOperationReview" satisfies AutoBeEventSource;