@autobe/agent 0.25.6 → 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
@@ -0,0 +1,104 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+
3
+ export interface IAutoBeInterfaceSchemaRelationReviewApplication {
4
+ /**
5
+ * Reviews and validates DTO relations and structural patterns in OpenAPI
6
+ * schemas.
7
+ *
8
+ * This specialized relation review function focuses exclusively on data
9
+ * relations, foreign key transformations, and structural integrity. It
10
+ * ensures proper modeling of business domains while preventing circular
11
+ * references and enabling efficient code generation.
12
+ *
13
+ * The review process validates and corrects:
14
+ *
15
+ * - Relation classifications (Composition vs Association vs Aggregation)
16
+ * - Foreign key to object transformations in response DTOs
17
+ * - Actor reversal violations (e.g., User containing articles array)
18
+ * - Inline object extractions to named types with $ref
19
+ * - IInvert pattern applications for alternative perspectives
20
+ *
21
+ * @param props Relation review results including violations found, fixes
22
+ * applied, and modified schemas
23
+ */
24
+ review: (
25
+ props: IAutoBeInterfaceSchemaRelationReviewApplication.IProps,
26
+ ) => void;
27
+ }
28
+
29
+ export namespace IAutoBeInterfaceSchemaRelationReviewApplication {
30
+ /**
31
+ * Output structure for the relation review function.
32
+ *
33
+ * Contains the relation analysis, structural fixes, and schemas modified for
34
+ * proper relations during the validation process.
35
+ */
36
+ export interface IProps {
37
+ /** Relation analysis and structural planning information. */
38
+ think: IThink;
39
+
40
+ /**
41
+ * Modified schemas resulting from relation and structural fixes.
42
+ *
43
+ * Contains ONLY the schemas that were modified for relation or structural
44
+ * reasons during review. This includes both modified existing schemas and
45
+ * newly created schemas (extracted types, IInvert types).
46
+ *
47
+ * Relation modifications include:
48
+ *
49
+ * - Extracting inline objects to named types with $ref
50
+ * - Transforming foreign keys to object references
51
+ * - Removing incorrect reverse relations
52
+ * - Creating new IInvert types for alternative views
53
+ * - Correcting relation types (composition/association/aggregation)
54
+ *
55
+ * Return empty object {} when all relations are already correct and no
56
+ * structural fixes were needed.
57
+ */
58
+ content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
59
+ }
60
+
61
+ export interface IThink {
62
+ /**
63
+ * Relation and structural violation findings from the review process.
64
+ *
65
+ * Documents all relation issues discovered during validation, categorized
66
+ * by severity and type. Each violation includes the affected schema,
67
+ * specific relation problem, and theoretical justification.
68
+ *
69
+ * Common violations documented:
70
+ *
71
+ * - CRITICAL: Inline object types instead of named types with $ref
72
+ * - CRITICAL: Actor reversal violations (User.articles[], Seller.sales[])
73
+ * - HIGH: Raw foreign keys instead of object references
74
+ * - HIGH: Wrong relation types (event-driven data as composition)
75
+ * - MEDIUM: Missing IInvert types for independent child views
76
+ * - LOW: Naming convention violations (plural instead of singular)
77
+ *
78
+ * Should state "No relation or structure issues found." when all schemas
79
+ * have correct relations.
80
+ */
81
+ review: string;
82
+
83
+ /**
84
+ * Relation corrections and structural fixes applied during review.
85
+ *
86
+ * Lists all relation modifications implemented, organized by fix type and
87
+ * impact. Documents both schemas modified and new schemas created during
88
+ * the fix process.
89
+ *
90
+ * Typical fixes documented:
91
+ *
92
+ * - Inline objects extracted to named types
93
+ * - Foreign keys transformed to object references
94
+ * - Actor reversal arrays removed with API endpoint suggestions
95
+ * - IInvert types created with parent context
96
+ * - Relation types corrected based on lifecycle analysis
97
+ * - Naming conventions standardized
98
+ *
99
+ * Should state "No relation issues require fixes. All relations are
100
+ * properly structured." when no modifications were necessary.
101
+ */
102
+ plan: string;
103
+ }
104
+ }
@@ -0,0 +1,45 @@
1
+ import { AutoBeInterfaceSchemaRefactor } from "@autobe/interface";
2
+
3
+ export interface IAutoBeInterfaceSchemaRenameApplication {
4
+ /**
5
+ * Analyze DTO type names and identify naming violations.
6
+ *
7
+ * This method examines existing DTO type names to detect violations of the
8
+ * CRITICAL naming rule: ALL words from the Prisma table name MUST be
9
+ * preserved in the DTO type name. Omitting intermediate words breaks
10
+ * type-to-table traceability and causes system failures.
11
+ *
12
+ * The method receives a list of Prisma table names and current DTO type
13
+ * names, then identifies which type names incorrectly omit service prefixes
14
+ * or intermediate components from their corresponding table names.
15
+ *
16
+ * @param props Properties containing refactoring operations to fix naming
17
+ * violations.
18
+ */
19
+ rename(props: IAutoBeInterfaceSchemaRenameApplication.IProps): void;
20
+ }
21
+ export namespace IAutoBeInterfaceSchemaRenameApplication {
22
+ export interface IProps {
23
+ /**
24
+ * List of refactoring operations to rename incorrectly named DTO types.
25
+ *
26
+ * Each refactor specifies:
27
+ *
28
+ * - `from`: The current INCORRECT type name (e.g., "ISale", "IBbsComment")
29
+ * - `to`: The CORRECT type name with all components preserved (e.g.,
30
+ * "IShoppingSale", "IBbsArticleComment")
31
+ *
32
+ * IMPORTANT: Only include type names that violate the naming rules. If a
33
+ * type name correctly preserves all components from the table name, do NOT
34
+ * include it in the refactors list.
35
+ *
36
+ * The orchestrator will automatically handle:
37
+ *
38
+ * - Renaming the base type (e.g., ISale → IShoppingSale)
39
+ * - Renaming all variants (e.g., ISale.ICreate → IShoppingSale.ICreate)
40
+ * - Renaming page types (e.g., IPageISale → IPageIShoppingSale)
41
+ * - Updating all $ref references throughout the OpenAPI document
42
+ */
43
+ refactors: AutoBeInterfaceSchemaRefactor[];
44
+ }
45
+ }
@@ -0,0 +1,99 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+
3
+ export interface IAutoBeInterfaceSchemaSecurityReviewApplication {
4
+ /**
5
+ * Reviews and validates OpenAPI schema definitions for security compliance.
6
+ *
7
+ * This specialized security review function focuses exclusively on
8
+ * authentication boundaries, data protection, and system integrity. It
9
+ * enforces strict security policies to prevent authentication bypass, data
10
+ * exposure, and unauthorized access.
11
+ *
12
+ * The review process identifies and removes:
13
+ *
14
+ * - Authentication context fields in request DTOs (e.g., bbs_member_id)
15
+ * - Password and token fields in response DTOs
16
+ * - System-managed fields in request DTOs
17
+ * - Phantom fields that don't exist in Prisma schema
18
+ *
19
+ * @param props Security review results including violations found, fixes
20
+ * applied, and modified schemas
21
+ */
22
+ review: (
23
+ props: IAutoBeInterfaceSchemaSecurityReviewApplication.IProps,
24
+ ) => void;
25
+ }
26
+
27
+ export namespace IAutoBeInterfaceSchemaSecurityReviewApplication {
28
+ /**
29
+ * Output structure for the security review function.
30
+ *
31
+ * Contains the security analysis, remediation actions, and schemas modified
32
+ * for security compliance during the validation process.
33
+ */
34
+ export interface IProps {
35
+ /** Security analysis and remediation planning information. */
36
+ think: IThink;
37
+
38
+ /**
39
+ * Modified schemas resulting from security fixes.
40
+ *
41
+ * Contains ONLY the schemas that were modified for security reasons during
42
+ * review. This focused output enables precise tracking of security-related
43
+ * changes.
44
+ *
45
+ * Security modifications include:
46
+ *
47
+ * - Removing authentication context fields (user_id, session_id, etc.)
48
+ * - Removing password/token fields from responses
49
+ * - Removing system-managed fields from requests
50
+ * - Removing phantom fields not in Prisma schema
51
+ *
52
+ * Return empty object {} when all schemas are already secure and no
53
+ * security fixes were needed.
54
+ */
55
+ content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
56
+ }
57
+
58
+ export interface IThink {
59
+ /**
60
+ * Security violation findings from the review process.
61
+ *
62
+ * Documents all security issues discovered during validation, categorized
63
+ * by severity level (CRITICAL, HIGH, MEDIUM, LOW). Each violation includes
64
+ * the affected schema name, field name, and specific security rule
65
+ * violated.
66
+ *
67
+ * Common violations documented:
68
+ *
69
+ * - CRITICAL: Authentication context in requests (bbs_member_id, session_id)
70
+ * - CRITICAL: Password/token exposure in responses
71
+ * - CRITICAL: Phantom fields not existing in Prisma schema
72
+ * - HIGH: System-managed fields in requests
73
+ * - HIGH: Immutable ownership fields in updates
74
+ *
75
+ * Should state "No security violations found." when all schemas pass
76
+ * security validation.
77
+ */
78
+ review: string;
79
+
80
+ /**
81
+ * Security remediation actions applied to fix identified violations.
82
+ *
83
+ * Lists all security fixes implemented during the review process, organized
84
+ * by fix type and priority. Each fix documents which field was removed or
85
+ * modified and from which schema.
86
+ *
87
+ * Typical fixes documented:
88
+ *
89
+ * - Authentication context fields removed from request DTOs
90
+ * - Sensitive data removed from response DTOs
91
+ * - Phantom fields deleted to match Prisma schema
92
+ * - System fields removed from client-controllable DTOs
93
+ *
94
+ * Should state "No security issues require fixes. All schemas are secure."
95
+ * when no security modifications were necessary.
96
+ */
97
+ plan: string;
98
+ }
99
+ }
@@ -1,6 +1,6 @@
1
1
  import { AutoBeOpenApi, AutoBePrisma } from "@autobe/interface";
