@autobe/agent 0.25.7 → 0.26.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 (257) hide show
  1. package/lib/AutoBeAgent.js +3 -0
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/AutoBeMockAgent.js +15 -12
  4. package/lib/AutoBeMockAgent.js.map +1 -1
  5. package/lib/constants/AutoBeSystemPromptConstant.d.ts +26 -19
  6. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  7. package/lib/factory/consentFunctionCall.js +3 -0
  8. package/lib/factory/consentFunctionCall.js.map +1 -1
  9. package/lib/factory/createAutoBeContext.js +4 -1
  10. package/lib/factory/createAutoBeContext.js.map +1 -1
  11. package/lib/factory/getCommonPrompt.d.ts +2 -0
  12. package/lib/factory/getCommonPrompt.js +20 -0
  13. package/lib/factory/getCommonPrompt.js.map +1 -0
  14. package/lib/index.mjs +2636 -2258
  15. package/lib/index.mjs.map +1 -1
  16. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
  17. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  18. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
  19. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  20. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +6 -6
  21. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  22. package/lib/orchestrate/analyze/orchestrateAnalyze.js +1 -1
  23. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  24. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +73 -73
  25. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  26. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
  27. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +9 -9
  28. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +1 -1
  29. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +2 -17
  30. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
  31. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.d.ts +6 -0
  32. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js +58 -0
  33. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +1 -0
  34. package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
  35. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  36. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +2 -2
  37. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +8 -8
  38. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  39. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
  40. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  41. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
  42. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  43. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
  44. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  45. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
  46. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  47. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  48. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  49. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
  50. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  51. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +1 -0
  52. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +46 -20
  53. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  54. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +5 -0
  55. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +51 -0
  56. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +1 -0
  57. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +11 -0
  58. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +81 -0
  59. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +1 -0
  60. package/lib/orchestrate/interface/orchestrateInterface.js +24 -4
  61. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  62. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +52 -52
  63. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  64. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +2 -2
  65. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  66. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +2 -2
  67. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
  68. package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
  69. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +2 -2
  70. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  71. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +57 -57
  72. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  73. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +43 -43
  74. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  75. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +4 -4
  76. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
  77. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.d.ts +7 -0
  78. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +444 -0
  79. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -0
  80. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +12 -0
  81. package/lib/orchestrate/interface/{orchestrateInterfaceSchemasReview.js → orchestrateInterfaceSchemaReview.js} +66 -57
  82. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -0
  83. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +9 -6
  84. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  85. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +22 -22
  86. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +7 -7
  87. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +101 -0
  88. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js +3 -0
  89. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js.map +1 -0
  90. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +97 -0
  91. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js +3 -0
  92. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js.map +1 -0
  93. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +44 -0
  94. package/lib/orchestrate/interface/structures/{IAutobeInterfaceSchemasReviewApplication.js → IAutoBeInterfaceSchemaRenameApplication.js} +1 -1
  95. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js.map +1 -0
  96. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +92 -0
  97. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js +3 -0
  98. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js.map +1 -0
  99. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +42 -1
  100. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
  101. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +94 -0
  102. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
  103. package/lib/orchestrate/interface/utils/OperationValidator.d.ts +1 -1
  104. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +13 -13
  105. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  106. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
  107. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  108. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
  109. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  110. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +2 -2
  111. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +2 -2
  112. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  113. package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +2 -2
  114. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +2 -2
  115. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  116. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +2 -2
  117. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +8 -7
  118. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  119. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +4 -4
  120. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  121. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +4 -7
  122. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +8 -18
  123. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -1
  124. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -1
  125. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +8 -28
  126. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  127. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +1 -1
  128. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +16 -280
  129. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
  130. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +1 -1
  131. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  132. package/lib/orchestrate/realize/orchestrateRealize.js +2 -2
  133. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  134. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +12 -12
  135. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  136. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +9 -9
  137. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  138. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +1 -1
  139. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +43 -22
  140. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  141. package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.js → orchestrateRealizeCorrectCasting.js} +58 -46
  142. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -0
  143. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
  144. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +2 -2
  145. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +6 -6
  146. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -1
  147. package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -1
  148. package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
  149. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +2 -2
  150. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
  151. package/lib/orchestrate/realize/utils/getRealizeWriteDto.js +1 -1
  152. package/lib/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -1
  153. package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js +2 -2
  154. package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -1
  155. package/lib/orchestrate/realize/utils/printErrorHints.js +1 -1
  156. package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -1
  157. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -1
  158. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
  159. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +5 -22
  160. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  161. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +10 -10
  162. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
  163. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +5 -5
  164. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  165. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +2 -2
  166. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
  167. package/lib/orchestrate/test/orchestrateTestCorrect.js +2 -0
  168. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  169. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +1 -0
  170. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  171. package/lib/orchestrate/test/orchestrateTestScenario.js +26 -26
  172. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  173. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +2 -2
  174. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  175. package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.d.ts → IAutoBeTestScenarioAuthorizationActor.d.ts} +1 -1
  176. package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.js → IAutoBeTestScenarioAuthorizationActor.js} +1 -1
  177. package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationActor.js.map +1 -0
  178. package/package.json +5 -5
  179. package/src/AutoBeAgent.ts +3 -0
  180. package/src/AutoBeMockAgent.ts +15 -12
  181. package/src/constants/AutoBeSystemPromptConstant.ts +26 -19
  182. package/src/factory/consentFunctionCall.ts +4 -0
  183. package/src/factory/createAutoBeContext.ts +5 -1
  184. package/src/factory/getCommonPrompt.ts +25 -0
  185. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +5 -5
  186. package/src/orchestrate/analyze/orchestrateAnalyze.ts +1 -1
  187. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +3 -3
  188. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +9 -9
  189. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +1 -1
  190. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +2 -20
  191. package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.ts +65 -0
  192. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +9 -9
  193. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +45 -20
  194. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +55 -0
  195. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +90 -0
  196. package/src/orchestrate/interface/orchestrateInterface.ts +34 -14
  197. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +18 -18
  198. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +4 -4
  199. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +2 -2
  200. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +5 -5
  201. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +23 -23
  202. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +4 -4
  203. package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +2 -2
  204. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +269 -0
  205. package/src/orchestrate/interface/{orchestrateInterfaceSchemasReview.ts → orchestrateInterfaceSchemaReview.ts} +88 -70
  206. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +16 -8
  207. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +26 -22
  208. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +7 -7
  209. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +108 -0
  210. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +104 -0
  211. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +45 -0
  212. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +99 -0
  213. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +45 -3
  214. package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +110 -0
  215. package/src/orchestrate/interface/utils/OperationValidator.ts +1 -1
  216. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +12 -12
  217. package/src/orchestrate/prisma/orchestratePrisma.ts +4 -4
  218. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -4
  219. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +7 -7
  220. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +8 -7
  221. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +4 -4
  222. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +14 -28
  223. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -30
  224. package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +20 -285
  225. package/src/orchestrate/realize/orchestrateRealize.ts +1 -1
  226. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +9 -9
  227. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -3
  228. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +74 -60
  229. package/src/orchestrate/realize/{orchestRateRealizeCorrectCasting.ts → orchestrateRealizeCorrectCasting.ts} +86 -85
  230. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
  231. package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +10 -7
  232. package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -1
  233. package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +2 -2
  234. package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +1 -1
  235. package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +2 -2
  236. package/src/orchestrate/realize/utils/printErrorHints.ts +1 -1
  237. package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -1
  238. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +6 -24
  239. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +10 -10
  240. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +12 -10
  241. package/src/orchestrate/test/orchestrateTestCorrect.ts +2 -0
  242. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +1 -0
  243. package/src/orchestrate/test/orchestrateTestScenario.ts +30 -30
  244. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +2 -2
  245. package/src/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.ts → IAutoBeTestScenarioAuthorizationActor.ts} +1 -1
  246. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +0 -4
  247. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +0 -60
  248. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +0 -1
  249. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +0 -9
  250. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +0 -1
  251. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +0 -91
  252. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +0 -1
  253. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +0 -1
  254. package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +0 -1
  255. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +0 -67
  256. package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +0 -96
  257. /package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.d.ts → orchestrateRealizeCorrectCasting.d.ts} +0 -0
