@autobe/agent 0.25.5 → 0.25.6

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 (119) hide show
  1. package/lib/constants/AutoBeSystemPromptConstant.d.ts +12 -13
  2. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  3. package/lib/context/AutoBeTokenUsage.d.ts +2 -2
  4. package/lib/context/AutoBeTokenUsage.js.map +1 -1
  5. package/lib/context/{IAutoBeApplication.d.ts → IAutoBeFacadeApplication.d.ts} +15 -83
  6. package/lib/context/{IAutoBeApplicationProps.js → IAutoBeFacadeApplication.js} +1 -1
  7. package/lib/context/IAutoBeFacadeApplication.js.map +1 -0
  8. package/lib/context/{IAutoBeApplicationProps.d.ts → IAutoBeFacadeApplicationProps.d.ts} +1 -1
  9. package/lib/context/{IAutoBeApplication.js → IAutoBeFacadeApplicationProps.js} +1 -1
  10. package/lib/context/IAutoBeFacadeApplicationProps.js.map +1 -0
  11. package/lib/context/{IAutoBeApplicationResult.d.ts → IAutoBeFacadeApplicationResult.d.ts} +1 -1
  12. package/lib/context/{IAutoBeApplicationResult.js → IAutoBeFacadeApplicationResult.js} +1 -1
  13. package/lib/context/IAutoBeFacadeApplicationResult.js.map +1 -0
  14. package/lib/factory/createAgenticaHistory.js +3 -1
  15. package/lib/factory/createAgenticaHistory.js.map +1 -1
  16. package/lib/factory/createAutoBeApplication.js +38 -76
  17. package/lib/factory/createAutoBeApplication.js.map +1 -1
  18. package/lib/factory/createAutoBeContext.js +10 -11
  19. package/lib/factory/createAutoBeContext.js.map +1 -1
  20. package/lib/index.mjs +167 -246
  21. package/lib/index.mjs.map +1 -1
  22. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +0 -1
  23. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  24. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +1 -1
  25. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +3 -18
  26. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  27. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +0 -1
  28. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +1 -13
  29. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  30. package/lib/orchestrate/analyze/orchestrateAnalyze.d.ts +1 -2
  31. package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -4
  32. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  33. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +1 -1
  34. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
  35. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  36. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +0 -1
  37. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  38. package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
  39. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  40. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +0 -4
  41. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
  42. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +10 -7
  43. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
  44. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.d.ts +3 -0
  45. package/lib/orchestrate/interface/histories/{transformInterfaceCommonPrerequisiteHistories.js → transformInterfaceCommonHistories.js} +4 -4
  46. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.js.map +1 -0
  47. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +12 -9
  48. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
  49. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +10 -7
  50. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
  51. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
  52. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
  53. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +13 -10
  54. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
  55. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +10 -7
  56. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
  57. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
  58. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
  59. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +10 -7
  60. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
  61. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +1 -1
  62. package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
  63. package/lib/orchestrate/interface/orchestrateInterface.d.ts +2 -2
  64. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  65. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +10 -5
  66. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
  67. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
  68. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
  69. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +9 -6
  70. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
  71. package/lib/orchestrate/prisma/orchestratePrisma.d.ts +2 -2
  72. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  73. package/lib/orchestrate/realize/orchestrateRealize.d.ts +2 -2
  74. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  75. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +8 -5
  76. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
  77. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +8 -5
  78. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
  79. package/lib/orchestrate/test/histories/transformTestWriteHistories.js +8 -5
  80. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
  81. package/lib/orchestrate/test/orchestrateTest.d.ts +2 -2
  82. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  83. package/package.json +6 -6
  84. package/src/constants/AutoBeSystemPromptConstant.ts +12 -13
  85. package/src/context/AutoBeTokenUsage.ts +2 -2
  86. package/src/context/{IAutoBeApplication.ts → IAutoBeFacadeApplication.ts} +15 -83
  87. package/src/context/{IAutoBeApplicationProps.ts → IAutoBeFacadeApplicationProps.ts} +1 -1
  88. package/src/context/{IAutoBeApplicationResult.ts → IAutoBeFacadeApplicationResult.ts} +1 -1
  89. package/src/factory/createAgenticaHistory.ts +5 -4
  90. package/src/factory/createAutoBeApplication.ts +6 -6
  91. package/src/factory/createAutoBeContext.ts +2 -3
  92. package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +0 -1
  93. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +0 -16
  94. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +0 -13
  95. package/src/orchestrate/analyze/orchestrateAnalyze.ts +71 -74
  96. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +1 -2
  97. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +0 -1
  98. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +0 -4
  99. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +9 -6
  100. package/src/orchestrate/interface/histories/{transformInterfaceCommonPrerequisiteHistories.ts → transformInterfaceCommonHistories.ts} +1 -1
  101. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +9 -6
  102. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +9 -6
  103. package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +11 -10
  104. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +9 -6
  105. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +9 -6
  106. package/src/orchestrate/interface/orchestrateInterface.ts +2 -2
  107. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +9 -4
  108. package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +8 -5
  109. package/src/orchestrate/prisma/orchestratePrisma.ts +2 -2
  110. package/src/orchestrate/realize/orchestrateRealize.ts +2 -2
  111. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +8 -5
  112. package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +8 -5
  113. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +8 -5
  114. package/src/orchestrate/test/orchestrateTest.ts +2 -2
  115. package/lib/context/IAutoBeApplication.js.map +0 -1
  116. package/lib/context/IAutoBeApplicationProps.js.map +0 -1
  117. package/lib/context/IAutoBeApplicationResult.js.map +0 -1
  118. package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.d.ts +0 -3
  119. package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { IAutoBeTokenUsageJson } from "@autobe/interface";
