@autobe/agent 0.24.2 → 0.25.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 (297) hide show
  1. package/lib/AutoBeAgent.js +11 -1
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/AutoBeMockAgent.js +1 -0
  4. package/lib/AutoBeMockAgent.js.map +1 -1
  5. package/lib/constants/AutoBeSystemPromptConstant.d.ts +21 -21
  6. package/lib/context/IAutoBeApplication.d.ts +101 -6
  7. package/lib/context/IAutoBeApplicationProps.d.ts +6 -2
  8. package/lib/factory/createAgenticaHistory.js +1 -1
  9. package/lib/factory/createAgenticaHistory.js.map +1 -1
  10. package/lib/factory/createAutoBeApplication.js +80 -90
  11. package/lib/factory/createAutoBeApplication.js.map +1 -1
  12. package/lib/factory/createAutoBeContext.js +6 -5
  13. package/lib/factory/createAutoBeContext.js.map +1 -1
  14. package/lib/index.mjs +3914 -2594
  15. package/lib/index.mjs.map +1 -1
  16. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +5 -1
  17. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  18. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +1 -1
  19. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +18 -3
  20. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  21. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +5 -1
  22. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +19 -7
  23. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  24. package/lib/orchestrate/analyze/orchestrateAnalyze.js +3 -2
  25. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  26. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +1 -1
  27. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
  28. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  29. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +1 -0
  30. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
  31. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  32. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +1 -1
  33. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
  34. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +36 -23
  35. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  36. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +22 -42
  37. package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
  38. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  39. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +2 -1
  40. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
  41. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +5 -1
  42. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +20 -7
  43. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  44. package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.d.ts +3 -0
  45. package/lib/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.js → transformInterfaceCommonPrerequisiteHistories.js} +4 -4
  46. package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.js.map +1 -0
  47. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +6 -1
  48. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -23
  49. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  50. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +6 -1
  51. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +22 -6
  52. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  53. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
  54. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  55. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +4 -1
  56. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +27 -6
  57. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  58. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +5 -1
  59. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +21 -5
  60. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  61. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
  62. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  63. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +3 -0
  64. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +102 -0
  65. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +1 -0
  66. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +5 -1
  67. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +20 -4
  68. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  69. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
  70. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  71. package/lib/orchestrate/interface/orchestrateInterface.js +45 -11
  72. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  73. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +1 -1
  74. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +277 -37
  75. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  76. package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -1
  77. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +69 -70
  78. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  79. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +6 -1
  80. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +28 -13
  81. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  82. package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -1
  83. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +11 -8
  84. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  85. package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +5 -1
  86. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +36 -21
  87. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  88. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +260 -29
  89. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  90. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.d.ts +5 -0
  91. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +713 -0
  92. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -0
  93. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +5 -1
  94. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +83 -53
  95. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  96. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js +41 -7
  97. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
  98. package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +0 -38
  99. package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -10
  100. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +52 -0
  101. package/lib/orchestrate/{common/structures/IAutoBeCommonCorrectDateApplication.js → interface/structures/IAutoBeInterfacePrerequisitesApplication.js} +1 -1
  102. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +1 -0
  103. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +0 -33
  104. package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +6 -2
  105. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +105 -5
  106. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
  107. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +20 -1
  108. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
  109. package/lib/orchestrate/interface/utils/OperationValidator.d.ts +3 -4
  110. package/lib/orchestrate/interface/utils/OperationValidator.js +1 -1
  111. package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
  112. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +4 -1
  113. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +19 -8
  114. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  115. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
  116. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  117. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +6 -1
  118. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +20 -6
  119. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  120. package/lib/orchestrate/prisma/orchestratePrisma.js +3 -3
  121. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  122. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
  123. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -3
  124. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  125. package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +1 -1
  126. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +12 -6
  127. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  128. package/lib/orchestrate/{common/histories/transformCommonCorrectDateHistories.d.ts → realize/histories/transformRealizeCorrectCastingHistories.d.ts} +1 -2
  129. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +32 -0
  130. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -0
  131. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +14 -22
  132. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  133. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +6 -6
  134. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +8 -2
  135. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  136. package/lib/orchestrate/realize/internal/compileRealizeFiles.js +1 -2
  137. package/lib/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
  138. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.d.ts +2 -1
  139. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +119 -42
  140. package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
  141. package/lib/orchestrate/realize/orchestrateRealize.js +82 -52
  142. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  143. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +128 -88
  144. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  145. package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -1
  146. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +117 -54
  147. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  148. package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +52 -26
  149. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +44 -34
  150. package/lib/orchestrate/realize/utils/InternalFileSystem.js +1 -1
  151. package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -1
  152. package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -5
  153. package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
  154. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +8 -3
  155. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +44 -17
  156. package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
  157. package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +4 -1
  158. package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js +24 -9
  159. package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -1
  160. package/lib/orchestrate/realize/utils/printErrorHints.d.ts +8 -0
  161. package/lib/orchestrate/realize/utils/printErrorHints.js +48 -0
  162. package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -0
  163. package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +1 -0
  164. package/lib/orchestrate/realize/utils/replaceImportStatements.js +93 -53
  165. package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  166. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +5 -1
  167. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +11 -7
  168. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  169. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +1 -1
  170. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
  171. package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +7 -1
  172. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +35 -96
  173. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  174. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +6 -3
  175. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +33 -77
  176. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
  177. package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +5 -1
  178. package/lib/orchestrate/test/histories/transformTestWriteHistories.js +111 -94
  179. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  180. package/lib/orchestrate/test/orchestrateTest.js +20 -14
  181. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  182. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -1
  183. package/lib/orchestrate/test/orchestrateTestCorrect.js +81 -50
  184. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  185. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +31 -13
  186. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  187. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
  188. package/lib/orchestrate/test/orchestrateTestScenario.js +18 -7
  189. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  190. package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -1
  191. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +20 -12
  192. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  193. package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -1
  194. package/lib/orchestrate/test/orchestrateTestWrite.js +46 -25
  195. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  196. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +9 -5
  197. package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.d.ts +8 -2
  198. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +11 -7
  199. package/lib/orchestrate/test/utils/getPrerequisites.d.ts +5 -0
  200. package/lib/orchestrate/test/utils/getPrerequisites.js +36 -0
  201. package/lib/orchestrate/test/utils/getPrerequisites.js.map +1 -0
  202. package/lib/orchestrate/test/utils/getReferenceIds.js +1 -1
  203. package/lib/orchestrate/test/utils/getReferenceIds.js.map +1 -1
  204. package/package.json +5 -5
  205. package/src/AutoBeAgent.ts +17 -1
  206. package/src/AutoBeMockAgent.ts +1 -0
  207. package/src/constants/AutoBeSystemPromptConstant.ts +21 -21
  208. package/src/context/IAutoBeApplication.ts +101 -6
  209. package/src/context/IAutoBeApplicationProps.ts +6 -2
  210. package/src/factory/createAgenticaHistory.ts +11 -5
  211. package/src/factory/createAutoBeContext.ts +6 -5
  212. package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +5 -1
  213. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +16 -0
  214. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +22 -7
  215. package/src/orchestrate/analyze/orchestrateAnalyze.ts +3 -2
  216. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +2 -1
  217. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
  218. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +2 -2
  219. package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +25 -45
  220. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +2 -1
  221. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +23 -9
  222. package/src/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.ts → transformInterfaceCommonPrerequisiteHistories.ts} +1 -1
  223. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +33 -24
  224. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +26 -9
  225. package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +30 -6
  226. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +24 -7
  227. package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +118 -0
  228. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +23 -6
  229. package/src/orchestrate/interface/orchestrateInterface.ts +65 -20
  230. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +22 -12
  231. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +34 -47
  232. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +40 -28
  233. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +9 -3
  234. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +51 -35
  235. package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +274 -0
  236. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +52 -33
  237. package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +1 -1
  238. package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +0 -39
  239. package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -10
  240. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +58 -0
  241. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +0 -34
  242. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +92 -4
  243. package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +19 -1
  244. package/src/orchestrate/interface/utils/OperationValidator.ts +9 -7
  245. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +20 -6
  246. package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +24 -9
  247. package/src/orchestrate/prisma/orchestratePrisma.ts +7 -3
  248. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +5 -1
  249. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +15 -10
  250. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +44 -0
  251. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -24
  252. package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +6 -6
  253. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +6 -4
  254. package/src/orchestrate/realize/internal/compileRealizeFiles.ts +1 -5
  255. package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +102 -16
  256. package/src/orchestrate/realize/orchestrateRealize.ts +121 -81
  257. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +50 -7
  258. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +14 -4
  259. package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +54 -29
  260. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +46 -35
  261. package/src/orchestrate/realize/utils/InternalFileSystem.ts +1 -1
  262. package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -5
  263. package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +54 -22
  264. package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +28 -16
  265. package/src/orchestrate/realize/utils/printErrorHints.ts +55 -0
  266. package/src/orchestrate/realize/utils/replaceImportStatements.ts +99 -97
  267. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +14 -7
  268. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +50 -115
  269. package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +41 -111
  270. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +35 -12
  271. package/src/orchestrate/test/orchestrateTest.ts +19 -13
  272. package/src/orchestrate/test/orchestrateTestCorrect.ts +71 -51
  273. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +13 -1
  274. package/src/orchestrate/test/orchestrateTestScenario.ts +27 -17
  275. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +32 -19
  276. package/src/orchestrate/test/orchestrateTestWrite.ts +20 -10
  277. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +9 -228
  278. package/src/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.ts +8 -2
  279. package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +11 -78
  280. package/src/orchestrate/test/utils/getPrerequisites.ts +51 -0
  281. package/src/orchestrate/test/utils/getReferenceIds.ts +2 -1
  282. package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js +0 -48
  283. package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js.map +0 -1
  284. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.d.ts +0 -35
  285. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js.map +0 -1
  286. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +0 -3
  287. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +0 -1
  288. package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.d.ts +0 -6
  289. package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js +0 -22
  290. package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +0 -1
  291. package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.d.ts +0 -4
  292. package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js +0 -540
  293. package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js.map +0 -1
  294. package/src/orchestrate/common/histories/transformCommonCorrectDateHistories.ts +0 -60
  295. package/src/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.ts +0 -40
  296. package/src/orchestrate/interface/utils/OpenApiEndpointComparator.ts +0 -23
  297. package/src/orchestrate/realize/orchestrateRealizeCorrectDate.ts +0 -372
