@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,4 +1,3 @@
1
- import { IAutoBeApplicationProps } from "./IAutoBeApplicationProps";
2
1
  import { IAutoBeApplicationResult } from "./IAutoBeApplicationResult";
3
2
 
4
3
  /**
@@ -26,7 +25,26 @@ export interface IAutoBeApplication {
26
25
  * conversation. When executed after other agents have generated code, it can
27
26
  * also interpret change requests in the context of existing implementations.
28
27
  */
29
- analyze(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
28
+ analyze(props: {
29
+ /**
30
+ * Requirements-focused instructions extracted from user utterances.
31
+ *
32
+ * Contains AI-interpreted guidance specifically for the requirements
33
+ * analysis phase. Should focus ONLY on features, business rules, user
34
+ * stories, and functional specifications. Must NOT include database design,
35
+ * API patterns, or implementation details which belong to other phases.
36
+ *
37
+ * **CRITICAL**: Only include what the user actually said. NEVER fabricate
38
+ * or invent requirements the user didn't mention.
39
+ *
40
+ * Examples:
41
+ *
42
+ * - "Focus on inventory management with real-time stock tracking"
43
+ * - "Prioritize user authentication with role-based permissions"
44
+ * - "Emphasize order processing workflow with approval stages"
45
+ */
46
+ instruction: string;
47
+ }): Promise<IAutoBeApplicationResult>;
30
48
 
31
49
  /**
32
50
  * Run prisma agent.
@@ -47,7 +65,26 @@ export interface IAutoBeApplication {
47
65
  * generate ERD documentation using prisma-markdown. An internal review
48
66
  * process ensures schema quality and optimization.
49
67
  */
50
- prisma(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
68
+ prisma(props: {
69
+ /**
70
+ * Database design instructions extracted from user utterances.
71
+ *
72
+ * Contains AI-interpreted guidance specifically for the database schema
73
+ * design phase. Should focus ONLY on schema structure, relationships,
74
+ * constraints, and indexing strategies. Must NOT include API design or
75
+ * business logic implementation details.
76
+ *
77
+ * **CRITICAL**: Only include what the user actually said. NEVER fabricate
78
+ * or invent requirements the user didn't mention.
79
+ *
80
+ * Examples:
81
+ *
82
+ * - "Design flexible product catalog with variant support"
83
+ * - "Optimize for high-volume transaction queries"
84
+ * - "Implement strict referential integrity for financial data"
85
+ */
86
+ instruction: string;
87
+ }): Promise<IAutoBeApplicationResult>;
51
88
 
52
89
  /**
53
90
  * Run interface agent.
@@ -62,7 +99,26 @@ export interface IAutoBeApplication {
62
99
  * generated interface includes comprehensive JSDoc comments and undergoes
63
100
  * internal review for consistency.
64
101
  */
65
- interface(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
102
+ interface(props: {
103
+ /**
104
+ * API design instructions extracted from user utterances.
105
+ *
106
+ * Contains AI-interpreted guidance specifically for the API interface
107
+ * design phase. Should focus ONLY on endpoint patterns, request/response
108
+ * formats, DTO schemas, and operation specifications. Must NOT include
109
+ * database details or implementation logic.
110
+ *
111
+ * **CRITICAL**: Only include what the user actually said. NEVER fabricate
112
+ * or invent requirements the user didn't mention.
113
+ *
114
+ * Examples:
115
+ *
116
+ * - "Create RESTful endpoints with pagination for all list operations"
117
+ * - "Design mobile-friendly APIs with minimal response payloads"
118
+ * - "Follow OpenAPI 3.0 patterns with comprehensive error responses"
119
+ */
120
+ instruction: string;
121
+ }): Promise<IAutoBeApplicationResult>;
66
122
 
67
123
  /**
68
124
  * Run test program agent.
@@ -85,7 +141,26 @@ export interface IAutoBeApplication {
85
141
  * TypeScript compiler validation and internal review ensure test quality and
86
142
  * optimal coverage.
87
143
  */
88
- test(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
144
+ test(props: {
145
+ /**
146
+ * Testing strategy instructions extracted from user utterances.
147
+ *
148
+ * Contains AI-interpreted guidance specifically for the test code
149
+ * generation phase. Should focus ONLY on test scenarios, coverage
150
+ * priorities, edge cases, and validation strategies. Must NOT include
151
+ * implementation or API design details.
152
+ *
153
+ * **CRITICAL**: Only include what the user actually said. NEVER fabricate
154
+ * or invent requirements the user didn't mention.
155
+ *
156
+ * Examples:
157
+ *
158
+ * - "Prioritize payment flow testing with failure scenarios"
159
+ * - "Generate comprehensive tests for concurrent user operations"
160
+ * - "Focus on data integrity validation across all endpoints"
161
+ */
162
+ instruction: string;
163
+ }): Promise<IAutoBeApplicationResult>;
89
164
 
90
165
  /**
91
166
  * Run realize agent.
@@ -108,5 +183,25 @@ export interface IAutoBeApplication {
108
183
  * validation checks, and processes business rules according to
109
184
  * specifications.
110
185
  */
111
- realize(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
186
+ realize(props: {
187
+ /**
188
+ * Implementation instructions extracted from user utterances.
189
+ *
190
+ * Contains AI-interpreted guidance specifically for the business logic
191
+ * implementation phase. Should focus ONLY on architectural patterns,
192
+ * performance requirements, business logic details, and service layer
193
+ * decisions. Must NOT include database schema or API interface
194
+ * specifications.
195
+ *
196
+ * **CRITICAL**: Only include what the user actually said. NEVER fabricate
197
+ * or invent requirements the user didn't mention.
198
+ *
199
+ * Examples:
200
+ *
201
+ * - "Implement with caching for frequently accessed data"
202
+ * - "Use transaction patterns for financial operations"
203
+ * - "Optimize for 10K concurrent users with rate limiting"
204
+ */
205
+ instruction: string;
206
+ }): Promise<IAutoBeApplicationResult>;
112
207
  }
@@ -1,4 +1,8 @@
1
1
  export interface IAutoBeApplicationProps {
2
- /** The reason of the function call. */
3
- reason: string;
2
+ /**
3
+ * Instructions for each agent phase redefined by AI from user's utterance.
4
+ * Contains specific guidance for analyze/prisma/interface/test/realize
5
+ * agents.
6
+ */
7
+ instruction: string;
4
8
  }
@@ -1,4 +1,8 @@
1
- import { AgenticaOperation, MicroAgenticaHistory } from "@agentica/core";
1
+ import {
2
+ AgenticaExecuteHistory,
3
+ AgenticaOperation,
4
+ MicroAgenticaHistory,
5
+ } from "@agentica/core";
2
6
  import {
3
7
  AutoBeAssistantMessageHistory,
4
8
  AutoBeHistory,
@@ -6,6 +10,8 @@ import {
6
10
  } from "@autobe/interface";
7
11
  import { ILlmSchema } from "@samchon/openapi";
8
12
 
13
+ import { IAutoBeApplicationProps } from "../context/IAutoBeApplicationProps";
14
+
9
15
  export function createAgenticaHistory<Model extends ILlmSchema.Model>(props: {
10
16
  operations: readonly AgenticaOperation<Model>[];
11
17
  history: AutoBeHistory;
@@ -30,8 +36,8 @@ export function createAgenticaHistory<Model extends ILlmSchema.Model>(props: {
30
36
  created_at: props.history.created_at,
31
37
  type: "execute" as const,
32
38
  arguments: {
33
- reason: props.history.reason,
34
- },
39
+ instruction: props.history.instruction,
40
+ } satisfies IAutoBeApplicationProps,
35
41
  value: {
36
42
  success:
37
43
  props.history.type === "analyze" || props.history.type === "interface"
@@ -39,7 +45,7 @@ export function createAgenticaHistory<Model extends ILlmSchema.Model>(props: {
39
45
  : props.history.compiled.type === "success",
40
46
  },
41
47
  success: true,
42
- };
48
+ } satisfies Partial<AgenticaExecuteHistory<Model>>;
43
49
  return {
44
50
  ...partial,
45
51
  protocol: operation.protocol as "class",
@@ -49,5 +55,5 @@ export function createAgenticaHistory<Model extends ILlmSchema.Model>(props: {
49
55
  protocol: operation.protocol as "class",
50
56
  operation: operation.toJSON(),
51
57
  }),
52
- };
58
+ } satisfies AgenticaExecuteHistory<Model>;
53
59
  }
@@ -279,7 +279,7 @@ const createDispatch = (props: {
279
279
  history: {
280
280
  type: "analyze",
281
281
  id: v7(),
282
- reason: analyzeStart?.reason ?? "",
282
+ instruction: analyzeStart?.reason ?? "",
283
283
  prefix: event.prefix,
284
284
  roles: event.roles,
285
285
  files: event.files,
@@ -297,7 +297,7 @@ const createDispatch = (props: {
297
297
  history: {
298
298
  type: "prisma",
299
299
  id: v7(),
300
- reason: prismaStart?.reason ?? "",
300
+ instruction: prismaStart?.reason ?? "",
301
301
  schemas: event.schemas,
302
302
  result: event.result,
303
303
  compiled: event.compiled,
@@ -315,9 +315,10 @@ const createDispatch = (props: {
315
315
  history: {
316
316
  type: "interface",
317
317
  id: v7(),
318
- reason: interfaceStart?.reason ?? "",
318
+ instruction: interfaceStart?.reason ?? "",
319
319
  authorizations: event.authorizations,
320
320
  document: event.document,
321
+ missed: event.missed,
321
322
  created_at: interfaceStart?.created_at ?? new Date().toISOString(),
322
323
  completed_at: new Date().toISOString(),
323
324
  step: event.step,
@@ -332,7 +333,7 @@ const createDispatch = (props: {
332
333
  history: {
333
334
  type: "test",
334
335
  id: v7(),
335
- reason: testStart?.reason ?? "",
336
+ instruction: testStart?.reason ?? "",
336
337
  files: event.files,
337
338
  compiled: event.compiled,
338
339
  created_at: testStart?.created_at ?? new Date().toISOString(),
@@ -349,7 +350,7 @@ const createDispatch = (props: {
349
350
  history: {
350
351
  type: "realize",
351
352
  id: v7(),
352
- reason: realizeStart?.reason ?? "",
353
+ instruction: realizeStart?.reason ?? "",
353
354
  authorizations: event.authorizations,
354
355
  functions: event.functions,
355
356
  controllers: event.controllers,
@@ -20,7 +20,11 @@ export const transformAnalyzeReviewHistories = <Model extends ILlmSchema.Model>(
20
20
  | IAgenticaHistoryJson.ISystemMessage
21
21
  > => {
22
22
  return [
23
- ...transformAnalyzeWriteHistories(ctx, scenario, myFile).slice(0, -1),
23
+ ...transformAnalyzeWriteHistories(ctx, {
24
+ scenario,
25
+ file: myFile,
26
+ instruction: "",
27
+ }).slice(0, -2),
24
28
  {
25
29
  id: v7(),
26
30
  created_at: new Date().toISOString(),
@@ -8,6 +8,7 @@ import { AutoBeContext } from "../../../context/AutoBeContext";
8
8
 
9
9
  export function transformAnalyzeSceHistories<Model extends ILlmSchema.Model>(
10
10
  ctx: AutoBeContext<Model>,
11
+ instruction: string,
11
12
  ): Array<IMicroAgenticaHistoryJson> {
12
13
  return [
13
14
  ...ctx
@@ -33,5 +34,20 @@ export function transformAnalyzeSceHistories<Model extends ILlmSchema.Model>(
33
34
  `,
34
35
  created_at: new Date().toISOString(),
35
36
  },
37
+ {
38
+ id: v7(),
39
+ type: "assistantMessage",
40
+ text: StringUtil.trim`
41
+ ## Instructions from Requirements Discussion
42
+
43
+ The following instructions were extracted by AI from
44
+ the discussion with the user about requirements.
45
+ Use these to guide document structure planning and
46
+ scenario definitions.
47
+
48
+ ${instruction}
49
+ `,
50
+ created_at: new Date().toISOString(),
51
+ },
36
52
  ];
37
53
  }
@@ -10,8 +10,11 @@ import { AutoBeContext } from "../../../context/AutoBeContext";
10
10
 
11
11
  export const transformAnalyzeWriteHistories = <Model extends ILlmSchema.Model>(
12
12
  ctx: AutoBeContext<Model>,
13
- scenario: AutoBeAnalyzeScenarioEvent,
14
- file: AutoBeAnalyzeFile.Scenario,
13
+ props: {
14
+ scenario: AutoBeAnalyzeScenarioEvent;
15
+ file: AutoBeAnalyzeFile.Scenario;
16
+ instruction: string;
17
+ },
15
18
  ): Array<
16
19
  | IAgenticaHistoryJson.IUserMessage
17
20
  | IAgenticaHistoryJson.IAssistantMessage
@@ -46,15 +49,15 @@ export const transformAnalyzeWriteHistories = <Model extends ILlmSchema.Model>(
46
49
  text: StringUtil.trim`
47
50
  ## Language
48
51
 
49
- The language of the document is ${JSON.stringify(scenario.language ?? "en-US")}.
52
+ The language of the document is ${JSON.stringify(props.scenario.language ?? "en-US")}.
50
53
 
51
54
  ## Metadata
52
55
 
53
- Prefix name of the service to create is ${scenario.prefix}
56
+ Prefix name of the service to create is ${props.scenario.prefix}
54
57
  and here is the list of the roles to reference.
55
58
 
56
59
  \`\`\`json
57
- ${JSON.stringify(scenario.roles)}
60
+ ${JSON.stringify(props.scenario.roles)}
58
61
  \`\`\`
59
62
 
60
63
  Here is the entire list of the documents that would be published
@@ -64,14 +67,26 @@ export const transformAnalyzeWriteHistories = <Model extends ILlmSchema.Model>(
64
67
 
65
68
  \`\`\`json
66
69
  ${JSON.stringify(
67
- scenario.files.filter((f) => f.filename !== file.filename),
70
+ props.scenario.files.filter((f) => f.filename !== props.file.filename),
68
71
  )}
69
72
  \`\`\`
70
73
 
71
74
  ## The document to write
72
75
  \`\`\`json
73
- ${JSON.stringify(file)}
76
+ ${JSON.stringify(props.file)}
74
77
  \`\`\`
78
+
79
+ ## Instructions from Requirements Discussion
80
+
81
+ The following instructions were extracted by AI from
82
+ the discussion with the user about requirements.
83
+ If these instructions are relevant to the document you're
84
+ currently writing (${props.file.filename}), incorporate
85
+ them appropriately.
86
+
87
+ If not relevant to this specific document, ignore them.
88
+
89
+ ${props.instruction}
75
90
  `,
76
91
  },
77
92
  ];
@@ -29,14 +29,14 @@ export const orchestrateAnalyze =
29
29
  ctx.dispatch({
30
30
  type: "analyzeStart",
31
31
  id: v7(),
32
- reason: props.reason,
32
+ reason: props.instruction,
33
33
  step,
34
34
  created_at: startTime.toISOString(),
35
35
  });
36
36
 
37
37
  // Generate analysis scenario
38
38
  const scenario: AutoBeAnalyzeScenarioEvent | AutoBeAssistantMessageHistory =
39
- await orchestrateAnalyzeScenario(ctx);
39
+ await orchestrateAnalyzeScenario(ctx, props.instruction);
40
40
  if (scenario.type === "assistantMessage")
41
41
  return ctx.assistantMessage(scenario);
42
42
  else ctx.dispatch(scenario);
@@ -55,6 +55,7 @@ export const orchestrateAnalyze =
55
55
  file,
56
56
  progress: writeProgress,
57
57
  promptCacheKey,
58
+ instruction: props.instruction,
58
59
  },
59
60
  );
60
61
  return event.file;
@@ -21,6 +21,7 @@ export const orchestrateAnalyzeScenario = async <
21
21
  Model extends ILlmSchema.Model,
22
22
  >(
23
23
  ctx: AutoBeContext<Model>,
24
+ instruction: string,
24
25
  ): Promise<AutoBeAnalyzeScenarioEvent | AutoBeAssistantMessageHistory> => {
25
26
  const start: Date = new Date();
26
27
  const pointer: IPointer<IAutoBeAnalyzeScenarioApplication.IProps | null> = {
@@ -32,7 +33,7 @@ export const orchestrateAnalyzeScenario = async <
32
33
  model: ctx.model,
33
34
  build: (value) => (pointer.value = value),
34
35
  }),
35
- histories: transformAnalyzeSceHistories(ctx),
36
+ histories: transformAnalyzeSceHistories(ctx, instruction),
36
37
  enforceFunctionCall: false,
37
38
  message: StringUtil.trim`
38
39
  Design a complete list of documents and user roles for this project.
@@ -20,11 +20,12 @@ export const orchestrateAnalyzeWrite = async <Model extends ILlmSchema.Model>(
20
20
  props: {
21
21
  scenario: AutoBeAnalyzeScenarioEvent;
22
22
  file: AutoBeAnalyzeFile.Scenario;
23
+ instruction: string;
23
24
  progress: AutoBeProgressEventBase;
24
25
  promptCacheKey: string;
25
26
  },
26
27
  ): Promise<AutoBeAnalyzeWriteEvent> => {
27
- const { scenario, file, progress, promptCacheKey } = props;
28
+ const { file, progress, promptCacheKey } = props;
28
29
  const pointer: IPointer<IAutoBeAnalyzeWriteApplication.IProps | null> = {
29
30
  value: null,
30
31
  };
@@ -34,7 +35,7 @@ export const orchestrateAnalyzeWrite = async <Model extends ILlmSchema.Model>(
34
35
  model: ctx.model,
35
36
  pointer,
36
37
  }),
37
- histories: transformAnalyzeWriteHistories(ctx, scenario, file),
38
+ histories: transformAnalyzeWriteHistories(ctx, props),
38
39
  enforceFunctionCall: true,
39
40
  promptCacheKey,
40
41
  message: "Write requirement analysis report.",
@@ -120,7 +120,7 @@ const correct = async <
120
120
  think: pointer.value.think,
121
121
  draft: pointer.value.draft,
122
122
  review: pointer.value.revise.review,
123
- final: pointer.value.revise.final,
123
+ final: pointer.value.revise.final ?? undefined,
124
124
  tokenUsage,
125
125
  }),
126
126
  );
@@ -129,7 +129,7 @@ const correct = async <
129
129
  factory,
130
130
  [...failures, event],
131
131
  script,
132
- await factory.validate(pointer.value.revise.final),
132
+ await factory.validate(pointer.value.revise.final ?? pointer.value.draft),
133
133
  life - 1,
134
134
  );
135
135
  };
@@ -1,44 +1,22 @@
1
- /**
2
- * Function calling interface for fixing TypeScript type casting and assignment errors.
3
- *
4
- * This interface is used by the CommonCorrectCasting agent to fix TypeScript
5
- * compilation errors related to type casting and type assignment incompatibilities
6
- * in any TypeScript code, not limited to e2e tests.
7
- *
8
- * The agent handles various type casting issues including:
9
- *
10
- * - **Typia tag type incompatibilities**: Format tag mismatches (e.g., Format<"uuid">
11
- * vs Pattern<...>), type constraint incompatibilities (e.g., Type<"int32"> vs
12
- * Type<"int32"> & Minimum<0>), nullable type conversions with tags
13
- * - **Date to string conversions**: Date to string, Date to string & Format<"date-time">,
14
- * nullable Date handling
15
- * - **Nullable and undefined type assignments**: Exhaustive type narrowing for
16
- * T | null | undefined patterns
17
- * - **String to literal type assignments**: Converting general string to literal
18
- * union types (e.g., "pending" | "approved" | "rejected")
19
- * - **Optional chaining with union types**: Handling boolean | undefined results
20
- * from array methods like includes()
21
- * - **Type narrowing "no overlap" errors**: Removing redundant comparisons after
22
- * TypeScript's control flow analysis
23
- *
24
- * @author Samchon
25
- */
26
1
  export interface IAutoBeCommonCorrectCastingApplication {
27
2
  /**
28
3
  * Rewrite function to fix type casting and assignment errors.
29
4
  *
30
- * This function is called when the agent detects any type casting or assignment
31
- * related compilation error patterns.
5
+ * This function is called when the agent detects any type casting or
6
+ * assignment related compilation error patterns.
32
7
  *
33
8
  * The agent applies various fix strategies based on the error type:
34
9
  *
35
- * - **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to strip
36
- * incompatible tags, or `typia.assert<T>()` as a last resort
37
- * - **Date conversions**: Uses `.toISOString()` method for Date to string conversions
38
- * - **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null && !== undefined)
39
- * - **typia.assert vs assertGuard**: Uses assert for value assignment, assertGuard
40
- * for type narrowing
41
- * - **Literal type conversions**: Uses `typia.assert<T>()` for runtime validation
10
+ * - **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to
11
+ * strip incompatible tags, or `typia.assert<T>()` as a last resort
12
+ * - **Date conversions**: Uses `.toISOString()` method for Date to string
13
+ * conversions
14
+ * - **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&
15
+ * !== undefined)
16
+ * - **typia.assert vs assertGuard**: Uses assert for value assignment,
17
+ * assertGuard for type narrowing
18
+ * - **Literal type conversions**: Uses `typia.assert<T>()` for runtime
19
+ * validation
42
20
  * - **Optional chaining results**: Uses `=== true` or `??` operators
43
21
  * - **"No overlap" errors**: Removes redundant comparisons
44
22
  *
@@ -52,24 +30,20 @@ export interface IAutoBeCommonCorrectCastingApplication {
52
30
  /**
53
31
  * Reject function when error is not related to type casting or assignment.
54
32
  *
55
- * This function is called when the compilation error is unrelated to type
56
- * casting issues (e.g., missing imports, syntax errors, undefined variables),
33
+ * This function is called when the compilation error is unrelated to type
34
+ * casting issues (e.g., missing imports, syntax errors, undefined variables),
57
35
  * indicating the error should be handled by a different agent.
58
36
  */
59
37
  reject(): void;
60
38
  }
61
39
  export namespace IAutoBeCommonCorrectCastingApplication {
62
- /**
63
- * Properties for the rewrite function containing the type casting error
64
- * analysis and correction workflow.
65
- */
66
40
  export interface IProps {
67
41
  /**
68
42
  * Initial analysis of the type casting or assignment error.
69
43
  *
70
44
  * Contains the agent's analysis of the specific type mismatch pattern:
71
45
  *
72
- * - Type of casting error (tag incompatibility, nullable assignment, literal
46
+ * - Type of casting error (tag incompatibility, nullable assignment, literal
73
47
  * type conversion, etc.)
74
48
  * - Whether nullable or undefined types are involved
75
49
  * - If Date to string conversions are needed
@@ -94,12 +68,12 @@ export namespace IAutoBeCommonCorrectCastingApplication {
94
68
  * Review and finalization of type casting corrections.
95
69
  *
96
70
  * Contains the review of applied corrections and the final code with all
97
- * type casting issues resolved while preserving type safety and validation intent.
71
+ * type casting issues resolved while preserving type safety and validation
72
+ * intent.
98
73
  */
99
74
  revise: IReviseProps;
100
75
  }
101
76
 
102
- /** Properties for the revision phase of type casting corrections. */
103
77
  export interface IReviseProps {
104
78
  /**
105
79
  * Review of the type casting correction patterns applied.
@@ -120,8 +94,14 @@ export namespace IAutoBeCommonCorrectCastingApplication {
120
94
  *
121
95
  * The complete code ready for TypeScript compilation, with all type casting
122
96
  * and assignment errors properly fixed using appropriate patterns while
123
- * maintaining type safety and the original validation logic.
97
+ * maintaining type safety and the original validation logic. When the draft
98
+ * already successfully resolves all type casting issues with no problems
99
+ * found during review, this value can be null, indicating no further
100
+ * refinements are necessary.
101
+ *
102
+ * A `null` value signifies the draft corrections were already optimal and
103
+ * require no additional modifications.
124
104
  */
125
- final: string;
105
+ final: string | null;
126
106
  }
127
107
  }
@@ -29,7 +29,7 @@ export const transformInterfaceAssetHistories = (
29
29
 
30
30
  ## User Request
31
31
 
32
- ${analyze.reason}
32
+ ${analyze.instruction}
33
33
 
34
34
  ## Requirement Analysis Report
35
35
 
@@ -64,6 +64,7 @@ export const transformInterfaceAssetHistories = (
64
64
  \`\`\`
65
65
 
66
66
  ## Entity Relationship Diagrams
67
+
67
68
  \`\`\`json
68
69
  ${JSON.stringify(
69
70
  (prisma.compiled as IAutoBePrismaCompileResult.ISuccess).diagrams,
@@ -7,13 +7,14 @@ import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromp
7
7
  import { AutoBeState } from "../../../context/AutoBeState";
8
8
  import { transformInterfaceAssetHistories } from "./transformInterfaceAssetHistories";
9
9
 
10
- export const transformInterfaceAuthorizationsHistories = (
11
- state: AutoBeState,
12
- role: AutoBeAnalyzeRole,
13
- ): Array<
10
+ export const transformInterfaceAuthorizationsHistories = (props: {
11
+ state: AutoBeState;
12
+ role: AutoBeAnalyzeRole;
13
+ instruction: string;
14
+ }): Array<
14
15
  IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
15
16
  > => {
16
- const analyze: AutoBeAnalyzeHistory = state.analyze!;
17
+ const analyze: AutoBeAnalyzeHistory = props.state.analyze!;
17
18
  return [
18
19
  {
19
20
  type: "systemMessage",
@@ -21,7 +22,7 @@ export const transformInterfaceAuthorizationsHistories = (
21
22
  created_at: new Date().toISOString(),
22
23
  text: AutoBeSystemPromptConstant.INTERFACE_AUTHORIZATION,
23
24
  },
24
- ...transformInterfaceAssetHistories(state),
25
+ ...transformInterfaceAssetHistories(props.state),
25
26
  {
26
27
  type: "systemMessage",
27
28
  id: v7(),
@@ -44,14 +45,27 @@ export const transformInterfaceAuthorizationsHistories = (
44
45
  id: v7(),
45
46
  created_at: new Date().toISOString(),
46
47
  text: StringUtil.trim`
47
- You have to make API operations for the given role:
48
+ ## API Design Instructions
49
+
50
+ The following API-specific instructions were extracted by AI from
51
+ the user's utterances. These focus ONLY on API interface design aspects
52
+ such as endpoint patterns, request/response formats, DTO schemas,
53
+ and operation specifications.
54
+
55
+ Apply these instructions when designing authorization-related API operations
56
+ for the ${props.role.name} role. Focus particularly on authentication endpoints,
57
+ token management, and security patterns. If the instructions are not relevant
58
+ to authorization operations for this specific role, you may ignore them.
59
+
60
+ ${props.instruction}
48
61
 
49
62
  ## Role
63
+
64
+ You have to make API operations for the given role:
50
65
 
51
66
  \`\`\`json
52
- ${JSON.stringify(role)}
67
+ ${JSON.stringify(props.role)}
53
68
  \`\`\`
54
-
55
69
  `,
56
70
  },
57
71
  ];
@@ -3,7 +3,7 @@ import { v7 } from "uuid";
3
3
 
4
4
  import { AutoBeState } from "../../../context/AutoBeState";
5
5
 
6
- export const transformInterfacePrerequisiteHistories = (
6
+ export const transformInterfaceCommonPrerequisiteHistories = (
7
7
  state: AutoBeState,
8
8
  ): Array<
9
9
  IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage