@autobe/agent 0.26.0 → 0.28.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 (205) hide show
  1. package/lib/AutoBeAgent.d.ts +2 -1
  2. package/lib/AutoBeAgent.js +27 -7
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/AutoBeMockAgent.js +2 -4
  5. package/lib/AutoBeMockAgent.js.map +1 -1
  6. package/lib/constants/AutoBeSystemPromptConstant.d.ts +11 -11
  7. package/lib/context/AutoBeContext.d.ts +4 -1
  8. package/lib/context/AutoBeTokenUsage.d.ts +1 -1
  9. package/lib/context/AutoBeTokenUsage.js.map +1 -1
  10. package/lib/context/assertSchemaModel.d.ts +1 -1
  11. package/lib/context/assertSchemaModel.js +4 -7
  12. package/lib/context/assertSchemaModel.js.map +1 -1
  13. package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +7 -0
  14. package/lib/factory/AutoBeFunctionCallingMetricFactory.js +35 -0
  15. package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +1 -0
  16. package/lib/factory/AutoBeProcessAggregateFactory.d.ts +13 -0
  17. package/lib/factory/AutoBeProcessAggregateFactory.js +100 -0
  18. package/lib/factory/AutoBeProcessAggregateFactory.js.map +1 -0
  19. package/lib/factory/createAutoBeContext.d.ts +2 -1
  20. package/lib/factory/createAutoBeContext.js +78 -27
  21. package/lib/factory/createAutoBeContext.js.map +1 -1
  22. package/lib/index.mjs +24065 -12997
  23. package/lib/index.mjs.map +1 -1
  24. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
  25. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  26. package/lib/orchestrate/analyze/orchestrateAnalyze.js +1 -0
  27. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  28. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +166 -87
  29. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  30. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +639 -322
  31. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  32. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +146 -76
  33. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  34. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +17 -52
  35. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +25 -22
  36. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +7 -23
  37. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +2 -1
  38. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +168 -4
  39. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  40. package/lib/{factory/createAutoBeApplication.d.ts → orchestrate/facade/createAutoBeFacadeController.d.ts} +2 -2
  41. package/lib/orchestrate/facade/createAutoBeFacadeController.js +1308 -0
  42. package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -0
  43. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplication.js.map +1 -0
  44. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationProps.js.map +1 -0
  45. package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationResult.js.map +1 -0
  46. package/lib/orchestrate/facade/{transformFacadeStateMessage.d.ts → structures/transformFacadeStateMessage.d.ts} +1 -1
  47. package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js.map +1 -0
  48. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +2 -2
  49. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  50. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
  51. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  52. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +3 -2
  53. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  54. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +1 -1
  55. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  56. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
  57. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  58. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
  59. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  60. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
  61. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  62. package/lib/orchestrate/interface/orchestrateInterface.d.ts +1 -1
  63. package/lib/orchestrate/interface/orchestrateInterface.js +15 -8
  64. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  65. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +874 -49
  66. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
  67. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +1858 -67
  68. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  69. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +251 -133
  70. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
  71. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -6
  72. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +257 -135
  73. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
  74. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +341 -227
  75. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
  76. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +761 -49
  77. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  78. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +911 -50
  79. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
  80. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +207 -4
  81. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
  82. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +109 -2
  83. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
  84. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +5 -3
  85. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +1904 -77
  86. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
  87. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +1858 -67
  88. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
  89. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +23 -23
  90. package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
  91. package/lib/orchestrate/prisma/orchestratePrisma.js +1 -0
  92. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  93. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +391 -197
  94. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  95. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1168 -591
  96. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  97. package/lib/orchestrate/prisma/orchestratePrismaReview.js +1186 -600
  98. package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  99. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +6 -3
  100. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
  101. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +2 -2
  102. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
  103. package/lib/orchestrate/realize/orchestrateRealize.d.ts +1 -1
  104. package/lib/orchestrate/realize/orchestrateRealize.js +2 -1
  105. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  106. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +362 -180
  107. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  108. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +399 -199
  109. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  110. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +133 -4
  111. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  112. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +171 -7
  113. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
  114. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +132 -3
  115. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  116. package/lib/orchestrate/realize/utils/replaceImportStatements.js +0 -85
  117. package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  118. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  119. package/lib/orchestrate/test/orchestrateTest.d.ts +1 -1
  120. package/lib/orchestrate/test/orchestrateTest.js +2 -1
  121. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  122. package/lib/orchestrate/test/orchestrateTestCorrect.js +134 -3
  123. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  124. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +169 -4
  125. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  126. package/lib/orchestrate/test/orchestrateTestScenario.js +257 -4
  127. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  128. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +283 -4
  129. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  130. package/lib/orchestrate/test/orchestrateTestWrite.js +141 -3
  131. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  132. package/lib/utils/TokenUsageComputer.d.ts +5 -0
  133. package/lib/utils/TokenUsageComputer.js +29 -0
  134. package/lib/utils/TokenUsageComputer.js.map +1 -0
  135. package/package.json +10 -10
  136. package/src/AutoBeAgent.ts +40 -6
  137. package/src/AutoBeMockAgent.ts +2 -4
  138. package/src/constants/AutoBeSystemPromptConstant.ts +11 -11
  139. package/src/context/AutoBeContext.ts +8 -0
  140. package/src/context/AutoBeTokenUsage.ts +1 -1
  141. package/src/context/assertSchemaModel.ts +5 -8
  142. package/src/factory/AutoBeFunctionCallingMetricFactory.ts +44 -0
  143. package/src/factory/AutoBeProcessAggregateFactory.ts +141 -0
  144. package/src/factory/createAutoBeContext.ts +96 -36
  145. package/src/orchestrate/analyze/orchestrateAnalyze.ts +1 -0
  146. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +9 -10
  147. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +15 -10
  148. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +10 -11
  149. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +19 -54
  150. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +25 -22
  151. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +8 -24
  152. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +20 -3
  153. package/src/orchestrate/facade/createAutoBeFacadeController.ts +136 -0
  154. package/src/orchestrate/facade/{transformFacadeStateMessage.ts → structures/transformFacadeStateMessage.ts} +2 -2
  155. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +1 -0
  156. package/src/orchestrate/interface/orchestrateInterface.ts +17 -6
  157. package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -2
  158. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +13 -2
  159. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +16 -11
  160. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +16 -13
  161. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +19 -15
  162. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +13 -2
  163. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +16 -2
  164. package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +13 -2
  165. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +11 -2
  166. package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +24 -16
  167. package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +13 -2
  168. package/src/orchestrate/prisma/orchestratePrisma.ts +2 -1
  169. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +15 -10
  170. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +9 -10
  171. package/src/orchestrate/prisma/orchestratePrismaReview.ts +9 -11
  172. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +2 -1
  173. package/src/orchestrate/realize/orchestrateRealize.ts +3 -2
  174. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +15 -10
  175. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +15 -10
  176. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +14 -3
  177. package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +21 -6
  178. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +13 -2
  179. package/src/orchestrate/realize/utils/replaceImportStatements.ts +0 -90
  180. package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +5 -1
  181. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +1 -1
  182. package/src/orchestrate/test/orchestrateTest.ts +3 -2
  183. package/src/orchestrate/test/orchestrateTestCorrect.ts +14 -2
  184. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +21 -3
  185. package/src/orchestrate/test/orchestrateTestScenario.ts +13 -2
  186. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +13 -2
  187. package/src/orchestrate/test/orchestrateTestWrite.ts +13 -2
  188. package/src/utils/TokenUsageComputer.ts +35 -0
  189. package/lib/context/IAutoBeFacadeApplication.js.map +0 -1
  190. package/lib/context/IAutoBeFacadeApplicationProps.js.map +0 -1
  191. package/lib/context/IAutoBeFacadeApplicationResult.js.map +0 -1
  192. package/lib/factory/createAutoBeApplication.js +0 -942
  193. package/lib/factory/createAutoBeApplication.js.map +0 -1
  194. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
  195. package/src/factory/createAutoBeApplication.ts +0 -123
  196. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.d.ts +0 -0
  197. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.js +0 -0
  198. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.d.ts +0 -0
  199. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.js +0 -0
  200. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.d.ts +0 -0
  201. /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.js +0 -0
  202. /package/lib/orchestrate/facade/{transformFacadeStateMessage.js → structures/transformFacadeStateMessage.js} +0 -0
  203. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.ts +0 -0
  204. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.ts +0 -0
  205. /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.ts +0 -0