2
2
 
3
3
  import { AutoBeTokenUsageComponent } from "./AutoBeTokenUsageComponent";
4
- import { IAutoBeApplication } from "./IAutoBeApplication";
4
+ import { IAutoBeFacadeApplication } from "./IAutoBeFacadeApplication";
5
5
 
6
6
  /**
7
7
  * Comprehensive token usage tracker for the AutoBe vibe coding system.
@@ -218,7 +218,7 @@ export class AutoBeTokenUsage implements IAutoBeTokenUsageJson {
218
218
  */
219
219
  public record(
220
220
  usage: IAutoBeTokenUsageJson.IComponent,
221
- additionalStages: (keyof IAutoBeApplication)[] = [],
221
+ additionalStages: (keyof IAutoBeFacadeApplication)[] = [],
222
222
  ) {
223
223
  additionalStages.forEach((stage) => {
224
224
  this[stage].increment(usage);
@@ -1,11 +1,11 @@
1
- import { IAutoBeApplicationResult } from "./IAutoBeApplicationResult";
1
+ import { IAutoBeFacadeApplicationResult } from "./IAutoBeFacadeApplicationResult";
2
2
 
3
3
  /**
4
4
  * Application for AutoBE function calling.
5
5
  *
6
6
  * @author Samchon
7
7
  */
8
- export interface IAutoBeApplication {
8
+ export interface IAutoBeFacadeApplication {
9
9
  /**
10
10
  * Run Analyze Agent.
11
11
  *
@@ -25,26 +25,7 @@ export interface IAutoBeApplication {
25
25
  * conversation. When executed after other agents have generated code, it can
26
26
  * also interpret change requests in the context of existing implementations.
27
27
  */
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>;
28
+ analyze(): Promise<IAutoBeFacadeApplicationResult>;
48
29
 
49
30
  /**
50
31
  * Run prisma agent.
@@ -67,24 +48,12 @@ export interface IAutoBeApplication {
67
48
  */
68
49
  prisma(props: {
69
50
  /**
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:
51
+ * Database design instructions from user conversation.
81
52
  *
82
- * - "Design flexible product catalog with variant support"
83
- * - "Optimize for high-volume transaction queries"
84
- * - "Implement strict referential integrity for financial data"
53
+ * Pass empty string "" if no database-specific instructions exist.
85
54
  */
86
55
  instruction: string;
87
- }): Promise<IAutoBeApplicationResult>;
56
+ }): Promise<IAutoBeFacadeApplicationResult>;
88
57
 
89
58
  /**
90
59
  * Run interface agent.
@@ -101,24 +70,12 @@ export interface IAutoBeApplication {
101
70
  */
102
71
  interface(props: {
103
72
  /**
104
- * API design instructions extracted from user utterances.
73
+ * API design instructions from user conversation.
105
74
  *
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"
75
+ * Pass empty string "" if no API-specific instructions exist.
119
76
  */
120
77
  instruction: string;
121
- }): Promise<IAutoBeApplicationResult>;
78
+ }): Promise<IAutoBeFacadeApplicationResult>;
122
79
 
123
80
  /**
124
81
  * Run test program agent.
@@ -143,24 +100,12 @@ export interface IAutoBeApplication {
143
100
  */
144
101
  test(props: {
145
102
  /**
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.
103
+ * Testing strategy instructions from user conversation.
155
104
  *
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"
105
+ * Pass empty string "" if no test-specific instructions exist.
161
106
  */
162
107
  instruction: string;
163
- }): Promise<IAutoBeApplicationResult>;
108
+ }): Promise<IAutoBeFacadeApplicationResult>;
164
109
 