@@ -1,11 +1,7 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
2
  import { AutoBeOpenApi } from "@autobe/interface";
3
- import {
4
- ILlmApplication,
5
- ILlmSchema,
6
- IValidation,
7
- OpenApiTypeChecker,
8
- } from "@samchon/openapi";
3
+ import { missedOpenApiSchemas } from "@autobe/utils";
4
+ import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
9
5
  import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
10
6
  import { IPointer } from "tstl";
11
7
  import typia from "typia";
@@ -22,20 +18,24 @@ import { fulfillJsonSchemaErrorMessages } from "./utils/fulfillJsonSchemaErrorMe
22
18
 
23
19
  export function orchestrateInterfaceComplement<Model extends ILlmSchema.Model>(
24
20
  ctx: AutoBeContext<Model>,
25
- document: AutoBeOpenApi.IDocument,
21
+ props: {
22
+ instruction: string;
23
+ document: AutoBeOpenApi.IDocument;
24
+ },
26
25
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
27
- return step(ctx, document, 8);
26
+ return step(ctx, props, false);
28
27
  }
29
28
 
30
29
  async function step<Model extends ILlmSchema.Model>(
31
30
  ctx: AutoBeContext<Model>,
32
- document: AutoBeOpenApi.IDocument,
33
- life: number,
31
+ props: {
32
+ instruction: string;
33
+ document: AutoBeOpenApi.IDocument;
34
+ },
35
+ wasEmpty: boolean,
34
36
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
35
- const missed: string[] = getMissed(document);
36
- if (missed.length === 0 || life < 0) {
37
- return document.components.schemas;
38
- }
37
+ const missed: string[] = missedOpenApiSchemas(props.document);
38
+ if (missed.length === 0) return props.document.components.schemas;
39
39
 
40
40
  const pointer: IPointer<Record<
41
41
  string,
@@ -45,11 +45,12 @@ async function step<Model extends ILlmSchema.Model>(
45
45
  };
46
46
  const { tokenUsage } = await ctx.conversate({
47
47
  source: "interfaceComplement",
48
- histories: transformInterfaceComplementHistories(
49
- ctx.state(),
50
- document,
48
+ histories: transformInterfaceComplementHistories({
49
+ state: ctx.state(),
50
+ instruction: props.instruction,
51
+ document: props.document,
51
52
  missed,
52
- ),
53
+ }),
53
54
  controller: createController({
54
55
  model: ctx.model,
55
56
  build: (next) => {
@@ -83,45 +84,31 @@ async function step<Model extends ILlmSchema.Model>(
83
84
  created_at: new Date().toISOString(),
84
85
  });
85
86
 
87
+ const empty: boolean = Object.keys(pointer.value).length === 0;
88
+ if (empty === true && wasEmpty === true)
89
+ return props.document.components.schemas;
90
+
86
91
  const newSchemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {
87
92
  ...pointer.value,
88
- ...document.components.schemas,
93
+ ...props.document.components.schemas,
89
94
  };
90
- JsonSchemaNamingConvention.schemas(document.operations, newSchemas);
95
+ JsonSchemaNamingConvention.schemas(props.document.operations, newSchemas);
91
96
  return step(
92
97
  ctx,
93
98
  {
94
- ...document,
95
- components: {
96
- ...document.components,
97
- schemas: newSchemas,
99
+ instruction: props.instruction,
100
+ document: {
101
+ ...props.document,
102
+ components: {
103
+ ...props.document.components,
104
+ schemas: newSchemas,
105
+ },
98
106
  },
99
107
  },
100
- life - 1,
108
+ empty,
101
109
  );
102
110
  }
103
111
 
104
- const getMissed = (document: AutoBeOpenApi.IDocument): string[] => {
105
- const missed: Set<string> = new Set();
106
- const check = (name: string) => {
107
- if (document.components.schemas[name] === undefined) missed.add(name);
108
- };
109
- for (const op of document.operations) {
110
- if (op.requestBody !== null) check(op.requestBody.typeName);
111
- if (op.responseBody !== null) check(op.responseBody.typeName);
112
- }
113
- for (const value of Object.values(document.components.schemas))
114
- OpenApiTypeChecker.visit({
115
- components: document.components,
116
- schema: value,
117
- closure: (next) => {
118
- if (OpenApiTypeChecker.isReference(next))
119
- check(next.$ref.split("/").pop()!);
120
- },
121
- });
122
- return Array.from(missed);
123
- };
124
-
125
112
  function createController<Model extends ILlmSchema.Model>(props: {
126
113
  model: Model;
127
114
  build: (
@@ -133,7 +120,7 @@ function createController<Model extends ILlmSchema.Model>(props: {
133
120
  const validate = (
134
121
  next: unknown,
135
122
  ): IValidation<IAutoBeInterfaceComplementApplication.IProps> => {
136
- JsonSchemaFactory.fix("schemas", next);
123
+ JsonSchemaFactory.fixPage("schemas", next);
137
124
 
138
125
  const result: IValidation<IAutoBeInterfaceComplementApplication.IProps> =
139
126
  typia.validate<IAutoBeInterfaceComplementApplication.IProps>(next);
@@ -5,6 +5,7 @@ import {
5
5
  AutoBeProgressEventBase,
6
6
  } from "@autobe/interface";
7
7
  import { AutoBeInterfaceGroup } from "@autobe/interface/src/histories/contents/AutoBeInterfaceGroup";
8
+ import { AutoBeOpenApiEndpointComparator } from "@autobe/utils";
8
9
  import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
9
10
  import { HashSet, IPointer } from "tstl";
10
11
  import typia from "typia";
@@ -16,45 +17,55 @@ import { executeCachedBatch } from "../../utils/executeCachedBatch";
16
17
  import { transformInterfaceEndpointHistories } from "./histories/transformInterfaceEndpointHistories";
17
18
  import { orchestrateInterfaceEndpointsReview } from "./orchestrateInterfaceEndpointsReview";
18
19
  import { IAutoBeInterfaceEndpointApplication } from "./structures/IAutoBeInterfaceEndpointApplication";
19
- import { OpenApiEndpointComparator } from "./utils/OpenApiEndpointComparator";
20
20
 
21
21
  export async function orchestrateInterfaceEndpoints<
22
22
  Model extends ILlmSchema.Model,
23
23
  >(
24
24
  ctx: AutoBeContext<Model>,
25
- groups: AutoBeInterfaceGroup[],
26
- authorizations: AutoBeOpenApi.IOperation[],
27
- content: string = `Make endpoints for the given assets`,
25
+ props: {
26
+ groups: AutoBeInterfaceGroup[];
27
+ authorizations: AutoBeOpenApi.IOperation[];
28
+ instruction: string;
29
+ message?: string;
30
+ },
28
31
  ): Promise<AutoBeOpenApi.IEndpoint[]> {
29
32
  const progress: AutoBeProgressEventBase = {
30
- total: groups.length,
33
+ total: props.groups.length,
31
34
  completed: 0,
32
35
  };
33
36
  const endpoints: AutoBeOpenApi.IEndpoint[] = (
34
37
  await executeCachedBatch(
35
- groups.map(
36
- (g) => (promptCacheKey) =>
37
- process(ctx, g, content, progress, authorizations, promptCacheKey),
38
+ props.groups.map(
39
+ (group) => (promptCacheKey) =>
40
+ process(ctx, {
41
+ group,
42
+ authorizations: props.authorizations,
43
+ instruction: props.instruction,
44
+ message: props.message ?? "Make endpoints for the given assets.",
45
+ progress,
46
+ promptCacheKey,
47
+ }),
38
48
  ),
39
49
  )
40
50
  ).flat();
41
-
42
51
  const deduplicated: AutoBeOpenApi.IEndpoint[] = new HashSet(
43
52
  endpoints,
44
- OpenApiEndpointComparator.hashCode,
45
- OpenApiEndpointComparator.equals,
53
+ AutoBeOpenApiEndpointComparator.hashCode,
54
+ AutoBeOpenApiEndpointComparator.equals,
46
55
  ).toJSON();
47
-
48
56
  return orchestrateInterfaceEndpointsReview(ctx, deduplicated);
49
57
  }
50
58
 
51
59
  async function process<Model extends ILlmSchema.Model>(
52
60
  ctx: AutoBeContext<Model>,
53
- group: AutoBeInterfaceGroup,
54
- message: string,
55
- progress: AutoBeProgressEventBase,
56
- authorizations: AutoBeOpenApi.IOperation[],
57
- promptCacheKey: string,
61
+ props: {
62
+ group: AutoBeInterfaceGroup;
63
+ message: string;
64
+ progress: AutoBeProgressEventBase;
65
+ authorizations: AutoBeOpenApi.IOperation[];
66
+ promptCacheKey: string;
67
+ instruction: string;
68
+ },
58
69
  ): Promise<AutoBeOpenApi.IEndpoint[]> {
59
70
  const start: Date = new Date();
60
71
  const pointer: IPointer<AutoBeOpenApi.IEndpoint[] | null> = {
@@ -62,11 +73,12 @@ async function process<Model extends ILlmSchema.Model>(
62
73
  };
63
74
  const { tokenUsage } = await ctx.conversate({
64
75
  source: "interfaceEndpoints",
65
- histories: transformInterfaceEndpointHistories(
66
- ctx.state(),
67
- group,
68
- authorizations,
69
- ),
76
+ histories: transformInterfaceEndpointHistories({
77
+ state: ctx.state(),
78
+ group: props.group,
79
+ authorizations: props.authorizations,
80
+ instruction: props.instruction,
81
+ }),
70
82
  controller: createController({
71
83
  model: ctx.model,
72
84
  build: (endpoints) => {
@@ -75,8 +87,8 @@ async function process<Model extends ILlmSchema.Model>(
75
87
  },
76
88
  }),
77
89
  enforceFunctionCall: true,
78
- promptCacheKey,
79
- message,
90
+ promptCacheKey: props.promptCacheKey,
91
+ message: props.message,
80
92
  });
81
93
  if (pointer.value === null) throw new Error("Failed to generate endpoints."); // unreachable
82
94
 
@@ -85,14 +97,14 @@ async function process<Model extends ILlmSchema.Model>(
85
97
  id: v7(),
86
98
  endpoints: new HashSet(
87
99
  pointer.value,
88
- OpenApiEndpointComparator.hashCode,
89
- OpenApiEndpointComparator.equals,
100
+ AutoBeOpenApiEndpointComparator.hashCode,
101
+ AutoBeOpenApiEndpointComparator.equals,
90
102
  ).toJSON(),
91
103
  tokenUsage,
92
104
  created_at: start.toISOString(),
93
105
  step: ctx.state().analyze?.step ?? 0,
94
- completed: ++progress.completed,
95
- total: progress.total,
106
+ completed: ++props.progress.completed,
107
+ total: props.progress.total,
96
108
  };
97
109
  ctx.dispatch(event);
98
110
  return pointer.value;
@@ -14,7 +14,10 @@ export async function orchestrateInterfaceGroups<
14
14
  Model extends ILlmSchema.Model,
15
15
  >(
16
16
  ctx: AutoBeContext<Model>,
17
- message: string = "Design API operations for the given assets.",
17
+ props: {
18
+ instruction: string;
19
+ message?: string;
20
+ },
18
21
  ): Promise<AutoBeInterfaceGroupsEvent> {
19
22
  const start: Date = new Date();
20
23
  const pointer: IPointer<IAutoBeInterfaceGroupApplication.IProps | null> = {
@@ -22,7 +25,10 @@ export async function orchestrateInterfaceGroups<
22
25
  };
23
26
  const { tokenUsage } = await ctx.conversate({
24
27
  source: "interfaceGroups",
25
- histories: transformInterfaceGroupHistories(ctx.state()),
28
+ histories: transformInterfaceGroupHistories({
29
+ state: ctx.state(),
30
+ instruction: props.instruction,
31
+ }),
26
32
  controller: createController({
27
33
  model: ctx.model,
28
34
  build: (next) => {
@@ -30,7 +36,7 @@ export async function orchestrateInterfaceGroups<
30
36
  },
31
37
  }),
32
38
  enforceFunctionCall: true,
33
- message,
39
+ message: props.message ?? "Design API operations for the given assets.",
34
40
  });
35
41
  if (pointer.value === null) throw new Error("Failed to generate groups."); // unreachable
36
42
  return {
@@ -4,7 +4,7 @@ import {
4
4
  AutoBeOpenApi,
5
5
  AutoBeProgressEventBase,
6
6
  } from "@autobe/interface";
7
- import { StringUtil } from "@autobe/utils";
7
+ import { AutoBeOpenApiEndpointComparator, StringUtil } from "@autobe/utils";
8
8
  import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
9
9
  import { HashMap, HashSet, IPointer } from "tstl";
10
10
  import typia from "typia";
@@ -19,21 +19,22 @@ import { executeCachedBatch } from "../../utils/executeCachedBatch";
19
19
  import { transformInterfaceOperationHistories } from "./histories/transformInterfaceOperationHistories";
20
20
  import { orchestrateInterfaceOperationsReview } from "./orchestrateInterfaceOperationsReview";
21
21
  import { IAutoBeInterfaceOperationApplication } from "./structures/IAutoBeInterfaceOperationApplication";
22
- import { OpenApiEndpointComparator } from "./utils/OpenApiEndpointComparator";
23
22
  import { OperationValidator } from "./utils/OperationValidator";
24
23
 
25
24
  export async function orchestrateInterfaceOperations<
26
25
  Model extends ILlmSchema.Model,
27
26
  >(
28
27
  ctx: AutoBeContext<Model>,
29
- endpoints: AutoBeOpenApi.IEndpoint[],
30
- capacity: number = AutoBeConfigConstant.INTERFACE_CAPACITY,
28
+ props: {
29
+ instruction: string;
30
+ endpoints: AutoBeOpenApi.IEndpoint[];
31
+ capacity?: number;
32
+ },
31
33
  ): Promise<AutoBeOpenApi.IOperation[]> {
32
34
  const matrix: AutoBeOpenApi.IEndpoint[][] = divideArray({
33
- array: endpoints,
34
- capacity,
35
+ array: props.endpoints,
36
+ capacity: props.capacity ?? AutoBeConfigConstant.INTERFACE_CAPACITY,
35
37
  });
36
-
37
38
  const progress: AutoBeProgressEventBase = {
38
39
  total: matrix.flat().length,
39
40
  completed: 0,
@@ -45,13 +46,13 @@ export async function orchestrateInterfaceOperations<
45
46
  return (
46
47
  await executeCachedBatch(
47
48
  matrix.map((it) => async (promptCacheKey) => {
48
- const row: AutoBeOpenApi.IOperation[] = await divideAndConquer(
49
- ctx,
50
- it,
49
+ const row: AutoBeOpenApi.IOperation[] = await divideAndConquer(ctx, {
50
+ endpoints: it,
51
51
  progress,
52
52
  reviewProgress,
53
53
  promptCacheKey,
54
- );
54
+ instruction: props.instruction,
55
+ });
55
56
  return row;
56
57
  }),
57
58
  )
@@ -60,25 +61,34 @@ export async function orchestrateInterfaceOperations<
60
61
 
61
62
  async function divideAndConquer<Model extends ILlmSchema.Model>(
62
63
  ctx: AutoBeContext<Model>,
63
- endpoints: AutoBeOpenApi.IEndpoint[],
64
- operationsProgress: AutoBeProgressEventBase,
65
- operationsReviewProgress: AutoBeProgressEventBase,
66
- promptCacheKey: string,
64
+ props: {
65
+ endpoints: AutoBeOpenApi.IEndpoint[];
66
+ progress: AutoBeProgressEventBase;
67
+ reviewProgress: AutoBeProgressEventBase;
68
+ promptCacheKey: string;
69
+ instruction: string;
70
+ },
67
71
  ): Promise<AutoBeOpenApi.IOperation[]> {
68
72
  const remained: HashSet<AutoBeOpenApi.IEndpoint> = new HashSet(
69
- endpoints,
70
- OpenApiEndpointComparator.hashCode,
71
- OpenApiEndpointComparator.equals,
73
+ props.endpoints,
74
+ AutoBeOpenApiEndpointComparator.hashCode,
75
+ AutoBeOpenApiEndpointComparator.equals,
72
76
  );
73
77
  const unique: HashMap<AutoBeOpenApi.IEndpoint, AutoBeOpenApi.IOperation> =
74
78
  new HashMap(
75
- OpenApiEndpointComparator.hashCode,
76
- OpenApiEndpointComparator.equals,
79
+ AutoBeOpenApiEndpointComparator.hashCode,
80
+ AutoBeOpenApiEndpointComparator.equals,
77
81
  );
78
82
  for (let i: number = 0; i < ctx.retry; ++i) {
79
- if (remained.empty() === true || unique.size() >= endpoints.length) break;
83
+ if (remained.empty() === true || unique.size() >= props.endpoints.length)
84
+ break;
80
85
  const operations: AutoBeOpenApi.IOperation[] = remained.size()
81
- ? await process(ctx, remained, operationsProgress, promptCacheKey)
86
+ ? await process(ctx, {
87
+ endpoints: remained,
88
+ progress: props.progress,
89
+ promptCacheKey: props.promptCacheKey,
90
+ instruction: props.instruction,
91
+ })
82
92
  : [];
83
93
 
84
94
  for (const item of operations) {
@@ -90,7 +100,7 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
90
100
  await orchestrateInterfaceOperationsReview(
91
101
  ctx,
92
102
  unique.toJSON().map((it) => it.second),
93
- operationsReviewProgress,
103
+ props.reviewProgress,
94
104
  );
95
105
  for (const item of newbie) unique.set(item, item);
96
106
  return unique.toJSON().map((it) => it.second);
@@ -98,9 +108,12 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
98
108
 
99
109
  async function process<Model extends ILlmSchema.Model>(
100
110
  ctx: AutoBeContext<Model>,
101
- endpoints: HashSet<AutoBeOpenApi.IEndpoint>,
102
- progress: AutoBeProgressEventBase,
103
- promptCacheKey: string,
111
+ props: {
112
+ endpoints: HashSet<AutoBeOpenApi.IEndpoint>;
113
+ progress: AutoBeProgressEventBase;
114
+ promptCacheKey: string;
115
+ instruction: string;
116
+ },
104
117
  ): Promise<AutoBeOpenApi.IOperation[]> {
105
118
  const prefix: string = NamingConvention.camel(ctx.state().analyze!.prefix);
106
119
  const pointer: IPointer<AutoBeOpenApi.IOperation[] | null> = {
@@ -108,10 +121,11 @@ async function process<Model extends ILlmSchema.Model>(
108
121
  };
109
122
  const { tokenUsage } = await ctx.conversate({
110
123
  source: "interfaceOperations",
111
- histories: transformInterfaceOperationHistories(
112
- ctx.state(),
113
- endpoints.toJSON(),
114
- ),
124
+ histories: transformInterfaceOperationHistories({
125
+ state: ctx.state(),
126
+ endpoints: props.endpoints.toJSON(),
127
+ instruction: props.instruction,
128
+ }),
115
129
  controller: createController({
116
130
  model: ctx.model,
117
131
  roles: ctx.state().analyze?.roles.map((it) => it.name) ?? [],
@@ -129,6 +143,7 @@ async function process<Model extends ILlmSchema.Model>(
129
143
  .join("/"),
130
144
  authorizationRole: null,
131
145
  authorizationType: null,
146
+ prerequisites: [],
132
147
  },
133
148
  ];
134
149
  return op.authorizationRoles.map((role) => ({
@@ -140,13 +155,14 @@ async function process<Model extends ILlmSchema.Model>(
140
155
  .join("/"),
141
156
  authorizationRole: role,
142
157
  authorizationType: null,
158
+ prerequisites: [],
143
159
  }));
144
160
  });
145
161
  pointer.value.push(...matrix.flat());
146
- progress.completed += matrix.flat().length;
147
- progress.total += operations
162
+ props.progress.completed += matrix.flat().length;
163
+ props.progress.total += operations
148
164
  .map((op) =>
149
- endpoints.has({ path: op.path, method: op.method })
165
+ props.endpoints.has({ path: op.path, method: op.method })
150
166
  ? op.authorizationRoles.length === 0
151
167
  ? 0
152
168
  : op.authorizationRoles.length - 1
@@ -156,7 +172,7 @@ async function process<Model extends ILlmSchema.Model>(
156
172
  },
157
173
  }),
158
174
  enforceFunctionCall: true,
159
- promptCacheKey,
175
+ promptCacheKey: props.promptCacheKey,
160
176
  message: "Make API operations",
161
177
  });
162
178
  if (pointer.value === null) throw new Error("Failed to create operations."); // never be happened
@@ -166,7 +182,7 @@ async function process<Model extends ILlmSchema.Model>(
166
182
  id: v7(),
167
183
  operations: pointer.value,
168
184
  tokenUsage,
169
- ...progress,
185
+ ...props.progress,
170
186
  step: ctx.state().analyze?.step ?? 0,
171
187
  created_at: new Date().toISOString(),
172
188
  } satisfies AutoBeInterfaceOperationsEvent);