@autobe/agent 0.18.0 → 0.19.1

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 (281) hide show
  1. package/lib/AutoBeMockAgent.d.ts +2 -10
  2. package/lib/agent/src/AutoBeAgent.js +5 -0
  3. package/lib/agent/src/AutoBeAgent.js.map +1 -1
  4. package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
  5. package/lib/agent/src/AutoBeMockAgent.js +7 -2
  6. package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
  7. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +23 -29
  8. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
  9. package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +1 -0
  10. package/lib/agent/src/context/AutoBeTokenUsageComponent.js +14 -0
  11. package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
  12. package/lib/agent/src/factory/consentFunctionCall.d.ts +10 -0
  13. package/lib/agent/src/factory/consentFunctionCall.js +212 -0
  14. package/lib/agent/src/factory/consentFunctionCall.js.map +1 -0
  15. package/lib/agent/src/factory/createAgenticaHistory.js +1 -0
  16. package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -1
  17. package/lib/agent/src/factory/createAutoBeContext.js +71 -14
  18. package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
  19. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
  20. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +4 -4
  21. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +1 -1
  22. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
  23. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
  24. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +16 -4
  25. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  26. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +8 -3
  27. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  28. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
  29. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +7 -7
  30. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  31. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +24 -37
  32. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  33. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -3
  34. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  35. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
  36. package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
  37. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +1 -0
  38. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
  39. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
  40. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  41. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
  42. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  43. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +2 -10
  44. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  45. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
  46. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  47. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  48. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  49. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +3 -3
  50. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  51. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
  52. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  53. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +9 -3
  54. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  55. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +29 -9
  56. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
  57. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
  58. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +1565 -1142
  59. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  60. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +22 -4
  61. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  62. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
  63. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +11 -15
  64. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  65. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +32 -26
  66. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  67. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
  68. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +135 -124
  69. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  70. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +371 -209
  71. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  72. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +185 -179
  73. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
  74. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
  75. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
  76. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
  77. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
  78. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
  79. package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
  80. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
  81. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +35 -0
  82. package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -0
  83. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +11 -17
  84. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  85. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
  86. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
  87. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
  88. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  89. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
  90. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  91. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +13 -4
  92. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  93. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
  94. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +6 -10
  95. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  96. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +35 -2
  97. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  98. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +44 -3
  99. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  100. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +40 -3
  101. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  102. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +2 -2
  103. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  104. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +5 -5
  105. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  106. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
  107. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +2 -2
  108. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  109. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
  110. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +278 -0
  111. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
  112. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
  113. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +12 -20
  114. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  115. package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +3 -3
  116. package/lib/agent/src/orchestrate/realize/internal/compile.js +9 -26
  117. package/lib/agent/src/orchestrate/realize/internal/compile.js.map +1 -1
  118. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +59 -42
  119. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
  120. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +6 -6
  121. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  122. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +6 -6
  123. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
  124. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +17 -16
  125. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  126. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
  127. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -19
  128. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  129. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
  130. package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeCoderApplication.js → IAutoBeRealizeCorrectApplication.js} +1 -1
  131. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
  132. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
  133. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +5 -1
  134. package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  135. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
  136. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  137. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
  138. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +95 -50
  139. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  140. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
  141. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  142. package/lib/agent/src/orchestrate/test/orchestrateTest.js +12 -0
  143. package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
  144. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +4 -4
  145. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +119 -16
  146. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  147. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  148. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
  149. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
  150. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
  151. package/lib/agent/src/orchestrate/{internal/IProgress.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
  152. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
  153. package/lib/agent/src/utils/predicateStateMessage.d.ts +4 -0
  154. package/lib/agent/src/utils/predicateStateMessage.js +87 -0
  155. package/lib/agent/src/utils/predicateStateMessage.js.map +1 -0
  156. package/lib/constants/AutoBeSystemPromptConstant.d.ts +23 -29
  157. package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
  158. package/lib/factory/consentFunctionCall.d.ts +10 -0
  159. package/lib/index.mjs +3036 -1648
  160. package/lib/index.mjs.map +1 -1
  161. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
  162. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
  163. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
  164. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
  165. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
  166. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
  167. package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
  168. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
  169. package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
  170. package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
  171. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
  172. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
  173. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
  174. package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
  175. package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
  176. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
  177. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
  178. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
  179. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
  180. package/lib/orchestrate/realize/internal/compile.d.ts +3 -3
  181. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
  182. package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
  183. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
  184. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
  185. package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
  186. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
  187. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
  188. package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
  189. package/lib/utils/predicateStateMessage.d.ts +4 -0
  190. package/package.json +6 -6
  191. package/src/AutoBeAgent.ts +14 -0
  192. package/src/AutoBeMockAgent.ts +9 -11
  193. package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
  194. package/src/context/AutoBeTokenUsageComponent.ts +20 -0
  195. package/src/factory/consentFunctionCall.ts +128 -0
  196. package/src/factory/createAgenticaHistory.ts +1 -0
  197. package/src/factory/createAutoBeContext.ts +99 -14
  198. package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +11 -4
  199. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +26 -4
  200. package/src/orchestrate/analyze/orchestrateAnalyze.ts +19 -14
  201. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +3 -3
  202. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +8 -32
  203. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -3
  204. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +16 -16
  205. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +5 -5
  206. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +1 -0
  207. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -10
  208. package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +1 -1
  209. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +9 -3
  210. package/src/orchestrate/interface/orchestrateInterface.ts +51 -12
  211. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +126 -23
  212. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +6 -19
  213. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +32 -27
  214. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +49 -32
  215. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +127 -33
  216. package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +67 -65
  217. package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +39 -0
  218. package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +16 -16
  219. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +62 -14
  220. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +38 -1
  221. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +47 -14
  222. package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +18 -24
  223. package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +41 -0
  224. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +9 -16
  225. package/src/orchestrate/prisma/orchestratePrisma.ts +15 -6
  226. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -19
  227. package/src/orchestrate/prisma/orchestratePrismaReview.ts +15 -9
  228. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +1 -1
  229. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +19 -23
  230. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +4 -2
  231. package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +285 -0
  232. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -27
  233. package/src/orchestrate/realize/internal/compile.ts +28 -45
  234. package/src/orchestrate/realize/orchestrateRealize.ts +71 -67
  235. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +3 -3
  236. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +19 -15
  237. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +23 -15
  238. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
  239. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +19 -16
  240. package/src/orchestrate/realize/utils/replaceImportStatements.ts +7 -0
  241. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +110 -59
  242. package/src/orchestrate/test/orchestrateTest.ts +12 -0
  243. package/src/orchestrate/test/orchestrateTestScenario.ts +155 -19
  244. package/src/orchestrate/test/orchestrateTestWrite.ts +3 -3
  245. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +6 -5
  246. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
  247. package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
  248. package/src/utils/predicateStateMessage.ts +107 -0
  249. package/lib/agent/src/orchestrate/internal/IProgress.d.ts +0 -4
  250. package/lib/agent/src/orchestrate/internal/IProgress.js.map +0 -1
  251. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
  252. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js +0 -213
  253. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +0 -1
  254. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
  255. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
  256. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
  257. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js +0 -3
  258. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
  259. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
  260. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -5
  261. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
  262. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +0 -3
  263. package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +0 -1
  264. package/lib/agent/src/utils/pipe.d.ts +0 -5
  265. package/lib/agent/src/utils/pipe.js +0 -14
  266. package/lib/agent/src/utils/pipe.js.map +0 -1
  267. package/lib/orchestrate/internal/IProgress.d.ts +0 -4
  268. package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
  269. package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
  270. package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
  271. package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
  272. package/lib/utils/pipe.d.ts +0 -5
  273. package/src/orchestrate/internal/IProgress.ts +0 -4
  274. package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
  275. package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +0 -358
  276. package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +0 -70
  277. package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +0 -2
  278. package/src/utils/pipe.ts +0 -39
  279. /package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
  280. /package/lib/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
  281. /package/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.ts → IAutoBeRealizeCorrectApplication.ts} +0 -0
