@autobe/agent 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (531) hide show
  1. package/lib/AutoBeAgent.js +1 -0
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/AutoBeMockAgent.js +1 -0
  4. package/lib/AutoBeMockAgent.js.map +1 -1
  5. package/lib/constants/AutoBeConfigConstant.d.ts +3 -1
  6. package/lib/constants/AutoBeSystemPromptConstant.d.ts +39 -26
  7. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  8. package/lib/context/AutoBeContext.d.ts +1 -1
  9. package/lib/factory/createAutoBeContext.js +5 -3
  10. package/lib/factory/createAutoBeContext.js.map +1 -1
  11. package/lib/index.mjs +37005 -17000
  12. package/lib/index.mjs.map +1 -1
  13. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +7 -2
  14. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +11 -21
  15. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  16. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +2 -2
  17. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -5
  18. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  19. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +2 -2
  20. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +53 -50
  21. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  22. package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -2
  23. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  24. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +855 -258
  25. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  26. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +15 -22
  27. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  28. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -9
  29. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  30. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +110 -36
  31. package/lib/orchestrate/common/AutoBePreliminaryController.d.ts +40 -0
  32. package/lib/orchestrate/common/AutoBePreliminaryController.js +97 -0
  33. package/lib/orchestrate/common/AutoBePreliminaryController.js.map +1 -0
  34. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistory.d.ts +8 -0
  35. package/lib/orchestrate/{realize/histories/transformRealizeCorrectCastingHistories.js → common/histories/transformCommonCorrectCastingHistory.js} +16 -13
  36. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistory.js.map +1 -0
  37. package/lib/orchestrate/common/histories/transformPreliminaryHistory.d.ts +4 -0
  38. package/lib/orchestrate/common/histories/transformPreliminaryHistory.js +285 -0
  39. package/lib/orchestrate/common/histories/transformPreliminaryHistory.js.map +1 -0
  40. package/lib/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.d.ts → transformPreviousAndLatestCorrectHistory.d.ts} +1 -1
  41. package/lib/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.js → transformPreviousAndLatestCorrectHistory.js} +4 -4
  42. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js.map +1 -0
  43. package/lib/orchestrate/common/internal/complementPreliminaryCollection.d.ts +7 -0
  44. package/lib/orchestrate/common/internal/complementPreliminaryCollection.js +99 -0
  45. package/lib/orchestrate/common/internal/complementPreliminaryCollection.js.map +1 -0
  46. package/lib/orchestrate/common/internal/createPreliminaryCollection.d.ts +3 -0
  47. package/lib/orchestrate/common/internal/createPreliminaryCollection.js +20 -0
  48. package/lib/orchestrate/common/internal/createPreliminaryCollection.js.map +1 -0
  49. package/lib/orchestrate/common/internal/validatePreliminary.d.ts +5 -0
  50. package/lib/orchestrate/common/internal/validatePreliminary.js +217 -0
  51. package/lib/orchestrate/common/internal/validatePreliminary.js.map +1 -0
  52. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +10 -22
  53. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  54. package/lib/orchestrate/common/orchestratePreliminary.d.ts +12 -0
  55. package/lib/orchestrate/common/orchestratePreliminary.js +231 -0
  56. package/lib/orchestrate/common/orchestratePreliminary.js.map +1 -0
  57. package/lib/orchestrate/common/structures/AutoBePreliminaryRequest.d.ts +16 -0
  58. package/lib/orchestrate/{realize/structures/IAutoBeRealizeAuthorizationApplication.js → common/structures/AutoBePreliminaryRequest.js} +1 -1
  59. package/lib/orchestrate/common/structures/AutoBePreliminaryRequest.js.map +1 -0
  60. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +1 -4
  61. package/lib/orchestrate/common/structures/IAutoBeOrchestrateResult.d.ts +9 -0
  62. package/lib/orchestrate/{interface/structures/IAutoBeInterfacePrerequisitesApplication.js → common/structures/IAutoBeOrchestrateResult.js} +1 -1
  63. package/lib/orchestrate/common/structures/IAutoBeOrchestrateResult.js.map +1 -0
  64. package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.d.ts +8 -0
  65. package/lib/orchestrate/{interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js → common/structures/IAutoBePreliminaryCollection.js} +1 -1
  66. package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.js.map +1 -0
  67. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.d.ts +27 -0
  68. package/lib/orchestrate/{interface/structures/IAutoBeInterfaceOperationsReviewApplication.js → common/structures/IAutoBePreliminaryGetAnalysisFiles.js} +1 -1
  69. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.js.map +1 -0
  70. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.d.ts +28 -0
  71. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.js +3 -0
  72. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.js.map +1 -0
  73. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.d.ts +27 -0
  74. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.js +3 -0
  75. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.js.map +1 -0
  76. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.d.ts +27 -0
  77. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.js +3 -0
  78. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.js.map +1 -0
  79. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.d.ts +10 -0
  80. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.js +70 -0
  81. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.js.map +1 -0
  82. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistory.d.ts +3 -0
  83. package/lib/orchestrate/interface/histories/{transformInterfaceCommonHistories.js → transformInterfaceCommonHistory.js} +4 -4
  84. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistory.js.map +1 -0
  85. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.d.ts +9 -0
  86. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.js +60 -0
  87. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.js.map +1 -0
  88. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.d.ts +12 -0
  89. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.js +63 -0
  90. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.js.map +1 -0
  91. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.d.ts +7 -0
  92. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.js +36 -0
  93. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.js.map +1 -0
  94. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.d.ts +6 -0
  95. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.js +68 -0
  96. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.js.map +1 -0
  97. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.d.ts +9 -0
  98. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.js +72 -0
  99. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.js.map +1 -0
  100. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.d.ts +7 -0
  101. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.js +38 -0
  102. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.js.map +1 -0
  103. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.d.ts +8 -0
  104. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.js +73 -0
  105. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.js.map +1 -0
  106. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.d.ts +11 -0
  107. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.js +95 -0
  108. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.js.map +1 -0
  109. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.d.ts +5 -0
  110. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.js +54 -0
  111. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.js.map +1 -0
  112. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.d.ts +12 -0
  113. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.js +75 -0
  114. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.js.map +1 -0
  115. package/lib/orchestrate/interface/orchestrateInterface.js +90 -46
  116. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  117. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.d.ts +6 -0
  118. package/lib/orchestrate/interface/{orchestrateInterfaceAuthorizations.js → orchestrateInterfaceAuthorization.js} +1395 -241
  119. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js.map +1 -0
  120. package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -3
  121. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +2843 -556
  122. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  123. package/lib/orchestrate/interface/{orchestrateInterfaceEndpoints.d.ts → orchestrateInterfaceEndpoint.d.ts} +1 -1
  124. package/lib/orchestrate/interface/orchestrateInterfaceEndpoint.js +1356 -0
  125. package/lib/orchestrate/interface/orchestrateInterfaceEndpoint.js.map +1 -0
  126. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.d.ts +4 -0
  127. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js +1337 -0
  128. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js.map +1 -0
  129. package/lib/orchestrate/interface/{orchestrateInterfaceGroups.d.ts → orchestrateInterfaceGroup.d.ts} +1 -2
  130. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js +621 -0
  131. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js.map +1 -0
  132. package/lib/orchestrate/interface/{orchestrateInterfaceOperations.d.ts → orchestrateInterfaceOperation.d.ts} +1 -2
  133. package/lib/orchestrate/interface/{orchestrateInterfaceOperations.js → orchestrateInterfaceOperation.js} +1299 -232
  134. package/lib/orchestrate/interface/orchestrateInterfaceOperation.js.map +1 -0
  135. package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.d.ts +4 -0
  136. package/lib/orchestrate/interface/{orchestrateInterfaceOperationsReview.js → orchestrateInterfaceOperationReview.js} +1447 -264
  137. package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.js.map +1 -0
  138. package/lib/orchestrate/interface/{orchestrateInterfacePrerequisites.d.ts → orchestrateInterfacePrerequisite.d.ts} +1 -1
  139. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js +2159 -0
  140. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js.map +1 -0
  141. package/lib/orchestrate/interface/{orchestrateInterfaceSchemas.d.ts → orchestrateInterfaceSchema.d.ts} +1 -2
  142. package/lib/orchestrate/interface/{orchestrateInterfaceSchemas.js → orchestrateInterfaceSchema.js} +2586 -570
  143. package/lib/orchestrate/interface/orchestrateInterfaceSchema.js.map +1 -0
  144. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +7 -17
  145. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
  146. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +1 -0
  147. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +2875 -588
  148. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
  149. package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.d.ts +56 -5
  150. package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +57 -10
  151. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +55 -10
  152. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.d.ts +96 -0
  153. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.js +3 -0
  154. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.js.map +1 -0
  155. package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -82
  156. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +58 -13
  157. package/lib/orchestrate/interface/structures/{IAutoBeInterfaceOperationsReviewApplication.d.ts → IAutoBeInterfaceOperationReviewApplication.d.ts} +58 -28
  158. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.js +3 -0
  159. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.js.map +1 -0
  160. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.d.ts +98 -0
  161. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.js +3 -0
  162. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.js.map +1 -0
  163. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +56 -15
  164. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +62 -22
  165. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +60 -21
  166. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +61 -19
  167. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +29 -23
  168. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
  169. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.js +67 -61
  170. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -1
  171. package/lib/orchestrate/interface/utils/JsonSchemaValidator.d.ts +2 -1
  172. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +52 -25
  173. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
  174. package/lib/orchestrate/interface/utils/OperationValidator.js +59 -1
  175. package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
  176. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.d.ts +6 -0
  177. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js +98 -0
  178. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js.map +1 -0
  179. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.d.ts +7 -0
  180. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.js +31 -0
  181. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.js.map +1 -0
  182. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.d.ts +7 -0
  183. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.js +38 -0
  184. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.js.map +1 -0
  185. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.d.ts +8 -0
  186. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js +79 -0
  187. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js.map +1 -0
  188. package/lib/orchestrate/prisma/orchestratePrisma.js +9 -6
  189. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  190. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
  191. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +19 -22
  192. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  193. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +2864 -1535
  194. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  195. package/lib/orchestrate/prisma/orchestratePrismaReview.d.ts +1 -1
  196. package/lib/orchestrate/prisma/orchestratePrismaReview.js +2886 -1557
  197. package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  198. package/lib/orchestrate/prisma/{orchestratePrismaSchemas.d.ts → orchestratePrismaSchema.d.ts} +1 -1
  199. package/lib/orchestrate/prisma/orchestratePrismaSchema.js +3068 -0
  200. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -0
  201. package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.d.ts +74 -76
  202. package/lib/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.d.ts +90 -72
  203. package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.d.ts +89 -66
  204. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.d.ts +9 -0
  205. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.js +79 -0
  206. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.js.map +1 -0
  207. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.d.ts +7 -0
  208. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.js +41 -0
  209. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.js.map +1 -0
  210. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.d.ts +12 -0
  211. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.js +67 -0
  212. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.js.map +1 -0
  213. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.d.ts +18 -0
  214. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.js +54 -0
  215. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.js.map +1 -0
  216. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +4 -2
  217. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +140 -106
  218. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  219. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.d.ts +3 -0
  220. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.js +23 -0
  221. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.js.map +1 -0
  222. package/lib/orchestrate/realize/orchestrateRealize.js +4 -4
  223. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  224. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +5 -1
  225. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +1288 -569
  226. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  227. package/lib/orchestrate/realize/{orchestrateRealizeAuthorization.d.ts → orchestrateRealizeAuthorizationWrite.d.ts} +1 -1
  228. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js +1410 -0
  229. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js.map +1 -0
  230. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +664 -140
  231. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  232. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +20 -65
  233. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
  234. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +660 -135
  235. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  236. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +79 -19
  237. package/lib/orchestrate/realize/structures/{IAutoBeRealizeAuthorizationApplication.d.ts → IAutoBeRealizeAuthorizationWriteApplication.d.ts} +60 -27
  238. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.js +3 -0
  239. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.js.map +1 -0
  240. package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +54 -5
  241. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +6 -14
  242. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +54 -6
  243. package/lib/orchestrate/realize/utils/generateRealizeScenario.d.ts +1 -3
  244. package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -7
  245. package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
  246. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -3
  247. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +23 -20
  248. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  249. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.d.ts +4 -0
  250. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.js +36 -0
  251. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.js.map +1 -0
  252. package/lib/orchestrate/test/histories/transformTestScenarioHistory.d.ts +11 -0
  253. package/lib/orchestrate/test/histories/transformTestScenarioHistory.js +95 -0
  254. package/lib/orchestrate/test/histories/transformTestScenarioHistory.js.map +1 -0
  255. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.d.ts +10 -0
  256. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.js +67 -0
  257. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.js.map +1 -0
  258. package/lib/orchestrate/test/histories/{transformTestWriteHistories.d.ts → transformTestWriteHistory.d.ts} +4 -4
  259. package/lib/orchestrate/test/histories/{transformTestWriteHistories.js → transformTestWriteHistory.js} +79 -76
  260. package/lib/orchestrate/test/histories/transformTestWriteHistory.js.map +1 -0
  261. package/lib/orchestrate/test/orchestrateTestCorrect.js +13 -26
  262. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  263. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +3 -15
  264. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  265. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
  266. package/lib/orchestrate/test/orchestrateTestScenario.js +1381 -325
  267. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  268. package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -3
  269. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +1072 -291
  270. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  271. package/lib/orchestrate/test/orchestrateTestWrite.js +8 -15
  272. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  273. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +66 -4
  274. package/lib/orchestrate/test/structures/IAutoBeTestScenarioReviewApplication.d.ts +82 -14
  275. package/lib/structures/IAutoBeOrchestrateHistory.d.ts +5 -0
  276. package/lib/structures/IAutoBeOrchestrateHistory.js +3 -0
  277. package/lib/structures/IAutoBeOrchestrateHistory.js.map +1 -0
  278. package/lib/utils/executeCachedBatch.d.ts +5 -1
  279. package/lib/utils/executeCachedBatch.js +23 -5
  280. package/lib/utils/executeCachedBatch.js.map +1 -1
  281. package/lib/utils/validateEmptyCode.js +2 -2
  282. package/lib/utils/validateEmptyCode.js.map +1 -1
  283. package/package.json +10 -8
  284. package/src/AutoBeAgent.ts +1 -0
  285. package/src/AutoBeMockAgent.ts +1 -0
  286. package/src/constants/AutoBeConfigConstant.ts +2 -0
  287. package/src/constants/AutoBeSystemPromptConstant.ts +39 -26
  288. package/src/context/AutoBeContext.ts +1 -1
  289. package/src/factory/createAutoBeContext.ts +5 -2
  290. package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +17 -28
  291. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +12 -6
  292. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +62 -61
  293. package/src/orchestrate/analyze/orchestrateAnalyze.ts +2 -0
  294. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +97 -48
  295. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +3 -16
  296. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +1 -2
  297. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +114 -36
  298. package/src/orchestrate/common/AutoBePreliminaryController.ts +161 -0
  299. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistory.ts +32 -0
  300. package/src/orchestrate/common/histories/transformPreliminaryHistory.ts +383 -0
  301. package/src/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.ts → transformPreviousAndLatestCorrectHistory.ts} +1 -1
  302. package/src/orchestrate/common/internal/complementPreliminaryCollection.ts +123 -0
  303. package/src/orchestrate/common/internal/createPreliminaryCollection.ts +32 -0
  304. package/src/orchestrate/common/internal/validatePreliminary.ts +315 -0
  305. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +8 -15
  306. package/src/orchestrate/common/orchestratePreliminary.ts +361 -0
  307. package/src/orchestrate/common/structures/AutoBePreliminaryRequest.ts +18 -0
  308. package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +1 -4
  309. package/src/orchestrate/common/structures/IAutoBeOrchestrateResult.ts +13 -0
  310. package/src/orchestrate/common/structures/IAutoBePreliminaryCollection.ts +9 -0
  311. package/src/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.ts +29 -0
  312. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.ts +30 -0
  313. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.ts +29 -0
  314. package/src/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.ts +29 -0
  315. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.ts +77 -0
  316. package/src/orchestrate/interface/histories/{transformInterfaceCommonHistories.ts → transformInterfaceCommonHistory.ts} +1 -1
  317. package/src/orchestrate/interface/histories/{transformInterfaceGroupHistories.ts → transformInterfaceComplementHistory.ts} +35 -21
  318. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistory.ts +74 -0
  319. package/src/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.ts +40 -0
  320. package/src/orchestrate/interface/histories/transformInterfaceGroupHistory.ts +72 -0
  321. package/src/orchestrate/interface/histories/transformInterfaceOperationHistory.ts +79 -0
  322. package/src/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.ts +43 -0
  323. package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.ts +89 -0
  324. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistory.ts +105 -0
  325. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.ts +56 -0
  326. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.ts +88 -0
  327. package/src/orchestrate/interface/orchestrateInterface.ts +115 -51
  328. package/src/orchestrate/interface/{orchestrateInterfaceAuthorizations.ts → orchestrateInterfaceAuthorization.ts} +91 -67
  329. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +174 -78
  330. package/src/orchestrate/interface/orchestrateInterfaceEndpoint.ts +207 -0
  331. package/src/orchestrate/interface/orchestrateInterfaceEndpointReview.ts +139 -0
  332. package/src/orchestrate/interface/orchestrateInterfaceGroup.ts +153 -0
  333. package/src/orchestrate/interface/{orchestrateInterfaceOperations.ts → orchestrateInterfaceOperation.ts} +109 -86
  334. package/src/orchestrate/interface/orchestrateInterfaceOperationReview.ts +186 -0
  335. package/src/orchestrate/interface/{orchestrateInterfacePrerequisites.ts → orchestrateInterfacePrerequisite.ts} +123 -58
  336. package/src/orchestrate/interface/{orchestrateInterfaceSchemas.ts → orchestrateInterfaceSchema.ts} +96 -90
  337. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +10 -11
  338. package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +127 -60
  339. package/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.ts +63 -5
  340. package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +67 -12
  341. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.ts +63 -10
  342. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.ts +106 -0
  343. package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -84
  344. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +65 -13
  345. package/src/orchestrate/interface/structures/{IAutoBeInterfaceOperationsReviewApplication.ts → IAutoBeInterfaceOperationReviewApplication.ts} +65 -30
  346. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.ts +111 -0
  347. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +65 -15
  348. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +71 -24
  349. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +68 -23
  350. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +69 -21
  351. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +31 -23
  352. package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +73 -61
  353. package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +53 -26
  354. package/src/orchestrate/interface/utils/OperationValidator.ts +69 -1
  355. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistory.ts +109 -0
  356. package/src/orchestrate/prisma/histories/{transformPrismaCorrectHistories.ts → transformPrismaCorrectHistory.ts} +13 -22
  357. package/src/orchestrate/prisma/histories/transformPrismaReviewHistory.ts +42 -0
  358. package/src/orchestrate/prisma/histories/{transformPrismaSchemaHistories.ts → transformPrismaSchemaHistory.ts} +7 -8
  359. package/src/orchestrate/prisma/orchestratePrisma.ts +12 -17
  360. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +7 -15
  361. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +129 -64
  362. package/src/orchestrate/prisma/orchestratePrismaReview.ts +115 -59
  363. package/src/orchestrate/prisma/{orchestratePrismaSchemas.ts → orchestratePrismaSchema.ts} +92 -60
  364. package/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.ts +81 -76
  365. package/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.ts +97 -72
  366. package/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.ts +93 -66
  367. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.ts +89 -0
  368. package/src/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.ts +45 -0
  369. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.ts +85 -0
  370. package/src/orchestrate/realize/histories/transformRealizeCorrectHistory.ts +77 -0
  371. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +152 -121
  372. package/src/orchestrate/realize/histories/{transformRealizeWriteAuthorizationsHistories.ts → transformRealizeWriteMembershipHistory.ts} +2 -2
  373. package/src/orchestrate/realize/orchestrateRealize.ts +4 -3
  374. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +155 -97
  375. package/src/orchestrate/realize/orchestrateRealizeAuthorizationWrite.ts +241 -0
  376. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +88 -86
  377. package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +17 -56
  378. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +82 -78
  379. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +85 -22
  380. package/src/orchestrate/realize/structures/{IAutoBeRealizeAuthorizationApplication.ts → IAutoBeRealizeAuthorizationWriteApplication.ts} +64 -29
  381. package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +58 -5
  382. package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +6 -19
  383. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +58 -6
  384. package/src/orchestrate/realize/utils/generateRealizeScenario.ts +2 -20
  385. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +30 -30
  386. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.ts +40 -0
  387. package/src/orchestrate/test/histories/transformTestScenarioHistory.ts +116 -0
  388. package/src/orchestrate/test/histories/transformTestScenarioReviewHistory.ts +85 -0
  389. package/src/orchestrate/test/histories/transformTestWriteHistory.ts +169 -0
  390. package/src/orchestrate/test/orchestrateTestCorrect.ts +13 -19
  391. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +5 -12
  392. package/src/orchestrate/test/orchestrateTestScenario.ts +143 -83
  393. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +93 -76
  394. package/src/orchestrate/test/orchestrateTestWrite.ts +7 -7
  395. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +74 -4
  396. package/src/orchestrate/test/structures/IAutoBeTestScenarioReviewApplication.ts +89 -14
  397. package/src/structures/IAutoBeOrchestrateHistory.ts +6 -0
  398. package/src/utils/executeCachedBatch.ts +33 -7
  399. package/src/utils/validateEmptyCode.ts +2 -2
  400. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.d.ts +0 -8
  401. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +0 -16
  402. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +0 -1
  403. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +0 -1
  404. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.d.ts +0 -3
  405. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +0 -62
  406. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +0 -1
  407. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +0 -8
  408. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +0 -68
  409. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +0 -1
  410. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.d.ts +0 -3
  411. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.js.map +0 -1
  412. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +0 -9
  413. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +0 -74
  414. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +0 -1
  415. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +0 -10
  416. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +0 -61
  417. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +0 -1
  418. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +0 -4
  419. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +0 -34
  420. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +0 -1
  421. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +0 -6
  422. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +0 -52
  423. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +0 -1
  424. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +0 -8
  425. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +0 -71
  426. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +0 -1
  427. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.d.ts +0 -5
  428. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +0 -36
  429. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +0 -1
  430. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +0 -3
  431. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +0 -102
  432. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +0 -1
  433. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +0 -9
  434. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +0 -74
  435. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +0 -1
  436. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +0 -5
  437. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +0 -51
  438. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +0 -1
  439. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +0 -11
  440. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +0 -81
  441. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +0 -1
  442. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +0 -4
  443. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +0 -1
  444. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +0 -506
  445. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +0 -1
  446. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -4
  447. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +0 -487
  448. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +0 -1
  449. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +0 -455
  450. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +0 -1
  451. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +0 -1
  452. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +0 -4
  453. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +0 -1
  454. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +0 -916
  455. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +0 -1
  456. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +0 -1
  457. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +0 -60
  458. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +0 -1
  459. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js.map +0 -1
  460. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +0 -52
  461. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +0 -1
  462. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +0 -6
  463. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +0 -95
  464. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +0 -1
  465. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.d.ts +0 -3
  466. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +0 -41
  467. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +0 -1
  468. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.d.ts +0 -8
  469. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +0 -62
  470. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +0 -1
  471. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +0 -8
  472. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +0 -78
  473. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +0 -1
  474. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +0 -1678
  475. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +0 -1
  476. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +0 -5
  477. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +0 -44
  478. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +0 -1
  479. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.d.ts +0 -5
  480. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +0 -82
  481. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +0 -1
  482. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +0 -5
  483. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +0 -1
  484. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -13
  485. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +0 -29
  486. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +0 -1
  487. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +0 -3
  488. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +0 -23
  489. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +0 -1
  490. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +0 -707
  491. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +0 -1
  492. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +0 -1
  493. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.d.ts +0 -4
  494. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +0 -33
  495. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +0 -1
  496. package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +0 -10
  497. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +0 -101
  498. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +0 -1
  499. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +0 -8
  500. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +0 -72
  501. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +0 -1
  502. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +0 -1
  503. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +0 -25
  504. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +0 -72
  505. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +0 -75
  506. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +0 -82
  507. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -72
  508. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +0 -40
  509. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +0 -78
  510. package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +0 -44
  511. package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +0 -118
  512. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +0 -80
  513. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +0 -55
  514. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +0 -90
  515. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +0 -152
  516. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +0 -98
  517. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +0 -91
  518. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +0 -157
  519. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +0 -65
  520. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +0 -58
  521. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +0 -104
  522. package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +0 -69
  523. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +0 -52
  524. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +0 -95
  525. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +0 -30
  526. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +0 -46
  527. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +0 -185
  528. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +0 -39
  529. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +0 -125
  530. package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +0 -89
  531. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +0 -172
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrateRealizeAuthorization.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorization.ts"],"names":[],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IAutoBeRealizeAuthorizationApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
3
- import { IAutoBeTestFunction } from "../structures/IAutoBeTestFunction";
4
- export declare const transformTestCorrectInvalidRequestHistories: (func: IAutoBeTestFunction, diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[]) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformTestCorrectInvalidRequestHistories = void 0;
4
- const utils_1 = require("@autobe/utils");
5
- const uuid_1 = require("uuid");
6
- const transformTestCorrectInvalidRequestHistories = (func, diagnostics) => [
7
- {
8
- id: (0, uuid_1.v7)(),
9
- created_at: new Date().toISOString(),
10
- type: "systemMessage",
11
- text: "<!--\nfilename: TEST_CORRECT_INVALID_REQUEST.md\n-->\n# E2E Test Code Compilation Error Fix System Prompt only for Invalid Requests\n\n## 1. Role and Responsibility\n\nYou are an AI assistant specialized in analyzing and correcting E2E (End-to-End) test code compilation errors, specifically focused on detecting and removing code that deliberately sends API requests with wrong type parameters.\n\nYour sole purpose is to identify and eliminate test code that intentionally violates TypeScript's type system to test error handling. This practice is fundamentally wrong because:\n\n- **Type validation is NOT the responsibility of E2E tests** - it's the server's responsibility\n- **TypeScript compiler enforces type safety** - deliberately breaking it defeats the purpose\n- **Invalid type testing breaks the entire test suite** - compilation errors prevent any tests from running\n- **E2E tests should focus on business logic** - not on type system violations\n\nWhen you find such cases, you must DELETE them immediately without hesitation or justification. There are NO exceptions to this rule.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the test corrections directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n### 1.1. Function Calling Workflow\n\nThis agent operates through a specific function calling workflow to correct compilation errors:\n\n1. **Decision Point**: Analyze the compilation error\n - If error is caused by invalid type API requests \u2192 Call `rewrite()`\n - If error is unrelated to invalid type API requests \u2192 Call `reject()`\n\n2. **For `rewrite()` function**:\n ```typescript\n rewrite({\n think: string, // Analysis of the invalid type pattern found\n draft: string, // Initial code with problematic sections removed\n revise: {\n review: string, // Review of changes made\n final: string | null // Final corrected code (null if draft needs no changes)\n }\n })\n ```\n\n3. **For `reject()` function**:\n ```typescript\n reject() // No parameters needed - error is unrelated to your responsibility\n ```\n\n**Execution Rules:**\n- You MUST call one of these functions immediately upon analyzing the input\n- You CANNOT skip function calling or provide text responses instead\n- You MUST complete all required parameters in a single function call\n- You CANNOT ask for clarification or additional information\n\n## 2. Input Materials\n\n### 2.1. TypeScript Code\n\nYou will receive TypeScript E2E test code that may contain invalid type parameter API requests. Your task is to:\n\n- Analyze the code for patterns where API functions are called with deliberately wrong types\n- Identify sections that use type assertions (`as any`) to bypass TypeScript's type checking\n- Find test cases that intentionally violate the API's type contract\n\nIf no such patterns exist, the compilation error is caused by something else, and you must call `reject()`.\n\n### 2.2. TypeScript Compilation Results\n\nYou will receive compilation errors in the form of `Array<IAutoBeTypeScriptCompileResult.IDiagnostic>`. Your responsibility is to:\n\n- Determine if the compilation error originates from invalid type API requests\n- If yes, remove the offending code by calling `rewrite()`\n- If no, acknowledge it's not your domain by calling `reject()`\n\n**CRITICAL**: If the compilation error is NOT related to invalid type API requests (e.g., import errors, syntax errors, legitimate type issues), you MUST NOT touch the code. Call `reject()` immediately as another agent will handle it.\n\n```typescript\n/**\n * Result of TypeScript compilation and validation operations.\n *\n * This union type represents all possible outcomes when the TypeScript compiler\n * processes generated code from the Test and Realize agents. The compilation\n * results enable AI self-correction through detailed feedback mechanisms while\n * ensuring that all generated code meets production standards and integrates\n * seamlessly with the TypeScript ecosystem.\n *\n * The compilation process validates framework integration, type system\n * integrity, dependency resolution, and build compatibility. Success results\n * indicate production-ready code, while failure results provide detailed\n * diagnostics for iterative refinement through the AI feedback loop.\n *\n * @author Samchon\n */\nexport type IAutoBeTypeScriptCompileResult =\n | IAutoBeTypeScriptCompileResult.ISuccess\n | IAutoBeTypeScriptCompileResult.IFailure\n | IAutoBeTypeScriptCompileResult.IException;\n\nexport namespace IAutoBeTypeScriptCompileResult {\n /**\n * Successful compilation result with generated JavaScript output.\n *\n * Represents the ideal outcome where TypeScript compilation completed without\n * errors and produced clean JavaScript code ready for execution. This result\n * indicates that the generated TypeScript code meets all production\n * standards, integrates correctly with frameworks and dependencies, and\n * maintains complete type safety throughout the application stack.\n */\n export interface ISuccess {\n /** Discriminator indicating successful compilation. */\n type: \"success\";\n }\n\n /**\n * Compilation failure with detailed diagnostic information and partial\n * output.\n *\n * Represents cases where TypeScript compilation encountered errors or\n * warnings that prevent successful code generation. This result provides\n * comprehensive diagnostic information to enable AI agents to understand\n * specific issues and implement targeted corrections through the iterative\n * refinement process.\n */\n export interface IFailure {\n /** Discriminator indicating compilation failure. */\n type: \"failure\";\n\n /**\n * Detailed compilation diagnostics for error analysis and correction.\n *\n * Contains comprehensive information about compilation errors, warnings,\n * and suggestions that occurred during the TypeScript compilation process.\n * Each diagnostic includes file location, error category, diagnostic codes,\n * and detailed messages that enable AI agents to understand and resolve\n * specific compilation issues.\n */\n diagnostics: IDiagnostic[];\n }\n\n /**\n * Unexpected exception during the compilation process.\n *\n * Represents cases where the TypeScript compilation process encountered an\n * unexpected runtime error or system exception that prevented normal\n * compilation operation. These cases indicate potential issues with the\n * compilation environment or unexpected edge cases that should be\n * investigated.\n */\n export interface IException {\n /** Discriminator indicating compilation exception. */\n type: \"exception\";\n\n /**\n * The raw error or exception that occurred during compilation.\n *\n * Contains the original error object or exception details for debugging\n * purposes. This information helps developers identify the root cause of\n * unexpected compilation failures and improve system reliability while\n * maintaining the robustness of the automated development pipeline.\n */\n error: unknown;\n }\n\n /**\n * Detailed diagnostic information for compilation issues.\n *\n * Provides comprehensive details about specific compilation problems\n * including file locations, error categories, diagnostic codes, and\n * descriptive messages. This information is essential for AI agents to\n * understand compilation failures and implement precise corrections during\n * the iterative development process.\n *\n * @author Samchon\n */\n export interface IDiagnostic {\n /**\n * Source file where the diagnostic was generated.\n *\n * Specifies the TypeScript source file that contains the issue, or null if\n * the diagnostic applies to the overall compilation process rather than a\n * specific file. This information helps AI agents target corrections to the\n * appropriate source files during the refinement process.\n */\n file: string | null;\n\n /**\n * Category of the diagnostic message.\n *\n * Indicates the severity and type of the compilation issue, enabling AI\n * agents to prioritize fixes and understand the impact of each diagnostic.\n * Errors must be resolved for successful compilation, while warnings and\n * suggestions can guide code quality improvements.\n */\n category: DiagnosticCategory;\n\n /**\n * TypeScript diagnostic code for the specific issue.\n *\n * Provides the official TypeScript diagnostic code that identifies the\n * specific type of compilation issue. This code can be used to look up\n * detailed explanations and resolution strategies in TypeScript\n * documentation or automated correction systems.\n */\n code: number | string;\n\n /**\n * Character position where the diagnostic begins in the source file.\n *\n * Specifies the exact location in the source file where the issue starts,\n * or undefined if the diagnostic doesn't apply to a specific location. This\n * precision enables AI agents to make targeted corrections without\n * affecting unrelated code sections.\n */\n start: number | undefined;\n\n /**\n * Length of the text span covered by this diagnostic.\n *\n * Indicates how many characters from the start position are affected by\n * this diagnostic, or undefined if the diagnostic doesn't apply to a\n * specific text span. This information helps AI agents understand the scope\n * of corrections needed for each issue.\n */\n length: number | undefined;\n\n /**\n * Human-readable description of the compilation issue.\n *\n * Provides a detailed explanation of the compilation problem in natural\n * language that AI agents can analyze to understand the issue and formulate\n * appropriate corrections. The message text includes context and\n * suggestions for resolving the identified problem.\n */\n messageText: string;\n }\n\n /**\n * Categories of TypeScript diagnostic messages.\n *\n * Defines the severity levels and types of compilation diagnostics that can\n * be generated during TypeScript compilation. These categories help AI agents\n * prioritize fixes and understand the impact of each compilation issue on the\n * overall code quality and functionality.\n *\n * @author Samchon\n */\n export type DiagnosticCategory =\n | \"warning\" // Issues that don't prevent compilation but indicate potential problems\n | \"error\" // Critical issues that prevent successful compilation and must be fixed\n | \"suggestion\" // Recommendations for code improvements that enhance quality\n | \"message\"; // Informational messages about the compilation process\n}\n```\n\n## 3. Prohibited Patterns - DELETE ON SIGHT\n\nThe following patterns represent attempts to test invalid types and MUST be deleted immediately:\n\n### 3.1. Type Assertion Abuse (`as any`)\n\n```typescript\n// \uD83D\uDEA8 DELETE THIS IMMEDIATELY - Type error testing\nawait TestValidator.error(\"should reject invalid type\", async () => {\n await api.functional.users.create(connection, {\n body: {\n age: \"not a number\" as any, // \uD83D\uDEA8 Wrong type testing\n email: 123 as any, // \uD83D\uDEA8 Wrong type testing\n name: null as any // \uD83D\uDEA8 Wrong type testing\n }\n });\n});\n```\n\n**Why this must be deleted:**\n- Uses `as any` to bypass TypeScript's type checking\n- Attempts to test server-side type validation through client-side type violations\n- Creates compilation errors that break the entire test suite\n\n### 3.2. Missing Required Fields\n\n```typescript\n// \uD83D\uDEA8 DELETE THIS IMMEDIATELY - Missing required fields\nawait api.functional.posts.create(connection, {\n body: {\n // Missing 'title' field - DELETE THIS TEST\n content: \"test\"\n } as any\n});\n```\n\n**Why this must be deleted:**\n- Tests incomplete data structures by omitting required fields\n- Uses `as any` to force TypeScript to accept invalid objects\n- E2E tests should test with complete, valid data\n\n### 3.3. Wrong Type Assignments\n\n```typescript\n// \uD83D\uDEA8 DELETE THIS IMMEDIATELY - Wrong type assignments\nconst body = {\n price: \"free\" as any, // \uD83D\uDEA8 Wrong type\n date: 12345 // \uD83D\uDEA8 Wrong type\n} satisfies IOrder.ICreate;\n\nawait api.functional.orders.create(connection, { body });\n```\n\n**Why this must be deleted:**\n- Deliberately assigns wrong types to properties\n- Attempts to test type validation at the wrong layer\n- Creates type conflicts that prevent compilation\n\n### 3.4. TestValidator.error with Type Violations\n\n```typescript\n// \u274C DELETE THIS ENTIRELY:\nawait TestValidator.error(\n \"string age should fail\",\n async () => {\n await api.functional.users.create(connection, {\n body: {\n age: 21,\n } satisfies IPartial<IUser.ICreate>,\n });\n }\n);\n```\n\n**Why this must be deleted:**\n- TestValidator.error is being misused to test type violations\n- The test name explicitly states it's testing wrong types\n- Uses both `as any` and `satisfies` to force type mismatches\n\n### 3.5. Nested Type Violations\n\n```typescript\n// \uD83D\uDEA8 DELETE COMPLEX TYPE VIOLATIONS\nawait TestValidator.error(\"nested type error\", async () => {\n await api.functional.products.update(connection, \"123\", {\n body: {\n details: {\n specifications: {\n weight: \"heavy\" as any, // Wrong type\n dimensions: \"large\" as any // Wrong type\n }\n },\n price: {\n amount: \"expensive\" as any, // Wrong type\n currency: 123 as any // Wrong type\n }\n } satisfies IProduct.IUpdate,\n });\n});\n```\n\n**Why this must be deleted:**\n- Multiple nested type violations throughout the object structure\n- Each `as any` represents an intentional type system breach\n- Complex structures don't justify type testing - delete entirely\n\n### 3.6. Partial Type Testing\n\n```typescript\n// \uD83D\uDEA8 DELETE PARTIAL TYPE TESTS\ntype PartialUser = Partial<IUser.ICreate>;\nconst invalidUser: PartialUser = {\n email: 12345 as any, // Wrong type\n age: true as any // Wrong type\n};\n\nawait TestValidator.error(\"partial type test\", async () => {\n await api.functional.users.create(connection, {\n body: invalidUser as IUser.ICreate\n });\n});\n```\n\n**Why this must be deleted:**\n- Uses TypeScript utility types to create invalid structures\n- Multiple layers of type assertions to bypass safety\n- Tests type system rather than business logic\n\n## 4. Final Verification Checklist\n\nBefore submitting your correction, verify:\n\n### 4.1. Pattern Detection\n- [ ] All `as any` type assertions in API calls have been identified\n- [ ] All TestValidator.error calls testing type violations have been found\n- [ ] All deliberate type mismatches have been detected\n- [ ] All missing required field tests have been located\n\n### 4.2. Deletion Completeness\n- [ ] Entire test functions containing type violations have been removed\n- [ ] No partial fixes - complete removal only\n- [ ] No commented-out code remains\n- [ ] Test suite structure remains valid after deletions\n- [ ] If draft successfully removes all violations, final can be null\n\n### 4.3. Decision Accuracy\n- [ ] If type violations found \u2192 `rewrite()` was called\n- [ ] If no type violations found \u2192 `reject()` was called\n- [ ] No hesitation or uncertainty in the decision\n\n### 4.4. Code Integrity\n- [ ] Remaining code compiles without errors\n- [ ] Valid business logic tests are untouched\n- [ ] No new code or tests were added\n- [ ] File structure and imports remain consistent\n\n### 4.5. Zero Tolerance Verification\n- [ ] NO exceptions were made for \"educational\" type tests\n- [ ] NO attempts to \"fix\" type errors - only deletion\n- [ ] NO preservation of type testing \"for documentation\"\n- [ ] COMPLETE elimination of all type violation attempts\n\nRemember: Your mission is surgical removal of invalid type testing. When in doubt, if it uses `as any` or similar patterns to test types, DELETE IT.\n\n**IMPORTANT NOTE on revise.final:**\n- If your draft successfully removes all problematic code and the review finds no additional issues, set `revise.final` to `null`\n- A `null` value indicates the draft deletion was complete and sufficient\n- Only provide a non-null final if the review identified additional problems requiring further changes" /* AutoBeSystemPromptConstant.TEST_CORRECT_INVALID_REQUEST */,
12
- },
13
- {
14
- id: (0, uuid_1.v7)(),
15
- created_at: new Date().toISOString(),
16
- type: "assistantMessage",
17
- text: utils_1.StringUtil.trim `
18
- ## TypeScript Code
19
-
20
- \`\`\`typescript
21
- ${func.script}
22
- \`\`\`
23
-
24
- ## Compile Errors
25
-
26
- \`\`\`json
27
- ${JSON.stringify(diagnostics)}
28
- \`\`\`
29
- `,
30
- },
31
- ];
32
- exports.transformTestCorrectInvalidRequestHistories = transformTestCorrectInvalidRequestHistories;
33
- //# sourceMappingURL=transformTestCorrectInvalidRequestHistories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformTestCorrectInvalidRequestHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAC3C,+BAA0B;AAKnB,MAAM,2CAA2C,GAAG,CACzD,IAAyB,EACzB,WAAyD,EAGzD,EAAE,CAAC;IACH;QACE,EAAE,EAAE,IAAA,SAAE,GAAE;QACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,IAAI,EAAE,eAAe;QACrB,IAAI,y1iBAAyD;KAC9D;IACD;QACE,EAAE,EAAE,IAAA,SAAE,GAAE;QACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;QAIjB,IAAI,CAAC,MAAM;;;;;;QAMX,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;;KAE9B;KACF;CACF,CAAC;AA9BW,QAAA,2CAA2C,+CA8BtD"}
@@ -1,10 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { AutoBeOpenApi } from "@autobe/interface";
3
- import { AutoBeState } from "../../../context/AutoBeState";
4
- export declare const transformTestScenarioHistories: (props: {
5
- state: AutoBeState;
6
- document: AutoBeOpenApi.IDocument;
7
- include: AutoBeOpenApi.IOperation[];
8
- exclude: Pick<AutoBeOpenApi.IOperation, "method" | "path">[];
9
- instruction: string;
10
- }) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformTestScenarioHistories = void 0;
4
- const utils_1 = require("@autobe/utils");
5
- const uuid_1 = require("uuid");
6
- const getPrerequisites_1 = require("../utils/getPrerequisites");
7
- const transformTestScenarioHistories = (props) => {
8
- var _a, _b;
9
- const authorizations = (_b = (_a = props.state.interface) === null || _a === void 0 ? void 0 : _a.authorizations) !== null && _b !== void 0 ? _b : [];
10
- const authorizationActors = new Map();
11
- for (const authorization of authorizations) {
12
- for (const op of authorization.operations) {
13
- if (op.authorizationType === null)
14
- continue;
15
- const value = utils_1.MapUtil.take(authorizationActors, authorization.name, () => ({
16
- name: authorization.name,
17
- join: null,
18
- login: null,
19
- }));
20
- if (op.authorizationType === "join")
21
- value.join = op;
22
- else if (op.authorizationType === "login")
23
- value.login = op;
24
- }
25
- }
26
- return [
27
- {
28
- id: (0, uuid_1.v7)(),
29
- created_at: new Date().toISOString(),
30
- type: "systemMessage",
31
- text: "<!--\nfilename: TEST_SCENARIO.md\n-->\n# Test Scenario Generation System Prompt\n\n## Naming Conventions\n\n### Notation Types\nThe following naming conventions (notations) are used throughout test scenario generation:\n- **camelCase**: First word lowercase, subsequent words capitalized (e.g., `userProfile`, `commentUpdate`)\n- **PascalCase**: All words capitalized (e.g., `UserProfile`, `CommentUpdate`)\n- **snake_case**: All lowercase with underscores between words (e.g., `test_api_user_profile`, `test_api_comment_update`)\n\n### Specific Naming Rules\n- **Test Function Names**: Use snake_case notation (e.g., `test_api_article_creation`)\n- **Purpose Descriptions**: Use clear, concise sentences starting with action verbs\n- **Avoid Reserved Words**: Never use JavaScript/TypeScript reserved keywords (delete, class, for, if, etc.)\n\n## 1. Overview\n\nYou are the Test Scenario Agent, specializing in generating comprehensive E2E test scenarios for API operations. Your mission is to create realistic, implementable test scenarios that validate business logic through complete user workflows.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate test scenarios directly through the function call\n- \u2705 Include proper authentication setup based on authorizationActor\n- \u2705 Follow realistic user workflows with correct dependencies\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 2. Your Mission\n\nGenerate test scenarios that transform simple endpoint definitions into comprehensive test cases with proper authentication, complete dependency chains, and meaningful business logic validation. Each scenario must reflect real-world usage patterns and validate actual business requirements.\n\n### 2.1. Critical Authorization Verification Rule\n\n**\uD83D\uDD34 CRITICAL PRINCIPLE**: You MUST check the authorizationActor for EVERY operation involved in your test scenario.\n\n**MANDATORY VERIFICATION PROCESS**:\n1. **Target Operation**: Look up its authorizationActor in \"API Operations\"\n2. **Every Prerequisite**: Look up EACH prerequisite's authorizationActor in \"API Operations\"\n3. **Additional Dependencies**: Check authorizationActor for any operations you add\n\n**Authorization Rules**:\n- `authorizationActor: null` \u2192 NO authentication needed for this operation\n- `authorizationActor: \"roleX\"` \u2192 MUST add authentication for roleX before this operation\n- Authentication must PRECEDE any operation that requires it\n\n**\u26A0\uFE0F WARNING**: The prerequisites array only provides endpoints. You MUST look up each endpoint in \"API Operations\" to find its authorizationActor. Never assume an operation is public without verification.\n\n### 2.2. Test Scenario Design Philosophy\n\n**CRITICAL**: Focus on creating scenarios that validate real business workflows, not framework-level validations.\n\n**Design Principles**:\n- **Business Logic Focus**: Test what users actually do, not type checking\n- **Complete Workflows**: Include all steps from authentication to completion\n- **Realistic Patterns**: Follow actual user behavior patterns\n- **No Framework Testing**: Skip validation errors, focus on business rules\n\n**Ask Before Creating Each Scenario**:\n- Does this test a meaningful business workflow?\n- Are all dependencies properly authenticated?\n- Is the execution order realistic and correct?\n- Does this avoid testing framework-level validations?\n\n### 2.3. User Context Strategy: Critical Rules\n\n**\u26A0\uFE0F CRITICAL PRINCIPLE**: User Context determines how user authentication is established in your test scenario.\n\n**\uD83D\uDD34 FUNDAMENTAL RULE: User Context Type Determines Authentication Method**\n\n**New User Context (DEFAULT - 99% of cases)**\n- **MUST use `join` ONLY** - Creates brand new user accounts\n- **NEVER use `login`** for new user contexts\n- Fresh, isolated test environment\n- Example: `/auth/admin/join`, `/auth/member/join`\n\n**Existing User Context (RARE - 1% of cases)**\n- **MUST use `login` ONLY** - Uses pre-existing user accounts\n- **NEVER use `join`** for existing user contexts\n- Only when specifically testing login functionality or legacy users\n- Example: `/auth/admin/login`, `/auth/member/login`\n\n**\uD83D\uDEA8 ABSOLUTE PROHIBITION**: \n- **NEVER mix join and login in the same test scenario**\n- **NEVER use login unless explicitly testing login functionality**\n- **When in doubt, ALWAYS use join (new user context)**\n\n**How User Context Works in Tests**:\n```typescript\n// \u2705 CORRECT: New User Context (join only)\ndescribe('Article Creation', () => {\n it('test_api_article_creation_by_member', async () => {\n // 1. Create NEW user context with join\n const authResponse = await api.post('/auth/member/join', userData);\n const token = authResponse.body.accessToken;\n \n // 2. Perform business operation with new user's token\n const articleResponse = await api\n .post('/articles', articleData)\n .set('Authorization', `Bearer ${token}`);\n \n // 3. Validate business logic\n expect(articleResponse.status).toBe(201);\n });\n});\n\n// \u274C WRONG: Never mix join and login\ndescribe('Wrong Pattern', () => {\n it('test_api_wrong_pattern', async () => {\n await api.post('/auth/admin/join', adminData); // New context\n await api.post('/auth/member/login', memberData); // WRONG! Mixing\n });\n});\n```\n\n### 2.4. System-Generated vs User-Managed Data\n\n**\uD83D\uDD34 CRITICAL DISTINCTION**: Understand what data is created by users vs generated by the system.\n\n**User-Managed Data (Include in Dependencies)**:\n- Business entities users create (posts, comments, orders)\n- Configuration users set (preferences, settings)\n- Content users upload (images, documents)\n\n**System-Generated Data (NEVER Include)**:\n- Audit logs (created automatically during operations)\n- Analytics events (tracked by system)\n- Performance metrics (collected internally)\n- System timestamps (created_at, updated_at)\n\n**Example - What NOT to Do**:\n```json\n// \u274C WRONG - Don't create system data manually\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/audit-logs\" } } // NEVER!\n ]\n}\n\n// \u2705 CORRECT - System creates audit logs automatically\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } } // User action\n // Audit log created automatically by system during article creation\n ]\n}\n```\n\n### 2.5. User Context: The Golden Rule\n\n**\uD83C\uDFC6 THE GOLDEN RULE OF USER CONTEXT**:\n\n```\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 New User Context = join ONLY (99% of test scenarios) \u2502\n\u2502 Existing User Context = login ONLY (1% - testing login) \u2502\n\u2502 \u2502\n\u2502 NEVER MIX THEM IN ONE SCENARIO! \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n**Why This Matters**:\n- **join** creates a completely new user \u2192 Clean test environment\n- **login** uses an existing user \u2192 Only for testing login itself\n- Mixing them creates confusion about which user is being used\n\n**Quick Decision Guide**:\n- Testing any normal business operation? \u2192 Use **join**\n- Testing the login operation itself? \u2192 Use **join** first, then **login**\n- Testing with multiple roles? \u2192 Use **join** for ALL roles\n- Not sure? \u2192 Use **join**\n\n## 3. Input Materials\n\nYou will receive the following materials to guide your scenario generation:\n\n### 3.1. Instructions\n**Purpose**: E2E test-specific requirements extracted from user conversations\n- Test coverage priorities\n- Critical user workflows to validate\n- Specific edge cases to test\n- Business logic verification strategies\n- Apply these when relevant to target operations\n\n### 3.2. API Operations\n**Purpose**: Complete catalog of available API endpoints\n- **Critical Field**: `authorizationActor` for each operation\n- Use to verify authentication requirements\n- Reference for available endpoints\n- Source of truth for operation details\n\n**Structure Example**:\n```json\n{\n \"operations\": [\n {\n \"method\": \"post\",\n \"path\": \"/articles\",\n \"authorizationActor\": \"member\", // \u2190 MUST CHECK THIS\n \"name\": \"createArticle\",\n // ... other fields\n }\n ]\n}\n```\n\n### 3.3. Included in Test Plan\n**Purpose**: Target operations requiring test scenarios\n- **\uD83D\uDEA8 CRITICAL**: Generate scenarios ONLY for these operations\n- **NEVER** generate scenarios for unlisted operations\n- Contains enhanced operation data with prerequisites\n\n**Enhanced Structure**:\n```json\n{\n \"method\": \"put\",\n \"path\": \"/articles/{id}/comments/{cid}\",\n \"authorizationActor\": \"member\",\n \"prerequisites\": [ // \u2190 Pre-calculated dependencies\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" },\n \"purpose\": \"Create article to hold comments\"\n }\n ],\n \"authorizationActors\": [ // \u2190 Available auth operations\n {\n \"name\": \"member\",\n \"join\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"login\": { \"method\": \"post\", \"path\": \"/auth/member/login\" }\n }\n ]\n}\n```\n\n### 3.4. Excluded from Test Plan\n**Purpose**: Operations already tested elsewhere\n- Reference only for understanding coverage\n- May use as dependencies if needed\n- Do NOT generate scenarios for these\n\n## 4. Core Algorithm\n\n### 4.1. Step 1: Target Analysis and Special Cases\n\n**First, identify your target operation type:**\n\n**A. Regular Business Operations**\n- Continue to Step 2 for normal workflow\n\n**B. Authentication Operations (Special User Context Handling)**\n\n**Testing `join` (Creating New User Context)**:\n- `dependencies: []` (empty - join creates its own new user context)\n- This IS the user context creation\n\n**Testing `login` (Using Existing User Context)**:\n- `dependencies: [corresponding join]` \n- First create user with join, then test login with that existing user\n- ONLY case where you test with \"existing\" user (that you just created)\n\n**Testing `refresh` (Refreshing Existing User Context)**:\n- `dependencies: [corresponding join]`\n- First create user with join, then test token refresh\n\n**Special Case Examples**:\n```json\n// Testing join\n{\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_member_registration\",\n \"dependencies\": [] // \u2190 Empty for join\n }]\n}\n\n// Testing login\n{\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/login\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_member_login_existing\",\n \"dependencies\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"purpose\": \"Create member account for login testing\"\n }\n ]\n }]\n}\n```\n\n### 4.2. Step 2: Authorization Analysis\n\n**\uD83D\uDD34 MANDATORY: Create an authorization requirements table**\n\n1. **Extract target operation details**:\n - Find in \"Included in Test Plan\"\n - Note its authorizationActor\n - Extract prerequisites array\n\n2. **Look up EACH operation's authorizationActor**:\n```\nOperation | authorizationActor | Auth Needed?\n---------------------------|-------------------|-------------\nPUT /articles/{id}/comments/{cid} | \"member\" | Yes\nPOST /articles | \"member\" | Yes \nPOST /articles/{id}/comments | \"member\" | Yes\n```\n\n3. **Identify unique roles needing authentication**:\n - List all non-null authorizationActors\n - These roles MUST have authentication added\n\n### 4.3. Step 3: Build Dependencies with Authentication\n\n**Order Template**:\n```javascript\ndependencies = [\n // 1. Authentication operations (ALWAYS FIRST)\n ...authOperations,\n \n // 2. Prerequisites in logical order\n ...prerequisites.filter(needed)\n]\n```\n\n**Execution Rules**:\n- \u2705 Authentication BEFORE any operation needing it\n- \u2705 Parent resources BEFORE child resources\n- \u2705 Each operation appears EXACTLY ONCE\n- \u274C NEVER include target operation in dependencies\n- \u274C NEVER duplicate operations\n\n**Multi-Role Example**:\n```json\n[\n // Role X authentication\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleX/join\" } },\n // Role X operations\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/config\" } },\n \n // Role Y authentication \n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleY/join\" } },\n // Role Y operations\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } }\n]\n```\n\n### 4.4. Step 4: Generate Complete Scenario\n\n**Required Components**:\n\n1. **functionName** (snake_case):\n - Format: `test_api_[feature]_[action]_[context]`\n - Examples: `test_api_article_update_by_author`\n - Avoid reserved words\n\n2. **draft** (comprehensive description):\n - Business functionality tested\n - Step-by-step workflow\n - Validation points\n - Expected outcomes\n\n3. **dependencies** (ordered array):\n - Authentication operations first\n - Prerequisites in logical order\n - Clear purpose for each\n\n## 5. Common Anti-Patterns and Solutions\n\n### 5.1. \u274C ANTI-PATTERN: Missing Authentication Check\n**Problem**: Not checking prerequisite authorizationActors\n```json\n// Wrong - Didn't check if POST /resources needs auth\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" } }\n ]\n}\n```\n\n**\u2705 SOLUTION**: Always check authorizationActor\n```json\n// Correct - Checked and added required auth\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/user/join\" } },\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" } }\n ]\n}\n```\n\n### 5.2. \u274C ANTI-PATTERN: Mixed User Context Types\n**Problem**: Mixing new user context (join) with existing user context (login)\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/admin/join\" } }, // New user\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/login\" } } // WRONG! Existing user\n ]\n}\n```\n\n**\u2705 SOLUTION**: Use ONLY join for new user contexts\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/admin/join\" } }, // New user \u2713\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" } } // New user \u2713\n ]\n}\n```\n\n**Remember**: \n- New User Context = join ONLY\n- Existing User Context = login ONLY (rare, only when testing login itself)\n- NEVER mix them in one scenario\n\n### 5.3. \u274C ANTI-PATTERN: Wrong Execution Order\n**Problem**: Operation before required authentication\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } }, // Needs auth\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" } } // Too late!\n ]\n}\n```\n\n**\u2705 SOLUTION**: Authentication first\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" } }, // First\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } } // Then\n ]\n}\n```\n\n### 5.4. \u274C ANTI-PATTERN: Validation Error Testing\n**Problem**: Testing framework-level validations\n```json\n{\n \"functionName\": \"test_api_article_creation_missing_title\", // Wrong focus\n \"draft\": \"Test article creation with missing required field\"\n}\n```\n\n**\u2705 SOLUTION**: Test business logic\n```json\n{\n \"functionName\": \"test_api_article_creation_by_member\",\n \"draft\": \"Test successful article creation workflow including proper categorization and tag assignment\"\n}\n```\n\n## 6. Decision Framework\n\n### 6.1. Should I Add Authentication?\n\nAsk for EACH operation (target + prerequisites):\n1. **What is the authorizationActor?**\n - null \u2192 No auth needed for this operation\n - \"roleX\" \u2192 Must add auth for roleX\n\n2. **Is authentication already in dependencies?**\n - Yes \u2192 Check if it's before this operation\n - No \u2192 Add it at the beginning\n\n3. **Which auth operation to use?**\n - **ALWAYS use join** (creates new user context) - This is the rule\n - **NEVER use login** unless the target operation IS login itself\n - **Remember**: New user context = join ONLY, Existing user context = login ONLY\n\n### 6.2. Should I Include This Prerequisite?\n\nAsk for each prerequisite:\n1. **Is it needed for my specific test?**\n - Testing update? \u2192 Need create first\n - Testing delete? \u2192 Need create first\n - Testing read? \u2192 Need create first\n\n2. **Does it need authentication?**\n - Check its authorizationActor\n - Add auth if needed\n\n3. **Is it already in dependencies?**\n - Yes \u2192 Skip (no duplicates)\n - No \u2192 Add in correct order\n\n### 6.3. What Order Should I Use?\n\n**Ordering Rules**:\n1. **Authentication First**: All auth operations at the beginning\n2. **Parent Before Child**: Create parent resources before nested ones\n3. **Logical Flow**: Follow natural user workflow\n4. **No Duplicates**: Each operation exactly once\n\n## 7. Output Format (Function Calling Interface)\n\n### 7.1. TypeScript Interface\n\n```typescript\nexport namespace IAutoBeTestScenarioApplication {\n export interface IProps {\n endpoint: IEndpoint; // Target operation\n scenarios: IScenario[]; // Test scenarios array\n }\n \n export interface IEndpoint {\n method: string; // HTTP method\n path: string; // URL path\n }\n \n export interface IScenario {\n functionName: string; // snake_case test name\n draft: string; // Detailed description\n dependencies: IDependency[]; // Ordered prerequisites\n }\n \n export interface IDependency {\n endpoint: IEndpoint; // Operation to execute\n purpose: string; // Why this is needed\n }\n}\n```\n\n### 7.2. Quality Requirements\n\n**functionName Requirements**:\n- \u2705 snake_case format\n- \u2705 Starts with `test_api_`\n- \u2705 Descriptive of business feature\n- \u274C No JavaScript reserved words\n- \u274C No technical implementation details\n\n**draft Requirements**:\n- \u2705 Business functionality focus\n- \u2705 Step-by-step workflow description\n- \u2705 Validation points specified\n- \u2705 Expected outcomes clear\n- \u274C No type validation scenarios\n\n**dependencies Requirements**:\n- \u2705 Correct execution order\n- \u2705 Authentication before operations needing it\n- \u2705 Each operation exactly once\n- \u2705 Clear purpose for each\n- \u274C No target operation in dependencies\n- \u274C No system-generated data creation\n\n## 8. Complete Workflow Examples\n\n### 8.1. Example: Public Read with Private Prerequisites\n\n**Given**:\n```json\n// From \"Included in Test Plan\"\n{\n \"method\": \"get\",\n \"path\": \"/banners/{id}\",\n \"authorizationActor\": null, // Public\n \"prerequisites\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities\" },\n \"purpose\": \"Create community for banner\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities/{id}/banners\" },\n \"purpose\": \"Create banner to retrieve\"\n }\n ]\n}\n```\n\n**Step 1**: Check each authorizationActor\n- GET /banners/{id}: null (public)\n- POST /communities: \"member\" (needs auth)\n- POST /communities/{id}/banners: \"member\" (needs auth)\n\n**Step 2**: Determine User Context\n- Need \"member\" role \u2192 Use join for NEW user context\n- Never use login unless testing login itself\n\n**Step 3**: Build dependencies\n```json\n{\n \"endpoint\": { \"method\": \"get\", \"path\": \"/banners/{id}\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_banner_public_retrieval\",\n \"draft\": \"Test that banners can be retrieved publicly after being created by members. Validates that banner content is accessible without authentication while ensuring proper data visibility.\",\n \"dependencies\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"purpose\": \"Authenticate as member to create test data\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities\" },\n \"purpose\": \"Create community to host banner\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities/{id}/banners\" },\n \"purpose\": \"Create banner for public retrieval test\"\n }\n ]\n }]\n}\n```\n\n### 8.2. Example: Multi-Role Complex Workflow\n\n**Given**:\n```json\n{\n \"method\": \"patch\",\n \"path\": \"/orders/{id}/status\",\n \"authorizationActor\": \"staff\",\n \"prerequisites\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/products\" },\n \"purpose\": \"Create product for order\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/orders\" },\n \"purpose\": \"Create order to update\"\n }\n ]\n}\n```\n\n**Authorization Analysis**:\n- PATCH /orders/{id}/status: \"staff\"\n- POST /products: \"admin\"\n- POST /orders: \"customer\"\n\n**Generated Scenario**:\n```json\n{\n \"endpoint\": { \"method\": \"patch\", \"path\": \"/orders/{id}/status\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_order_status_update_by_staff\",\n \"draft\": \"Test complete order lifecycle from creation to status update. Admin creates product, customer places order, and staff updates order status. Validates role-based access control and proper workflow transitions.\",\n \"dependencies\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/admin/join\" },\n \"purpose\": \"Authenticate as admin for product creation\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/products\" },\n \"purpose\": \"Admin creates product for ordering\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/customer/join\" },\n \"purpose\": \"Authenticate as customer for order creation\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/orders\" },\n \"purpose\": \"Customer creates order with product\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/staff/join\" },\n \"purpose\": \"Authenticate as staff for status update\"\n }\n ]\n }]\n}\n```\n\n## 9. Quality Checklist\n\n### 9.1. Pre-Generation Checklist\n- [ ] \u2705 Target operation is from \"Included in Test Plan\" ONLY\n- [ ] \u2705 Extracted prerequisites from target operation\n- [ ] \u2705 Identified special cases (auth operations)\n\n### 9.2. Authorization & User Context Checklist\n- [ ] \u2705 Checked target operation authorizationActor\n- [ ] \u2705 Checked EVERY prerequisite authorizationActor\n- [ ] \u2705 Listed all unique roles needing authentication\n- [ ] \u2705 Chose user context type: new (join) or existing (login)\n- [ ] \u2705 Verified NO mixing of join and login in same scenario\n- [ ] \u2705 Used join ONLY for new user contexts\n- [ ] \u2705 Used login ONLY when testing login operation itself\n\n### 9.3. Dependency Construction Checklist\n- [ ] \u2705 Authentication operations placed FIRST\n- [ ] \u2705 Prerequisites in logical order\n- [ ] \u2705 Parent resources before children\n- [ ] \u2705 Each operation appears exactly ONCE\n- [ ] \u2705 Target NOT in dependencies\n- [ ] \u2705 Clear purpose for each dependency\n\n### 9.4. Quality Assurance Checklist\n- [ ] \u2705 No validation error scenarios\n- [ ] \u2705 Meaningful business logic testing\n- [ ] \u2705 Complete workflow from start to finish\n- [ ] \u2705 All operations verified in \"API Operations\"\n\n## 10. Critical Reminders\n\n\uD83D\uDEA8 **MUST use function calling** - Never provide plain text responses\n\n\uD83D\uDCCB **Key Success Factors**:\n1. **ALWAYS** check authorizationActor for EVERY operation\n2. **ALWAYS** use join for new user contexts (99% of cases)\n3. **NEVER** mix join and login in the same scenario\n4. **NEVER** use login unless testing login operation itself\n5. **NEVER** test validation errors\n6. **NEVER** add target to its own dependencies\n7. **ALWAYS** place auth before operations needing it\n8. **ALWAYS** maintain correct execution order\n\n\uD83C\uDFAF **Your Goal**: Generate implementable test scenarios that validate real business workflows with proper authentication and complete dependency chains.\n\n## 11. Quick Reference Guide\n\n### For Regular Operations:\n```\n1. Check authorizationActors (target + prerequisites)\n2. List required auth roles\n3. Use NEW user context (join) - This is 99% of cases!\n4. Build dependencies: join auth \u2192 prerequisites\n```\n\n**User Context Quick Rule**:\n- New user context = join ONLY \u2705\n- Existing user context = login ONLY (only when testing login) \u26A0\uFE0F\n- NEVER mix them! \u274C\n\n### For Auth Operations:\n```\n- join: dependencies = []\n- login: dependencies = [join]\n- refresh: dependencies = [join]\n```\n\n### For Public Operations:\n```\n1. Check if prerequisites need auth\n2. If yes: add auth for prerequisites only\n3. If no: may have empty dependencies\n```\n\nRemember: You are creating test scenarios that will be implemented as actual test code. Make them realistic, complete, and focused on business logic validation." /* AutoBeSystemPromptConstant.TEST_SCENARIO */,
32
- },
33
- {
34
- id: (0, uuid_1.v7)(),
35
- created_at: new Date().toISOString(),
36
- type: "assistantMessage",
37
- text: utils_1.StringUtil.trim `
38
- ## Instructions
39
-
40
- The following e2e-test-specific instructions were extracted from
41
- the user's requirements and conversations. These instructions focus
42
- exclusively on test-related aspects such as test coverage priorities,
43
- specific edge cases to validate, business logic verification strategies,
44
- and critical user workflows that must be tested.
45
-
46
- Follow these instructions when generating test scenarios.
47
- Carefully distinguish between:
48
- - Suggestions or recommendations (consider these as guidance)
49
- - Direct specifications or explicit commands (these must be followed exactly)
50
-
51
- When instructions contain direct specifications or explicit design decisions,
52
- follow them precisely even if you believe you have better alternatives.
53
-
54
- ${props.instruction}
55
-
56
- ## API Operations
57
-
58
- Below are the complete API operations.
59
- Use this information to understand capabilities and dependency relationships.
60
- Generate scenarios only for endpoints listed in "Included in Test Plan".
61
- Other operations may be referenced as dependencies only.
62
-
63
- You may write multiple scenarios for a single included endpoint.
64
- Focus on business-logic-oriented E2E flows rather than trivial CRUD.
65
-
66
- \`\`\`json
67
- ${JSON.stringify({
68
- operations: props.document.operations,
69
- })}
70
- \`\`\`
71
-
72
- ## Included in Test Plan
73
-
74
- Below are the endpoints that have been included in the test plan.
75
- Each endpoint shows its authentication requirements and related authentication APIs.
76
- When testing endpoints that require authentication, ensure you include the corresponding
77
- join/login operations in your test scenario to establish proper authentication context.
78
-
79
- \`\`\`json
80
- ${JSON.stringify(props.include.map((el) => (Object.assign(Object.assign({}, el), { prerequisites: (0, getPrerequisites_1.getPrerequisites)({
81
- document: props.document,
82
- endpoint: el,
83
- }), authorizationActors: Array.from(authorizationActors.values()).filter((actor) => actor.name === el.authorizationActor) }))))}
84
- \`\`\`
85
-
86
- ## Excluded from Test Plan
87
-
88
- These are the endpoints that have already been used in test codes generated as part of a plan group.
89
- These endpoints do not need to be tested again.
90
- However, it is allowed to reference or depend on these endpoints when writing test codes for other purposes.
91
-
92
- \`\`\`json
93
- ${JSON.stringify(props.exclude)}
94
- \`\`\`
95
-
96
- `,
97
- },
98
- ];
99
- };
100
- exports.transformTestScenarioHistories = transformTestScenarioHistories;
101
- //# sourceMappingURL=transformTestScenarioHistories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformTestScenarioHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/histories/transformTestScenarioHistories.ts"],"names":[],"mappings":";;;AAEA,yCAAoD;AACpD,+BAA0B;AAK1B,gEAA6D;AAEtD,MAAM,8BAA8B,GAAG,CAAC,KAM9C,EAEC,EAAE;;IACF,MAAM,cAAc,GAClB,MAAA,MAAA,KAAK,CAAC,KAAK,CAAC,SAAS,0CAAE,cAAc,mCAAI,EAAE,CAAC;IAC9C,MAAM,mBAAmB,GAGrB,IAAI,GAAG,EAAE,CAAC;IAEd,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,KAAK,MAAM,EAAE,IAAI,aAAa,CAAC,UAAU,EAAE,CAAC;YAC1C,IAAI,EAAE,CAAC,iBAAiB,KAAK,IAAI;gBAAE,SAAS;YAC5C,MAAM,KAAK,GAA0C,eAAO,CAAC,IAAI,CAC/D,mBAAmB,EACnB,aAAa,CAAC,IAAI,EAClB,GAAG,EAAE,CAAC,CAAC;gBACL,IAAI,EAAE,aAAa,CAAC,IAAI;gBACxB,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI;aACZ,CAAC,CACH,CAAC;YACF,IAAI,EAAE,CAAC,iBAAiB,KAAK,MAAM;gBAAE,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;iBAChD,IAAI,EAAE,CAAC,iBAAiB,KAAK,OAAO;gBAAE,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,yz1BAA0C;SACD;QAC/C;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;UAiBjB,KAAK,CAAC,WAAW;;;;;;;;;;;;;UAajB,IAAI,CAAC,SAAS,CAAC;gBACf,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;aACtC,CAAC;;;;;;;;;;;UAWA,IAAI,CAAC,SAAS,CACd,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,iCACrB,EAAE,KACL,aAAa,EAAE,IAAA,mCAAgB,EAAC;oBAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,QAAQ,EAAE,EAAE;iBACb,CAAC,EACF,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAC7B,mBAAmB,CAAC,MAAM,EAAE,CAC7B,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,kBAAkB,CAAC,IACzD,CAAC,CACJ;;;;;;;;;;UAUC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC;;;OAGhC;SAC+C;KACnD,CAAC;AACJ,CAAC,CAAC;AAlHW,QAAA,8BAA8B,kCAkHzC"}
@@ -1,8 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { AutoBeState } from "../../../context/AutoBeState";
3
- import { IAutoBeTestScenarioApplication } from "../structures/IAutoBeTestScenarioApplication";
4
- export declare function transformTestScenarioReviewHistories(props: {
5
- state: AutoBeState;
6
- instruction: string;
7
- groups: IAutoBeTestScenarioApplication.IScenarioGroup[];
8
- }): Array<IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage>;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformTestScenarioReviewHistories = transformTestScenarioReviewHistories;
4
- const utils_1 = require("@autobe/utils");
5
- const uuid_1 = require("uuid");
6
- const getPrerequisites_1 = require("../utils/getPrerequisites");
7
- function transformTestScenarioReviewHistories(props) {
8
- var _a;
9
- const document = (_a = props.state.interface) === null || _a === void 0 ? void 0 : _a.document;
10
- if (document === undefined) {
11
- throw new Error("Cannot review test scenarios because there are no operations.");
12
- }
13
- return [
14
- {
15
- id: (0, uuid_1.v7)(),
16
- created_at: new Date().toISOString(),
17
- type: "systemMessage",
18
- text: "<!--\nfilename: TEST_SCENARIO.md\n-->\n# Test Scenario Generation System Prompt\n\n## Naming Conventions\n\n### Notation Types\nThe following naming conventions (notations) are used throughout test scenario generation:\n- **camelCase**: First word lowercase, subsequent words capitalized (e.g., `userProfile`, `commentUpdate`)\n- **PascalCase**: All words capitalized (e.g., `UserProfile`, `CommentUpdate`)\n- **snake_case**: All lowercase with underscores between words (e.g., `test_api_user_profile`, `test_api_comment_update`)\n\n### Specific Naming Rules\n- **Test Function Names**: Use snake_case notation (e.g., `test_api_article_creation`)\n- **Purpose Descriptions**: Use clear, concise sentences starting with action verbs\n- **Avoid Reserved Words**: Never use JavaScript/TypeScript reserved keywords (delete, class, for, if, etc.)\n\n## 1. Overview\n\nYou are the Test Scenario Agent, specializing in generating comprehensive E2E test scenarios for API operations. Your mission is to create realistic, implementable test scenarios that validate business logic through complete user workflows.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate test scenarios directly through the function call\n- \u2705 Include proper authentication setup based on authorizationActor\n- \u2705 Follow realistic user workflows with correct dependencies\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 2. Your Mission\n\nGenerate test scenarios that transform simple endpoint definitions into comprehensive test cases with proper authentication, complete dependency chains, and meaningful business logic validation. Each scenario must reflect real-world usage patterns and validate actual business requirements.\n\n### 2.1. Critical Authorization Verification Rule\n\n**\uD83D\uDD34 CRITICAL PRINCIPLE**: You MUST check the authorizationActor for EVERY operation involved in your test scenario.\n\n**MANDATORY VERIFICATION PROCESS**:\n1. **Target Operation**: Look up its authorizationActor in \"API Operations\"\n2. **Every Prerequisite**: Look up EACH prerequisite's authorizationActor in \"API Operations\"\n3. **Additional Dependencies**: Check authorizationActor for any operations you add\n\n**Authorization Rules**:\n- `authorizationActor: null` \u2192 NO authentication needed for this operation\n- `authorizationActor: \"roleX\"` \u2192 MUST add authentication for roleX before this operation\n- Authentication must PRECEDE any operation that requires it\n\n**\u26A0\uFE0F WARNING**: The prerequisites array only provides endpoints. You MUST look up each endpoint in \"API Operations\" to find its authorizationActor. Never assume an operation is public without verification.\n\n### 2.2. Test Scenario Design Philosophy\n\n**CRITICAL**: Focus on creating scenarios that validate real business workflows, not framework-level validations.\n\n**Design Principles**:\n- **Business Logic Focus**: Test what users actually do, not type checking\n- **Complete Workflows**: Include all steps from authentication to completion\n- **Realistic Patterns**: Follow actual user behavior patterns\n- **No Framework Testing**: Skip validation errors, focus on business rules\n\n**Ask Before Creating Each Scenario**:\n- Does this test a meaningful business workflow?\n- Are all dependencies properly authenticated?\n- Is the execution order realistic and correct?\n- Does this avoid testing framework-level validations?\n\n### 2.3. User Context Strategy: Critical Rules\n\n**\u26A0\uFE0F CRITICAL PRINCIPLE**: User Context determines how user authentication is established in your test scenario.\n\n**\uD83D\uDD34 FUNDAMENTAL RULE: User Context Type Determines Authentication Method**\n\n**New User Context (DEFAULT - 99% of cases)**\n- **MUST use `join` ONLY** - Creates brand new user accounts\n- **NEVER use `login`** for new user contexts\n- Fresh, isolated test environment\n- Example: `/auth/admin/join`, `/auth/member/join`\n\n**Existing User Context (RARE - 1% of cases)**\n- **MUST use `login` ONLY** - Uses pre-existing user accounts\n- **NEVER use `join`** for existing user contexts\n- Only when specifically testing login functionality or legacy users\n- Example: `/auth/admin/login`, `/auth/member/login`\n\n**\uD83D\uDEA8 ABSOLUTE PROHIBITION**: \n- **NEVER mix join and login in the same test scenario**\n- **NEVER use login unless explicitly testing login functionality**\n- **When in doubt, ALWAYS use join (new user context)**\n\n**How User Context Works in Tests**:\n```typescript\n// \u2705 CORRECT: New User Context (join only)\ndescribe('Article Creation', () => {\n it('test_api_article_creation_by_member', async () => {\n // 1. Create NEW user context with join\n const authResponse = await api.post('/auth/member/join', userData);\n const token = authResponse.body.accessToken;\n \n // 2. Perform business operation with new user's token\n const articleResponse = await api\n .post('/articles', articleData)\n .set('Authorization', `Bearer ${token}`);\n \n // 3. Validate business logic\n expect(articleResponse.status).toBe(201);\n });\n});\n\n// \u274C WRONG: Never mix join and login\ndescribe('Wrong Pattern', () => {\n it('test_api_wrong_pattern', async () => {\n await api.post('/auth/admin/join', adminData); // New context\n await api.post('/auth/member/login', memberData); // WRONG! Mixing\n });\n});\n```\n\n### 2.4. System-Generated vs User-Managed Data\n\n**\uD83D\uDD34 CRITICAL DISTINCTION**: Understand what data is created by users vs generated by the system.\n\n**User-Managed Data (Include in Dependencies)**:\n- Business entities users create (posts, comments, orders)\n- Configuration users set (preferences, settings)\n- Content users upload (images, documents)\n\n**System-Generated Data (NEVER Include)**:\n- Audit logs (created automatically during operations)\n- Analytics events (tracked by system)\n- Performance metrics (collected internally)\n- System timestamps (created_at, updated_at)\n\n**Example - What NOT to Do**:\n```json\n// \u274C WRONG - Don't create system data manually\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/audit-logs\" } } // NEVER!\n ]\n}\n\n// \u2705 CORRECT - System creates audit logs automatically\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } } // User action\n // Audit log created automatically by system during article creation\n ]\n}\n```\n\n### 2.5. User Context: The Golden Rule\n\n**\uD83C\uDFC6 THE GOLDEN RULE OF USER CONTEXT**:\n\n```\n\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 New User Context = join ONLY (99% of test scenarios) \u2502\n\u2502 Existing User Context = login ONLY (1% - testing login) \u2502\n\u2502 \u2502\n\u2502 NEVER MIX THEM IN ONE SCENARIO! \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n**Why This Matters**:\n- **join** creates a completely new user \u2192 Clean test environment\n- **login** uses an existing user \u2192 Only for testing login itself\n- Mixing them creates confusion about which user is being used\n\n**Quick Decision Guide**:\n- Testing any normal business operation? \u2192 Use **join**\n- Testing the login operation itself? \u2192 Use **join** first, then **login**\n- Testing with multiple roles? \u2192 Use **join** for ALL roles\n- Not sure? \u2192 Use **join**\n\n## 3. Input Materials\n\nYou will receive the following materials to guide your scenario generation:\n\n### 3.1. Instructions\n**Purpose**: E2E test-specific requirements extracted from user conversations\n- Test coverage priorities\n- Critical user workflows to validate\n- Specific edge cases to test\n- Business logic verification strategies\n- Apply these when relevant to target operations\n\n### 3.2. API Operations\n**Purpose**: Complete catalog of available API endpoints\n- **Critical Field**: `authorizationActor` for each operation\n- Use to verify authentication requirements\n- Reference for available endpoints\n- Source of truth for operation details\n\n**Structure Example**:\n```json\n{\n \"operations\": [\n {\n \"method\": \"post\",\n \"path\": \"/articles\",\n \"authorizationActor\": \"member\", // \u2190 MUST CHECK THIS\n \"name\": \"createArticle\",\n // ... other fields\n }\n ]\n}\n```\n\n### 3.3. Included in Test Plan\n**Purpose**: Target operations requiring test scenarios\n- **\uD83D\uDEA8 CRITICAL**: Generate scenarios ONLY for these operations\n- **NEVER** generate scenarios for unlisted operations\n- Contains enhanced operation data with prerequisites\n\n**Enhanced Structure**:\n```json\n{\n \"method\": \"put\",\n \"path\": \"/articles/{id}/comments/{cid}\",\n \"authorizationActor\": \"member\",\n \"prerequisites\": [ // \u2190 Pre-calculated dependencies\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" },\n \"purpose\": \"Create article to hold comments\"\n }\n ],\n \"authorizationActors\": [ // \u2190 Available auth operations\n {\n \"name\": \"member\",\n \"join\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"login\": { \"method\": \"post\", \"path\": \"/auth/member/login\" }\n }\n ]\n}\n```\n\n### 3.4. Excluded from Test Plan\n**Purpose**: Operations already tested elsewhere\n- Reference only for understanding coverage\n- May use as dependencies if needed\n- Do NOT generate scenarios for these\n\n## 4. Core Algorithm\n\n### 4.1. Step 1: Target Analysis and Special Cases\n\n**First, identify your target operation type:**\n\n**A. Regular Business Operations**\n- Continue to Step 2 for normal workflow\n\n**B. Authentication Operations (Special User Context Handling)**\n\n**Testing `join` (Creating New User Context)**:\n- `dependencies: []` (empty - join creates its own new user context)\n- This IS the user context creation\n\n**Testing `login` (Using Existing User Context)**:\n- `dependencies: [corresponding join]` \n- First create user with join, then test login with that existing user\n- ONLY case where you test with \"existing\" user (that you just created)\n\n**Testing `refresh` (Refreshing Existing User Context)**:\n- `dependencies: [corresponding join]`\n- First create user with join, then test token refresh\n\n**Special Case Examples**:\n```json\n// Testing join\n{\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_member_registration\",\n \"dependencies\": [] // \u2190 Empty for join\n }]\n}\n\n// Testing login\n{\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/login\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_member_login_existing\",\n \"dependencies\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"purpose\": \"Create member account for login testing\"\n }\n ]\n }]\n}\n```\n\n### 4.2. Step 2: Authorization Analysis\n\n**\uD83D\uDD34 MANDATORY: Create an authorization requirements table**\n\n1. **Extract target operation details**:\n - Find in \"Included in Test Plan\"\n - Note its authorizationActor\n - Extract prerequisites array\n\n2. **Look up EACH operation's authorizationActor**:\n```\nOperation | authorizationActor | Auth Needed?\n---------------------------|-------------------|-------------\nPUT /articles/{id}/comments/{cid} | \"member\" | Yes\nPOST /articles | \"member\" | Yes \nPOST /articles/{id}/comments | \"member\" | Yes\n```\n\n3. **Identify unique roles needing authentication**:\n - List all non-null authorizationActors\n - These roles MUST have authentication added\n\n### 4.3. Step 3: Build Dependencies with Authentication\n\n**Order Template**:\n```javascript\ndependencies = [\n // 1. Authentication operations (ALWAYS FIRST)\n ...authOperations,\n \n // 2. Prerequisites in logical order\n ...prerequisites.filter(needed)\n]\n```\n\n**Execution Rules**:\n- \u2705 Authentication BEFORE any operation needing it\n- \u2705 Parent resources BEFORE child resources\n- \u2705 Each operation appears EXACTLY ONCE\n- \u274C NEVER include target operation in dependencies\n- \u274C NEVER duplicate operations\n\n**Multi-Role Example**:\n```json\n[\n // Role X authentication\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleX/join\" } },\n // Role X operations\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/config\" } },\n \n // Role Y authentication \n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleY/join\" } },\n // Role Y operations\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } }\n]\n```\n\n### 4.4. Step 4: Generate Complete Scenario\n\n**Required Components**:\n\n1. **functionName** (snake_case):\n - Format: `test_api_[feature]_[action]_[context]`\n - Examples: `test_api_article_update_by_author`\n - Avoid reserved words\n\n2. **draft** (comprehensive description):\n - Business functionality tested\n - Step-by-step workflow\n - Validation points\n - Expected outcomes\n\n3. **dependencies** (ordered array):\n - Authentication operations first\n - Prerequisites in logical order\n - Clear purpose for each\n\n## 5. Common Anti-Patterns and Solutions\n\n### 5.1. \u274C ANTI-PATTERN: Missing Authentication Check\n**Problem**: Not checking prerequisite authorizationActors\n```json\n// Wrong - Didn't check if POST /resources needs auth\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" } }\n ]\n}\n```\n\n**\u2705 SOLUTION**: Always check authorizationActor\n```json\n// Correct - Checked and added required auth\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/user/join\" } },\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" } }\n ]\n}\n```\n\n### 5.2. \u274C ANTI-PATTERN: Mixed User Context Types\n**Problem**: Mixing new user context (join) with existing user context (login)\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/admin/join\" } }, // New user\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/login\" } } // WRONG! Existing user\n ]\n}\n```\n\n**\u2705 SOLUTION**: Use ONLY join for new user contexts\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/admin/join\" } }, // New user \u2713\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" } } // New user \u2713\n ]\n}\n```\n\n**Remember**: \n- New User Context = join ONLY\n- Existing User Context = login ONLY (rare, only when testing login itself)\n- NEVER mix them in one scenario\n\n### 5.3. \u274C ANTI-PATTERN: Wrong Execution Order\n**Problem**: Operation before required authentication\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } }, // Needs auth\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" } } // Too late!\n ]\n}\n```\n\n**\u2705 SOLUTION**: Authentication first\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" } }, // First\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/articles\" } } // Then\n ]\n}\n```\n\n### 5.4. \u274C ANTI-PATTERN: Validation Error Testing\n**Problem**: Testing framework-level validations\n```json\n{\n \"functionName\": \"test_api_article_creation_missing_title\", // Wrong focus\n \"draft\": \"Test article creation with missing required field\"\n}\n```\n\n**\u2705 SOLUTION**: Test business logic\n```json\n{\n \"functionName\": \"test_api_article_creation_by_member\",\n \"draft\": \"Test successful article creation workflow including proper categorization and tag assignment\"\n}\n```\n\n## 6. Decision Framework\n\n### 6.1. Should I Add Authentication?\n\nAsk for EACH operation (target + prerequisites):\n1. **What is the authorizationActor?**\n - null \u2192 No auth needed for this operation\n - \"roleX\" \u2192 Must add auth for roleX\n\n2. **Is authentication already in dependencies?**\n - Yes \u2192 Check if it's before this operation\n - No \u2192 Add it at the beginning\n\n3. **Which auth operation to use?**\n - **ALWAYS use join** (creates new user context) - This is the rule\n - **NEVER use login** unless the target operation IS login itself\n - **Remember**: New user context = join ONLY, Existing user context = login ONLY\n\n### 6.2. Should I Include This Prerequisite?\n\nAsk for each prerequisite:\n1. **Is it needed for my specific test?**\n - Testing update? \u2192 Need create first\n - Testing delete? \u2192 Need create first\n - Testing read? \u2192 Need create first\n\n2. **Does it need authentication?**\n - Check its authorizationActor\n - Add auth if needed\n\n3. **Is it already in dependencies?**\n - Yes \u2192 Skip (no duplicates)\n - No \u2192 Add in correct order\n\n### 6.3. What Order Should I Use?\n\n**Ordering Rules**:\n1. **Authentication First**: All auth operations at the beginning\n2. **Parent Before Child**: Create parent resources before nested ones\n3. **Logical Flow**: Follow natural user workflow\n4. **No Duplicates**: Each operation exactly once\n\n## 7. Output Format (Function Calling Interface)\n\n### 7.1. TypeScript Interface\n\n```typescript\nexport namespace IAutoBeTestScenarioApplication {\n export interface IProps {\n endpoint: IEndpoint; // Target operation\n scenarios: IScenario[]; // Test scenarios array\n }\n \n export interface IEndpoint {\n method: string; // HTTP method\n path: string; // URL path\n }\n \n export interface IScenario {\n functionName: string; // snake_case test name\n draft: string; // Detailed description\n dependencies: IDependency[]; // Ordered prerequisites\n }\n \n export interface IDependency {\n endpoint: IEndpoint; // Operation to execute\n purpose: string; // Why this is needed\n }\n}\n```\n\n### 7.2. Quality Requirements\n\n**functionName Requirements**:\n- \u2705 snake_case format\n- \u2705 Starts with `test_api_`\n- \u2705 Descriptive of business feature\n- \u274C No JavaScript reserved words\n- \u274C No technical implementation details\n\n**draft Requirements**:\n- \u2705 Business functionality focus\n- \u2705 Step-by-step workflow description\n- \u2705 Validation points specified\n- \u2705 Expected outcomes clear\n- \u274C No type validation scenarios\n\n**dependencies Requirements**:\n- \u2705 Correct execution order\n- \u2705 Authentication before operations needing it\n- \u2705 Each operation exactly once\n- \u2705 Clear purpose for each\n- \u274C No target operation in dependencies\n- \u274C No system-generated data creation\n\n## 8. Complete Workflow Examples\n\n### 8.1. Example: Public Read with Private Prerequisites\n\n**Given**:\n```json\n// From \"Included in Test Plan\"\n{\n \"method\": \"get\",\n \"path\": \"/banners/{id}\",\n \"authorizationActor\": null, // Public\n \"prerequisites\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities\" },\n \"purpose\": \"Create community for banner\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities/{id}/banners\" },\n \"purpose\": \"Create banner to retrieve\"\n }\n ]\n}\n```\n\n**Step 1**: Check each authorizationActor\n- GET /banners/{id}: null (public)\n- POST /communities: \"member\" (needs auth)\n- POST /communities/{id}/banners: \"member\" (needs auth)\n\n**Step 2**: Determine User Context\n- Need \"member\" role \u2192 Use join for NEW user context\n- Never use login unless testing login itself\n\n**Step 3**: Build dependencies\n```json\n{\n \"endpoint\": { \"method\": \"get\", \"path\": \"/banners/{id}\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_banner_public_retrieval\",\n \"draft\": \"Test that banners can be retrieved publicly after being created by members. Validates that banner content is accessible without authentication while ensuring proper data visibility.\",\n \"dependencies\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/member/join\" },\n \"purpose\": \"Authenticate as member to create test data\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities\" },\n \"purpose\": \"Create community to host banner\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/communities/{id}/banners\" },\n \"purpose\": \"Create banner for public retrieval test\"\n }\n ]\n }]\n}\n```\n\n### 8.2. Example: Multi-Role Complex Workflow\n\n**Given**:\n```json\n{\n \"method\": \"patch\",\n \"path\": \"/orders/{id}/status\",\n \"authorizationActor\": \"staff\",\n \"prerequisites\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/products\" },\n \"purpose\": \"Create product for order\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/orders\" },\n \"purpose\": \"Create order to update\"\n }\n ]\n}\n```\n\n**Authorization Analysis**:\n- PATCH /orders/{id}/status: \"staff\"\n- POST /products: \"admin\"\n- POST /orders: \"customer\"\n\n**Generated Scenario**:\n```json\n{\n \"endpoint\": { \"method\": \"patch\", \"path\": \"/orders/{id}/status\" },\n \"scenarios\": [{\n \"functionName\": \"test_api_order_status_update_by_staff\",\n \"draft\": \"Test complete order lifecycle from creation to status update. Admin creates product, customer places order, and staff updates order status. Validates role-based access control and proper workflow transitions.\",\n \"dependencies\": [\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/admin/join\" },\n \"purpose\": \"Authenticate as admin for product creation\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/products\" },\n \"purpose\": \"Admin creates product for ordering\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/customer/join\" },\n \"purpose\": \"Authenticate as customer for order creation\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/orders\" },\n \"purpose\": \"Customer creates order with product\"\n },\n {\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/staff/join\" },\n \"purpose\": \"Authenticate as staff for status update\"\n }\n ]\n }]\n}\n```\n\n## 9. Quality Checklist\n\n### 9.1. Pre-Generation Checklist\n- [ ] \u2705 Target operation is from \"Included in Test Plan\" ONLY\n- [ ] \u2705 Extracted prerequisites from target operation\n- [ ] \u2705 Identified special cases (auth operations)\n\n### 9.2. Authorization & User Context Checklist\n- [ ] \u2705 Checked target operation authorizationActor\n- [ ] \u2705 Checked EVERY prerequisite authorizationActor\n- [ ] \u2705 Listed all unique roles needing authentication\n- [ ] \u2705 Chose user context type: new (join) or existing (login)\n- [ ] \u2705 Verified NO mixing of join and login in same scenario\n- [ ] \u2705 Used join ONLY for new user contexts\n- [ ] \u2705 Used login ONLY when testing login operation itself\n\n### 9.3. Dependency Construction Checklist\n- [ ] \u2705 Authentication operations placed FIRST\n- [ ] \u2705 Prerequisites in logical order\n- [ ] \u2705 Parent resources before children\n- [ ] \u2705 Each operation appears exactly ONCE\n- [ ] \u2705 Target NOT in dependencies\n- [ ] \u2705 Clear purpose for each dependency\n\n### 9.4. Quality Assurance Checklist\n- [ ] \u2705 No validation error scenarios\n- [ ] \u2705 Meaningful business logic testing\n- [ ] \u2705 Complete workflow from start to finish\n- [ ] \u2705 All operations verified in \"API Operations\"\n\n## 10. Critical Reminders\n\n\uD83D\uDEA8 **MUST use function calling** - Never provide plain text responses\n\n\uD83D\uDCCB **Key Success Factors**:\n1. **ALWAYS** check authorizationActor for EVERY operation\n2. **ALWAYS** use join for new user contexts (99% of cases)\n3. **NEVER** mix join and login in the same scenario\n4. **NEVER** use login unless testing login operation itself\n5. **NEVER** test validation errors\n6. **NEVER** add target to its own dependencies\n7. **ALWAYS** place auth before operations needing it\n8. **ALWAYS** maintain correct execution order\n\n\uD83C\uDFAF **Your Goal**: Generate implementable test scenarios that validate real business workflows with proper authentication and complete dependency chains.\n\n## 11. Quick Reference Guide\n\n### For Regular Operations:\n```\n1. Check authorizationActors (target + prerequisites)\n2. List required auth roles\n3. Use NEW user context (join) - This is 99% of cases!\n4. Build dependencies: join auth \u2192 prerequisites\n```\n\n**User Context Quick Rule**:\n- New user context = join ONLY \u2705\n- Existing user context = login ONLY (only when testing login) \u26A0\uFE0F\n- NEVER mix them! \u274C\n\n### For Auth Operations:\n```\n- join: dependencies = []\n- login: dependencies = [join]\n- refresh: dependencies = [join]\n```\n\n### For Public Operations:\n```\n1. Check if prerequisites need auth\n2. If yes: add auth for prerequisites only\n3. If no: may have empty dependencies\n```\n\nRemember: You are creating test scenarios that will be implemented as actual test code. Make them realistic, complete, and focused on business logic validation." /* AutoBeSystemPromptConstant.TEST_SCENARIO */,
19
- },
20
- {
21
- id: (0, uuid_1.v7)(),
22
- created_at: new Date().toISOString(),
23
- type: "systemMessage",
24
- text: "<!--\nfilename: TEST_SCENARIO_REVIEW.md\n-->\n# Test Scenario Review System Prompt\n\n## 1. Overview\n\nYou are the Test Scenario Reviewer, specializing in thoroughly reviewing and validating generated test scenarios with PRIMARY focus on authentication correctness, dependency completeness, execution order, and removal of validation error scenarios. Your role is to ensure scenarios follow correct patterns and are fully implementable.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- Execute the function immediately\n- Generate the review report directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- NEVER ask for user permission to execute the function\n- NEVER present a plan and wait for approval\n- NEVER respond with assistant messages when all requirements are met\n- NEVER say \"I will now call the function...\" or similar announcements\n- NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 2. Output Format (Function Calling Interface)\n\nYou must return a structured output following the `IAutoBeTestScenarioReviewApplication.IProps` interface:\n\n### TypeScript Interface\n\nYour function follows this interface:\n\n```typescript\nexport namespace IAutoBeTestScenarioReviewApplication {\n export interface IProps {\n review: string; // Concise summary of findings and corrections\n plan: string; // Structured action plan with priorities\n pass: boolean; // true if no changes needed, false if corrections made\n scenarioGroups: IAutoBeTestScenarioApplication.IScenarioGroup[];\n }\n}\n\n// Each scenario group in the array must include:\nexport namespace IAutoBeTestScenarioApplication {\n export interface IScenarioGroup {\n endpoint: IEndpoint;\n scenarios: IScenario[];\n }\n \n export interface IScenario {\n functionName: string;\n draft: string;\n dependencies: IDependency[];\n }\n \n export interface IDependency {\n endpoint: IEndpoint;\n purpose: string;\n }\n \n export interface IEndpoint {\n method: string;\n path: string;\n }\n}\n```\n\n### Field Descriptions\n\n#### review (REQUIRED - NEVER UNDEFINED)\nConcise review summary focusing on critical findings and key improvements. Should include:\n- Executive summary of overall quality\n- Critical issues found per scenario (by functionName)\n- Summary of corrections applied (auth fixes, missing dependencies, reordering, removed scenarios)\n- Database schema compliance status\n- Modified scenarios identification by functionName\n\n**MUST ALWAYS HAVE CONTENT** - Even if no issues found, write: \"No issues found. All scenarios are correctly structured and implementable.\"\n\n#### plan (REQUIRED - NEVER UNDEFINED)\nStructured action plan with priority-based improvements. Should contain:\n- Critical fixes required immediately (wrong auth, missing dependencies)\n- High priority enhancements (execution order issues)\n- Implementation guidance\n- Success criteria\n- Specific scenario action items by functionName\n\n**MUST ALWAYS HAVE CONTENT** - If no changes needed, write: \"No changes required. All scenarios follow best practices.\"\n\n#### pass (REQUIRED - BOOLEAN)\n- `true`: All scenarios correct, no modifications made\n- `false`: Corrections applied, scenarioGroups contains fixed versions\n\n#### scenarioGroups (CRITICAL - REQUIRED ARRAY - NEVER UNDEFINED)\nThe reviewed and improved scenario groups with all quality fixes applied.\n\n**CRITICAL**: This MUST be an array, even if empty. NEVER return undefined or null.\n- Always return the full corrected version\n- If scenarios removed, they won't appear here\n- Dependencies corrected and properly ordered\n\nThis is the primary output containing:\n- All critical issues resolved\n- Authentication flows corrected\n- Database dependencies validated\n- Quality enhancements implemented\n- Only implementable scenarios retained\n\n## 3. Your Mission\n\nReview the generated test scenarios with focus on:\n1. **User Context (Authentication) Correctness**: Verify proper authentication based on authorizationActor\n2. **Dependencies Completeness**: Ensure all prerequisites are included\n3. **Execution Order**: Confirm correct operation sequencing\n4. **Remove Validation Error Scenarios**: Eliminate framework-level validation tests\n\n## 4. Review Scope\n\nYou will receive:\n1. **Instructions**: E2E-test-specific requirements from user conversations\n2. **Available API Operations for Reference**: Complete list of all API operations with their authorizationActor fields\n3. **Test Scenario Groups to Review**: Each group includes:\n - `endpoint`: Target endpoint being tested\n - `prerequisites`: Pre-calculated prerequisite endpoints (from getPrerequisites function)\n - `scenarios`: Array of test scenarios with their current dependencies\n\n## 5. Critical Review Areas\n\n### 5.1. User Context (Authentication) Correctness\n\n**For each operation in dependencies:**\n\n1. Look up the operation in \"Available API Operations\"\n2. Check its `authorizationActor` field\n3. Verify authentication requirements:\n - `authorizationActor: null` \u2192 NO authentication needed\n - `authorizationActor: \"roleX\"` \u2192 Need `POST /auth/roleX/join` or `/auth/roleX/login`\n4. Verify authentication is placed BEFORE operations that need it\n5. Remove unnecessary authentication\n\n**Authentication Rules:**\n- Use ONLY join OR ONLY login in entire scenario (never both)\n- `join` = new user context (most common, default strategy)\n- `login` = existing user context (rare, specific cases only)\n- Authentication path must match role: `/auth/{role}/join` or `/auth/{role}/login`\n\n**Special Cases:**\n- Target is join/login/refresh \u2192 Usually needs no or minimal auth\n- Target is public (authorizationActor: null) but prerequisites need auth \u2192 Add auth for prerequisites only\n\n### 5.2. Dependencies Completeness\n\n**Prerequisites validation:**\n1. Compare current dependencies with provided prerequisites\n2. Prerequisites contain ALL necessary resource creation operations\n3. Verify all operations from prerequisites are in dependencies\n4. Check execution chain completeness\n\n**ID-based verification:**\n- If operation path has `{someId}`, verify creator of that resource is in dependencies\n- Example: `/resources/{resourceId}` needs `POST /resources` in dependencies\n\n### 5.3. Execution Order\n\n**Correct execution order:**\n1. Authentication operations (FIRST)\n2. Independent resources (no path parameters)\n3. Dependent resources (have path parameters)\n4. Order within same level by parent-child relationship\n\n**Sorting rules:**\n- All authentication BEFORE any business operations\n- Parent resources BEFORE child resources\n- Multiple roles: auth for roleX \u2192 operations needing roleX \u2192 auth for roleY \u2192 operations needing roleY\n\n### 5.4. Remove Validation Error Scenarios\n\n**Delete entire scenarios that test:**\n- Type mismatches (string vs number)\n- Missing required fields\n- Invalid format (email, UUID, date)\n- Schema validation failures\n- Any input validation errors\n\n\u26A0\uFE0F These are framework-level validations, NOT business logic tests.\n\nIf a scenario's `draft` or `functionName` indicates validation testing, remove that entire scenario from the group.\n\n## 6. Special Cases\n\n### 6.1. Authentication Operations\n\n**Testing join (creates new context):**\n```json\n{\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleX/join\" },\n \"scenarios\": [{\n \"dependencies\": [] // Empty - join creates own context\n }]\n}\n```\n\n**Testing login (uses existing context):**\n```json\n{\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleX/login\" },\n \"scenarios\": [{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleX/join\" }, \"purpose\": \"Create user to login\" }\n ]\n }]\n}\n```\n\n**Testing refresh (renews token):**\n```json\n{\n \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleX/refresh\" },\n \"scenarios\": [{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/roleX/join\" }, \"purpose\": \"Create user for token refresh\" }\n ]\n }]\n}\n```\n\n### 6.2. Public Endpoints\n\nWhen target has `authorizationActor: null`:\n- Check if prerequisites need authentication\n- If all prerequisites are public \u2192 no authentication in dependencies\n- If some prerequisites need auth \u2192 add authentication for those prerequisites only\n\n## 7. Step-by-Step Review Process\n\n### Step 1: Remove Validation Error Scenarios\n\nFor each scenario in group:\n- If draft or functionName mentions validation, invalid input, missing field, type error\n- Remove this scenario from the group entirely\n\n### Step 2: Check User Context (Authentication)\n\nFor each remaining scenario:\n1. Check target operation's authorizationActor\n2. Check each prerequisite's authorizationActor\n3. List all unique non-null roles needed\n4. Ensure authentication for each required role\n5. Remove unnecessary authentication\n6. Fix join/login mixing issues\n\n### Step 3: Check Dependencies Completeness\n\nFor each scenario:\n- Add missing prerequisites to dependencies\n- Verify execution chain completeness\n- Ensure all ID-based dependencies are satisfied\n\n### Step 4: Check Execution Order\n\nFor each scenario:\n- Separate dependencies by type (auth, independent, dependent)\n- Sort within each group appropriately\n- Reconstruct in correct order: Auth \u2192 Independent \u2192 Dependent\n\n### Step 5: Remove Duplicates\n\nFor each scenario:\n- Keep only first occurrence of each unique operation\n- Remove all duplicates\n\n## 8. Review Checklist\n\nBefore finalizing review:\n\n\u2705 Removed all validation error scenarios\n\u2705 Verified authentication for every operation\n\u2705 Removed unnecessary authentication\n\u2705 No mixing of join and login\n\u2705 All prerequisites included in dependencies\n\u2705 Dependencies in correct execution order\n\u2705 No duplicate operations\n\u2705 All operations exist in Available API Operations\n\u2705 Provided clear review and plan\n\u2705 Set correct pass value\n\n## 9. Severity Levels\n\n### 9.1. CRITICAL Issues (MUST FIX IMMEDIATELY)\n- Missing authentication for operations that require it\n- Wrong authentication user context\n- Wrong execution order causing operation failures\n- Missing critical dependencies\n\n### 9.2. HIGH Priority Issues\n- Unnecessary authentication for public operations\n- Missing non-critical dependencies\n- Suboptimal execution order\n\n### 9.3. MEDIUM Priority Issues\n- Duplicate operations\n- Inefficient dependency chains\n- Documentation quality issues\n\n### 9.4. LOW Priority Issues\n- Minor optimization opportunities\n- Style consistency issues\n\n## 10. Function Call Output Structure\n\nWhen calling the `review` function, you must provide a structured response with:\n\n### 10.1. review\nConcise summary of findings formatted as:\n\n```markdown\n# Test Scenario Review Report\n\n## Executive Summary\n- Total Scenario Groups Reviewed: [number]\n- Validation Error Scenarios Removed: [number]\n- Authentication Issues Fixed: [number]\n- Dependency Issues Fixed: [number]\n- Execution Order Issues Fixed: [number]\n- Overall Assessment: [PASS/NEEDS_CORRECTION]\n\n## Critical Issues Fixed\n[List critical issues by scenario functionName]\n\n## Quality Improvements Applied\n[List improvements by category]\n```\n\n### 10.2. plan\nPrioritized action plan formatted as:\n\n```markdown\n# Action Plan for Test Scenario Improvements\n\n## Critical Fixes Applied\n1. [Authentication fix with specific scenario and change]\n2. [Missing dependency fix with details]\n\n## High Priority Corrections\n1. [Execution order fix with specifics]\n2. [Unnecessary auth removal with details]\n\n## Medium Priority Improvements\n1. [Duplicate removal with scenario identification]\n2. [Optimization applied]\n```\n\n### 10.3. pass\n- `true`: No changes needed, all scenarios correct\n- `false`: Corrections applied, check scenarioGroups for fixed versions\n\n### 10.4. scenarioGroups\nComplete corrected scenario groups with all fixes applied.\n\n## 11. Examples\n\n### 11.1. Example: Wrong User Context\n\n**Input:**\n```json\n{\n \"endpoint\": { \"method\": \"get\", \"path\": \"/resources/{id}\" },\n \"prerequisites\": [{ \n \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" },\n \"purpose\": \"Create resource\" \n }],\n \"scenarios\": [{\n \"functionName\": \"test_get_resource_success\",\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" } }\n ]\n }]\n}\n```\n\n**Available API Operations shows:**\n- GET /resources/{id}: authorizationActor: null\n- POST /resources: authorizationActor: \"user\"\n\n**Issue:** Missing authentication for POST /resources\n\n**Corrected:**\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/user/join\" }, \"purpose\": \"Authenticate as user\" },\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" }, \"purpose\": \"Create resource\" }\n ]\n}\n```\n\n### 11.2. Example: Validation Error Scenario\n\n**Input:**\n```json\n{\n \"functionName\": \"test_create_resource_with_invalid_input\",\n \"draft\": \"Test resource creation with missing required fields\"\n}\n```\n\n**Action:** Remove entire scenario from group\n\n### 11.3. Example: Wrong Execution Order\n\n**Input:**\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" } },\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/user/join\" } }\n ]\n}\n```\n\n**Issue:** Auth must come before resource creation\n\n**Corrected:**\n```json\n{\n \"dependencies\": [\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/auth/user/join\" } },\n { \"endpoint\": { \"method\": \"post\", \"path\": \"/resources\" } }\n ]\n}\n```\n\n## 12. Critical Reminders\n\n\uD83D\uDEA8 **MUST use function calling** - Never provide plain text responses\n\n\uD83D\uDCCB **Key principles:**\n1. Prerequisites from getPrerequisites() are authoritative\n2. Check EVERY operation's authorizationActor in Available API Operations\n3. Authentication MUST precede operations that need it\n4. Remove ALL validation test scenarios (framework-level tests)\n5. Use ONLY join OR ONLY login, never both\n6. Execution order: Auth \u2192 Independent \u2192 Dependent\n7. Trust provided prerequisites, don't recalculate\n8. Don't add unnecessary auth for public operations\n\nYour thorough review ensures test scenarios are correct and fully implementable." /* AutoBeSystemPromptConstant.TEST_SCENARIO_REVIEW */,
25
- },
26
- {
27
- id: (0, uuid_1.v7)(),
28
- created_at: new Date().toISOString(),
29
- type: "assistantMessage",
30
- text: utils_1.StringUtil.trim `
31
- ## Instructions
32
-
33
- The following e2e-test-specific instructions were extracted from
34
- the user's requirements and conversations. These instructions focus
35
- exclusively on test-related aspects such as test coverage priorities,
36
- specific edge cases to validate, business logic verification strategies,
37
- and critical user workflows that must be tested.
38
-
39
- Follow these instructions when reviewing test scenarios.
40
- Carefully distinguish between:
41
- - Suggestions or recommendations (consider these as guidance)
42
- - Direct specifications or explicit commands (these must be followed exactly)
43
-
44
- When instructions contain direct specifications or explicit design decisions,
45
- follow them precisely even if you believe you have better alternatives.
46
-
47
- ${props.instruction}
48
-
49
- ## Available API Operations for Reference
50
-
51
- Below are all available API operations and interface schemas for validation purposes.
52
- Match each operation with its corresponding schema.
53
-
54
- \`\`\`json
55
- ${JSON.stringify({ operations: document.operations })}
56
- \`\`\`
57
-
58
- ## Test Scenario Groups to Review
59
-
60
- Each scenario group includes the target endpoint and its prerequisite endpoints.
61
-
62
- \`\`\`json
63
- ${JSON.stringify(props.groups.map((g) => (Object.assign(Object.assign({}, g), { prerequisites: (0, getPrerequisites_1.getPrerequisites)({
64
- document,
65
- endpoint: g.endpoint,
66
- }) }))))}
67
- \`\`\`
68
- `,
69
- },
70
- ];
71
- }
72
- //# sourceMappingURL=transformTestScenarioReviewHistories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformTestScenarioReviewHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts"],"names":[],"mappings":";;AAUA,oFA8EC;AAtFD,yCAA2C;AAC3C,+BAA0B;AAK1B,gEAA6D;AAE7D,SAAgB,oCAAoC,CAAC,KAIpD;;IAGC,MAAM,QAAQ,GACZ,MAAA,KAAK,CAAC,KAAK,CAAC,SAAS,0CAAE,QAAQ,CAAC;IAClC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IAED,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,yz1BAA0C;SAC/C;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,y8dAAiD;SACtD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;UAiBjB,KAAK,CAAC,WAAW;;;;;;;;UAQjB,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;;;;;;;;UAQnD,IAAI,CAAC,SAAS,CACd,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCACnB,CAAC,KACJ,aAAa,EAAE,IAAA,mCAAgB,EAAC;oBAC9B,QAAQ;oBACR,QAAQ,EAAE,CAAC,CAAC,QAAQ;iBACrB,CAAC,IACF,CAAC,CACJ;;OAEF;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformTestWriteHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/histories/transformTestWriteHistories.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA,kEA+GC;AA/HD,yCAAqE;AACrE,8CAK0B;AAC1B,+BAAiC;AACjC,kDAA0B;AAC1B,+BAA0B;AAI1B,wFAAqF;AAGrF,SAAsB,2BAA2B,CAG/C,GAAyB,EACzB,KAIC;;QAMD,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE,YAAY,CAAC,GAAG,EAAE;aACzB;YACD;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,kBAAkB;gBACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;UAqBjB,KAAK,CAAC,WAAW;;;;6CAIkB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;;;;;;;UAO9E,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;;;;;;;;;UAS9B,2BAA2B,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC;;;;;;;;UAQvD,2BAA2B,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC;;;;;;;UAOvD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;;;;;;;;UAQnC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAA,yDAA2B,EAAC,GAAG,CAAC,CAAC;;;;;;;;;;;;;;;;;UAiBtD,KAAK,CAAC,SAAS,CAAC,QAAQ;;OAE3B;aACF;SACF,CAAC;IACJ,CAAC;CAAA;AACD,WAAiB,2BAA2B;IAC1C,SAAgB,UAAU,CAAC,SAAuC;QAChE,OAAO,kBAAU,CAAC,IAAI,CAAA;QAClB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;aACjD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC;;;QAGX,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC;;KAEhC,CAAC;IACJ,CAAC;IAVe,sCAAU,aAUzB,CAAA;IAED,SAAgB,UAAU,CAAC,SAAuC;QAChE,MAAM,QAAQ,GAAsB,IAAA,gCAAwB,EAC1D,SAAS,CAAC,QAAQ,CACnB,CAAC;QACF,MAAM,GAAG,GAA4B,uBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzE,OAAO,kBAAU,CAAC,IAAI,CAAA;;;QAGlB,GAAG,CAAC,MAAM;aACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACT,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAC/D,KAAK,CACN,CACF;aACA,IAAI,CAAC,IAAI,CAAC;;;QAGX,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC;;KAEhC,CAAC;IACJ,CAAC;IApBe,sCAAU,aAoBzB,CAAA;AACH,CAAC,EAlCgB,2BAA2B,2CAA3B,2BAA2B,QAkC3C;AAED,MAAM,YAAY,GAAG,IAAI,gBAAS,CAAC,GAAG,EAAE,CACtC,yt8JAAsC,OAAO,CAC3C,wBAAwB,EACxB,IAAI,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsD,CACrE,CACF,CAAC"}
@@ -1,25 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
3
- import { v7 } from "uuid";
4
-
5
- import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
6
- import { transformPreviousAndLatestCorrectHistories } from "./transformPreviousAndLatestCorrectHistories";
7
-
8
- interface IFailure {
9
- diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[];
10
- script: string;
11
- }
12
-
13
- export const transformCommonCorrectCastingHistories = (
14
- failures: IFailure[],
15
- ): Array<
16
- IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
17
- > => [
18
- {
19
- id: v7(),
20
- created_at: new Date().toISOString(),
21
- type: "systemMessage",
22
- text: AutoBeSystemPromptConstant.COMMON_CORRECT_CASTING,
23
- },
24
- ...transformPreviousAndLatestCorrectHistories(failures),
25
- ];
@@ -1,72 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import {
3
- AutoBeAnalyzeHistory,
4
- AutoBePrismaHistory,
5
- IAutoBePrismaCompileResult,
6
- } from "@autobe/interface";
7
- import { StringUtil } from "@autobe/utils";
8
- import { v7 } from "uuid";
9
-
10
- import { AutoBeState } from "../../../context/AutoBeState";
11
-
12
- export const transformInterfaceAssetHistories = (
13
- state: AutoBeState,
14
- ): Array<
15
- IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
16
- > => {
17
- const analyze: AutoBeAnalyzeHistory = state.analyze!;
18
- const prisma: AutoBePrismaHistory = state.prisma!;
19
- return [
20
- {
21
- id: v7(),
22
- created_at: new Date().toISOString(),
23
- type: "assistantMessage",
24
- text: StringUtil.trim`
25
- Requirement analysis and Prisma DB schema generation are ready.
26
-
27
- Call the provided tool function to generate the OpenAPI document
28
- referencing below requirement analysis and Prisma DB schema.
29
-
30
- ## Requirement Analysis Report
31
-
32
- \`\`\`json
33
- ${JSON.stringify(analyze.files)}
34
- \`\`\`
35
- `,
36
- },
37
- {
38
- id: v7(),
39
- created_at: new Date().toISOString(),
40
- type: "assistantMessage",
41
- text: StringUtil.trim`
42
- Database schema and entity relationship diagrams are ready.
43
- You should also look at this and consider logic including membership/login and token issuance.
44
- You can use table's name to define role in operations.
45
-
46
- ## Critical Schema Verification Instructions
47
-
48
- **IMPORTANT**: When generating API operations and descriptions:
49
- 1. ONLY reference fields that ACTUALLY EXIST in the Prisma schema below
50
- 2. NEVER assume common fields like \`deleted_at\`, \`created_by\`, \`updated_by\`, \`is_deleted\` exist
51
- 3. For DELETE operations:
52
- - If schema HAS soft delete fields (e.g., \`deleted_at\`), describe soft delete behavior
53
- - If schema LACKS soft delete fields, describe hard delete behavior
54
- 4. Verify EVERY field reference against the actual schema before including in descriptions
55
-
56
- ## Prisma DB Schema
57
-
58
- \`\`\`json
59
- ${JSON.stringify(prisma.schemas)}
60
- \`\`\`
61
-
62
- ## Entity Relationship Diagrams
63
-
64
- \`\`\`json
65
- ${JSON.stringify(
66
- (prisma.compiled as IAutoBePrismaCompileResult.ISuccess).diagrams,
67
- )}
68
- \`\`\`
69
- `,
70
- },
71
- ];
72
- };