@@ -1,9 +1,5 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
- import {
3
- AutoBeInterfaceSchemasReviewEvent,
4
- AutoBeOpenApi,
5
- AutoBeProgressEventBase,
6
- } from "@autobe/interface";
2
+ import { AutoBeOpenApi, AutoBeProgressEventBase } from "@autobe/interface";
7
3
  import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
8
4
  import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
9
5
  import { IPointer } from "tstl";
@@ -15,31 +11,38 @@ import { AutoBeContext } from "../../context/AutoBeContext";
15
11
  import { assertSchemaModel } from "../../context/assertSchemaModel";
16
12
  import { divideArray } from "../../utils/divideArray";
17
13
  import { executeCachedBatch } from "../../utils/executeCachedBatch";
18
- import { transformInterfaceSchemasReviewHistories } from "./histories/transformInterfaceSchemasReviewHistories";
19
- import { IAutoBeInterfaceSchemasReviewApplication } from "./structures/IAutobeInterfaceSchemasReviewApplication";
14
+ import { transformInterfaceSchemaReviewHistories } from "./histories/transformInterfaceSchemaReviewHistories";
15
+ import { IAutoBeInterfaceSchemaContentReviewApplication } from "./structures/IAutoBeInterfaceSchemaContentReviewApplication";
20
16
  import { JsonSchemaFactory } from "./utils/JsonSchemaFactory";
