@autobe/agent 0.25.7 → 0.27.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 (339) hide show
  1. package/lib/AutoBeAgent.d.ts +2 -1
  2. package/lib/AutoBeAgent.js +30 -7
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/AutoBeMockAgent.js +13 -12
  5. package/lib/AutoBeMockAgent.js.map +1 -1
  6. package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -20
  7. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  8. package/lib/context/AutoBeContext.d.ts +4 -1
  9. package/lib/context/AutoBeTokenUsage.d.ts +1 -1
  10. package/lib/context/AutoBeTokenUsage.js.map +1 -1
  11. package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +7 -0
  12. package/lib/factory/AutoBeFunctionCallingMetricFactory.js +35 -0
  13. package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +1 -0
  14. package/lib/factory/AutoBeProcessAggregateFactory.d.ts +13 -0
  15. package/lib/factory/AutoBeProcessAggregateFactory.js +100 -0
  16. package/lib/factory/AutoBeProcessAggregateFactory.js.map +1 -0
  17. package/lib/factory/consentFunctionCall.js +3 -0
  18. package/lib/factory/consentFunctionCall.js.map +1 -1
  19. package/lib/factory/createAutoBeContext.d.ts +2 -1
  20. package/lib/factory/createAutoBeContext.js +82 -28
  21. package/lib/factory/createAutoBeContext.js.map +1 -1
  22. package/lib/factory/getCommonPrompt.d.ts +2 -0
  23. package/lib/factory/getCommonPrompt.js +20 -0
  24. package/lib/factory/getCommonPrompt.js.map +1 -0
  25. package/lib/index.mjs +20929 -19874
  26. package/lib/index.mjs.map +1 -1
  27. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
  28. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  29. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
  30. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  31. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +6 -6
  32. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  33. package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -1
  34. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  35. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +2 -1
  36. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  37. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +75 -74
  38. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  39. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -4
  40. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  41. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +9 -9
  42. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +1 -1
  43. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +2 -17
  44. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
  45. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.d.ts +6 -0
  46. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js +58 -0
  47. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +1 -0
  48. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +2 -1
  49. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +3 -2
  50. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  51. package/lib/{factory/createAutoBeApplication.d.ts → orchestrate/facade/createAutoBeFacadeController.d.ts} +2 -2
  52. package/lib/{factory/createAutoBeApplication.js → orchestrate/facade/createAutoBeFacadeController.js} +53 -57
  53. package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -0
  54. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplication.js.map +1 -0
  55. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationProps.js.map +1 -0
  56. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationResult.js.map +1 -0
  57. package/lib/orchestrate/facade/{transformFacadeStateMessage.d.ts → structures/transformFacadeStateMessage.d.ts} +1 -1
  58. package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js +46 -0
  59. package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js.map +1 -0
  60. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +2 -2
  61. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +8 -8
  62. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  63. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
  64. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  65. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
  66. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  67. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +3 -2
  68. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  69. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
  70. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  71. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  72. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  73. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
  74. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  75. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +1 -0
  76. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +46 -20
  77. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  78. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +5 -0
  79. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +51 -0
  80. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +1 -0
  81. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +11 -0
  82. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +81 -0
  83. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +1 -0
  84. package/lib/orchestrate/interface/orchestrateInterface.d.ts +1 -1
  85. package/lib/orchestrate/interface/orchestrateInterface.js +33 -6
  86. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  87. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +185 -97
  88. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  89. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +234 -59
  90. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  91. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +5 -4
  92. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  93. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -6
  94. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +4 -4
  95. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
  96. package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
  97. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +4 -3
  98. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  99. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +178 -90
  100. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  101. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +176 -88
  102. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  103. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +6 -5
  104. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
  105. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.d.ts +7 -0
  106. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +445 -0
  107. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -0
  108. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +14 -0
  109. package/lib/orchestrate/interface/{orchestrateInterfaceSchemasReview.js → orchestrateInterfaceSchemaReview.js} +302 -121
  110. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -0
  111. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +243 -65
  112. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  113. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +22 -22
  114. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +7 -7
  115. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +101 -0
  116. package/lib/orchestrate/interface/structures/{IAutobeInterfaceSchemasReviewApplication.js → IAutoBeInterfaceSchemaContentReviewApplication.js} +1 -1
  117. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js.map +1 -0
  118. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +97 -0
  119. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js +3 -0
  120. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js.map +1 -0
  121. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +44 -0
  122. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js +3 -0
  123. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js.map +1 -0
  124. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +92 -0
  125. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js +3 -0
  126. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js.map +1 -0
  127. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +65 -24
  128. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
  129. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +94 -0
  130. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
  131. package/lib/orchestrate/interface/utils/OperationValidator.d.ts +1 -1
  132. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +13 -13
  133. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  134. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
  135. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  136. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
  137. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  138. package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
  139. package/lib/orchestrate/prisma/orchestratePrisma.js +1 -0
  140. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  141. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +2 -2
  142. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +4 -3
  143. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  144. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +2 -1
  145. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  146. package/lib/orchestrate/prisma/orchestratePrismaReview.js +2 -1
  147. package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  148. package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +2 -2
  149. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +4 -3
  150. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  151. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +2 -2
  152. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +8 -7
  153. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  154. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +4 -4
  155. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  156. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +4 -7
  157. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +8 -18
  158. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -1
  159. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -1
  160. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +8 -28
  161. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  162. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +1 -1
  163. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +16 -280
  164. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
  165. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +1 -1
  166. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  167. package/lib/orchestrate/realize/orchestrateRealize.d.ts +1 -1
  168. package/lib/orchestrate/realize/orchestrateRealize.js +4 -3
  169. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  170. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +14 -13
  171. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  172. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +12 -11
  173. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  174. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +1 -1
  175. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +46 -24
  176. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  177. package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.js → orchestrateRealizeCorrectCasting.js} +64 -51
  178. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -0
  179. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +2 -1
  180. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  181. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
  182. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +2 -2
  183. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +6 -6
  184. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -1
  185. package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -1
  186. package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
  187. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +2 -2
  188. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
  189. package/lib/orchestrate/realize/utils/getRealizeWriteDto.js +1 -1
  190. package/lib/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -1
  191. package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js +2 -2
  192. package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -1
  193. package/lib/orchestrate/realize/utils/printErrorHints.js +1 -1
  194. package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -1
  195. package/lib/orchestrate/realize/utils/replaceImportStatements.js +0 -85
  196. package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  197. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -1
  198. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
  199. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +5 -22
  200. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  201. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +10 -10
  202. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
  203. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +5 -5
  204. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  205. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +2 -2
  206. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
  207. package/lib/orchestrate/test/orchestrateTest.d.ts +1 -1
  208. package/lib/orchestrate/test/orchestrateTest.js +2 -1
  209. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  210. package/lib/orchestrate/test/orchestrateTestCorrect.js +5 -1
  211. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  212. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +4 -2
  213. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  214. package/lib/orchestrate/test/orchestrateTestScenario.js +28 -27
  215. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  216. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +4 -3
  217. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  218. package/lib/orchestrate/test/orchestrateTestWrite.js +2 -1
  219. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  220. package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.d.ts → IAutoBeTestScenarioAuthorizationActor.d.ts} +1 -1
  221. package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.js → IAutoBeTestScenarioAuthorizationActor.js} +1 -1
  222. package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationActor.js.map +1 -0
  223. package/lib/utils/TokenUsageComputer.d.ts +5 -0
  224. package/lib/utils/TokenUsageComputer.js +29 -0
  225. package/lib/utils/TokenUsageComputer.js.map +1 -0
  226. package/package.json +7 -7
  227. package/src/AutoBeAgent.ts +43 -6
  228. package/src/AutoBeMockAgent.ts +13 -12
  229. package/src/constants/AutoBeSystemPromptConstant.ts +27 -20
  230. package/src/context/AutoBeContext.ts +8 -0
  231. package/src/context/AutoBeTokenUsage.ts +1 -1
  232. package/src/factory/AutoBeFunctionCallingMetricFactory.ts +44 -0
  233. package/src/factory/AutoBeProcessAggregateFactory.ts +141 -0
  234. package/src/factory/consentFunctionCall.ts +4 -0
  235. package/src/factory/createAutoBeContext.ts +101 -37
  236. package/src/factory/getCommonPrompt.ts +25 -0
  237. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +5 -5
  238. package/src/orchestrate/analyze/orchestrateAnalyze.ts +2 -1
  239. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +2 -1
  240. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +5 -4
  241. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
  242. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +9 -9
  243. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +1 -1
  244. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +2 -20
  245. package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.ts +65 -0
  246. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +5 -2
  247. package/src/orchestrate/facade/createAutoBeFacadeController.ts +135 -0
  248. package/src/orchestrate/facade/{transformFacadeStateMessage.ts → structures/transformFacadeStateMessage.ts} +2 -2
  249. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +9 -9
  250. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +1 -0
  251. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +45 -20
  252. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +55 -0
  253. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +90 -0
  254. package/src/orchestrate/interface/orchestrateInterface.ts +47 -16
  255. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +20 -19
  256. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -1
  257. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +7 -6
  258. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +5 -6
  259. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +7 -6
  260. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +25 -24
  261. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +6 -5
  262. package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +4 -3
  263. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +270 -0
  264. package/src/orchestrate/interface/{orchestrateInterfaceSchemasReview.ts → orchestrateInterfaceSchemaReview.ts} +89 -76
  265. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +18 -9
  266. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +26 -22
  267. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +7 -7
  268. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +108 -0
  269. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +104 -0
  270. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +45 -0
  271. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +99 -0
  272. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +45 -3
  273. package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +110 -0
  274. package/src/orchestrate/interface/utils/OperationValidator.ts +1 -1
  275. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +12 -12
  276. package/src/orchestrate/prisma/orchestratePrisma.ts +6 -5
  277. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -5
  278. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +2 -1
  279. package/src/orchestrate/prisma/orchestratePrismaReview.ts +2 -1
  280. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +9 -8
  281. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +8 -7
  282. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +4 -4
  283. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +14 -28
  284. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -30
  285. package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +20 -285
  286. package/src/orchestrate/realize/orchestrateRealize.ts +4 -3
  287. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +11 -10
  288. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +5 -4
  289. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +77 -62
  290. package/src/orchestrate/realize/{orchestRateRealizeCorrectCasting.ts → orchestrateRealizeCorrectCasting.ts} +92 -90
  291. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +2 -1
  292. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
  293. package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +10 -7
  294. package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -1
  295. package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +2 -2
  296. package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +1 -1
  297. package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +2 -2
  298. package/src/orchestrate/realize/utils/printErrorHints.ts +1 -1
  299. package/src/orchestrate/realize/utils/replaceImportStatements.ts +0 -90
  300. package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -1
  301. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +6 -24
  302. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +10 -10
  303. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +12 -10
  304. package/src/orchestrate/test/orchestrateTest.ts +3 -2
  305. package/src/orchestrate/test/orchestrateTestCorrect.ts +5 -1
  306. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +4 -2
  307. package/src/orchestrate/test/orchestrateTestScenario.ts +32 -31
  308. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +4 -3
  309. package/src/orchestrate/test/orchestrateTestWrite.ts +2 -1
  310. package/src/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.ts → IAutoBeTestScenarioAuthorizationActor.ts} +1 -1
  311. package/src/utils/TokenUsageComputer.ts +35 -0
  312. package/lib/context/IAutoBeFacadeApplication.js.map +0 -1
  313. package/lib/context/IAutoBeFacadeApplicationProps.js.map +0 -1
  314. package/lib/context/IAutoBeFacadeApplicationResult.js.map +0 -1
  315. package/lib/factory/createAutoBeApplication.js.map +0 -1
  316. package/lib/orchestrate/facade/transformFacadeStateMessage.js +0 -46
  317. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
  318. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +0 -4
  319. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +0 -60
  320. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +0 -1
  321. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +0 -9
  322. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +0 -1
  323. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +0 -91
  324. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +0 -1
  325. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +0 -1
  326. package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +0 -1
  327. package/src/factory/createAutoBeApplication.ts +0 -123
  328. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +0 -67
  329. package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +0 -96
  330. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.d.ts +0 -0
  331. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.js +0 -0
  332. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.d.ts +0 -0
  333. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.js +0 -0
  334. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.d.ts +0 -0
  335. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.js +0 -0
  336. /package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.d.ts → orchestrateRealizeCorrectCasting.d.ts} +0 -0
  337. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.ts +0 -0
  338. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.ts +0 -0
  339. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.ts +0 -0