2
2
  import { AutoBeOpenApiTypeChecker, StringUtil } from "@autobe/utils";
3
- import { OpenApiTypeChecker } from "@samchon/openapi";
3
+ import { OpenApi, OpenApiTypeChecker } from "@samchon/openapi";
4
4
  import typia, { tags } from "typia";
5
5
 
6
6
  export namespace JsonSchemaFactory {
@@ -53,6 +53,7 @@ export namespace JsonSchemaFactory {
53
53
  application: AutoBePrisma.IApplication;
54
54
  }): void => {
55
55
  removeUnused(props.document);
56
+ removeDuplicated(props.document);
56
57
  fixTimestamps(props);
57
58
  };
58
59
 
@@ -84,6 +85,47 @@ export namespace JsonSchemaFactory {
84
85
  if (used.has(key) === false) delete document.components.schemas[key];
85
86
  };
86
87
 
88
+ const removeDuplicated = (document: AutoBeOpenApi.IDocument): void => {
89
+ // gather duplicated schemas
90
+ const correct: Map<string, string> = new Map();
91
+ for (const key of Object.keys(document.components.schemas)) {
92
+ if (key.includes(".") === false) continue;
93
+ const dotRemoved: string = key.replace(".", "");
94
+ if (document.components.schemas[dotRemoved] === undefined) continue;
95
+ correct.set(dotRemoved, key);
96
+ }
97
+
98
+ // fix operations' references
99
+ for (const op of document.operations) {
100
+ if (op.requestBody && correct.has(op.requestBody.typeName))
101
+ op.requestBody.typeName = correct.get(op.requestBody.typeName)!;
102
+ if (op.responseBody && correct.has(op.responseBody.typeName))
103
+ op.responseBody.typeName = correct.get(op.responseBody.typeName)!;
104
+ }
105
+
106
+ // fix schemas' references
107
+ const $refChangers: Map<OpenApi.IJsonSchema, () => void> = new Map();
108
+ for (const value of Object.values(document.components.schemas))
109
+ OpenApiTypeChecker.visit({
110
+ components: { schemas: document.components.schemas },
111
+ schema: value,
112
+ closure: (next) => {
113
+ if (OpenApiTypeChecker.isReference(next) === false) return;
114
+ const x: string = next.$ref.split("/").pop()!;
115
+ const y: string | undefined = correct.get(x);
116
+ if (y === undefined) return;
117
+ $refChangers.set(
118
+ next,
119
+ () => (next.$ref = `#/components/schemas/${y}`),
120
+ );
121
+ },
122
+ });
123
+ for (const fn of $refChangers.values()) fn();
124
+
125
+ // remove duplicated schemas
126
+ for (const key of correct.keys()) delete document.components.schemas[key];
127
+ };
128
+
87
129
  const fixTimestamps = (props: {
88
130
  document: AutoBeOpenApi.IDocument;
89
131
  application: AutoBePrisma.IApplication;
@@ -220,8 +262,8 @@ namespace IPage {
220
262
  * refresh tokens along with their expiration information.
221
263
  *
222
264
  * This token structure is automatically included in API schemas when the system
223
- * detects authorization roles in the requirements analysis phase. It provides a
224
- * standard format for JWT-based authentication across the generated backend
265
+ * detects authorization actors in the requirements analysis phase. It provides
266
+ * a standard format for JWT-based authentication across the generated backend
225
267
  * applications.
226
268
  */
227
269
  interface IAuthorizationToken {
@@ -13,6 +13,7 @@ export namespace JsonSchemaValidator {
13
13
  export const validateSchemas = (props: IProps): void => {
14
14
  validateAuthorization(props);
15
15
  validatePrismaSchema(props.errors);
16
+ validateRecursive(props);
16
17
  for (const key of Object.keys(props.schemas))
17
18
  validateKey({
18
19
  errors: props.errors,
@@ -174,4 +175,113 @@ export namespace JsonSchemaValidator {
174
175
  `;
175
176
  }
176
177
  };
178
+
179
+ const validateRecursive = (props: IProps): void => {
180
+ for (const [key, value] of Object.entries(props.schemas)) {
181
+ const report = (description: string) =>
182
+ props.errors.push({
183
+ path: `${props.path}[${JSON.stringify(key)}]`,
184
+ expected: "Non-infinite recursive schema definition",
185
+ value,
186
+ description,
187
+ });
188
+ if (
189
+ AutoBeOpenApiTypeChecker.isReference(value) &&
190
+ value.$ref === `#/components/schemas/${key}`
191
+ )
192
+ report(StringUtil.trim`
193
+ You have defined a nonsensible type like below:
194
+
195
+ \`\`\`typescript
196
+ type ${key} = ${key};
197
+ \`\`\`
198
+
199
+ This is an infinite recursive type definition that cannot exist in any
200
+ programming language. A type cannot be defined as itself - this creates
201
+ a circular definition with no base case, making the type impossible to
202
+ instantiate or validate.
203
+
204
+ If you need tree or graph structures, use explicit relationships with
205
+ ID references (e.g., parentId: string) instead of recursive type definitions.
206
+ Remove the self-reference and redesign the schema at the next time.
207
+ `);
208
+ else if (
209
+ AutoBeOpenApiTypeChecker.isArray(value) &&
210
+ AutoBeOpenApiTypeChecker.isReference(value.items) &&
211
+ value.items.$ref === `#/components/schemas/${key}`
212
+ )
213
+ report(StringUtil.trim`
214
+ You have defined a nonsensible type like below:
215
+
216
+ \`\`\`typescript
217
+ type ${key} = Array<${key}>;
218
+ \`\`\`
219
+
220
+ This is an infinite recursive array type that cannot exist in any
221
+ programming language. An array of itself creates a circular definition
222
+ with no base case, making the type impossible to instantiate or validate.
223
+
224
+ If you need nested structures, define explicit depth levels with separate
225
+ types, or use parent-child relationships with ID references.
226
+ Remove the self-reference and redesign the schema at the next time.
227
+ `);
228
+ else if (
229
+ AutoBeOpenApiTypeChecker.isOneOf(value) &&
230
+ value.oneOf.some(
231
+ (v) =>
232
+ AutoBeOpenApiTypeChecker.isReference(v) &&
233
+ v.$ref === `#/components/schemas/${key}`,
234
+ ) === true
235
+ )
236
+ report(StringUtil.trim`
237
+ You have defined a nonsensible type like below:
238
+
239
+ \`\`\`typescript
240
+ type ${key} = ${key} | ...;
241
+ \`\`\`
242
+
243
+ This is an infinite recursive union type that cannot exist in any
244
+ programming language. A union that includes itself as a variant creates
245
+ a circular definition with no base case, making the type impossible to
246
+ instantiate or validate.
247
+
248
+ If you need polymorphic hierarchies, define separate concrete types for
249
+ each variant without including the union type itself as a variant.
250
+ Remove the self-reference and redesign the schema at the next time.
251
+ `);
252
+ else if (
253
+ AutoBeOpenApiTypeChecker.isObject(value) &&
254
+ value.properties &&
255
+ value.required &&
256
+ Object.entries(value.properties).some(
257
+ ([k, v]) =>
258
+ AutoBeOpenApiTypeChecker.isReference(v) &&
259
+ v.$ref === `#/components/schemas/${key}` &&
260
+ value.required.includes(k),
261
+ )
262
+ )
263
+ report(StringUtil.trim`
264
+ You have defined a nonsensible type like below:
265
+
266
+ \`\`\`typescript
267
+ interface ${key} {
268
+ someProperty: ${key}; // required, non-nullable
269
+ }
270
+ \`\`\`
271
+
272
+ This is an infinite recursive object type that cannot exist in any
273
+ programming language. A required non-nullable property referencing its
274
+ own type creates a circular definition with no base case, making the
275
+ type impossible to instantiate.
276
+
277
+ To create an instance of ${key}, you would need an instance of ${key},
278
+ which requires another instance of ${key}, infinitely. This is logically
279
+ impossible.
280
+
281
+ If you need parent-child or graph relationships, make the self-referencing
282
+ property either nullable or optional, or use ID references (e.g., parentId: string).
283
+ Remove the required self-reference and redesign the schema at the next time.
284
+ `);
285
+ }
286
+ };
177
287
  }
@@ -14,7 +14,7 @@ export namespace OperationValidator {
14
14
  operations: Array<
15
15
  Omit<
16
16
  AutoBeOpenApi.IOperation,
17
- "authorizationRole" | "authorizationType" | "prerequisites"
17
+ "authorizationActor" | "authorizationType" | "prerequisites"
18
18
  >
19
19
  >;
20
20
  }): void => {
@@ -65,19 +65,19 @@ export const transformPrismaComponentsHistories = (
65
65
  - \`mv_shopping_daily_stats\`
66
66
 
67
67
  ${
68
- state.analyze.roles.length > 0
68
+ state.analyze.actors.length > 0
69
69
  ? StringUtil.trim`
70
- ## User Role Handling
71
-
72
- The Requirement Analysis Report contains the following user roles: ${state.analyze.roles.join(", ")}
73
-
74
- **Do not normalize** user roles into a single table.
75
- Instead, create separate tables for each distinct role mentioned in the requirements.
76
-
77
- Create separate tables for each role:
78
-
79
- ${state.analyze.roles
80
- .map((role) => `- ${props.prefix}_${role.name.toLowerCase()}`)
70
+ ## User Actor Handling
71
+
72
+ The Requirement Analysis Report contains the following user actors: ${state.analyze.actors.join(", ")}
73
+
74
+ **Do not normalize** user actors into a single table.
75
+ Instead, create separate tables for each distinct actor mentioned in the requirements.
76
+
77
+ Create separate tables for each actor:
78
+
79
+ ${state.analyze.actors
80
+ .map((actor) => `- ${props.prefix}_${actor.name.toLowerCase()}`)
81
81
  .join("\n")}
82
82
  `
83
83
  : ""
@@ -2,13 +2,13 @@ import {
2
2
  AutoBeAssistantMessageHistory,
3
3
  AutoBePrisma,
4
4
  AutoBePrismaCompleteEvent,
5
- AutoBePrismaComponentsEvent,
5
+ AutoBePrismaComponentEvent,
6
6
  AutoBePrismaHistory,
7
7
  AutoBePrismaReviewEvent,
8
8
  IAutoBeCompiler,
9
9
  IAutoBePrismaValidation,
10
10
  } from "@autobe/interface";
11
- import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
11
+ import { AutoBePrismaSchemaEvent } from "@autobe/interface/src/events/AutoBePrismaSchemaEvent";
12
12
  import { ILlmSchema } from "@samchon/openapi";
13
13
  import { v7 } from "uuid";
14
14
 
@@ -44,12 +44,12 @@ export const orchestratePrisma = async <Model extends ILlmSchema.Model>(
44
44
  });
45
45
 
46
46
  // COMPONENTS
47
- const componentEvent: AutoBePrismaComponentsEvent =
47
+ const componentEvent: AutoBePrismaComponentEvent =
48
48
  await orchestratePrismaComponents(ctx, props.instruction);
49
49
  ctx.dispatch(componentEvent);
50
50
 
51
51
  // CONSTRUCT AST DATA
52
- const schemaEvents: AutoBePrismaSchemasEvent[] =
52
+ const schemaEvents: AutoBePrismaSchemaEvent[] =
53
53
  await orchestratePrismaSchemas(
54
54
  ctx,
55
55
  props.instruction,
@@ -1,5 +1,5 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
- import { AutoBePrismaComponentsEvent } from "@autobe/interface/src/events/AutoBePrismaComponentsEvent";
2
+ import { AutoBePrismaComponentEvent } from "@autobe/interface/src/events/AutoBePrismaComponentEvent";
3
3
  import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
4
4
  import { IPointer } from "tstl";
5
5
  import typia from "typia";
@@ -16,14 +16,14 @@ export async function orchestratePrismaComponents<
16
16
  ctx: AutoBeContext<Model>,
17
17
  instruction: string,
18
18
  message: string = "Design database from the given requirement analysis documents.",
19
- ): Promise<AutoBePrismaComponentsEvent> {
19
+ ): Promise<AutoBePrismaComponentEvent> {
20
20
  const start: Date = new Date();
21
21
  const pointer: IPointer<IAutoBePrismaComponentApplication.IProps | null> = {
22
22
  value: null,
23
23
  };
24
24
  const prefix: string | null = ctx.state().analyze?.prefix ?? null;
25
25
  const { tokenUsage } = await ctx.conversate({
26
- source: "prismaComponents",
26
+ source: "prismaComponent",
27
27
  histories: transformPrismaComponentsHistories(ctx.state(), {
28
28
  prefix,
29
29
  instruction,
@@ -40,7 +40,7 @@ export async function orchestratePrismaComponents<
40
40
  if (pointer.value === null)
41
41
  throw new Error("Failed to extract files and tables."); // unreachable
42
42
  return {
43
- type: "prismaComponents",
43
+ type: "prismaComponent",
44
44
  id: v7(),
45
45
  created_at: start.toISOString(),
46
46
  thinking: pointer.value.thinking,
@@ -1,6 +1,6 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
2
  import { AutoBePrisma } from "@autobe/interface";
3
- import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
3
+ import { AutoBePrismaSchemaEvent } from "@autobe/interface/src/events/AutoBePrismaSchemaEvent";
4
4
  import { StringUtil } from "@autobe/utils";
5
5
  import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
6
6
  import { IPointer } from "tstl";
@@ -17,7 +17,7 @@ export async function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(
17
17
  ctx: AutoBeContext<Model>,
18
18
  instruction: string,
19
19
  componentList: AutoBePrisma.IComponent[],
20
- ): Promise<AutoBePrismaSchemasEvent[]> {
20
+ ): Promise<AutoBePrismaSchemaEvent[]> {
21
21
  const start: Date = new Date();
22
22
  const total: number = componentList
23
23
  .map((c) => c.tables.length)
@@ -29,7 +29,7 @@ export async function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(
29
29
  .filter((y) => component !== y)
30
30
  .map((c) => c.tables)
31
31
  .flat();
32
- const event: AutoBePrismaSchemasEvent = await process(ctx, {
32
+ const event: AutoBePrismaSchemaEvent = await process(ctx, {
33
33
  instruction,
34
34
  component,
35
35
  otherTables,
@@ -55,12 +55,12 @@ async function process<Model extends ILlmSchema.Model>(
55
55
  completed: IPointer<number>;
56
56
  promptCacheKey: string;
57
57
  },
58
- ): Promise<AutoBePrismaSchemasEvent> {
58
+ ): Promise<AutoBePrismaSchemaEvent> {
59
59
  const pointer: IPointer<IAutoBePrismaSchemaApplication.IProps | null> = {
60
60
  value: null,
61
61
  };
62
62
  const { tokenUsage } = await ctx.conversate({
63
- source: "prismaSchemas",
63
+ source: "prismaSchema",
64
64
  histories: transformPrismaSchemaHistories({
65
65
  analysis:
66
66
  ctx
@@ -87,7 +87,7 @@ async function process<Model extends ILlmSchema.Model>(
87
87
  if (pointer.value === null)
88
88
  throw new Error("Unreachable code: Prisma Schema not generated");
89
89
  return {
90
- type: "prismaSchemas",
90
+ type: "prismaSchema",
91
91
  id: v7(),
92
92
  created_at: props.start.toISOString(),
93
93
  plan: pointer.value.plan,
@@ -101,7 +101,7 @@ async function process<Model extends ILlmSchema.Model>(
101
101
  completed: (props.completed.value += props.component.tables.length),
102
102
  total: props.total,
103
103
  step: ctx.state().analyze?.step ?? 0,
104
- } satisfies AutoBePrismaSchemasEvent;
104
+ } satisfies AutoBePrismaSchemaEvent;
105
105
  }
106
106
 
107
107
  function createController<Model extends ILlmSchema.Model>(
@@ -1,5 +1,5 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { AutoBeAnalyzeRole } from "@autobe/interface";
2
+ import { AutoBeAnalyzeActor } from "@autobe/interface";
3
3
  import { StringUtil } from "@autobe/utils";
4
4
  import { ILlmSchema } from "@samchon/openapi";
5
5
  import { v7 } from "uuid";
@@ -11,7 +11,7 @@ export const transformRealizeAuthorizationHistories = <
11
11
  Model extends ILlmSchema.Model,
12
12
  >(
13
13
  ctx: AutoBeContext<Model>,
14
- role: AutoBeAnalyzeRole,
14
+ actor: AutoBeAnalyzeActor,
15
15
  ): Array<
16
16
  IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
17
17
  > => {
@@ -27,9 +27,10 @@ export const transformRealizeAuthorizationHistories = <
27
27
  created_at: new Date().toISOString(),
28
28
  type: "systemMessage",
29
29
  text: StringUtil.trim`
30
- ## Role
30
+ ## Actor
31
+
31
32
  \`\`\`json
32
- ${JSON.stringify(role)}
33
+ ${JSON.stringify(actor)}
33
34
  \`\`\`
34
35
 
35
36
  ## Prisma Schema
@@ -42,9 +43,9 @@ export const transformRealizeAuthorizationHistories = <
42
43
 
43
44
  Please follow this naming convention for the authorization components:
44
45
 
45
- - Provider Name: ${role.name}Authorize (e.g. ${role.name}Authorize)
46
- - Decorator Name: ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Auth (e.g. ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Auth)
47
- - Payload Name: ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Payload (e.g. ${role.name.charAt(0).toUpperCase() + role.name.slice(1)}Payload)
46
+ - Provider Name: ${actor.name}Authorize (e.g. ${actor.name}Authorize)
47
+ - Decorator Name: ${actor.name.charAt(0).toUpperCase() + actor.name.slice(1)}Auth (e.g. ${actor.name.charAt(0).toUpperCase() + actor.name.slice(1)}Auth)
48
+ - Payload Name: ${actor.name.charAt(0).toUpperCase() + actor.name.slice(1)}Payload (e.g. ${actor.name.charAt(0).toUpperCase() + actor.name.slice(1)}Payload)
48
49
  `,
49
50
  },
50
51
  ];
@@ -57,7 +57,7 @@ export const transformRealizeAuthorizationCorrectHistories = <
57
57
  name: auth.payload.name,
58
58
  content: auth.payload.content,
59
59
  },
60
- } satisfies Omit<AutoBeRealizeAuthorization, "role">)}
60
+ } satisfies Omit<AutoBeRealizeAuthorization, "actor">)}
61
61
  \`\`\`
62
62
 
63
63
  ## Prisma Schema
@@ -86,9 +86,9 @@ export const transformRealizeAuthorizationCorrectHistories = <
86
86
 
87
87
  Please follow this naming convention for the authorization components:
88
88
 
89
- - Provider Name: ${auth.role.name.toLowerCase()}Authorize (e.g. ${auth.role.name.toLowerCase()}Authorize)
90
- - Decorator Name: ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Auth (e.g. ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Auth)
91
- - Payload Name: ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Payload (e.g. ${auth.role.name.charAt(0).toUpperCase() + auth.role.name.slice(1).toLowerCase()}Payload)
89
+ - Provider Name: ${auth.actor.name.toLowerCase()}Authorize (e.g. ${auth.actor.name.toLowerCase()}Authorize)
90
+ - Decorator Name: ${auth.actor.name.charAt(0).toUpperCase() + auth.actor.name.slice(1).toLowerCase()}Auth (e.g. ${auth.actor.name.charAt(0).toUpperCase() + auth.actor.name.slice(1).toLowerCase()}Auth)
91
+ - Payload Name: ${auth.actor.name.charAt(0).toUpperCase() + auth.actor.name.slice(1).toLowerCase()}Payload (e.g. ${auth.actor.name.charAt(0).toUpperCase() + auth.actor.name.slice(1).toLowerCase()}Payload)
92
92
  `,
93
93
  },
94
94
  ];