@@ -53,7 +53,7 @@ export async function orchestrateInterfaceEndpoints<
53
53
  AutoBeOpenApiEndpointComparator.hashCode,
54
54
  AutoBeOpenApiEndpointComparator.equals,
55
55
  ).toJSON();
56
- return orchestrateInterfaceEndpointsReview(ctx, deduplicated);
56
+ return await orchestrateInterfaceEndpointsReview(ctx, deduplicated);
57
57
  }
58
58
 
59
59
  async function process<Model extends ILlmSchema.Model>(
@@ -71,7 +71,7 @@ async function process<Model extends ILlmSchema.Model>(
71
71
  const pointer: IPointer<AutoBeOpenApi.IEndpoint[] | null> = {
72
72
  value: null,
73
73
  };
74
- const { tokenUsage } = await ctx.conversate({
74
+ const { metric, tokenUsage } = await ctx.conversate({
75
75
  source: "interfaceEndpoint",
76
76
  histories: transformInterfaceEndpointHistories({
77
77
  state: ctx.state(),
@@ -100,6 +100,7 @@ async function process<Model extends ILlmSchema.Model>(
100
100
  AutoBeOpenApiEndpointComparator.hashCode,
101
101
  AutoBeOpenApiEndpointComparator.equals,
102
102
  ).toJSON(),
103
+ metric,
103
104
  tokenUsage,
104
105
  created_at: start.toISOString(),
105
106
  step: ctx.state().analyze?.step ?? 0,
@@ -117,7 +118,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
117
118
  assertSchemaModel(props.model);
118
119
 
119
120
  const application: ILlmApplication<Model> = collection[
120
- props.model
121
+ props.model === "chatgpt"
122
+ ? "chatgpt"
123
+ : props.model === "gemini"
124
+ ? "gemini"
125
+ : "claude"
121
126
  ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
122
127
  return {
123
128
  protocol: "class",
@@ -131,17 +136,17 @@ function createController<Model extends ILlmSchema.Model>(props: {
131
136
  };
132
137
  }
133
138
 
134
- const claude = typia.llm.application<
135
- IAutoBeInterfaceEndpointApplication,
136
- "claude"
137
- >();
138
139
  const collection = {
139
140
  chatgpt: typia.llm.application<
140
141
  IAutoBeInterfaceEndpointApplication,
141
142
  "chatgpt"
142
143
  >(),
143
- claude,
144
- llama: claude,
145
- deepseek: claude,
146
- "3.1": claude,
144
+ claude: typia.llm.application<
145
+ IAutoBeInterfaceEndpointApplication,
146
+ "claude"
147
+ >(),
148
+ gemini: typia.llm.application<
149
+ IAutoBeInterfaceEndpointApplication,
150
+ "gemini"
151
+ >(),
147
152
  };
@@ -22,7 +22,7 @@ export async function orchestrateInterfaceEndpointsReview<
22
22
  value: null,
23
23
  };
24
24
 
25
- const { tokenUsage } = await ctx.conversate({
25
+ const { metric, tokenUsage } = await ctx.conversate({
26
26
  source: "interfaceEndpointReview",
27
27
  histories: transformInterfaceEndpointsReviewHistories(
28
28
  ctx.state(),
@@ -43,7 +43,6 @@ export async function orchestrateInterfaceEndpointsReview<
43
43
  }
44
44
 
45
45
  const response = pointer.value?.endpoints ?? [];
46
-
47
46
  ctx.dispatch({
48
47
  id: v7(),
49
48
  type: "interfaceEndpointReview",
@@ -52,20 +51,24 @@ export async function orchestrateInterfaceEndpointsReview<
52
51
  created_at: new Date().toISOString(),
53
52
  review: pointer.value?.review,
54
53
  step: ctx.state().analyze?.step ?? 0,
54
+ metric,
55
55
  tokenUsage,
56
56
  });
57
-
58
57
  return response;
59
58
  }
60
59
 
61
- export function createController<Model extends ILlmSchema.Model>(props: {
60
+ function createController<Model extends ILlmSchema.Model>(props: {
62
61
  model: Model;
63
62
  build: (props: IAutoBeInterfaceEndpointsReviewApplication.IProps) => void;
64
63
  }): IAgenticaController.IClass<Model> {
65
64
  assertSchemaModel(props.model);
66
65
 
67
66
  const application: ILlmApplication<Model> = collection[
68
- props.model
67
+ props.model === "chatgpt"
68
+ ? "chatgpt"
69
+ : props.model === "gemini"
70
+ ? "gemini"
71
+ : "claude"
69
72
  ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
70
73
  return {
71
74
  protocol: "class",
@@ -79,17 +82,17 @@ export function createController<Model extends ILlmSchema.Model>(props: {
79
82
  };
80
83
  }
81
84
 
82
- const claude = typia.llm.application<
83
- IAutoBeInterfaceEndpointsReviewApplication,
84
- "claude"
85
- >();
86
85
  const collection = {
87
86
  chatgpt: typia.llm.application<
88
87
  IAutoBeInterfaceEndpointsReviewApplication,
89
88
  "chatgpt"
90
89
  >(),
91
- claude,
92
- llama: claude,
93
- deepseek: claude,
94
- "3.1": claude,
90
+ claude: typia.llm.application<
91
+ IAutoBeInterfaceEndpointsReviewApplication,
92
+ "claude"
93
+ >(),
94
+ gemini: typia.llm.application<
95
+ IAutoBeInterfaceEndpointsReviewApplication,
96
+ "gemini"
97
+ >(),
95
98
  };
@@ -23,7 +23,7 @@ export async function orchestrateInterfaceGroups<
23
23
  const pointer: IPointer<IAutoBeInterfaceGroupApplication.IProps | null> = {
24
24
  value: null,
25
25
  };
26
- const { tokenUsage } = await ctx.conversate({
26
+ const { metric, tokenUsage } = await ctx.conversate({
27
27
  source: "interfaceGroup",
28
28
  histories: transformInterfaceGroupHistories({
29
29
  state: ctx.state(),
@@ -44,6 +44,7 @@ export async function orchestrateInterfaceGroups<
44
44
  id: v7(),
45
45
  created_at: start.toISOString(),
46
46
  groups: pointer.value.groups,
47
+ metric,
47
48
  tokenUsage,
48
49
  step: ctx.state().analyze?.step ?? 0,
49
50
  } satisfies AutoBeInterfaceGroupEvent;
@@ -56,7 +57,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
56
57
  assertSchemaModel(props.model);
57
58
 
58
59
  const application: ILlmApplication<Model> = collection[
59
- props.model
60
+ props.model === "chatgpt"
61
+ ? "chatgpt"
62
+ : props.model === "gemini"
63
+ ? "gemini"
64
+ : "claude"
60
65
  ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
61
66
  return {
62
67
  protocol: "class",
@@ -70,18 +75,17 @@ function createController<Model extends ILlmSchema.Model>(props: {
70
75
  };
71
76
  }
72
77
 
73
- const claude = typia.llm.application<
74
- IAutoBeInterfaceGroupApplication,
75
- "claude"
76
- >();
77
- const chatgpt = typia.llm.application<
78
- IAutoBeInterfaceGroupApplication,
79
- "chatgpt"
80
- >();
81
78
  const collection = {
82
- chatgpt,
83
- claude,
84
- llama: claude,
85
- deepseek: claude,
86
- "3.1": claude,
79
+ chatgpt: typia.llm.application<
80
+ IAutoBeInterfaceGroupApplication,
81
+ "chatgpt"
82
+ >(),
83
+ claude: typia.llm.application<
84
+ IAutoBeInterfaceGroupApplication,
85
+ "claude"
86
+ >(),
87
+ gemini: typia.llm.application<
88
+ IAutoBeInterfaceGroupApplication,
89
+ "gemini"
90
+ >(),
87
91
  };
@@ -119,7 +119,7 @@ async function process<Model extends ILlmSchema.Model>(
119
119
  const pointer: IPointer<AutoBeOpenApi.IOperation[] | null> = {
120
120
  value: null,
121
121
  };
122
- const { tokenUsage } = await ctx.conversate({
122
+ const { metric, tokenUsage } = await ctx.conversate({
123
123
  source: "interfaceOperation",
124
124
  histories: transformInterfaceOperationHistories({
125
125
  state: ctx.state(),
@@ -181,6 +181,7 @@ async function process<Model extends ILlmSchema.Model>(
181
181
  type: "interfaceOperation",
182
182
  id: v7(),
183
183
  operations: pointer.value,
184
+ metric,
184
185
  tokenUsage,
185
186
  ...props.progress,
186
187
  step: ctx.state().analyze?.step ?? 0,
@@ -243,7 +244,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
243
244
  return result;
244
245
  };
245
246
  const application: ILlmApplication<Model> = collection[
246
- props.model === "chatgpt" ? "chatgpt" : "claude"
247
+ props.model === "chatgpt"
248
+ ? "chatgpt"
249
+ : props.model === "gemini"
250
+ ? "gemini"
251
+ : "claude"
247
252
  ](
248
253
  validate,
249
254
  ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
@@ -273,6 +278,12 @@ const collection = {
273
278
  makeOperations: validate,
274
279
  },
275
280
  }),
281
+ gemini: (validate: Validator) =>
282
+ typia.llm.application<IAutoBeInterfaceOperationApplication, "gemini">({
283
+ validate: {
284
+ makeOperations: validate,
285
+ },
286
+ }),
276
287
  };
277
288
 
278
289
  type Validator = (
@@ -28,7 +28,7 @@ export async function orchestrateInterfaceOperationsReview<
28
28
  {
29
29
  value: null,
30
30
  };
31
- const { tokenUsage } = await ctx.conversate({
31
+ const { metric, tokenUsage } = await ctx.conversate({
32
32
  source: "interfaceOperationReview",
33
33
  histories: transformInterfaceOperationsReviewHistories(ctx, operations),
34
34
  controller: createReviewController({
@@ -60,6 +60,7 @@ export async function orchestrateInterfaceOperationsReview<
60
60
  review: pointer.value.think.review,
61
61
  plan: pointer.value.think.plan,
62
62
  content,
63
+ metric,
63
64
  tokenUsage,
64
65
  created_at: new Date().toISOString(),
65
66
  step: ctx.state().analyze?.step ?? 0,
@@ -100,7 +101,11 @@ function createReviewController<Model extends ILlmSchema.Model>(props: {
100
101
  return result;
101
102
  };
102
103
  const application: ILlmApplication<Model> = collection[
103
- props.model === "chatgpt" ? "chatgpt" : "claude"
104
+ props.model === "chatgpt"
105
+ ? "chatgpt"
106
+ : props.model === "gemini"
107
+ ? "gemini"
108
+ : "claude"
104
109
  ](
105
110
  validate,
106
111
  ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
@@ -136,6 +141,15 @@ const collection = {
136
141
  reviewOperations: validate,
137
142
  },
138
143
  }),
144
+ gemini: (validate: Validator) =>
145
+ typia.llm.application<
146
+ IAutoBeInterfaceOperationsReviewApplication,
147
+ "gemini"
148
+ >({
149
+ validate: {
150
+ reviewOperations: validate,
151
+ },
152
+ }),
139
153
  };
140
154
 
141
155
  type Validator = (
@@ -107,7 +107,7 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
107
107
  };
108
108
 
109
109
  try {
110
- const { tokenUsage } = await ctx.conversate({
110
+ const { metric, tokenUsage } = await ctx.conversate({
111
111
  source: "interfacePrerequisite",
112
112
  controller: createController({
113
113
  model: ctx.model,
@@ -134,6 +134,7 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
134
134
  type: "interfacePrerequisite",
135
135
  id: v7(),
136
136
  created_at: new Date().toISOString(),
137
+ metric,
137
138
  tokenUsage,
138
139
  operations: pointer.value,
139
140
  total: props.progress.total,
@@ -237,7 +238,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
237
238
  };
238
239
 
239
240
  const application: ILlmApplication<Model> = collection[
240
- props.model === "chatgpt" ? "chatgpt" : "claude"
241
+ props.model === "chatgpt"
242
+ ? "chatgpt"
243
+ : props.model === "gemini"
244
+ ? "gemini"
245
+ : "claude"
241
246
  ](
242
247
  validate,
243
248
  ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
@@ -267,6 +272,12 @@ const collection = {
267
272
  makePrerequisite: validate,
268
273
  },
269
274
  }),
275
+ gemini: (validate: Validator) =>
276
+ typia.llm.application<IAutoBeInterfacePrerequisitesApplication, "gemini">({
277
+ validate: {
278
+ makePrerequisite: validate,
279
+ },
280
+ }),
270
281
  };
271
282
 
272
283
  type Validator = (
@@ -157,7 +157,7 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
157
157
  {
158
158
  value: null,
159
159
  };
160
- const { tokenUsage } = await ctx.conversate({
160
+ const { metric, tokenUsage } = await ctx.conversate({
161
161
  source: "interfaceSchemaRename",
162
162
  controller: createController<Model>(
163
163
  ctx.model,
@@ -180,6 +180,7 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
180
180
  refactors: pointer.value.refactors,
181
181
  total: props.progress.total,
182
182
  completed: (props.progress.completed += props.typeNames.length),
183
+ metric,
183
184
  tokenUsage,
184
185
  created_at: new Date().toISOString(),
185
186
  } satisfies AutoBeInterfaceSchemaRenameEvent);
@@ -243,7 +244,11 @@ const createController = <Model extends ILlmSchema.Model>(
243
244
  ): IAgenticaController.IClass<Model> => {
244
245
  assertSchemaModel(model);
245
246
  const application: ILlmApplication<Model> = collection[
246
- model === "chatgpt" ? "chatgpt" : "claude"
247
+ model === "chatgpt"
248
+ ? "chatgpt"
249
+ : model === "gemini"
250
+ ? "gemini"
251
+ : "claude"
247
252
  ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
248
253
  return {
249
254
  protocol: "class",
@@ -266,4 +271,8 @@ const collection = {
266
271
  IAutoBeInterfaceSchemaRenameApplication,
267
272
  "claude"
268
273
  >(),
274
+ gemini: typia.llm.application<
275
+ IAutoBeInterfaceSchemaRenameApplication,
276
+ "gemini"
277
+ >(),
269
278
  };
@@ -1,5 +1,6 @@
1
1
  import { IAgenticaController } from "@agentica/core";
2
2
  import { AutoBeOpenApi, AutoBeProgressEventBase } from "@autobe/interface";
3
+ import { AutoBeInterfaceSchemaReviewEvent } from "@autobe/interface/src/events/AutoBeInterfaceSchemaReviewEvent";
3
4
  import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
4
5
  import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
5
6
  import { IPointer } from "tstl";
@@ -19,10 +20,7 @@ import { JsonSchemaValidator } from "./utils/JsonSchemaValidator";
19
20
  import { fulfillJsonSchemaErrorMessages } from "./utils/fulfillJsonSchemaErrorMessages";
20
21
 
21
22
  interface IConfig {
22
- type:
23
- | "interfaceSchemaContentReview"
24
- | "interfaceSchemaSecurityReview"
25
- | "interfaceSchemaRelationReview";
23
+ kind: AutoBeInterfaceSchemaReviewEvent["kind"];
26
24
  systemPrompt: string;
27
25
  }
28
26
 
@@ -34,19 +32,14 @@ export async function orchestrateInterfaceSchemaReview<
34
32
  props: {
35
33
  document: AutoBeOpenApi.IDocument;
36
34
  instruction: string;
35
+ progress: AutoBeProgressEventBase;
37
36
  },
38
- capacity: number = AutoBeConfigConstant.INTERFACE_CAPACITY,
39
37
  ): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
40
38
  const typeNames: string[] = Object.keys(props.document.components.schemas);
41
39
  const matrix: string[][] = divideArray({
42
40
  array: typeNames,
43
- capacity,
41
+ capacity: AutoBeConfigConstant.INTERFACE_CAPACITY,
44
42
  });
45
- const progress: AutoBeProgressEventBase = {
46
- total: matrix.length,
47
- completed: 0,
48
- };
49
-
50
43
  const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
51
44
  for (const y of await executeCachedBatch(
52
45
  matrix.map((it) => async (promptCacheKey) => {
@@ -68,7 +61,7 @@ export async function orchestrateInterfaceSchemaReview<
68
61
  },
69
62
  {} as Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
70
63
  ),
71
- progress,
64
+ progress: props.progress,
72
65
  promptCacheKey,
73
66
  });
74
67
  return row;
@@ -97,8 +90,8 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
97
90
  {
98
91
  value: null,
99
92
  };
100
- const { tokenUsage } = await ctx.conversate({
101
- source: "interfaceSchemaContentReview",
93
+ const { metric, tokenUsage } = await ctx.conversate({
94
+ source: "interfaceSchemaReview",
102
95
  controller: createController({
103
96
  model: ctx.model,
104
97
  pointer,
@@ -127,12 +120,14 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
127
120
  ).schemas ?? {}) as Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
128
121
 
129
122
  ctx.dispatch({
130
- type: config.type,
123
+ type: "interfaceSchemaReview",
124
+ kind: config.kind,
131
125
  id: v7(),
132
126
  schemas: props.reviewSchemas,
133
127
  review: pointer.value.think.review,
134
128
  plan: pointer.value.think.plan,
135
129
  content,
130
+ metric,
136
131
  tokenUsage,
137
132
  step: ctx.state().analyze?.step ?? 0,
138
133
  total: props.progress.total,
@@ -182,7 +177,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
182
177
  };
183
178
 
184
179
  const application: ILlmApplication<Model> = collection[
185
- props.model === "chatgpt" ? "chatgpt" : "claude"
180
+ props.model === "chatgpt"
181
+ ? "chatgpt"
182
+ : props.model === "gemini"
183
+ ? "gemini"
184
+ : "claude"
186
185
  ](
187
186
  validate,
188
187
  ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
@@ -217,6 +216,15 @@ const collection = {
217
216
  review: validate,
218
217
  },
219
218
  }),
219
+ gemini: (validate: Validator) =>
220
+ typia.llm.application<
221
+ IAutoBeInterfaceSchemaContentReviewApplication,
222
+ "gemini"
223
+ >({
224
+ validate: {
225
+ review: validate,
226
+ },
227
+ }),
220
228
  };
221
229
 
222
230
  type Validator = (
@@ -133,7 +133,7 @@ async function process<Model extends ILlmSchema.Model>(
133
133
  > | null> = {
134
134
  value: null,
135
135
  };
136
- const { tokenUsage } = await ctx.conversate({
136
+ const { metric, tokenUsage } = await ctx.conversate({
137
137
  source: "interfaceSchema",
138
138
  histories: transformInterfaceSchemaHistories({
139
139
  state: ctx.state(),
@@ -187,6 +187,7 @@ async function process<Model extends ILlmSchema.Model>(
187
187
  type: "interfaceSchema",
188
188
  id: v7(),
189
189
  schemas,
190
+ metric,
190
191
  tokenUsage,
191
192
  completed: (props.progress.completed += Object.keys(schemas).length),
192
193
  total: (props.progress.total += Object.keys(schemas).filter(
@@ -239,7 +240,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
239
240
  };
240
241
 
241
242
  const application: ILlmApplication<Model> = collection[
242
- props.model === "chatgpt" ? "chatgpt" : "claude"
243
+ props.model === "chatgpt"
244
+ ? "chatgpt"
245
+ : props.model === "gemini"
246
+ ? "gemini"
247
+ : "claude"
243
248
  ](
244
249
  validate,
245
250
  ) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
@@ -268,6 +273,12 @@ const collection = {
268
273
  makeComponents: validate,
269
274
  },
270
275
  }),
276
+ gemini: (validate: Validator) =>
277
+ typia.llm.application<IAutoBeInterfaceSchemaApplication, "gemini">({
278
+ validate: {
279
+ makeComponents: validate,
280
+ },
281
+ }),
271
282
  };
272
283
 
273
284
  type Validator = (
@@ -13,8 +13,8 @@ import { ILlmSchema } from "@samchon/openapi";
13
13
  import { v7 } from "uuid";
14
14
 
15
15
  import { AutoBeContext } from "../../context/AutoBeContext";
16
- import { IAutoBeFacadeApplicationProps } from "../../context/IAutoBeFacadeApplicationProps";
17
16
  import { predicateStateMessage } from "../../utils/predicateStateMessage";
17
+ import { IAutoBeFacadeApplicationProps } from "../facade/histories/IAutoBeFacadeApplicationProps";
18
18
  import { orchestratePrismaComponents } from "./orchestratePrismaComponent";
19
19
  import { orchestratePrismaCorrect } from "./orchestratePrismaCorrect";
20
20
  import { orchestratePrismaReview } from "./orchestratePrismaReview";
@@ -104,6 +104,7 @@ export const orchestratePrisma = async <Model extends ILlmSchema.Model>(
104
104
  compiled: await compiler.prisma.compile({
105
105
  files: finalSchemas,
106
106
  }),
107
+ aggregates: ctx.getCurrentAggregates("prisma"),
107
108
  step: ctx.state().analyze?.step ?? 0,
108
109
  elapsed: new Date().getTime() - start.getTime(),
109
110
  created_at: new Date().toISOString(),
@@ -22,7 +22,7 @@ export async function orchestratePrismaComponents<
22
22
  value: null,
23
23
  };
24
24
  const prefix: string | null = ctx.state().analyze?.prefix ?? null;
25
- const { tokenUsage } = await ctx.conversate({
25
+ const { metric, tokenUsage } = await ctx.conversate({
26
26
  source: "prismaComponent",
27
27
  histories: transformPrismaComponentsHistories(ctx.state(), {
28
28
  prefix,
@@ -47,6 +47,7 @@ export async function orchestratePrismaComponents<
47
47
  review: pointer.value.review,
48
48
  decision: pointer.value.decision,
49
49
  components: pointer.value.components,
50
+ metric,
50
51
  tokenUsage,
51
52
  step: ctx.state().analyze?.step ?? 0,
52
53
  };
@@ -59,7 +60,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
59
60
  assertSchemaModel(props.model);
60
61
 
61
62
  const application: ILlmApplication<Model> = collection[
62
- props.model
63
+ props.model === "chatgpt"
64
+ ? "chatgpt"
65
+ : props.model === "gemini"
66
+ ? "gemini"
67
+ : "claude"
63
68
  ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
64
69
  return {
65
70
  protocol: "class",
@@ -73,17 +78,17 @@ function createController<Model extends ILlmSchema.Model>(props: {
73
78
  };
74
79
  }
75
80
 
76
- const claude = typia.llm.application<
77
- IAutoBePrismaComponentApplication,
78
- "claude"
79
- >();
80
81
  const collection = {
81
82
  chatgpt: typia.llm.application<
82
83
  IAutoBePrismaComponentApplication,
83
84
  "chatgpt"
84
85
  >(),
85
- claude,
86
- llama: claude,
87
- deepseek: claude,
88
- "3.1": claude,
86
+ claude: typia.llm.application<
87
+ IAutoBePrismaComponentApplication,
88
+ "claude"
89
+ >(),
90
+ gemini: typia.llm.application<
91
+ IAutoBePrismaComponentApplication,
92
+ "gemini"
93
+ >(),
89
94
  };
@@ -116,7 +116,7 @@ async function execute<Model extends ILlmSchema.Model>(
116
116
  const pointer: IPointer<IAutoBePrismaCorrectApplication.IProps | null> = {
117
117
  value: null,
118
118
  };
119
- const { tokenUsage } = await ctx.conversate({
119
+ const { metric, tokenUsage } = await ctx.conversate({
120
120
  source: "prismaCorrect",
121
121
  histories: transformPrismaCorrectHistories(failure),
122
122
  controller: createController({
@@ -149,6 +149,7 @@ async function execute<Model extends ILlmSchema.Model>(
149
149
  failure,
150
150
  planning: pointer.value.planning,
151
151
  correction: correction,
152
+ metric,
152
153
  tokenUsage,
153
154
  step: ctx.state().analyze?.step ?? 0,
154
155
  created_at: new Date().toISOString(),
@@ -165,7 +166,11 @@ function createController<Model extends ILlmSchema.Model>(props: {
165
166
  }): IAgenticaController.IClass<Model> {
166
167
  assertSchemaModel(props.model);
167
168
  const application: ILlmApplication<Model> = collection[
168
- props.model
169
+ props.model === "chatgpt"
170
+ ? "chatgpt"
171
+ : props.model === "gemini"
172
+ ? "gemini"
173
+ : "claude"
169
174
  ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
170
175
  return {
171
176
  protocol: "class",
@@ -186,16 +191,10 @@ const getTableCount = (failure: IAutoBePrismaValidation.IFailure): number => {
186
191
  return unique.size;
187
192
  };
188
193
 
189
- const claude = typia.llm.application<
190
- IAutoBePrismaCorrectApplication,
191
- "claude"
192
- >();
193
194
  const collection = {
194
195
  chatgpt: typia.llm.application<IAutoBePrismaCorrectApplication, "chatgpt">(),
195
- claude,
196
- llama: claude,
197
- deepseek: claude,
198
- "3.1": claude,
196
+ claude: typia.llm.application<IAutoBePrismaCorrectApplication, "claude">(),
197
+ gemini: typia.llm.application<IAutoBePrismaCorrectApplication, "gemini">(),
199
198
  };
200
199
 
201
200
  interface IExecutionResult extends IAutoBePrismaCorrectApplication.IProps {
@@ -56,7 +56,7 @@ async function step<Model extends ILlmSchema.Model>(
56
56
  const pointer: IPointer<IAutoBePrismaReviewApplication.IProps | null> = {
57
57
  value: null,
58
58
  };
59
- const { tokenUsage } = await ctx.conversate({
59
+ const { metric, tokenUsage } = await ctx.conversate({
60
60
  source: "prismaReview",
61
61
  histories: transformPrismaReviewHistories({
62
62
  analysis:
@@ -90,6 +90,7 @@ async function step<Model extends ILlmSchema.Model>(
90
90
  review: pointer.value.review,
91
91
  plan: pointer.value.plan,
92
92
  modifications: pointer.value.modifications,
93
+ metric,
93
94
  tokenUsage,
94
95
  completed: ++props.progress.completed,
95
96
  total: props.progress.total,
@@ -108,7 +109,11 @@ function createController<Model extends ILlmSchema.Model>(
108
109
  assertSchemaModel(ctx.model);
109
110
 
110
111
  const application: ILlmApplication<Model> = collection[
111
- ctx.model
112
+ ctx.model === "chatgpt"
113
+ ? "chatgpt"
114
+ : ctx.model === "gemini"
115
+ ? "gemini"
116
+ : "claude"
112
117
  ] satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
113
118
 
114
119
  return {
@@ -123,15 +128,8 @@ function createController<Model extends ILlmSchema.Model>(
123
128
  };
124
129
  }
125
130
 
126
- const claude = typia.llm.application<
127
- IAutoBePrismaReviewApplication,
128
- "claude"
129
- >();
130
-
131
131
  const collection = {
132
132
  chatgpt: typia.llm.application<IAutoBePrismaReviewApplication, "chatgpt">(),
133
- claude,
134
- llama: claude,
135
- deepseek: claude,
136
- "3.1": claude,
133
+ claude: typia.llm.application<IAutoBePrismaReviewApplication, "claude">(),
134
+ gemini: typia.llm.application<IAutoBePrismaReviewApplication, "gemini">(),
137
135
  };