165
110
  /**
166
111
  * Run realize agent.
@@ -185,23 +130,10 @@ export interface IAutoBeApplication {
185
130
  */
186
131
  realize(props: {
187
132
  /**
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:
133
+ * Implementation instructions from user conversation.
200
134
  *
201
- * - "Implement with caching for frequently accessed data"
202
- * - "Use transaction patterns for financial operations"
203
- * - "Optimize for 10K concurrent users with rate limiting"
135
+ * Pass empty string "" if no implementation-specific instructions exist.
204
136
  */
205
137
  instruction: string;
206
- }): Promise<IAutoBeApplicationResult>;
138
+ }): Promise<IAutoBeFacadeApplicationResult>;
207
139
  }
@@ -1,4 +1,4 @@
1
- export interface IAutoBeApplicationProps {
1
+ export interface IAutoBeFacadeApplicationProps {
2
2
  /**
3
3
  * Instructions for each agent phase redefined by AI from user's utterance.
4
4
  * Contains specific guidance for analyze/prisma/interface/test/realize
@@ -1,4 +1,4 @@
1
- export interface IAutoBeApplicationResult {
1
+ export interface IAutoBeFacadeApplicationResult {
2
2
  type:
3
3
  | "success"
4
4
  | "failure"
@@ -10,8 +10,6 @@ import {
10
10
  } from "@autobe/interface";
11
11
  import { ILlmSchema } from "@samchon/openapi";
12
12
 
13
- import { IAutoBeApplicationProps } from "../context/IAutoBeApplicationProps";
14
-
15
13
  export function createAgenticaHistory<Model extends ILlmSchema.Model>(props: {
16
14
  operations: readonly AgenticaOperation<Model>[];
17
15
  history: AutoBeHistory;
@@ -36,8 +34,11 @@ export function createAgenticaHistory<Model extends ILlmSchema.Model>(props: {
36
34
  created_at: props.history.created_at,
37
35
  type: "execute" as const,
38
36
  arguments: {
39
- instruction: props.history.instruction,
40
- } satisfies IAutoBeApplicationProps,
37
+ instruction:
38
+ props.history.type === "analyze"
39
+ ? undefined
40
+ : props.history.instruction,
41
+ },
41
42
  value: {
42
43
  success:
43
44
  props.history.type === "analyze" || props.history.type === "interface"
@@ -4,7 +4,7 @@ import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
4
4
  import typia from "typia";
5
5
 
6
6
  import { AutoBeContext } from "../context/AutoBeContext";
7
- import { IAutoBeApplication } from "../context/IAutoBeApplication";
7
+ import { IAutoBeFacadeApplication } from "../context/IAutoBeFacadeApplication";
8
8
  import { assertSchemaModel } from "../context/assertSchemaModel";
9
9
  import { orchestrateAnalyze } from "../orchestrate/analyze/orchestrateAnalyze";
10
10
  import { orchestrateInterface } from "../orchestrate/interface/orchestrateInterface";
@@ -25,8 +25,8 @@ export const createAutoBeController = <Model extends ILlmSchema.Model>(props: {
25
25
  name: "autobe",
26
26
  application,
27
27
  execute: {
28
- analyze: async (next) => {
29
- const r = await orchestrateAnalyze(props.context)(next);
28
+ analyze: async () => {
29
+ const r = await orchestrateAnalyze(props.context);
30
30
  if (r.type === "analyze")
31
31
  return {
32
32
  type: "success",
@@ -109,13 +109,13 @@ export const createAutoBeController = <Model extends ILlmSchema.Model>(props: {
109
109
  description: "API interfaces are not yet completed.",
110
110
  };
111
111
  },
112
- } satisfies IAutoBeApplication,
112
+ } satisfies IAutoBeFacadeApplication,
113
113
  };
114
114
  };
115
115
 
116
- const claude = typia.llm.application<IAutoBeApplication, "claude">();
116
+ const claude = typia.llm.application<IAutoBeFacadeApplication, "claude">();
117
117
  const collection = {
118
- chatgpt: typia.llm.application<IAutoBeApplication, "chatgpt">(),
118
+ chatgpt: typia.llm.application<IAutoBeFacadeApplication, "chatgpt">(),
119
119
  claude,
120
120
  llama: claude,
121
121
  deepseek: claude,
@@ -34,7 +34,7 @@ import { AutoBeContext } from "../context/AutoBeContext";
34
34
  import { AutoBeState } from "../context/AutoBeState";
35
35
  import { AutoBeTokenUsage } from "../context/AutoBeTokenUsage";
36
36
  import { AutoBeTokenUsageComponent } from "../context/AutoBeTokenUsageComponent";
37
- import { IAutoBeApplication } from "../context/IAutoBeApplication";
37
+ import { IAutoBeFacadeApplication } from "../context/IAutoBeFacadeApplication";
38
38
  import { IAutoBeConfig } from "../structures/IAutoBeConfig";
39
39
  import { IAutoBeVendor } from "../structures/IAutoBeVendor";
40
40
  import { AutoBeTimeoutError } from "../utils/AutoBeTimeoutError";
@@ -310,7 +310,6 @@ const createDispatch = (props: {
310
310
  history: {
311
311
  type: "analyze",
312
312
  id: v7(),
313
- instruction: analyzeStart?.reason ?? "",
314
313
  prefix: event.prefix,
315
314
  roles: event.roles,
316
315
  files: event.files,
@@ -431,4 +430,4 @@ const forceRetry = async <T>(
431
430
  throw error;
432
431
  };
433
432
 
434
- const STAGES = typia.misc.literals<keyof IAutoBeApplication>();
433
+ const STAGES = typia.misc.literals<keyof IAutoBeFacadeApplication>();
@@ -23,7 +23,6 @@ export const transformAnalyzeReviewHistories = <Model extends ILlmSchema.Model>(
23
23
  ...transformAnalyzeWriteHistories(ctx, {
24
24
  scenario,
25
25
  file: myFile,
26
- instruction: "",
27
26
  }).slice(0, -2),
28
27
  {
29
28
  id: v7(),
@@ -8,7 +8,6 @@ import { AutoBeContext } from "../../../context/AutoBeContext";
8
8
 
9
9
  export function transformAnalyzeSceHistories<Model extends ILlmSchema.Model>(
10
10
  ctx: AutoBeContext<Model>,
11
- instruction: string,
12
11
  ): Array<IMicroAgenticaHistoryJson> {
13
12
  return [
14
13
  ...ctx
@@ -34,20 +33,5 @@ export function transformAnalyzeSceHistories<Model extends ILlmSchema.Model>(
34
33
  `,
35
34
  created_at: new Date().toISOString(),
36
35
  },
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
- },
52
36
  ];
53
37
  }
@@ -13,7 +13,6 @@ export const transformAnalyzeWriteHistories = <Model extends ILlmSchema.Model>(
13
13
  props: {
14
14
  scenario: AutoBeAnalyzeScenarioEvent;
15
15
  file: AutoBeAnalyzeFile.Scenario;
16
- instruction: string;
17
16
  },
18
17
  ): Array<
19
18
  | IAgenticaHistoryJson.IUserMessage
@@ -75,18 +74,6 @@ export const transformAnalyzeWriteHistories = <Model extends ILlmSchema.Model>(
75
74
  \`\`\`json
76
75
  ${JSON.stringify(props.file)}
77
76
  \`\`\`
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}
90
77
  `,
91
78
  },
92
79
  ];
@@ -11,92 +11,89 @@ import { ILlmSchema } from "@samchon/openapi";
11
11
  import { v7 } from "uuid";
12
12
 
13
13
  import { AutoBeContext } from "../../context/AutoBeContext";
14
- import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
15
14
  import { executeCachedBatch } from "../../utils/executeCachedBatch";
16
15
  import { orchestrateAnalyzeReview } from "./orchestrateAnalyzeReview";
17
16
  import { orchestrateAnalyzeScenario } from "./orchestrateAnalyzeScenario";
18
17
  import { orchestrateAnalyzeWrite } from "./orchestrateAnalyzeWrite";
19
18
 
20
- export const orchestrateAnalyze =
21
- <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>) =>
22
- async (
23
- props: IAutoBeApplicationProps,
24
- ): Promise<AutoBeAssistantMessageHistory | AutoBeAnalyzeHistory> => {
25
- // Initialize analysis state
26
- const step: number = (ctx.state().analyze?.step ?? -1) + 1;
27
- const startTime: Date = new Date();
19
+ export const orchestrateAnalyze = async <Model extends ILlmSchema.Model>(
20
+ ctx: AutoBeContext<Model>,
21
+ ): Promise<AutoBeAssistantMessageHistory | AutoBeAnalyzeHistory> => {
22
+ // Initialize analysis state
23
+ const step: number = (ctx.state().analyze?.step ?? -1) + 1;
24
+ const startTime: Date = new Date();
28
25
 
29
- ctx.dispatch({
30
- type: "analyzeStart",
31
- id: v7(),
32
- reason: props.instruction,
33
- step,
34
- created_at: startTime.toISOString(),
35
- });
26
+ ctx.dispatch({
27
+ type: "analyzeStart",
28
+ id: v7(),
29
+ step,
30
+ created_at: startTime.toISOString(),
31
+ });
36
32
 
37
- // Generate analysis scenario
38
- const scenario: AutoBeAnalyzeScenarioEvent | AutoBeAssistantMessageHistory =
39
- await orchestrateAnalyzeScenario(ctx, props.instruction);
40
- if (scenario.type === "assistantMessage")
41
- return ctx.assistantMessage(scenario);
42
- else ctx.dispatch(scenario);
33
+ // Generate analysis scenario
34
+ const scenario: AutoBeAnalyzeScenarioEvent | AutoBeAssistantMessageHistory =
35
+ await orchestrateAnalyzeScenario(ctx);
36
+ if (scenario.type === "assistantMessage")
37
+ return ctx.assistantMessage(scenario);
38
+ else ctx.dispatch(scenario);
43
39
 
44
- // write documents
45
- const writeProgress: AutoBeProgressEventBase = {
46
- total: scenario.files.length,
47
- completed: 0,
48
- };
49
- const fileList: AutoBeAnalyzeFile[] = await executeCachedBatch(
50
- scenario.files.map((file) => async (promptCacheKey) => {
51
- const event: AutoBeAnalyzeWriteEvent = await orchestrateAnalyzeWrite(
40
+ // write documents
41
+ const writeProgress: AutoBeProgressEventBase = {
42
+ total: scenario.files.length,
43
+ completed: 0,
44
+ };
45
+ const fileList: AutoBeAnalyzeFile[] = await executeCachedBatch(
46
+ scenario.files.map((file) => async (promptCacheKey) => {
47
+ const event: AutoBeAnalyzeWriteEvent = await orchestrateAnalyzeWrite(
48
+ ctx,
49
+ {
50
+ scenario,
51
+ file,
52
+ progress: writeProgress,
53
+ promptCacheKey,
54
+ },
55
+ );
56
+ return event.file;
57
+ }),
58
+ );
59
+
60
+ // review documents
61
+ const reviewProgress: AutoBeProgressEventBase = {
62
+ total: fileList.length,
63
+ completed: 0,
64
+ };
65
+ const newFiles: AutoBeAnalyzeFile[] = await executeCachedBatch(
66
+ fileList.map((file) => async (promptCacheKey) => {
67
+ try {
68
+ const event: AutoBeAnalyzeReviewEvent = await orchestrateAnalyzeReview(
52
69
  ctx,
53
70
  {
54
71
  scenario,
55
- file,
56
- progress: writeProgress,
72
+ allFiles: fileList, // all files
73
+ myFile: file,
74
+ progress: reviewProgress,
57
75
  promptCacheKey,
58
- instruction: props.instruction,
59
76
  },
60
77
  );
61
- return event.file;
62
- }),
63
- );
78
+ return {
79
+ ...event.file,
80
+ content: event.content,
81
+ };
82
+ } catch {
83
+ return file;
84
+ }
85
+ }),
86
+ );
64
87
 
65
- // review documents
66
- const reviewProgress: AutoBeProgressEventBase = {
67
- total: fileList.length,
68
- completed: 0,
69
- };
70
- const newFiles: AutoBeAnalyzeFile[] = await executeCachedBatch(
71
- fileList.map((file) => async (promptCacheKey) => {
72
- try {
73
- const event: AutoBeAnalyzeReviewEvent =
74
- await orchestrateAnalyzeReview(ctx, {
75
- scenario,
76
- allFiles: fileList, // all files
77
- myFile: file,
78
- progress: reviewProgress,
79
- promptCacheKey,
80
- });
81
- return {
82
- ...event.file,
83
- content: event.content,
84
- };
85
- } catch {
86
- return file;
87
- }
88
- }),
89
- );
90
-
91
- // Complete the analysis
92
- return ctx.dispatch({
93
- type: "analyzeComplete",
94
- id: v7(),
95
- roles: scenario.roles,
96
- prefix: scenario.prefix,
97
- files: newFiles,
98
- step,
99
- elapsed: new Date().getTime() - startTime.getTime(),
100
- created_at: new Date().toISOString(),
101
- }) satisfies AutoBeAnalyzeHistory;
102
- };
88
+ // Complete the analysis
89
+ return ctx.dispatch({
90
+ type: "analyzeComplete",
91
+ id: v7(),
92
+ roles: scenario.roles,
93
+ prefix: scenario.prefix,
94
+ files: newFiles,
95
+ step,
96
+ elapsed: new Date().getTime() - startTime.getTime(),
97
+ created_at: new Date().toISOString(),
98
+ }) satisfies AutoBeAnalyzeHistory;
99
+ };
@@ -21,7 +21,6 @@ export const orchestrateAnalyzeScenario = async <
21
21
  Model extends ILlmSchema.Model,
22
22
  >(
23
23
  ctx: AutoBeContext<Model>,
24
- instruction: string,
25
24
  ): Promise<AutoBeAnalyzeScenarioEvent | AutoBeAssistantMessageHistory> => {
26
25
  const start: Date = new Date();
27
26
  const pointer: IPointer<IAutoBeAnalyzeScenarioApplication.IProps | null> = {
@@ -33,7 +32,7 @@ export const orchestrateAnalyzeScenario = async <
33
32
  model: ctx.model,
34
33
  build: (value) => (pointer.value = value),
35
34
  }),
36
- histories: transformAnalyzeSceHistories(ctx, instruction),
35
+ histories: transformAnalyzeSceHistories(ctx),
37
36
  enforceFunctionCall: false,
38
37
  message: StringUtil.trim`
39
38
  Design a complete list of documents and user roles for this project.
@@ -20,7 +20,6 @@ export const orchestrateAnalyzeWrite = async <Model extends ILlmSchema.Model>(
20
20
  props: {
21
21
  scenario: AutoBeAnalyzeScenarioEvent;
22
22
  file: AutoBeAnalyzeFile.Scenario;
23
- instruction: string;
24
23
  progress: AutoBeProgressEventBase;
25
24
  promptCacheKey: string;
26
25
  },
@@ -27,10 +27,6 @@ export const transformInterfaceAssetHistories = (
27
27
  Call the provided tool function to generate the OpenAPI document
28
28
  referencing below requirement analysis and Prisma DB schema.
29
29
 
30
- ## User Request
31
-
32
- ${analyze.instruction}
33
-
34
30
  ## Requirement Analysis Report
35
31
 
36
32
  \`\`\`json
@@ -47,15 +47,18 @@ export const transformInterfaceAuthorizationsHistories = (props: {
47
47
  text: StringUtil.trim`
48
48
  ## API Design Instructions
49
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
50
+ The following API-specific instructions were extracted from
51
+ the user's requirements. These focus on API interface design aspects
52
52
  such as endpoint patterns, request/response formats, DTO schemas,
53
53
  and operation specifications.
54
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.
55
+ Follow these instructions when designing authorization operations for ${props.role.name}.
56
+ Carefully distinguish between:
57
+ - Suggestions or recommendations (consider these as guidance)
58
+ - Direct specifications or explicit commands (these must be followed exactly)
59
+
60
+ When instructions contain direct specifications or explicit design decisions,
61
+ follow them precisely even if you believe you have better alternatives.
59
62
 
60
63
  ${props.instruction}
61
64
 
@@ -3,7 +3,7 @@ import { v7 } from "uuid";
3
3
 
4
4
  import { AutoBeState } from "../../../context/AutoBeState";
5
5
 
6
- export const transformInterfaceCommonPrerequisiteHistories = (
6
+ export const transformInterfaceCommonHistories = (
7
7
  state: AutoBeState,
8
8
  ): Array<
9
9
  IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
@@ -41,15 +41,18 @@ export const transformInterfaceComplementHistories = (props: {
41
41
  text: StringUtil.trim`
42
42
  ## API Design Instructions
43
43
 
44
- The following API-specific instructions were extracted by AI from
45
- the user's utterances. These focus ONLY on API interface design aspects
44
+ The following API-specific instructions were extracted from
45
+ the user's requirements. These focus on API interface design aspects
46
46
  such as endpoint patterns, request/response formats, DTO schemas,
47
47
  and operation specifications.
48
48
 
49
- Apply these instructions when completing the missing schema types.
50
- Focus on ensuring the schemas align with the overall API design patterns
51
- and data structure requirements. If the instructions are not relevant
52
- to the specific schemas you need to create, you may ignore them.
49
+ Follow these instructions when completing missing schema types.
50
+ Carefully distinguish between:
51
+ - Suggestions or recommendations (consider these as guidance)
52
+ - Direct specifications or explicit commands (these must be followed exactly)
53
+
54
+ When instructions contain direct specifications or explicit design decisions,
55
+ follow them precisely even if you believe you have better alternatives.
53
56
 
54
57
  ${props.instruction}
55
58
 
@@ -30,15 +30,18 @@ export const transformInterfaceEndpointHistories = (props: {
30
30
  text: StringUtil.trim`
31
31
  ## API Design Instructions
32
32
 
33
- The following API-specific instructions were extracted by AI from
34
- the user's utterances. These focus ONLY on API interface design aspects
33
+ The following API-specific instructions were extracted from
34
+ the user's requirements. These focus on API interface design aspects
35
35
  such as endpoint patterns, request/response formats, DTO schemas,
36
36
  and operation specifications.
37
37
 
38
- Apply these instructions when designing endpoints for the ${props.group.name} group.
39
- Consider the specified URL patterns, HTTP methods, parameter structures,
40
- and response formats. If the instructions are not relevant to this specific
41
- endpoint group, you may ignore them.
38
+ Follow these instructions when designing endpoints for the ${props.group.name} group.
39
+ Carefully distinguish between:
40
+ - Suggestions or recommendations (consider these as guidance)
41
+ - Direct specifications or explicit commands (these must be followed exactly)
42
+
43
+ When instructions contain direct specifications or explicit design decisions,
44
+ follow them precisely even if you believe you have better alternatives.
42
45
 
43
46
  ${props.instruction}
44
47