21
17
  import { JsonSchemaNamingConvention } from "./utils/JsonSchemaNamingConvention";
22
18
  import { JsonSchemaValidator } from "./utils/JsonSchemaValidator";
23
19
  import { fulfillJsonSchemaErrorMessages } from "./utils/fulfillJsonSchemaErrorMessages";
24
20
 
25
- export async function orchestrateInterfaceSchemasReview<
21
+ interface IConfig {
22
+ type:
23
+ | "interfaceSchemaContentReview"
24
+ | "interfaceSchemaSecurityReview"
25
+ | "interfaceSchemaRelationReview";
26
+ systemPrompt: string;
27
+ }
28
+
29
+ export async function orchestrateInterfaceSchemaReview<
26
30
  Model extends ILlmSchema.Model,
27
31
  >(
28
32
  ctx: AutoBeContext<Model>,
29
- operations: AutoBeOpenApi.IOperation[],
30
- schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
33
+ config: IConfig,
34
+ props: {
35
+ document: AutoBeOpenApi.IDocument;
36
+ instruction: string;
37
+ },
31
38
  capacity: number = AutoBeConfigConstant.INTERFACE_CAPACITY,
32
39
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
33
- const a = Object.entries(schemas).map(([key, schema]) => {
34
- return { [key]: schema };
40
+ const typeNames: string[] = Object.keys(props.document.components.schemas);
41
+ const matrix: string[][] = divideArray({
42
+ array: typeNames,
43
+ capacity,
35
44
  });
36
-
37
- const matrix: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>[][] =
38
- divideArray({
39
- array: a,
40
- capacity,
41
- });
42
- const progress: IProgress = {
45
+ const progress: AutoBeProgressEventBase = {
43
46
  total: matrix.length,
44
47
  completed: 0,
45
48
  };
@@ -47,12 +50,31 @@ export async function orchestrateInterfaceSchemasReview<
47
50
  const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
48
51
  for (const y of await executeCachedBatch(
49
52
  matrix.map((it) => async (promptCacheKey) => {
53
+ const operations: AutoBeOpenApi.IOperation[] =
54
+ props.document.operations.filter(
55
+ (op) =>
56
+ (op.requestBody && it.includes(op.requestBody.typeName)) ||
57
+ (op.responseBody && it.includes(op.responseBody.typeName)),
58
+ );
50
59
  const row: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
51
- await divideAndConquer(ctx, operations, it, progress, promptCacheKey);
60
+ await divideAndConquer(ctx, config, {
61
+ instruction: props.instruction,
62
+ operations,
63
+ everySchemas: props.document.components.schemas,
64
+ reviewSchemas: it.reduce(
65
+ (acc, cur) => {
66
+ acc[cur] = props.document.components.schemas[cur];
67
+ return acc;
68
+ },
69
+ {} as Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
70
+ ),
71
+ progress,
72
+ promptCacheKey,
73
+ });
52
74
  return row;
53
75
  }),
54
76
  )) {
55
- JsonSchemaNamingConvention.schemas(operations, x, y);
77
+ JsonSchemaNamingConvention.schemas(props.document.operations, x, y);
56
78
  Object.assign(x, y);
57
79
  }
58
80
  return x;
@@ -60,46 +82,41 @@ export async function orchestrateInterfaceSchemasReview<
60
82
 
61
83
  async function divideAndConquer<Model extends ILlmSchema.Model>(
62
84
  ctx: AutoBeContext<Model>,
63
- operations: AutoBeOpenApi.IOperation[],
64
- schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>[],
65
- progress: AutoBeProgressEventBase,
66
- promptCacheKey: string,
67
- ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
68
- const schema = schemas.reduce((acc, cur) => Object.assign(acc, cur), {});
69
- return step(ctx, operations, schema, progress, promptCacheKey);
70
- }
71
-
72
- export async function step<Model extends ILlmSchema.Model>(
73
- ctx: AutoBeContext<Model>,
74
- operations: AutoBeOpenApi.IOperation[],
75
- schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
76
- progress: AutoBeProgressEventBase,
77
- promptCacheKey: string,
85
+ config: IConfig,
86
+ props: {
87
+ instruction: string;
88
+ operations: AutoBeOpenApi.IOperation[];
89
+ everySchemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
90
+ reviewSchemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
91
+ progress: AutoBeProgressEventBase;
92
+ promptCacheKey: string;
93
+ },
78
94
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
79
95
  try {
80
- const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
96
+ const pointer: IPointer<IAutoBeInterfaceSchemaContentReviewApplication.IProps | null> =
81
97
  {
82
98
  value: null,
83
99
  };
84
100
  const { tokenUsage } = await ctx.conversate({
85
- source: "interfaceSchemasReview",
101
+ source: "interfaceSchemaContentReview",
86
102
  controller: createController({
87
103
  model: ctx.model,
88
104
  pointer,
89
- operations,
90
- schemas,
91
105
  }),
92
- histories: transformInterfaceSchemasReviewHistories(
93
- ctx.state(),
94
- operations,
95
- schemas,
96
- ),
106
+ histories: transformInterfaceSchemaReviewHistories({
107
+ state: ctx.state(),
108
+ systemPrompt: config.systemPrompt,
109
+ instruction: props.instruction,
110
+ operations: props.operations,
111
+ everySchemas: props.everySchemas,
112
+ reviewSchemas: props.reviewSchemas,
113
+ }),
97
114
  enforceFunctionCall: true,
98
- promptCacheKey,
99
- message: "Review type schemas.",
115
+ promptCacheKey: props.promptCacheKey,
116
+ message: "Review DTO content completeness and consistency.",
100
117
  });
101
118
  if (pointer.value === null) {
102
- ++progress.completed;
119
+ ++props.progress.completed;
103
120
  return {};
104
121
  }
105
122
 
@@ -110,40 +127,40 @@ export async function step<Model extends ILlmSchema.Model>(
110
127
  ).schemas ?? {}) as Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
111
128
 
112
129
  ctx.dispatch({
113
- type: "interfaceSchemasReview",
130
+ type: config.type,
114
131
  id: v7(),
115
- schemas: schemas,
132
+ schemas: props.reviewSchemas,
116
133
  review: pointer.value.think.review,
117
134
  plan: pointer.value.think.plan,
118
135
  content,
119
136
  tokenUsage,
120
137
  step: ctx.state().analyze?.step ?? 0,
121
- total: progress.total,
122
- completed: ++progress.completed,
138
+ total: props.progress.total,
139
+ completed: ++props.progress.completed,
123
140
  created_at: new Date().toISOString(),
124
- } satisfies AutoBeInterfaceSchemasReviewEvent);
141
+ });
125
142
  return content;
126
143
  } catch {
127
- ++progress.completed;
144
+ ++props.progress.completed;
128
145
  return {};
129
146
  }
130
147
  }
131
148
 
132
149
  function createController<Model extends ILlmSchema.Model>(props: {
133
150
  model: Model;
134
- pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null>;
135
- operations: AutoBeOpenApi.IOperation[];
136
- schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
151
+ pointer: IPointer<IAutoBeInterfaceSchemaContentReviewApplication.IProps | null>;
137
152
  }): IAgenticaController.IClass<Model> {
138
153
  assertSchemaModel(props.model);
139
154
 
140
155
  const validate = (
141
156
  next: unknown,
142
- ): IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps> => {
157
+ ): IValidation<IAutoBeInterfaceSchemaContentReviewApplication.IProps> => {
143
158
  JsonSchemaFactory.fixPage("content", next);
144
159
 
145
- const result: IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps> =
146
- typia.validate<IAutoBeInterfaceSchemasReviewApplication.IProps>(next);
160
+ const result: IValidation<IAutoBeInterfaceSchemaContentReviewApplication.IProps> =
161
+ typia.validate<IAutoBeInterfaceSchemaContentReviewApplication.IProps>(
162
+ next,
163
+ );
147
164
  if (result.success === false) {
148
165
  fulfillJsonSchemaErrorMessages(result.errors);
149
166
  return result;
@@ -171,25 +188,31 @@ function createController<Model extends ILlmSchema.Model>(props: {
171
188
  ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
172
189
  return {
173
190
  protocol: "class",
174
- name: "Reviewer",
191
+ name: "ContentReviewer",
175
192
  application,
176
193
  execute: {
177
194
  review: (input) => {
178
195
  props.pointer.value = input;
179
196
  },
180
- } satisfies IAutoBeInterfaceSchemasReviewApplication,
197
+ } satisfies IAutoBeInterfaceSchemaContentReviewApplication,
181
198
  };
182
199
  }
183
200
 
184
201
  const collection = {
185
202
  chatgpt: (validate: Validator) =>
186
- typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "chatgpt">({
203
+ typia.llm.application<
204
+ IAutoBeInterfaceSchemaContentReviewApplication,
205
+ "chatgpt"
206
+ >({
187
207
  validate: {
188
208
  review: validate,
189
209
  },
190
210
  }),
191
211
  claude: (validate: Validator) =>
192
- typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "claude">({
212
+ typia.llm.application<
213
+ IAutoBeInterfaceSchemaContentReviewApplication,
214
+ "claude"
215
+ >({
193
216
  validate: {
194
217
  review: validate,
195
218
  },
@@ -198,9 +221,4 @@ const collection = {
198
221
 
199
222
  type Validator = (
200
223
  input: unknown,
201
- ) => IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps>;
202
-
203
- export interface IProgress {
204
- total: number;
205
- completed: number;
206
- }
224
+ ) => IValidation<IAutoBeInterfaceSchemaContentReviewApplication.IProps>;
@@ -1,6 +1,6 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
2
  import {
3
- AutoBeInterfaceSchemasEvent,
3
+ AutoBeInterfaceSchemaEvent,
4
4
  AutoBeOpenApi,
5
5
  AutoBeProgressEventBase,
6
6
  } from "@autobe/interface";
@@ -59,13 +59,18 @@ export async function orchestrateInterfaceSchemas<
59
59
  };
60
60
  for (const y of await executeCachedBatch(
61
61
  matrix.map((it) => async (promptCacheKey) => {
62
+ const operations: AutoBeOpenApi.IOperation[] = props.operations.filter(
63
+ (op) =>
64
+ (op.requestBody && it.includes(op.requestBody.typeName)) ||
65
+ (op.responseBody && it.includes(op.responseBody.typeName)),
66
+ );
62
67
  const row: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
63
68
  await divideAndConquer(ctx, {
64
- instruction: props.instruction,
65
- operations: props.operations,
66
- typeNames: it,
69
+ operations,
67
70
  progress,
68
71
  promptCacheKey,
72
+ typeNames: it,
73
+ instruction: props.instruction,
69
74
  });
70
75
  return row;
71
76
  }),
@@ -129,9 +134,12 @@ async function process<Model extends ILlmSchema.Model>(
129
134
  value: null,
130
135
  };
131
136
  const { tokenUsage } = await ctx.conversate({
132
- source: "interfaceSchemas",
137
+ source: "interfaceSchema",
133
138
  histories: transformInterfaceSchemaHistories({
134
139
  state: ctx.state(),
140
+ typeNames: Array.from(
141
+ new Set([...props.remained, ...Object.keys(props.oldbie)]),
142
+ ),
135
143
  operations: props.operations,
136
144
  instruction: props.instruction,
137
145
  }),
@@ -154,7 +162,7 @@ async function process<Model extends ILlmSchema.Model>(
154
162
  too.
155
163
 
156
164
  ${Array.from(props.remained)
157
- .map((k) => ` - \`${k}\``)
165
+ .map((k) => `- \`${k}\``)
158
166
  .join("\n")}${
159
167
  already.length !== 0
160
168
  ? StringUtil.trim`
@@ -176,7 +184,7 @@ async function process<Model extends ILlmSchema.Model>(
176
184
  }) as AutoBeOpenApi.IComponents
177
185
  ).schemas ?? {}) as Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
178
186
  ctx.dispatch({
179
- type: "interfaceSchemas",
187
+ type: "interfaceSchema",
180
188
  id: v7(),
181
189
  schemas,
182
190
  tokenUsage,
@@ -186,7 +194,7 @@ async function process<Model extends ILlmSchema.Model>(
186
194
  ).length),
187
195
  step: ctx.state().prisma?.step ?? 0,
188
196
  created_at: new Date().toISOString(),
189
- } satisfies AutoBeInterfaceSchemasEvent);
197
+ } satisfies AutoBeInterfaceSchemaEvent);
190
198
  return schemas;
191
199
  }
192
200
 
@@ -86,7 +86,11 @@ export namespace IAutoBeInterfaceOperationApplication {
86
86
  * }
87
87
  * ```
88
88
  */
89
- export interface IOperation extends AutoBeOpenApi.IEndpoint {
89
+ export interface IOperation
90
+ extends Omit<
91
+ AutoBeOpenApi.IEndpoint,
92
+ "authorizationActor" | "prerequisites"
93
+ > {
90
94
  /**
91
95
  * Specification of the API operation.
92
96
  *
@@ -341,58 +345,58 @@ export namespace IAutoBeInterfaceOperationApplication {
341
345
  name: string & CamelCasePattern;
342
346
 
343
347
  /**
344
- * Authorization roles required to access this API operation.
348
+ * Authorization actors required to access this API operation.
345
349
  *
346
- * This field specifies which user roles are allowed to access this
347
- * endpoint. Multiple roles can be specified to allow different types of
350
+ * This field specifies which user actors are allowed to access this
351
+ * endpoint. Multiple actors can be specified to allow different types of
348
352
  * users to access the same endpoint.
349
353
  *
350
- * ## ⚠️ CRITICAL: Role Multiplication Effect
354
+ * ## ⚠️ CRITICAL: Actor Multiplication Effect
351
355
  *
352
- * **EACH ROLE IN THIS ARRAY GENERATES A SEPARATE ENDPOINT**
356
+ * **EACH ACTOR IN THIS ARRAY GENERATES A SEPARATE ENDPOINT**
353
357
  *
354
358
  * - If you specify `["admin", "moderator", "member"]`, this creates 3
355
359
  * separate endpoints
356
- * - Total generated endpoints = operations × average roles.length
357
- * - Example: 100 operations with 3 roles each = 300 actual endpoints
360
+ * - Total generated endpoints = operations × average actors.length
361
+ * - Example: 100 operations with 3 actors each = 300 actual endpoints
358
362
  *
359
363
  * ## 🔴 AVOID OVER-GENERATION
360
364
  *
361
- * **DO NOT create role-specific endpoints when a public endpoint would
365
+ * **DO NOT create actor-specific endpoints when a public endpoint would
362
366
  * suffice:**
363
367
  *
364
368
  * - ❌ BAD: Separate GET endpoints for admin, member, moderator to view the
365
369
  * same public data
366
- * - ✅ GOOD: Single public endpoint `[]` with role-based filtering in business
370
+ * - ✅ GOOD: Single public endpoint `[]` with actor-based filtering in business
367
371
  * logic
368
372
  *
369
- * **DO NOT enumerate all possible roles when the Prisma schema uses a
373
+ * **DO NOT enumerate all possible actors when the Prisma schema uses a
370
374
  * single User table:**
371
375
  *
372
376
  * - If Prisma has a User table with role/permission fields, you likely only
373
377
  * need `["user"]`
374
378
  * - Avoid listing `["admin", "seller", "buyer", "moderator", ...]`
375
379
  * unnecessarily
376
- * - The actual role checking happens in business logic, not at the endpoint
380
+ * - The actual actor checking happens in business logic, not at the endpoint
377
381
  * level
378
382
  *
379
383
  * ## Naming Convention
380
384
  *
381
- * DO: Use camelCase for all role names.
385
+ * DO: Use camelCase for all actor names.
382
386
  *
383
387
  * ## Important Guidelines
384
388
  *
385
389
  * - Set to empty array `[]` for public endpoints that require no
386
390
  * authentication
387
- * - Set to array with role strings for role-restricted endpoints
388
- * - **MINIMIZE the number of roles per endpoint to prevent explosion**
389
- * - Consider if the endpoint can be public with role-based filtering instead
390
- * - The role names match exactly with the user type/role defined in the
391
+ * - Set to array with actor strings for actor-restricted endpoints
392
+ * - **MINIMIZE the number of actors per endpoint to prevent explosion**
393
+ * - Consider if the endpoint can be public with actor-based filtering instead
394
+ * - The actor names match exactly with the user type/actor defined in the
391
395
  * database
392
396
  * - This will be used by the Realize Agent to generate appropriate decorator
393
397
  * and authorization logic in the provider functions
394
398
  * - The controller will apply the corresponding authentication decorator
395
- * based on these roles
399
+ * based on these actors
396
400
  *
397
401
  * ## Examples
398
402
  *
@@ -410,17 +414,17 @@ export namespace IAutoBeInterfaceOperationApplication {
410
414
  *
411
415
  * 1. **Start with public `[]` for all read operations** unless sensitive data
412
416
  * is involved
413
- * 2. **Use single role `["user"]` for authenticated operations** and handle
417
+ * 2. **Use single actor `["user"]` for authenticated operations** and handle
414
418
  * permissions in business logic
415
- * 3. **Only use multiple roles when absolutely necessary** for different
419
+ * 3. **Only use multiple actors when absolutely necessary** for different
416
420
  * business logic paths
417
- * 4. **Remember: Fewer roles = Fewer endpoints = Better performance and
421
+ * 4. **Remember: Fewer actors = Fewer endpoints = Better performance and
418
422
  * maintainability**
419
423
  *
420
424
  * Note: The actual authentication/authorization implementation will be
421
425
  * handled by decorators at the controller level, and the provider function
422
426
  * will receive the authenticated user object with the appropriate type.
423
427
  */
424
- authorizationRoles: Array<string & CamelCasePattern & tags.MinLength<1>>;
428
+ authorizationActors: Array<string & CamelCasePattern & tags.MinLength<1>>;
425
429
  }
426
430
  }
@@ -18,8 +18,8 @@ export interface IAutoBeInterfaceOperationsReviewApplication {
18
18
  * process containing review findings and improvement plans, plus the final
19
19
  * production-ready operations with all critical issues resolved.
20
20
  *
21
- * @param input Properties containing the thinking process (review & plan)
22
- * and the enhanced operations content
21
+ * @param input Properties containing the thinking process (review & plan) and
22
+ * the enhanced operations content
23
23
  */
24
24
  reviewOperations(
25
25
  input: IAutoBeInterfaceOperationsReviewApplication.IProps,
@@ -32,7 +32,7 @@ export namespace IAutoBeInterfaceOperationsReviewApplication {
32
32
  *
33
33
  * Contains both the input operations to be reviewed and the outputs generated
34
34
  * by the Interface Operations Review Agent, which will be published as part
35
- * of the AutoBeInterfaceOperationsReviewEvent.
35
+ * of the AutoBeInterfaceOperationReviewEvent.
36
36
  */
37
37
  export interface IProps {
38
38
  /**
@@ -70,10 +70,10 @@ export namespace IAutoBeInterfaceOperationsReviewApplication {
70
70
  /**
71
71
  * Structured thinking process for comprehensive API operation review.
72
72
  *
73
- * Combines analytical review findings with actionable improvement planning
74
- * to guide the systematic enhancement of API operations. This thinking
75
- * structure ensures all aspects of API quality are evaluated and addressed
76
- * before producing the final operations.
73
+ * Combines analytical review findings with actionable improvement planning to
74
+ * guide the systematic enhancement of API operations. This thinking structure
75
+ * ensures all aspects of API quality are evaluated and addressed before
76
+ * producing the final operations.
77
77
  */
78
78
  export interface IThink {
79
79
  /**
@@ -0,0 +1,108 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+
3
+ export interface IAutoBeInterfaceSchemaContentReviewApplication {
4
+ /**
5
+ * Reviews and validates DTO content completeness and consistency in OpenAPI
6
+ * schemas.
7
+ *
8
+ * This specialized content review function focuses exclusively on ensuring
9
+ * DTOs accurately and completely represent their business entities. It
10
+ * validates field completeness, type accuracy, required field settings, and
11
+ * documentation quality.
12
+ *
13
+ * The review process validates and corrects:
14
+ *
15
+ * - Field completeness against Prisma schema
16
+ * - Data type accuracy (Prisma to OpenAPI type mappings)
17
+ * - Required field arrays matching Prisma nullability
18
+ * - Description quality and comprehensiveness
19
+ * - Consistency across DTO variants (IEntity, ICreate, IUpdate, ISummary)
20
+ * - Missing variant detection and creation
21
+ *
22
+ * @param props Content review results including completeness issues found,
23
+ * fixes applied, and modified schemas
24
+ */
25
+ review: (
26
+ props: IAutoBeInterfaceSchemaContentReviewApplication.IProps,
27
+ ) => void;
28
+ }
29
+
30
+ export namespace IAutoBeInterfaceSchemaContentReviewApplication {
31
+ /**
32
+ * Output structure for the content review function.
33
+ *
34
+ * Contains the content analysis, completeness fixes, and schemas modified for
35
+ * content quality during the validation process.
36
+ */
37
+ export interface IProps {
38
+ /** Content analysis and completeness planning information. */
39
+ think: IThink;
40
+
41
+ /**
42
+ * Modified schemas resulting from content and completeness fixes.
43
+ *
44
+ * Contains ONLY the schemas that were modified for content reasons during
45
+ * review. This includes both modified existing schemas and newly created
46
+ * variant schemas.
47
+ *
48
+ * Content modifications include:
49
+ *
50
+ * - Adding missing fields from Prisma schema
51
+ * - Correcting data type mappings
52
+ * - Fixing required field arrays
53
+ * - Enhancing or adding descriptions
54
+ * - Creating missing variant types (ISummary, IUpdate, etc.)
55
+ * - Ensuring cross-variant consistency
56
+ *
57
+ * Return empty object {} when all content is already complete and accurate,
58
+ * requiring no modifications.
59
+ */
60
+ content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
61
+ }
62
+
63
+ export interface IThink {
64
+ /**
65
+ * Content completeness and quality findings from the review process.
66
+ *
67
+ * Documents all content issues discovered during validation, categorized by
68
+ * type: field completeness, type accuracy, required fields, descriptions,
69
+ * variant consistency, and missing variants. Each issue includes the
70
+ * affected schema and specific problem identified.
71
+ *
72
+ * Common issues documented:
73
+ *
74
+ * - Field Completeness: Missing fields that exist in Prisma schema
75
+ * - Type Accuracy: Incorrect type mappings (e.g., Decimal as string)
76
+ * - Required Fields: Misaligned with Prisma nullable settings
77
+ * - Description Quality: Missing or inadequate descriptions
78
+ * - Variant Consistency: Same field with different types across variants
79
+ * - Missing Variants: Required DTO variants not present
80
+ *
81
+ * Should state "No content or completeness issues found." when all schemas
82
+ * have complete and accurate content.
83
+ */
84
+ review: string;
85
+
86
+ /**
87
+ * Content corrections and completeness fixes applied during review.
88
+ *
89
+ * Lists all content modifications implemented, organized by fix type:
90
+ * fields added, types corrected, required arrays fixed, descriptions
91
+ * enhanced, consistency fixes, and variants created. Documents both field-
92
+ * level changes and schema-level additions.
93
+ *
94
+ * Typical fixes documented:
95
+ *
96
+ * - Fields added to match Prisma schema
97
+ * - Type mappings corrected (Int→integer, Decimal→number)
98
+ * - Required arrays aligned with nullability
99
+ * - Descriptions added or enhanced for clarity
100
+ * - Variant consistency issues resolved
101
+ * - Missing variants created with appropriate fields
102
+ *
103
+ * Should state "No content issues require fixes. All DTOs are complete and
104
+ * consistent." when no content modifications were necessary.
105
+ */
106
+ plan: string;
107
+ }
108
+ }