@autobe/agent 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/lib/agent/src/AutoBeAgent.js +3 -2
  2. package/lib/agent/src/AutoBeAgent.js.map +1 -1
  3. package/lib/agent/src/AutoBeMockAgent.js +3 -3
  4. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +6 -6
  5. package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
  6. package/lib/agent/src/factory/consentFunctionCall.js +3 -2
  7. package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
  8. package/lib/agent/src/factory/createAutoBeContext.js +8 -5
  9. package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
  10. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
  11. package/lib/agent/src/orchestrate/analyze/histories/{transformAnalyzeReviewerHistories.js → transformAnalyzeReviewHistories.js} +24 -29
  12. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -0
  13. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -9
  14. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  15. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +31 -29
  16. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  17. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +19 -5
  18. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  19. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
  20. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +9 -6
  21. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  22. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +11 -9
  23. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  24. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
  25. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -1
  26. package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  27. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +45 -46
  28. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
  29. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +13 -13
  30. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  31. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -30
  32. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  33. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +23 -22
  34. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  35. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
  36. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +27 -26
  37. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  38. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +13 -12
  39. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  40. package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +4 -4
  41. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +11 -10
  42. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  43. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +31 -30
  44. package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  45. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +3 -1
  46. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
  47. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +22 -18
  48. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  49. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +2 -0
  50. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  51. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +6 -2
  52. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  53. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +2 -0
  54. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  55. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +74 -48
  56. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  57. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +24 -4
  58. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  59. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +30 -24
  60. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  61. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
  62. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +178 -0
  63. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
  64. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
  65. package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +38 -0
  66. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +54 -54
  67. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  68. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +18 -29
  69. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
  70. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +37 -34
  71. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  72. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +38 -25
  73. package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  74. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +3 -1
  75. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  76. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +2 -0
  77. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  78. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +3 -0
  79. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  80. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +19 -9
  81. package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  82. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +28 -21
  83. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  84. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +24 -21
  85. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
  86. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +58 -56
  87. package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  88. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +17 -13
  89. package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
  90. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +12 -3
  91. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
  92. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +35 -30
  93. package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  94. package/lib/{orchestrate/realize/internal/compile.d.ts → agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
  95. package/lib/agent/src/orchestrate/realize/internal/{compile.js → compileRealizeFiles.js} +6 -6
  96. package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
  97. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +26 -12
  98. package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
  99. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +9 -3
  100. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  101. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +3 -1
  102. package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  103. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
  104. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +8 -4
  105. package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  106. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
  107. package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
  108. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
  109. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +21 -17
  110. package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  111. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +13 -10
  112. package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
  113. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +16 -15
  114. package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  115. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +33 -32
  116. package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +1 -1
  117. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +62 -59
  118. package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  119. package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +2 -2
  120. package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -5
  121. package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
  122. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +16 -7
  123. package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  124. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +20 -8
  125. package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  126. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +17 -17
  127. package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  128. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
  129. package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
  130. package/lib/agent/src/utils/executeCachedBatch.d.ts +1 -0
  131. package/lib/agent/src/utils/executeCachedBatch.js +23 -0
  132. package/lib/agent/src/utils/executeCachedBatch.js.map +1 -0
  133. package/lib/constants/AutoBeSystemPromptConstant.d.ts +6 -6
  134. package/lib/context/AutoBeContext.d.ts +1 -0
  135. package/lib/index.mjs +1044 -270
  136. package/lib/index.mjs.map +1 -1
  137. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
  138. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
  139. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
  140. package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
  141. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
  142. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +38 -0
  143. package/lib/{agent/src/orchestrate/realize/internal/compile.d.ts → orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
  144. package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
  145. package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
  146. package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
  147. package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
  148. package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
  149. package/lib/utils/executeCachedBatch.d.ts +1 -0
  150. package/package.json +6 -6
  151. package/src/AutoBeAgent.ts +4 -3
  152. package/src/AutoBeMockAgent.ts +4 -4
  153. package/src/constants/AutoBeSystemPromptConstant.ts +6 -6
  154. package/src/context/AutoBeContext.ts +1 -0
  155. package/src/factory/consentFunctionCall.ts +4 -3
  156. package/src/factory/createAutoBeContext.ts +9 -6
  157. package/src/orchestrate/analyze/histories/{transformAnalyzeReviewerHistories.ts → transformAnalyzeReviewHistories.ts} +23 -30
  158. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +13 -10
  159. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +60 -61
  160. package/src/orchestrate/analyze/orchestrateAnalyze.ts +20 -13
  161. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +20 -9
  162. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +13 -11
  163. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +10 -5
  164. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +47 -48
  165. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +14 -14
  166. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +31 -30
  167. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +20 -19
  168. package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +3 -3
  169. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +23 -22
  170. package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +12 -11
  171. package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +5 -5
  172. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +11 -10
  173. package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +31 -30
  174. package/src/orchestrate/interface/orchestrateInterface.ts +4 -2
  175. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +36 -29
  176. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -0
  177. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +13 -9
  178. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +2 -0
  179. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +53 -50
  180. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +2 -0
  181. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +47 -23
  182. package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +85 -1
  183. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +39 -0
  184. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +40 -1
  185. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +57 -55
  186. package/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.ts +19 -30
  187. package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +38 -35
  188. package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +36 -23
  189. package/src/orchestrate/prisma/orchestratePrisma.ts +4 -2
  190. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +2 -0
  191. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +3 -0
  192. package/src/orchestrate/prisma/orchestratePrismaReview.ts +26 -13
  193. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +25 -17
  194. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +24 -21
  195. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +42 -40
  196. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +17 -13
  197. package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +14 -5
  198. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +35 -30
  199. package/src/orchestrate/realize/internal/{compile.ts → compileRealizeFiles.ts} +15 -11
  200. package/src/orchestrate/realize/orchestrateRealize.ts +59 -40
  201. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +19 -10
  202. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -0
  203. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +10 -10
  204. package/src/orchestrate/realize/orchestrateRealizeScenario.ts +0 -74
  205. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +24 -23
  206. package/src/orchestrate/test/compile/completeTestCode.ts +17 -13
  207. package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
  208. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +17 -16
  209. package/src/orchestrate/test/histories/transformTestHistories.ts +35 -34
  210. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +62 -57
  211. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +3 -3
  212. package/src/orchestrate/test/orchestrateTest.ts +7 -9
  213. package/src/orchestrate/test/orchestrateTestCorrect.ts +34 -24
  214. package/src/orchestrate/test/orchestrateTestScenario.ts +28 -21
  215. package/src/orchestrate/test/orchestrateTestWrite.ts +16 -17
  216. package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +3 -3
  217. package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +2 -2
  218. package/src/utils/executeCachedBatch.ts +15 -0
  219. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
  220. package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +0 -1
  221. package/lib/agent/src/orchestrate/realize/internal/compile.js.map +0 -1
  222. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
@@ -8,9 +8,11 @@ import {
8
8
  import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
9
9
  import { IPointer } from "tstl";
10
10
  import typia from "typia";
11
+ import { v7 } from "uuid";
11
12
 
12
13
  import { AutoBeContext } from "../../context/AutoBeContext";
13
14
  import { assertSchemaModel } from "../../context/assertSchemaModel";
15
+ import { executeCachedBatch } from "../../utils/executeCachedBatch";
14
16
  import { completeTestCode } from "./compile/completeTestCode";
15
17
  import { getTestScenarioArtifacts } from "./compile/getTestScenarioArtifacts";
16
18
  import { transformTestWriteHistories } from "./histories/transformTestWriteHistories";
@@ -26,22 +28,22 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
26
28
  total: scenarios.length,
27
29
  completed: 0,
28
30
  };
29
- const result: Array<IAutoBeTestWriteResult | null> = await Promise.all(
31
+ const result: Array<IAutoBeTestWriteResult | null> = await executeCachedBatch(
30
32
  /**
31
33
  * Generate test code for each scenario. Maps through plans array to create
32
34
  * individual test code implementations. Each scenario is processed to
33
35
  * generate corresponding test code and progress events.
34
36
  */
35
- scenarios.map(async (scenario) => {
37
+ scenarios.map((scenario) => async (promptCacheKey) => {
36
38
  try {
37
39
  const artifacts: IAutoBeTestScenarioArtifacts =
38
40
  await getTestScenarioArtifacts(ctx, scenario);
39
- const event: AutoBeTestWriteEvent = await process(
40
- ctx,
41
+ const event: AutoBeTestWriteEvent = await process(ctx, {
41
42
  scenario,
42
43
  artifacts,
43
44
  progress,
44
- );
45
+ promptCacheKey,
46
+ });
45
47
  ctx.dispatch(event);
46
48
  return {
47
49
  scenario,
@@ -56,21 +58,16 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
56
58
  return result.filter((r) => r !== null);
57
59
  }
58
60
 
59
- /**
60
- * Process function that generates test code for each individual scenario. Takes
61
- * the AutoBeContext and scenario information as input and uses MicroAgentica to
62
- * generate appropriate test code through LLM interaction.
63
- *
64
- * @param ctx - The AutoBeContext containing model, vendor and configuration
65
- * @param scenario - The test scenario information to generate code for
66
- * @param artifacts - The artifacts containing the reference files and schemas
67
- */
68
61
  async function process<Model extends ILlmSchema.Model>(
69
62
  ctx: AutoBeContext<Model>,
70
- scenario: AutoBeTestScenario,
71
- artifacts: IAutoBeTestScenarioArtifacts,
72
- progress: AutoBeProgressEventBase,
63
+ props: {
64
+ scenario: AutoBeTestScenario;
65
+ artifacts: IAutoBeTestScenarioArtifacts;
66
+ progress: AutoBeProgressEventBase;
67
+ promptCacheKey: string;
68
+ },
73
69
  ): Promise<AutoBeTestWriteEvent> {
70
+ const { scenario, artifacts, progress, promptCacheKey } = props;
74
71
  const pointer: IPointer<IAutoBeTestWriteApplication.IProps | null> = {
75
72
  value: null,
76
73
  };
@@ -85,6 +82,7 @@ async function process<Model extends ILlmSchema.Model>(
85
82
  },
86
83
  }),
87
84
  enforceFunctionCall: true,
85
+ promptCacheKey,
88
86
  message: "Create e2e test functions.",
89
87
  });
90
88
  if (pointer.value === null) throw new Error("Failed to create test code.");
@@ -93,6 +91,7 @@ async function process<Model extends ILlmSchema.Model>(
93
91
  pointer.value.final = await compiler.typescript.beautify(pointer.value.final);
94
92
  return {
95
93
  type: "testWrite",
94
+ id: v7(),
96
95
  created_at: new Date().toISOString(),
97
96
  location: `test/features/api/${pointer.value.domain}/${scenario.functionName}.ts`,
98
97
  ...pointer.value,
@@ -70,8 +70,8 @@ export namespace IAutoBeTestCorrectApplication {
70
70
  * AI generates the first corrected version of the test code based on error
71
71
  * analysis and correction strategies. This draft addresses all identified
72
72
  * compilation errors while preserving the original business logic and test
73
- * workflow. The code is compilation-error-free and follows all
74
- * established conventions.
73
+ * workflow. The code is compilation-error-free and follows all established
74
+ * conventions.
75
75
  *
76
76
  * The implementation incorporates lessons learned from error analysis to
77
77
  * produce properly typed, syntactically correct code that maintains the
@@ -80,7 +80,7 @@ export namespace IAutoBeTestCorrectApplication {
80
80
  *
81
81
  * Workflow: Error correction → TypeScript implementation → Functional
82
82
  * preservation
83
- *
83
+ *
84
84
  * DO: Resolve all compilation errors while maintaining original test intent
85
85
  */
86
86
  draft: string;
@@ -35,8 +35,8 @@ export namespace IAutoBeTestWriteApplication {
35
35
  *
36
36
  * AI determines the appropriate domain category based on the scenario
37
37
  * analysis. This classification drives file structure, test categorization,
38
- * and logical grouping. The domain must be a single, lowercase word that
39
- * represents the primary API resource.
38
+ * and logical grouping. The domain must be a single, lowercase word in
39
+ * snake_case format that represents the primary API resource.
40
40
  *
41
41
  * Workflow: Scenario analysis → Domain identification → Test organization
42
42
  * structure
@@ -0,0 +1,15 @@
1
+ import { v7 } from "uuid";
2
+
3
+ export const executeCachedBatch = async <T>(
4
+ tasks: Array<(user: string) => Promise<T>>,
5
+ promptCacheKey?: string,
6
+ ): Promise<T[]> => {
7
+ if (tasks.length === 0) return [];
8
+
9
+ promptCacheKey ??= v7();
10
+ const first: T = await tasks[0]!(promptCacheKey);
11
+ const tail: T[] = await Promise.all(
12
+ tasks.slice(1).map((task) => task(promptCacheKey)),
13
+ );
14
+ return [first, ...tail];
15
+ };
@@ -1,6 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { AutoBeAnalyzeScenarioEvent } from "@autobe/interface";
3
- import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
4
- import { ILlmSchema } from "@samchon/openapi";
5
- import { AutoBeContext } from "../../../context/AutoBeContext";
6
- export declare const transformAnalyzeReviewerHistories: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenario: AutoBeAnalyzeScenarioEvent, otherFiles: AutoBeAnalyzeFile[], myFile: AutoBeAnalyzeFile) => Array<IAgenticaHistoryJson.IUserMessage | IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformAnalyzeReviewerHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts"],"names":[],"mappings":";;;AAIA,+BAA0B;AAI1B,qFAAkF;AAE3E,MAAM,iCAAiC,GAAG,CAG/C,GAAyB,EACzB,QAAoC,EACpC,UAA+B,EAC/B,MAAyB,EAKzB,EAAE;IACF,OAAO;QACL,GAAG,IAAA,+DAA8B,EAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC;QACxD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,uDAAuD;gBACvD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;gBAC1B,KAAK;gBACL,EAAE;gBACF,kEAAkE;gBAClE,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;gBACtB,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,godAA2C;SAChD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,k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pB,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA"}
@@ -1,6 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { AutoBeAnalyzeScenarioEvent } from "@autobe/interface";
3
- import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
4
- import { ILlmSchema } from "@samchon/openapi";
5
- import { AutoBeContext } from "../../../context/AutoBeContext";
6
- export declare const transformAnalyzeReviewerHistories: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenario: AutoBeAnalyzeScenarioEvent, otherFiles: AutoBeAnalyzeFile[], myFile: AutoBeAnalyzeFile) => Array<IAgenticaHistoryJson.IUserMessage | IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;