@@ -3,9 +3,12 @@ import { AutoBeRealizeAuthorization } from "@autobe/interface";
3
3
  import { AutoBeState } from "../../../context/AutoBeState";
4
4
  import { IAutoBeTestScenarioArtifacts } from "../../test/structures/IAutoBeTestScenarioArtifacts";
5
5
  import { IAutoBeRealizeScenarioApplication } from "../structures/IAutoBeRealizeScenarioApplication";
6
- export declare const transformRealizeWriteHistories: (props: {
6
+ export declare const transformRealizeWriteHistories: (props: IProps) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
7
+ interface IProps {
7
8
  state: AutoBeState;
8
9
  scenario: IAutoBeRealizeScenarioApplication.IProps;
9
10
  artifacts: IAutoBeTestScenarioArtifacts;
10
11
  authorization: AutoBeRealizeAuthorization | null;
11
- }) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
12
+ totalAuthorizations: AutoBeRealizeAuthorization[];
13
+ }
14
+ export {};
@@ -1,7 +1,7 @@
1
- import { AutoBeRealizeAuthorization, AutoBeRealizeValidateEvent, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
1
+ import { AutoBeRealizeAuthorization, AutoBeRealizeFunction, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
2
2
  import { ILlmSchema } from "@samchon/openapi";
3
3
  import { AutoBeContext } from "../../../context/AutoBeContext";
4
4
  export declare function compile<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
5
5
  authorizations: AutoBeRealizeAuthorization[];
6
- providers: Record<string, string>;
7
- }): Promise<IAutoBeTypeScriptCompileResult.ISuccess | AutoBeRealizeValidateEvent>;
6
+ functions: AutoBeRealizeFunction[];
7
+ }): Promise<IAutoBeTypeScriptCompileResult>;
@@ -2,7 +2,14 @@ import { AutoBeRealizeAuthorization, AutoBeRealizeCorrectEvent, IAutoBeTypeScrip
2
2
  import { ILlmSchema } from "@samchon/openapi";
3
3
  import { AutoBeContext } from "../../context/AutoBeContext";
4
4
  import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
5
- export declare function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, authorization: AutoBeRealizeAuthorization | null, scenario: IAutoBeRealizeScenarioApplication.IProps, code: string, diagnostic: IAutoBeTypeScriptCompileResult.IDiagnostic, progress: IProgress): Promise<AutoBeRealizeCorrectEvent>;
5
+ export declare function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
6
+ authorization: AutoBeRealizeAuthorization | null;
7
+ totalAuthorizations: AutoBeRealizeAuthorization[];
8
+ scenario: IAutoBeRealizeScenarioApplication.IProps;
9
+ code: string;
10
+ diagnostic: IAutoBeTypeScriptCompileResult.IDiagnostic;
11
+ progress: IProgress;
12
+ }): Promise<AutoBeRealizeCorrectEvent>;
6
13
  export interface IProgress {
7
14
  total: number;
8
15
  completed: number;
@@ -2,7 +2,12 @@ import { AutoBeRealizeAuthorization, AutoBeRealizeWriteEvent } from "@autobe/int
2
2
  import { ILlmSchema } from "@samchon/openapi";
3
3
  import { AutoBeContext } from "../../context/AutoBeContext";
4
4
  import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
5
- export declare function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, authorization: AutoBeRealizeAuthorization | null, scenario: IAutoBeRealizeScenarioApplication.IProps, progress: IProgress): Promise<AutoBeRealizeWriteEvent>;
5
+ export declare function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
6
+ totalAuthorizations: AutoBeRealizeAuthorization[];
7
+ authorization: AutoBeRealizeAuthorization | null;
8
+ scenario: IAutoBeRealizeScenarioApplication.IProps;
9
+ progress: IProgress;
10
+ }): Promise<AutoBeRealizeWriteEvent>;
6
11
  export interface IProgress {
7
12
  total: number;
8
13
  completed: number;
@@ -34,7 +34,7 @@ export declare namespace IAutoBeRealizeAuthorizationApplication {
34
34
  * called by the decorator to verify JWT tokens and return authenticated
35
35
  * user information for the specified role.
36
36
  *
37
- * MUST use camelCase naming convention.
37
+ * DO: Use camelCase naming convention.
38
38
  */
39
39
  name: string & CamelPattern;
40
40
  /**
@@ -55,7 +55,7 @@ export declare namespace IAutoBeRealizeAuthorizationApplication {
55
55
  * authorize users for the specific role, injecting the authenticated user
56
56
  * payload as a method parameter.
57
57
  *
58
- * MUST use PascalCase naming convention.
58
+ * DO: Use PascalCase naming convention.
59
59
  */
60
60
  name: string & PascalPattern;
61
61
  /**
@@ -75,7 +75,7 @@ export declare namespace IAutoBeRealizeAuthorizationApplication {
75
75
  * authenticated user data that will be injected into Controller methods
76
76
  * when using the decorator.
77
77
  *
78
- * MUST use PascalCase naming convention.
78
+ * DO: Use PascalCase naming convention.
79
79
  */
80
80
  name: string & PascalPattern;
81
81
  /**
@@ -12,16 +12,18 @@ export declare namespace IAutoBeRealizeWriteApplication {
12
12
  * function according to the Realize Coder Agent specification. Before
13
13
  * writing the actual code, think through the logic and structure.
14
14
  *
15
- * The plan MUST follow MANDATORY SCHEMA-FIRST APPROACH:
15
+ * The plan follows a SCHEMA-FIRST APPROACH:
16
16
  *
17
- * 📋 STEP 1 - PRISMA SCHEMA VERIFICATION (MOST CRITICAL):
17
+ * 📋 STEP 1 - PRISMA SCHEMA VERIFICATION:
18
18
  *
19
- * - EXAMINE the actual Prisma schema model definition
20
- * - LIST EVERY field that exists in the model with exact types
21
- * - EXPLICITLY NOTE fields that DO NOT exist (e.g., "Note: deleted_at field
22
- * DOES NOT EXIST")
23
- * - Common assumption errors to avoid: `deleted_at`, `created_by`,
24
- * `updated_by`, `is_deleted`, `is_active`
19
+ * DO:
20
+ * - Examine the actual Prisma schema model definition
21
+ * - List EVERY field that exists in the model with exact types
22
+ * - Explicitly note fields that DO NOT exist
23
+ *
24
+ * DO NOT:
25
+ * - Assume common fields exist without verification
26
+ * - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active without checking
25
27
  *
26
28
  * 📋 STEP 2 - FIELD INVENTORY:
27
29
  *
@@ -155,8 +157,9 @@ export declare namespace IAutoBeRealizeWriteApplication {
155
157
  * Draft WITHOUT using native Date type.
156
158
  *
157
159
  * This is the initial drafting phase where you outline the basic skeleton
158
- * of the function. CRITICAL: This draft must NEVER use the native Date
159
- * type.
160
+ * of the function.
161
+ *
162
+ * DO NOT: Use the native Date type.
160
163
  *
161
164
  * - The function signature must correctly include `user`, `parameters`, and
162
165
  * `body` arguments.
@@ -165,13 +168,13 @@ export declare namespace IAutoBeRealizeWriteApplication {
165
168
  * - Mark any incomplete or missing parts clearly with placeholders (e.g.,
166
169
  * comments or temporary values).
167
170
  *
168
- * ⚠️ Import rules:
171
+ * Import rules:
172
+ *
173
+ * DO NOT:
174
+ * - Add any new import statements manually
175
+ * - Write import statements directly (this causes compile errors)
169
176
  *
170
- * - Do NOT add any new import statements manually.
171
- * - All necessary imports are provided globally or by the system
172
- * automatically.
173
- * - Writing import statements directly is prohibited and may cause compile
174
- * errors. If import errors occur, check your environment configuration.
177
+ * Note: All necessary imports are provided globally or by the system automatically.
175
178
  *
176
179
  * ✅ Requirements:
177
180
  *
@@ -1,3 +1,4 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
2
  import { AutoBeOpenApi } from "@autobe/interface";
3
- export declare const transformTestScenarioHistories: (entire: AutoBeOpenApi.IOperation[], include: AutoBeOpenApi.IOperation[], exclude: Pick<AutoBeOpenApi.IOperation, "method" | "path">[]) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
3
+ import { AutoBeState } from "../../../context/AutoBeState";
4
+ export declare const transformTestScenarioHistories: (state: AutoBeState, entire: AutoBeOpenApi.IOperation[], include: AutoBeOpenApi.IOperation[], exclude: Pick<AutoBeOpenApi.IOperation, "method" | "path">[]) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
@@ -30,7 +30,7 @@ export declare namespace IAutoBeTestCorrectApplication {
30
30
  * AI analyzes the original test scenario, business requirements, and
31
31
  * intended functionality without being influenced by compilation errors.
32
32
  * This clean analysis establishes a clear understanding of what the test
33
- * should accomplish, the expected business workflow, and the correct API
33
+ * accomplishes, the expected business workflow, and the correct API
34
34
  * integration patterns.
35
35
  *
36
36
  * This step ensures that error correction doesn't lose sight of the
@@ -67,17 +67,18 @@ export declare namespace IAutoBeTestCorrectApplication {
67
67
  * AI generates the first corrected version of the test code based on error
68
68
  * analysis and correction strategies. This draft addresses all identified
69
69
  * compilation errors while preserving the original business logic and test
70
- * workflow. The code must be compilation-error-free and follow all
70
+ * workflow. The code is compilation-error-free and follows all
71
71
  * established conventions.
72
72
  *
73
73
  * The implementation incorporates lessons learned from error analysis to
74
74
  * produce properly typed, syntactically correct code that maintains the
75
75
  * intended test functionality. All type safety requirements and framework
76
- * conventions must be followed in this corrected implementation.
76
+ * conventions are followed in this corrected implementation.
77
77
  *
78
78
  * Workflow: Error correction → TypeScript implementation → Functional
79
- * preservation Critical: Must resolve all compilation errors while
80
- * maintaining original test intent
79
+ * preservation
80
+ *
81
+ * DO: Resolve all compilation errors while maintaining original test intent
81
82
  */
82
83
  draft: string;
83
84
  /**
@@ -57,7 +57,7 @@ export declare namespace IAutoBeTestScenarioApplication {
57
57
  *
58
58
  * ## Naming Convention
59
59
  *
60
- * MUST use snake_case naming convention.
60
+ * DO: Use snake_case naming convention.
61
61
  *
62
62
  * - Must start with `test_api_` prefix (mandatory requirement)
63
63
  * - ALWAYS start with business feature, NOT action verbs
@@ -0,0 +1,6 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+ export interface IAutoBeTestScenarioAuthorizationRole {
3
+ name: string;
4
+ join: AutoBeOpenApi.IOperation | null;
5
+ login: AutoBeOpenApi.IOperation | null;
6
+ }
@@ -0,0 +1,4 @@
1
+ import { AutoBeState } from "../context/AutoBeState";
2
+ type StepName = "analyze" | "prisma" | "interface" | "test" | "realize";
3
+ export declare const predicateStateMessage: (state: AutoBeState, future: StepName) => string | null;
4
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobe/agent",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "AI backend server code generator",
5
5
  "main": "lib/index.js",
6
6
  "author": "Wrtn Technologies",
@@ -20,15 +20,15 @@
20
20
  "README.md"
21
21
  ],
22
22
  "dependencies": {
23
- "@agentica/core": "^0.31.1",
23
+ "@agentica/core": "^0.32.1",
24
24
  "@prisma/internals": "^6.7.0",
25
25
  "@samchon/openapi": "^4.7.1",
26
26
  "openai": "^5.12.2",
27
27
  "tstl": "^3.0.0",
28
28
  "typia": "^9.7.1",
29
29
  "uuid": "^11.1.0",
30
- "@autobe/interface": "^0.18.0",
31
- "@autobe/utils": "^0.18.0"
30
+ "@autobe/interface": "^0.19.1",
31
+ "@autobe/utils": "^0.19.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@rollup/plugin-json": "^6.1.0",
@@ -40,8 +40,8 @@
40
40
  "ts-node": "^10.9.2",
41
41
  "ts-patch": "^3.3.0",
42
42
  "typescript": "~5.9.2",
43
- "@autobe/compiler": "^0.18.0",
44
- "@autobe/filesystem": "^0.18.0"
43
+ "@autobe/filesystem": "^0.19.1",
44
+ "@autobe/compiler": "^0.19.1"
45
45
  },
46
46
  "keywords": [
47
47
  "ai",
@@ -197,6 +197,8 @@ export class AutoBeAgent<Model extends ILlmSchema.Model>
197
197
  });
198
198
  previous = current;
199
199
  };
200
+
201
+ // SHIFT EVENTS
200
202
  this.agentica_.on("assistantMessage", async (message) => {
201
203
  const start = new Date();
202
204
  const history: AutoBeAssistantMessageHistory = {
@@ -220,6 +222,18 @@ export class AutoBeAgent<Model extends ILlmSchema.Model>
220
222
  this.agentica_.on("request", (e) => {
221
223
  if (e.body.parallel_tool_calls !== undefined)
222
224
  delete e.body.parallel_tool_calls;
225
+ void this.dispatch({
226
+ ...e,
227
+ type: "vendorRequest",
228
+ source: "facade",
229
+ }).catch(() => {});
230
+ });
231
+ this.agentica_.on("response", (e) => {
232
+ void this.dispatch({
233
+ ...e,
234
+ type: "vendorResponse",
235
+ source: "facade",
236
+ }).catch(() => {});
223
237
  });
224
238
  }
225
239
 
@@ -8,6 +8,7 @@ import {
8
8
  IAutoBeAgent,
9
9
  IAutoBeCompiler,
10
10
  IAutoBeCompilerListener,
11
+ IAutoBePlaygroundReplay,
11
12
  } from "@autobe/interface";
12
13
  import { Singleton, randint, sleep_for } from "tstl";
13
14
  import { v4 } from "uuid";
@@ -113,7 +114,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
113
114
  }
114
115
  this.histories_.push(userMessage);
115
116
  this.histories_.push(
116
- this.props_.preset.histories.find((h) => h.type === type)!,
117
+ this.props_.replay.histories.find((h) => h.type === type)!,
117
118
  );
118
119
  };
119
120
  if (state.analyze === null) await take("analyze");
@@ -135,7 +136,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
135
136
  private getEventSnapshots(
136
137
  state: "analyze" | "prisma" | "interface" | "test" | "realize",
137
138
  ): AutoBeEventSnapshot[] | null {
138
- return this.props_.preset[state] ?? null;
139
+ return this.props_.replay[state] ?? null;
139
140
  }
140
141
  }
141
142
  export namespace AutoBeMockAgent {
@@ -143,21 +144,18 @@ export namespace AutoBeMockAgent {
143
144
  compiler: (
144
145
  listener: IAutoBeCompilerListener,
145
146
  ) => IAutoBeCompiler | Promise<IAutoBeCompiler>;
146
- preset: IPreset;
147
- }
148
- export interface IPreset {
149
- histories: AutoBeHistory[];
150
- analyze?: AutoBeEventSnapshot[] | null;
151
- prisma?: AutoBeEventSnapshot[] | null;
152
- interface?: AutoBeEventSnapshot[] | null;
153
- test?: AutoBeEventSnapshot[] | null;
154
- realize?: AutoBeEventSnapshot[] | null;
147
+ replay: IAutoBePlaygroundReplay;
155
148
  }
156
149
  }
157
150
 
158
151
  const sleepMap: Record<AutoBeEvent.Type, number> = {
159
152
  userMessage: 1_000,
160
153
  assistantMessage: 1_000,
154
+ vendorRequest: 0,
155
+ vendorResponse: 0,
156
+ jsonParseError: 0,
157
+ jsonValidateError: 0,
158
+ consentFunctionCall: 0,
161
159
  // ANALYZE
162
160
  analyzeStart: 1_000,
163
161
  analyzeScenario: 1_000,