@@ -5,7 +5,7 @@ import { v7 } from "uuid";
5
5
 
6
6
  import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
7
7
  import { AutoBeState } from "../../../context/AutoBeState";
8
- import { IAutoBeTestScenarioAuthorizationRole } from "../structures/IAutoBeTestScenarioAuthorizationRole";
8
+ import { IAutoBeTestScenarioAuthorizationActor } from "../structures/IAutoBeTestScenarioAuthorizationActor";
9
9
  import { getPrerequisites } from "../utils/getPrerequisites";
10
10
 
11
11
  export const transformTestScenarioHistories = (props: {
@@ -19,17 +19,19 @@ export const transformTestScenarioHistories = (props: {
19
19
  > => {
20
20
  const authorizations: AutoBeInterfaceAuthorization[] =
21
21
  props.state.interface?.authorizations ?? [];
22
- const authorizationRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
23
- new Map();
22
+ const authorizationActors: Map<
23
+ string,
24
+ IAutoBeTestScenarioAuthorizationActor
25
+ > = new Map();
24
26
 
25
27
  for (const authorization of authorizations) {
26
28
  for (const op of authorization.operations) {
27
29
  if (op.authorizationType === null) continue;
28
- const value: IAutoBeTestScenarioAuthorizationRole = MapUtil.take(
29
- authorizationRoles,
30
- authorization.role,
30
+ const value: IAutoBeTestScenarioAuthorizationActor = MapUtil.take(
31
+ authorizationActors,
32
+ authorization.name,
31
33
  () => ({
32
- name: authorization.role,
34
+ name: authorization.name,
33
35
  join: null,
34
36
  login: null,
35
37
  }),
@@ -100,9 +102,9 @@ export const transformTestScenarioHistories = (props: {
100
102
  document: props.document,
101
103
  endpoint: el,
102
104
  }),
103
- authorizationRoles: Array.from(authorizationRoles.values()).filter(
104
- (role) => role.name === el.authorizationRole,
105
- ),
105
+ authorizationActors: Array.from(
106
+ authorizationActors.values(),
107
+ ).filter((actor) => actor.name === el.authorizationActor),
106
108
  })),
107
109
  )}
108
110
  \`\`\`
@@ -11,8 +11,8 @@ import { ILlmSchema } from "@samchon/openapi";
11
11
  import { v7 } from "uuid";
12
12
 
13
13
  import { AutoBeContext } from "../../context/AutoBeContext";
14
- import { IAutoBeFacadeApplicationProps } from "../../context/IAutoBeFacadeApplicationProps";
15
14
  import { predicateStateMessage } from "../../utils/predicateStateMessage";
15
+ import { IAutoBeFacadeApplicationProps } from "../facade/histories/IAutoBeFacadeApplicationProps";
16
16
  import { orchestrateTestCorrect } from "./orchestrateTestCorrect";
17
17
  import { orchestrateTestScenario } from "./orchestrateTestScenario";
18
18
  import { orchestrateTestWrite } from "./orchestrateTestWrite";
@@ -101,10 +101,11 @@ export const orchestrateTest =
101
101
  return ctx.dispatch({
102
102
  type: "testComplete",
103
103
  id: v7(),
104
- created_at: new Date().toISOString(),
105
104
  files: corrects.map((s) => s.file),
106
105
  compiled: compileResult,
106
+ aggregates: ctx.getCurrentAggregates("test"),
107
107
  step: ctx.state().interface?.step ?? 0,
108
108
  elapsed: new Date().getTime() - start.getTime(),
109
+ created_at: new Date().toISOString(),
109
110
  });
110
111
  };
@@ -51,6 +51,7 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
51
51
  correct: (next) =>
52
52
  ({
53
53
  type: "testCorrect",
54
+ kind: "casting",
54
55
  id: v7(),
55
56
  created_at: new Date().toISOString(),
56
57
  file: {
@@ -60,6 +61,7 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
60
61
  },
61
62
  result: next.failure,
62
63
  tokenUsage: next.tokenUsage,
64
+ metric: next.metric,
63
65
  think: next.think,
64
66
  draft: next.draft,
65
67
  review: next.review,
@@ -150,7 +152,7 @@ const correct = async <Model extends ILlmSchema.Model>(
150
152
  const pointer: IPointer<IAutoBeTestCorrectApplication.IProps | null> = {
151
153
  value: null,
152
154
  };
153
- const { tokenUsage } = await ctx.conversate({
155
+ const { metric, tokenUsage } = await ctx.conversate({
154
156
  source: "testCorrect",
155
157
  histories: await transformTestCorrectHistories(ctx, {
156
158
  instruction: props.instruction,
@@ -196,10 +198,12 @@ const correct = async <Model extends ILlmSchema.Model>(
196
198
 
197
199
  ctx.dispatch({
198
200
  type: "testCorrect",
201
+ kind: "casting",
199
202
  id: v7(),
200
203
  created_at: new Date().toISOString(),
201
204
  file: props.validate.file,
202
205
  result: props.validate.result,
206
+ metric,
203
207
  tokenUsage,
204
208
  step: ctx.state().analyze?.step ?? 0,
205
209
  think: pointer.value.think,
@@ -63,7 +63,7 @@ const correct = async <Model extends ILlmSchema.Model>(
63
63
  > = {
64
64
  value: null,
65
65
  };
66
- const { tokenUsage } = await ctx.conversate({
66
+ const { metric, tokenUsage } = await ctx.conversate({
67
67
  source: "testCorrect",
68
68
  histories: await transformTestCorrectInvalidRequestHistories(
69
69
  null!,
@@ -83,7 +83,7 @@ const correct = async <Model extends ILlmSchema.Model>(
83
83
  message: StringUtil.trim`
84
84
  Fix the AutoBeTest.IFunction data to resolve the compilation error.
85
85
 
86
- You don't need to explain me anything, but just fix or give it up
86
+ You don't need to explain me anything, but just fix or give it up
87
87
  immediately without any hesitation, explanation, and questions.
88
88
  `,
89
89
  });
@@ -103,6 +103,7 @@ const correct = async <Model extends ILlmSchema.Model>(
103
103
  );
104
104
  ctx.dispatch({
105
105
  type: "testCorrect",
106
+ kind: "request",
106
107
  id: v7(),
107
108
  created_at: new Date().toISOString(),
108
109
  file: {
@@ -111,6 +112,7 @@ const correct = async <Model extends ILlmSchema.Model>(
111
112
  content: write.script,
112
113
  },
113
114
  result: event.result,
115
+ metric,
114
116
  tokenUsage,
115
117
  step: ctx.state().analyze?.step ?? 0,
116
118
  think: pointer.value.think,
@@ -24,7 +24,7 @@ import { executeCachedBatch } from "../../utils/executeCachedBatch";
24
24
  import { transformTestScenarioHistories } from "./histories/transformTestScenarioHistories";
25
25
  import { orchestrateTestScenarioReview } from "./orchestrateTestScenarioReview";
26
26
  import { IAutoBeTestScenarioApplication } from "./structures/IAutoBeTestScenarioApplication";
27
- import { IAutoBeTestScenarioAuthorizationRole } from "./structures/IAutoBeTestScenarioAuthorizationRole";
27
+ import { IAutoBeTestScenarioAuthorizationActor } from "./structures/IAutoBeTestScenarioAuthorizationActor";
28
28
 
29
29
  export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
30
30
  ctx: AutoBeContext<Model>,
@@ -147,8 +147,8 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
147
147
  ctx.state().interface?.authorizations ?? [];
148
148
 
149
149
  try {
150
- const { tokenUsage } = await ctx.conversate({
151
- source: "testScenarios",
150
+ const { metric, tokenUsage } = await ctx.conversate({
151
+ source: "testScenario",
152
152
  histories: transformTestScenarioHistories({
153
153
  state: ctx.state(),
154
154
  document: props.document,
@@ -182,8 +182,9 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
182
182
  (props.progress.completed += pointer.value.length),
183
183
  );
184
184
  ctx.dispatch({
185
- type: "testScenarios",
185
+ type: "testScenario",
186
186
  id: v7(),
187
+ metric,
187
188
  tokenUsage,
188
189
  scenarios: pointer.value
189
190
  .map((v) =>
@@ -257,16 +258,16 @@ function createController<Model extends ILlmSchema.Model>(props: {
257
258
  });
258
259
 
259
260
  // Authentication Correction
260
- const entireRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
261
+ const entireRoles: Map<string, IAutoBeTestScenarioAuthorizationActor> =
261
262
  new Map();
262
263
  for (const authorization of props.authorizations) {
263
264
  for (const op of authorization.operations) {
264
265
  if (op.authorizationType === null) continue;
265
- const value: IAutoBeTestScenarioAuthorizationRole = MapUtil.take(
266
+ const value: IAutoBeTestScenarioAuthorizationActor = MapUtil.take(
266
267
  entireRoles,
267
- authorization.role,
268
+ authorization.name,
268
269
  () => ({
269
- name: authorization.role,
270
+ name: authorization.name,
270
271
  join: null,
271
272
  login: null,
272
273
  }),
@@ -283,14 +284,14 @@ function createController<Model extends ILlmSchema.Model>(props: {
283
284
  group.endpoint,
284
285
  );
285
286
  group.scenarios.forEach((scenario) => {
286
- // gathere authorization roles
287
- const localRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
287
+ // gather authorization actors
288
+ const localRoles: Map<string, IAutoBeTestScenarioAuthorizationActor> =
288
289
  new Map();
289
290
  const add = (operation: AutoBeOpenApi.IOperation) => {
290
- const role: string | null = operation.authorizationRole;
291
- if (role === null) return;
292
- MapUtil.take(localRoles, role, () => ({
293
- name: role,
291
+ const actor: string | null = operation.authorizationActor;
292
+ if (actor === null) return;
293
+ MapUtil.take(localRoles, actor, () => ({
294
+ name: actor,
294
295
  join: null,
295
296
  login: null,
296
297
  }));
@@ -304,14 +305,14 @@ function createController<Model extends ILlmSchema.Model>(props: {
304
305
  add(depOperation);
305
306
  });
306
307
 
307
- // Single role case - add join operation
308
+ // Single actor case - add join operation
308
309
  if (localRoles.size === 1) {
309
- const role: IAutoBeTestScenarioAuthorizationRole = localRoles
310
+ const actor: IAutoBeTestScenarioAuthorizationActor = localRoles
310
311
  .values()
311
312
  .next().value!;
312
- if (role.join === null) {
313
+ if (actor.join === null) {
313
314
  const joinOperation: AutoBeOpenApi.IOperation | null =
314
- entireRoles.get(role.name)?.join ?? null;
315
+ entireRoles.get(actor.name)?.join ?? null;
315
316
  if (joinOperation === null) throw new Error("Unreachable code");
316
317
 
317
318
  scenario.dependencies.push({
@@ -320,16 +321,16 @@ function createController<Model extends ILlmSchema.Model>(props: {
320
321
  path: joinOperation.path,
321
322
  },
322
323
  purpose: StringUtil.trim`
323
- Essential authentication prerequisite:
324
- This join operation (${joinOperation.method} ${joinOperation.path}) must be executed before any operations requiring '${role.name}' role authorization.
325
- It establishes the necessary user account and authentication context for the '${role.name}' role, enabling subsequent API calls that depend on this specific authorization level.
324
+ Essential authentication prerequisite:
325
+ This join operation (${joinOperation.method} ${joinOperation.path}) must be executed before any operations requiring '${actor.name}' actor authorization.
326
+ It establishes the necessary user account and authentication context for the '${actor.name}' actor, enabling subsequent API calls that depend on this specific authorization level.
326
327
  Without this join operation, the main scenario endpoint and its dependencies will fail due to insufficient authentication credentials.
327
328
  `,
328
329
  });
329
330
  }
330
331
  }
331
332
 
332
- // Multiple roles case - add both join and login operations
333
+ // Multiple actors case - add both join and login operations
333
334
  if (localRoles.size > 1) {
334
335
  for (const role of localRoles.values()) {
335
336
  if (role.join === null) {
@@ -343,11 +344,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
343
344
  method: joinOperation.method,
344
345
  },
345
346
  purpose: StringUtil.trim`
346
- Multi-actor authentication setup:
347
- This join operation (${joinOperation.method} ${joinOperation.path}) is required to establish a '${role.name}' role user account in the system.
348
- This scenario involves multiple authorization roles, requiring separate user accounts for each role to properly test cross-role interactions and authorization boundaries.
347
+ Multi-actor authentication setup:
348
+ This join operation (${joinOperation.method} ${joinOperation.path}) is required to establish a '${role.name}' actor user account in the system.
349
+ This scenario involves multiple authorization actors, requiring separate user accounts for each actor to properly test cross-actor interactions and authorization boundaries.
349
350
  The join operation creates the foundational user identity that will be used throughout the test scenario for '${role.name}' specific operations.
350
- This join operation is required for the '${role.name}' role authentication.
351
+ This join operation is required for the '${role.name}' actor authentication.
351
352
  `,
352
353
  });
353
354
  }
@@ -362,11 +363,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
362
363
  method: loginOperation.method,
363
364
  },
364
365
  purpose: StringUtil.trim`
365
- Role switching authentication:
366
- This login operation (${loginOperation.method} ${loginOperation.path}) enables dynamic user role switching during test execution for the '${role.name}' role.
367
- In scenarios with multiple actors, the test agent needs to authenticate as different users to simulate real-world multi-user interactions.
368
- This login operation ensures proper session management and authorization context switching, allowing the test to validate permissions, access controls, and business logic that span across different user roles within a single test scenario.
369
- This login operation may be required for user role swapping between multiple actors.
366
+ Actor switching authentication:
367
+ This login operation (${loginOperation.method} ${loginOperation.path}) enables dynamic user actor switching during test execution for the '${role.name}' actor.
368
+ In scenarios with multiple actors, the test agent needs to authenticate as different users to simulate real-world multi-user interactions.
369
+ This login operation ensures proper session management and authorization context switching, allowing the test to validate permissions, access controls, and business logic that span across different user actors within a single test scenario.
370
+ This login operation may be required for user actor swapping between multiple actors.
370
371
  `,
371
372
  });
372
373
  }
@@ -42,8 +42,8 @@ async function review<Model extends ILlmSchema.Model>(
42
42
  {
43
43
  value: null,
44
44
  };
45
- const { tokenUsage } = await ctx.conversate({
46
- source: "testScenariosReview",
45
+ const { metric, tokenUsage } = await ctx.conversate({
46
+ source: "testScenarioReview",
47
47
  controller: createController({
48
48
  model: ctx.model,
49
49
  pointer,
@@ -68,8 +68,9 @@ async function review<Model extends ILlmSchema.Model>(
68
68
  );
69
69
 
70
70
  ctx.dispatch({
71
- type: "testScenariosReview",
71
+ type: "testScenarioReview",
72
72
  id: v7(),
73
+ metric,
73
74
  tokenUsage,
74
75
  total: props.progress.total,
75
76
  completed: props.progress.completed,
@@ -77,7 +77,7 @@ async function process<Model extends ILlmSchema.Model>(
77
77
  const pointer: IPointer<IAutoBeTestWriteApplication.IProps | null> = {
78
78
  value: null,
79
79
  };
80
- const { tokenUsage } = await ctx.conversate({
80
+ const { metric, tokenUsage } = await ctx.conversate({
81
81
  source: "testWrite",
82
82
  histories: await transformTestWriteHistories(ctx, {
83
83
  scenario,
@@ -122,6 +122,7 @@ async function process<Model extends ILlmSchema.Model>(
122
122
  draft: pointer.value.draft,
123
123
  review: pointer.value.revise?.review,
124
124
  final: pointer.value.revise?.final ?? undefined,
125
+ metric,
125
126
  tokenUsage,
126
127
  completed: ++progress.completed,
127
128
  total: progress.total,
@@ -1,6 +1,6 @@
1
1
  import { AutoBeOpenApi } from "@autobe/interface";
2
2
 
3
- export interface IAutoBeTestScenarioAuthorizationRole {
3
+ export interface IAutoBeTestScenarioAuthorizationActor {
4
4
  name: string;
5
5
  join: AutoBeOpenApi.IOperation | null;
6
6
  login: AutoBeOpenApi.IOperation | null;
@@ -0,0 +1,35 @@
1
+ import { IAutoBeTokenUsageJson } from "@autobe/interface";
2
+
3
+ export namespace TokenUsageComputer {
4
+ export const plus = (
5
+ x: IAutoBeTokenUsageJson.IComponent,
6
+ y: IAutoBeTokenUsageJson.IComponent,
7
+ ): IAutoBeTokenUsageJson.IComponent => ({
8
+ total: x.total + y.total,
9
+ input: {
10
+ total: x.input.total + y.input.total,
11
+ cached: x.input.cached + y.input.cached,
12
+ },
13
+ output: {
14
+ total: x.output.total + y.output.total,
15
+ reasoning: x.output.reasoning + y.output.reasoning,
16
+ accepted_prediction:
17
+ x.output.accepted_prediction + y.output.accepted_prediction,
18
+ rejected_prediction:
19
+ x.output.rejected_prediction + y.output.rejected_prediction,
20
+ },
21
+ });
22
+
23
+ export const increment = (
24
+ x: IAutoBeTokenUsageJson.IComponent,
25
+ y: IAutoBeTokenUsageJson.IComponent,
26
+ ): void => {
27
+ x.total += y.total;
28
+ x.input.total += y.input.total;
29
+ x.input.cached += y.input.cached;
30
+ x.output.total += y.output.total;
31
+ x.output.reasoning += y.output.reasoning;
32
+ x.output.accepted_prediction += y.output.accepted_prediction;
33
+ x.output.rejected_prediction += y.output.rejected_prediction;
34
+ };
35
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"IAutoBeFacadeApplication.js","sourceRoot":"","sources":["../../src/context/IAutoBeFacadeApplication.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IAutoBeFacadeApplicationProps.js","sourceRoot":"","sources":["../../src/context/IAutoBeFacadeApplicationProps.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"IAutoBeFacadeApplicationResult.js","sourceRoot":"","sources":["../../src/context/IAutoBeFacadeApplicationResult.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createAutoBeApplication.js","sourceRoot":"","sources":["../../src/factory/createAutoBeApplication.ts"],"names":[],"mappings":"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"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformFacadeStateMessage = transformFacadeStateMessage;
4
- const utils_1 = require("@autobe/utils");
5
- function transformFacadeStateMessage(state) {
6
- const currentState = getCurrentState(state);
7
- return "<!--\nfilename: FACADE.md\n-->\n# AutoBE Main Agent System Prompt\n\nYou are the AutoBE Main Agent, an orchestrator for backend server development automation. Your role is to manage the conversation with users about their backend requirements and coordinate the execution of five specialized functional agents through function calling.\n\n## Core Responsibilities\n\n1. **Requirements Gathering**: Engage in detailed conversations with users to understand their backend server needs, asking clarifying questions about business logic, data models, API endpoints, and technical requirements.\n\n2. **Agent Orchestration**: Execute the appropriate functional agents in the correct sequence based on the development stage and user needs.\n\n3. **Progress Communication**: Keep users informed about the current development stage, what has been completed, and what steps remain.\n\n## Functional Agents Overview\n\nYou have access to five functional agents that must be executed in a specific order:\n\n1. **Analyze Agent** - Converts conversations into structured requirements specifications\n2. **Prisma Agent** - Generates database schemas and ERD documentation\n3. **Interface Agent** - Creates API interfaces with OpenAPI schemas and TypeScript code\n4. **Test Agent** - Generates comprehensive E2E test suites\n5. **Realize Agent** - Implements actual business logic for service providers\n\n## Execution Rules\n\n### 1. Sequential Dependencies\n\n- **analyze()**: Can only be called when sufficient requirements have been gathered.\n- **prisma()**: Requires successful completion of analyze()\n- **interface()**: Requires successful completion of prisma()\n- **test()**: Requires successful completion of interface()\n- **realize()**: Requires successful completion of interface()\n\n### 2. Requirements Gathering and analyze() Calling Criteria\n\n- Since users are not developers, it is okay if they do not understand technical terms like \u201Cendpoints\u201D or \u201Cdata models.\u201D \n- Your job is to help users clearly express their intended **features** by asking many questions. \n- Use examples and simple questions to guide them if they have trouble explaining. \n- Break down features into smaller steps if needed to complete the planning gradually. \n- For instance, ask questions like \u201CWhat tasks do you want to automate?\u201D, \u201CWhat roles do users have?\u201D, \u201CWhat screens or actions are involved?\u201D \n- Even if the system requires many or complex APIs, it is not necessary to know all of them upfront. Focus on gathering core requirements step by step. \n\n#### Conditions for Calling analyze() \n- Call analyze() only when the user has clearly stated sufficient **features** and **requirements**, or \n- The user explicitly delegates the planning to you by saying things like \u201CI\u2019ll leave the planning to you\u201D or \u201CPlease proceed as you see fit.\u201D \n\n#### Pre-call Checks \n- If requirements are insufficient for some features, do **not** call analyze() and keep asking questions until the specifications are complete. \n- Continue asking actively and explain any technical terms in an easy-to-understand way.\n\n### 3. Requirements Gathering Phase\n\nBefore calling analyze(), ensure you have discussed:\n\n- System purpose and overall goals\n- Core features and functionalities\n- User roles and permissions\n- Main data entities and their relationships\n- Key business rules and constraints\n- API endpoints needed\n- Any specific technical requirements\n\nIf these aspects are unclear, continue the conversation to gather more details.\n\n### 4. Development Workflow\n\n1. Start by understanding the user's needs through conversation\n2. When requirements are sufficiently detailed, execute analyze()\n3. Review the analysis results with the user\n4. If approved, proceed with prisma() \u2192 interface() \u2192 test() \u2192 realize()\n5. At each stage, present results and get user confirmation before proceeding\n\n### 5. Handling Changes\n\n- If users request changes after agents have been executed, first understand the scope\n- For minor adjustments, you may re-run specific agents\n- For major changes, consider re-running analyze() to update the specification\n- Always explain the impact of changes on already generated code\n\n## Agent Instruction Guidelines\n\n### \uD83D\uDEA8 ABSOLUTE RULE #1: DOMAIN-SPECIFIC INSTRUCTION EXTRACTION WITH ZERO DISTORTION \uD83D\uDEA8\n\n**YOU ARE A DOMAIN-SPECIFIC INSTRUCTION EXTRACTOR AND COPY-PASTE MACHINE.**\n\nYour role is TWO-FOLD:\n1. **EXTRACT ONLY explicit, direct instructions for each agent's specific domain**\n - General requirements and features are handled by analyze() - DO NOT repeat them\n - Only extract instructions that directly tell the agent HOW to design/implement their part\n2. **COPY-PASTE the extracted instructions WITHOUT ANY MODIFICATION**\n\n### Phase-Specific Content Filtering\n\n**IMPORTANT: analyze() already processes and propagates general requirements. Each subsequent agent needs ONLY their domain-specific instructions, NOT general requirements.**\n\nEach agent should ONLY receive **direct instructions** for their specific domain:\n\n- **analyze()**: No special filtering - receives the full conversation history to analyze requirements\n- **prisma()**: ONLY direct database design instructions\n - Explicit database schema specifications, CREATE TABLE statements\n - Direct instructions about table structures, field definitions\n - Specific relationship definitions (foreign keys, joins)\n - Explicit database constraints, indexes, unique fields\n - **NOT general requirements - analyze() handles those**\n- **interface()**: ONLY direct API/DTO design instructions \n - Explicit API endpoint specifications\n - Direct request/response schema definitions\n - Specific DTO structure instructions\n - Explicit OpenAPI/Swagger specifications\n - **NOT general features or user stories - only API design specifics**\n- **test()**: ONLY direct testing program instructions\n - Explicit test scenario definitions\n - Specific test case instructions\n - Direct testing strategy commands\n - Explicit validation requirements\n - **NOT what to test (analyze provides that) - but HOW to test**\n- **realize()**: ONLY direct implementation logic instructions\n - Explicit business logic algorithms\n - Specific implementation patterns\n - Direct processing logic instructions\n - Explicit performance optimization requirements\n - **NOT what features to implement - but HOW to implement them**\n\n### Examples of What to Extract vs What to Exclude\n\n**Example User Input:**\n\"I need a blog system where users can write posts. \nPosts table should have: id, title, content, author_id, created_at.\nAPI should have GET /posts and POST /posts endpoints.\nTest the post creation with valid and invalid data.\nWhen creating a post, validate that title is not empty.\"\n\n**What Each Agent Should Receive:**\n- **prisma()**: \"Posts table should have: id, title, content, author_id, created_at.\" \u2705\n - NOT: \"I need a blog system where users can write posts\" \u274C (general requirement)\n- **interface()**: \"API should have GET /posts and POST /posts endpoints.\" \u2705\n - NOT: The database schema \u274C (that's prisma's job)\n- **test()**: \"Test the post creation with valid and invalid data.\" \u2705\n - NOT: What tables exist \u274C (analyze already knows)\n- **realize()**: \"When creating a post, validate that title is not empty.\" \u2705\n - NOT: The API endpoint definitions \u274C (interface handles that)\n\n### Within Each Phase: ABSOLUTE COPY-PASTE RULE\n\n**Once you identify content relevant to a specific phase:**\n\n1. **COPY the user's raw text** - ctrl+C, ctrl+V, nothing else\n2. **PASTE without ANY modifications** - no editing, no summarizing, no \"improving\"\n3. **INCLUDE EVERYTHING relevant** - every line, every character, every code block\n4. **PRESERVE ORIGINAL FORMATTING** - indentation, line breaks, markdown, everything\n\n**IF YOU WRITE THINGS LIKE:**\n- \"Design database according to user specification\" \u274C WRONG\n- \"Follow the schema provided\" \u274C WRONG \n- \"As specified in requirements\" \u274C WRONG\n- \"Create tables as shown\" \u274C WRONG\n\n**YOU MUST INSTEAD:**\n- Copy-paste the ENTIRE relevant specification \u2705\n- Include ALL relevant code blocks completely \u2705\n- Preserve ALL user comments and commands for that phase \u2705\n- Keep ALL sections, warnings, and rules related to that phase \u2705\n\nWhen calling each functional agent, you must:\n\n1. **Filter by Phase** - Extract ONLY content relevant to that specific agent\n2. **DO NOT Transform** - Copy-paste the user's exact words, do NOT rewrite\n3. **Preserve Everything Within Scope** - User's tone, emphasis, commands, code blocks for that phase\n4. **Never Summarize** - If user wrote 1000 lines about databases, prisma() gets 1000 lines\n5. **Act as a Selective Pipeline** - You filter by phase, but pass relevant content through unchanged\n\n### CRITICAL: Extract Instructions from Entire Conversation History\n\n**When preparing instructions for each agent:**\n- **SEARCH THE ENTIRE CONVERSATION HISTORY** - not just the most recent messages\n- **EXTRACT ALL RELEVANT INSTRUCTIONS** from any point in the dialogue, including early requirements, mid-conversation clarifications, and recent updates\n- **COMBINE INSTRUCTIONS CHRONOLOGICALLY** - preserve the evolution of requirements while ensuring later instructions override earlier ones when there's a conflict\n- **NEVER MISS PAST CONTEXT** - thoroughly scan all previous messages for specifications, constraints, examples, and design decisions\n- **INCLUDE FORGOTTEN DETAILS** - users may mention critical requirements early and assume you remember them throughout\n\n### CRITICAL: Preserve Original Content Without Arbitrary Summarization\n\n**When extracting instructions from user requirements:**\n- **DO clarify unclear content** when necessary for agent understanding\n- **DO NOT arbitrarily summarize or abbreviate** user requirements\n- **PRESERVE the original wording** as much as possible - stay close to the user's actual words\n- **MAINTAIN full context** - don't lose important details through oversimplification\n- **KEEP the complete narrative** - the preservation of tone and manner stems from this same principle\n- **PRESERVE ALL technical specifications verbatim** - design specs, schemas, API definitions, and code blocks MUST be included exactly as provided\n- **NEVER modify code blocks or technical specs** - pass them through unchanged, including formatting, indentation, and comments\n- **INCLUDE complete technical documentation** - if the user provides detailed specifications, architectures, or diagrams in text form, preserve them entirely\n\n### ABSOLUTE RULE: Copy-Paste Raw Content for Technical Specifications\n\n**FOR ALL TECHNICAL CONTENT (schemas, code, specifications, designs):**\n- **COPY-PASTE THE ENTIRE RAW CONTENT** - do not rewrite, summarize, or interpret\n- **INCLUDE MARKDOWN CODE BLOCKS AS-IS** - preserve ```language markers and all content within\n- **PRESERVE EXACT FORMATTING** - maintain line breaks, indentation, bullet points, numbering\n- **KEEP ALL COMMENTS AND ANNOTATIONS** - user's inline comments are part of the specification\n- **DO NOT TRANSLATE TECHNICAL TERMS** - keep CREATE TABLE, PRIMARY KEY, etc. exactly as written\n- **INCLUDE THE FULL SCHEMA/CODE** - never excerpt or abbreviate technical specifications\n\n### \uD83D\uDD34 STOP! READ THIS BEFORE CALLING ANY AGENT \uD83D\uDD34\n\n**THE INSTRUCTION PARAMETER IS NOT FOR YOUR SUMMARY. IT IS FOR PHASE-FILTERED RAW USER CONTENT.**\n\n**WHAT YOU ARE DOING WRONG:**\n```\ninstruction: \"Design the database schema according to the user's specification.\"\n```\nThis is WRONG. You are summarizing. STOP IT.\n\n**WHAT YOU MUST DO:**\n1. **FIRST: Identify content relevant to the specific agent phase**\n2. **THEN: Include that ENTIRE relevant content exactly as written by the user**\n\n**THE GOLDEN RULE FOR EACH PHASE:**\n- If the user wrote 10,000 characters about databases, prisma() gets ALL 10,000 characters\n- If the user included 50 API endpoint definitions, interface() gets ALL 50 endpoints\n- If the user wrote test scenarios with emphasis, test() gets that exact tone and wording\n- If the user described business logic, realize() gets the complete description\n\n**YOU ARE VIOLATING THIS RULE IF:**\n- Your instruction is shorter than what the user wrote for that phase\n- You removed any code blocks relevant to that phase\n- You changed any wording in the phase-specific content\n- You \"cleaned up\" the formatting of relevant content\n- You tried to \"organize\" or \"improve\" phase-specific instructions\n\n**REMEMBER:**\n- Phase filtering is MANDATORY - don't send database schemas to test()\n- Within each phase, content preservation is ABSOLUTE\n- Code blocks MUST be preserved with ``` markers\n- Every CREATE TABLE goes to prisma(), every endpoint to interface()\n- Every warning and rule SPECIFIC TO THAT PHASE must be preserved\n- You are a PHASE-SPECIFIC FILTER, then a PIPE\n\nThe goal is to pass the user's authentic voice and complete requirements to each agent, not a condensed interpretation. Technical specifications and code examples are sacred - they must flow through untouched. When in doubt, COPY MORE, not less.\n\n### IMPORTANT: Phase-Specific Instructions Only\n\n**You MUST extract ONLY the instructions relevant to each specific phase:**\n\n- **analyze()**: No special instructions needed - the agent will process the raw conversation history directly\n- **prisma()**: ONLY database design instructions (schema structure, relationships, constraints, indexing strategies)\n - Extract and pass through VERBATIM any database schemas, CREATE TABLE statements, entity definitions\n - Include all database-specific requirements WITHOUT interpretation\n- **interface()**: ONLY API and DTO schema instructions (endpoint patterns, request/response formats, operation specifications)\n - Extract and pass through VERBATIM any API definitions, endpoint specifications, OpenAPI schemas\n - Include all API-specific requirements WITHOUT modification\n- **test()**: ONLY testing strategy instructions (test scenarios, coverage priorities, edge cases to validate)\n - Extract and pass through VERBATIM any test scenarios, test cases, validation requirements\n - Include all testing-specific instructions WITHOUT editing\n- **realize()**: ONLY implementation instructions (business logic patterns, performance requirements, architectural decisions)\n - Extract and pass through VERBATIM any business logic, algorithms, processing rules\n - Include all implementation-specific requirements WITHOUT transformation\n\n**DO NOT include instructions meant for other phases. Each agent should receive ONLY its domain-specific guidance, but that guidance must be passed through UNCHANGED.**\n\n### CRITICAL: Never Fabricate User Requirements\n\n**ABSOLUTELY FORBIDDEN:**\n- **NEVER invent or create requirements the user didn't explicitly mention**\n- **NEVER expand simple requests into detailed specifications without user input**\n- **NEVER add features, functionalities, or details the user hasn't discussed**\n- **ONLY include instructions based on what the user ACTUALLY said**\n\nIf the user says \"Design an API\", do NOT create detailed specifications about platforms, features, or functionalities they never mentioned. Stick strictly to their actual words and requirements.\n\n### CRITICAL: Preserve User's Emphatic Rules and Tone\n\n**When the user provides strong directives or absolute rules, you MUST:**\n- **Preserve the exact tone and intensity** of their commands\n- **Maintain the user's original wording and emphatic language** without dilution\n- **Include all prohibitions, commands, and warnings exactly as stated**\n- **Never soften or reinterpret strong language** - if the user uses absolute terms, preserve them\n\n### Key Principle\n\n**Two-Step Process:**\n1. **Extract Domain-Specific Instructions**: Extract ONLY explicit, direct instructions for each agent's specific domain\n - prisma(): Database design HOW-TOs only\n - interface(): API/DTO design HOW-TOs only \n - test(): Testing program HOW-TOs only\n - realize(): Implementation logic HOW-TOs only\n2. **Preserve Completely**: Pass the extracted instructions with the user's authentic voice, preserving original wording and tone WITHOUT any interpretation, transformation, or summarization\n\n**The Formula:**\n- Domain-specific instruction extraction (not general requirements) + Zero distortion (exact copy-paste) = Correct instruction passing\n\n**Remember**: analyze() handles general requirements. Other agents need ONLY their specific technical instructions.\n\n## Communication Guidelines\n\n1. **Be Transparent**: Clearly explain which agent is being executed and why\n2. **Show Progress**: Indicate completed steps and remaining work\n3. **Confirm Understanding**: Summarize requirements before executing agents\n4. **Request Approval**: Get user confirmation before moving to the next stage\n5. **Explain Results**: Briefly describe what each agent has generated\n6. **Clarify Instructions**: When calling agents, explain how you've interpreted user needs into specific instructions\n\n## Current State\n\n{% STATE %}" /* AutoBeSystemPromptConstant.FACADE */.replace("{% STATE %}", utils_1.StringUtil.trim `
8
- ## Current State
9
-
10
- The current execution status of each functional agent is shown below.
11
- Each agent can be in one of three states: "none" (never executed),
12
- "up-to-date" (successfully executed with current output),
13
- or "out-of-date" (previously executed but needs updating due to
14
- changes in earlier stages).
15
-
16
- An agent cannot be executed if any of its prerequisite agents have
17
- a status of "none" or "out-of-date". In such cases, you must complete or
18
- update the earlier stages first. Additionally, re-executing an "up-to-date"
19
- agent will cause all subsequent agents to become "out-of-date", as they
20
- depend on the updated output.
21
-
22
- - analyze: ${currentState.analyze}
23
- - prisma: ${currentState.prisma}
24
- - interface: ${currentState.interface}
25
- - test: ${currentState.test}
26
- - realize: ${currentState.realize}
27
- `);
28
- }
29
- function getCurrentState(state) {
30
- const value = (obj) => {
31
- if (state.analyze === null || obj === null)
32
- return "none";
33
- else if (state.analyze.step === obj.step)
34
- return "up-to-date";
35
- else
36
- return "out-of-date";
37
- };
38
- return {
39
- analyze: state.analyze === null ? "none" : "up-to-date",
40
- prisma: value(state.prisma),
41
- interface: value(state.interface),
42
- test: value(state.test),
43
- realize: value(state.realize),
44
- };
45
- }
46
- //# sourceMappingURL=transformFacadeStateMessage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformFacadeStateMessage.js","sourceRoot":"","sources":["../../../src/orchestrate/facade/transformFacadeStateMessage.ts"],"names":[],"mappings":";;AAKA,kEA0BC;AA/BD,yCAA2C;AAK3C,SAAgB,2BAA2B,CAAC,KAAkB;IAC5D,MAAM,YAAY,GAAkB,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,wliBAAkC,OAAO,CAC9C,aAAa,EACb,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;mBAeA,YAAY,CAAC,OAAO;kBACrB,YAAY,CAAC,MAAM;qBAChB,YAAY,CAAC,SAAS;gBAC3B,YAAY,CAAC,IAAI;mBACd,YAAY,CAAC,OAAO;KAClC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkB;IACzC,MAAM,KAAK,GAAG,CACZ,GAEQ,EACR,EAAE;QACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC;aACrD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI;YAAE,OAAO,YAAY,CAAC;;YACzD,OAAO,aAAa,CAAC;IAC5B,CAAC,CAAC;IACF,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY;QACvD,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3B,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;QACvB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;KAC9B,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { AutoBeOpenApi } from "@autobe/interface";
3
- import { AutoBeState } from "../../../context/AutoBeState";
4
- export declare const transformInterfaceSchemasReviewHistories: (state: AutoBeState, operations: AutoBeOpenApi.IOperation[], schemaDescriptive: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;