@autobe/agent 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.d.ts +183 -12
- package/lib/AutoBeAgent.js +247 -65
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +4 -3
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/context/AutoBeContext.d.ts +2 -2
- package/lib/factory/index.d.ts +0 -1
- package/lib/factory/index.js +0 -1
- package/lib/factory/index.js.map +1 -1
- package/lib/index.mjs +1195 -834
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/test/compileTestScenario.d.ts +5 -0
- package/lib/orchestrate/test/compileTestScenario.js +56 -0
- package/lib/orchestrate/test/compileTestScenario.js.map +1 -0
- package/lib/orchestrate/test/filterTestFileName.d.ts +1 -0
- package/lib/orchestrate/test/filterTestFileName.js +13 -0
- package/lib/orchestrate/test/filterTestFileName.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTest.js +10 -11
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js +91 -73
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestScenario.js +616 -237
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -0
- package/lib/orchestrate/test/{orchestrateTestProgress.js → orchestrateTestWrite.js} +37 -51
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +123 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +5 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js.map +1 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -1
- package/lib/orchestrate/test/transformTestCorrectHistories.js +4 -4
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +1 -2
- package/lib/orchestrate/test/transformTestScenarioHistories.js +1 -77
- package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.d.ts +7 -0
- package/lib/orchestrate/test/transformTestWriteHistories.js +47 -0
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -0
- package/lib/structures/IAutoBeConfig.d.ts +48 -10
- package/lib/structures/IAutoBeProps.d.ts +87 -0
- package/lib/structures/IAutoBeVendor.d.ts +64 -22
- package/lib/utils/backoffRetry.d.ts +7 -0
- package/lib/utils/backoffRetry.js +73 -0
- package/lib/utils/backoffRetry.js.map +1 -0
- package/lib/utils/types/BackoffOptions.d.ts +12 -0
- package/lib/utils/types/BackoffOptions.js +3 -0
- package/lib/utils/types/BackoffOptions.js.map +1 -0
- package/package.json +4 -4
- package/src/AutoBeAgent.ts +251 -51
- package/src/constants/AutoBeSystemPromptConstant.ts +4 -3
- package/src/context/AutoBeContext.ts +7 -2
- package/src/factory/index.ts +0 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +1 -1
- package/src/orchestrate/interface/orchestrateInterface.ts +1 -1
- package/src/orchestrate/prisma/orchestratePrisma.ts +1 -0
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +4 -2
- package/src/orchestrate/test/compileTestScenario.ts +63 -0
- package/src/orchestrate/test/filterTestFileName.ts +9 -0
- package/src/orchestrate/test/orchestrateTest.ts +11 -17
- package/src/orchestrate/test/orchestrateTestCorrect.ts +152 -100
- package/src/orchestrate/test/orchestrateTestScenario.ts +195 -151
- package/src/orchestrate/test/{orchestrateTestProgress.ts → orchestrateTestWrite.ts} +29 -44
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +132 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +5 -0
- package/src/orchestrate/test/transformTestCorrectHistories.ts +4 -4
- package/src/orchestrate/test/transformTestScenarioHistories.ts +0 -79
- package/src/orchestrate/test/transformTestWriteHistories.ts +53 -0
- package/src/structures/IAutoBeConfig.ts +48 -10
- package/src/structures/IAutoBeProps.ts +91 -0
- package/src/structures/IAutoBeVendor.ts +64 -22
- package/src/utils/backoffRetry.ts +84 -0
- package/src/utils/types/BackoffOptions.ts +15 -0
- package/lib/orchestrate/test/orchestrateTestProgress.d.ts +0 -4
- package/lib/orchestrate/test/orchestrateTestProgress.js.map +0 -1
- package/lib/orchestrate/test/transformTestProgressHistories.d.ts +0 -2
- package/lib/orchestrate/test/transformTestProgressHistories.js +0 -47
- package/lib/orchestrate/test/transformTestProgressHistories.js.map +0 -1
- package/src/orchestrate/test/transformTestProgressHistories.ts +0 -51
|
@@ -2,10 +2,10 @@ import { IAgenticaHistoryJson } from "@agentica/core";
|
|
|
2
2
|
import { v4 } from "uuid";
|
|
3
3
|
|
|
4
4
|
import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
|
|
5
|
+
import { IAutoBeTestScenarioArtifacts } from "./structures/IAutoBeTestScenarioArtifacts";
|
|
5
6
|
|
|
6
7
|
export const transformTestCorrectHistories = (
|
|
7
|
-
|
|
8
|
-
dtoFiles: Record<string, string>,
|
|
8
|
+
artifacts: IAutoBeTestScenarioArtifacts,
|
|
9
9
|
): Array<
|
|
10
10
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
11
11
|
> => {
|
|
@@ -35,12 +35,12 @@ export const transformTestCorrectHistories = (
|
|
|
35
35
|
"## File References",
|
|
36
36
|
"### API Files",
|
|
37
37
|
"```typescript",
|
|
38
|
-
JSON.stringify(
|
|
38
|
+
JSON.stringify(artifacts.sdk),
|
|
39
39
|
"```",
|
|
40
40
|
"",
|
|
41
41
|
"### DTO Files",
|
|
42
42
|
"```typescript",
|
|
43
|
-
JSON.stringify(
|
|
43
|
+
JSON.stringify(artifacts.dto),
|
|
44
44
|
"```",
|
|
45
45
|
"",
|
|
46
46
|
"Now Fix the E2E test function based on the given error information.",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
2
|
import { v4 } from "uuid";
|
|
4
3
|
|
|
5
4
|
import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
|
|
@@ -7,8 +6,6 @@ import { AutoBeState } from "../../context/AutoBeState";
|
|
|
7
6
|
|
|
8
7
|
export const transformTestScenarioHistories = (
|
|
9
8
|
state: AutoBeState,
|
|
10
|
-
allEndpoints: AutoBeOpenApi.IEndpoint[],
|
|
11
|
-
files: Record<string, string>,
|
|
12
9
|
): Array<
|
|
13
10
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
14
11
|
> => {
|
|
@@ -87,47 +84,6 @@ export const transformTestScenarioHistories = (
|
|
|
87
84
|
type: "systemMessage",
|
|
88
85
|
text: AutoBeSystemPromptConstant.TEST,
|
|
89
86
|
},
|
|
90
|
-
{
|
|
91
|
-
id: v4(),
|
|
92
|
-
created_at: new Date().toISOString(),
|
|
93
|
-
type: "systemMessage",
|
|
94
|
-
text: [
|
|
95
|
-
"# Result of Analyze Agent",
|
|
96
|
-
"- The following document contains the user requirements that were extracted through conversations with the user by the Analyze Agent.",
|
|
97
|
-
"- The database schema was designed based on these requirements, so you may refer to this document when writing test code or reviewing the schema.",
|
|
98
|
-
"",
|
|
99
|
-
`## User Request`,
|
|
100
|
-
"",
|
|
101
|
-
`- ${state.analyze.reason}`,
|
|
102
|
-
"",
|
|
103
|
-
`## Requirement Analysis Report`,
|
|
104
|
-
"",
|
|
105
|
-
"```json",
|
|
106
|
-
JSON.stringify(state.analyze.files),
|
|
107
|
-
"```",
|
|
108
|
-
].join("\n"),
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: v4(),
|
|
112
|
-
created_at: new Date().toISOString(),
|
|
113
|
-
type: "systemMessage",
|
|
114
|
-
text: [
|
|
115
|
-
"# Result of Prisma Agent",
|
|
116
|
-
"- Given the following database schema and entity-relationship diagram, write appropriate test code to validate the constraints and relationships defined in the schema. For example, if there is a unique column, include a test that ensures its uniqueness.",
|
|
117
|
-
"- The test code should strictly adhere to the schema and relationships—no violations of constraints should occur.",
|
|
118
|
-
"- Use the information from the schema and diagram to design meaningful and accurate test cases.",
|
|
119
|
-
"",
|
|
120
|
-
"## Prisma DB Schema",
|
|
121
|
-
"```json",
|
|
122
|
-
JSON.stringify(state.prisma.schemas),
|
|
123
|
-
"```",
|
|
124
|
-
"",
|
|
125
|
-
"## Entity Relationship Diagrams",
|
|
126
|
-
"```json",
|
|
127
|
-
JSON.stringify(state.prisma.compiled.diagrams),
|
|
128
|
-
"```",
|
|
129
|
-
].join("\n"),
|
|
130
|
-
},
|
|
131
87
|
{
|
|
132
88
|
id: v4(),
|
|
133
89
|
created_at: new Date().toISOString(),
|
|
@@ -145,40 +101,5 @@ export const transformTestScenarioHistories = (
|
|
|
145
101
|
"```",
|
|
146
102
|
].join("\n"),
|
|
147
103
|
},
|
|
148
|
-
{
|
|
149
|
-
id: v4(),
|
|
150
|
-
created_at: new Date().toISOString(),
|
|
151
|
-
type: "systemMessage",
|
|
152
|
-
text: AutoBeSystemPromptConstant.TEST,
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
id: v4(),
|
|
156
|
-
created_at: new Date().toISOString(),
|
|
157
|
-
type: "systemMessage",
|
|
158
|
-
text: [
|
|
159
|
-
`This is a description of different APIs.`,
|
|
160
|
-
`Different APIs may have to be called to create one.`,
|
|
161
|
-
`Check which functions have been developed.`,
|
|
162
|
-
"```json",
|
|
163
|
-
JSON.stringify(allEndpoints, null, 2),
|
|
164
|
-
"```",
|
|
165
|
-
].join("\n"),
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
id: v4(),
|
|
169
|
-
created_at: new Date().toISOString(),
|
|
170
|
-
type: "systemMessage",
|
|
171
|
-
text: [
|
|
172
|
-
"Below is basically the generated test code,",
|
|
173
|
-
"which is a test to verify that the API is simply called and successful.",
|
|
174
|
-
"Since there is already an automatically generated API,",
|
|
175
|
-
"when a user requests to create a test scenario, two or more APIs must be combined,",
|
|
176
|
-
"but a test in which the currently given endpoint is the main must be created.",
|
|
177
|
-
'"Input Test Files" should be selected from the list of files here.',
|
|
178
|
-
"```json",
|
|
179
|
-
JSON.stringify(files, null, 2),
|
|
180
|
-
"```",
|
|
181
|
-
].join("\n"),
|
|
182
|
-
},
|
|
183
104
|
];
|
|
184
105
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
+
import { AutoBeTestScenario } from "@autobe/interface";
|
|
3
|
+
import { v4 } from "uuid";
|
|
4
|
+
|
|
5
|
+
import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
|
|
6
|
+
import { IAutoBeTestScenarioArtifacts } from "./structures/IAutoBeTestScenarioArtifacts";
|
|
7
|
+
|
|
8
|
+
export const transformTestWriteHistories = (props: {
|
|
9
|
+
scenario: AutoBeTestScenario;
|
|
10
|
+
artifacts: IAutoBeTestScenarioArtifacts;
|
|
11
|
+
}): Array<
|
|
12
|
+
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
13
|
+
> => {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
id: v4(),
|
|
17
|
+
created_at: new Date().toISOString(),
|
|
18
|
+
type: "systemMessage",
|
|
19
|
+
text: AutoBeSystemPromptConstant.TEST_WRITE,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: v4(),
|
|
23
|
+
created_at: new Date().toISOString(),
|
|
24
|
+
type: "assistantMessage",
|
|
25
|
+
text: [
|
|
26
|
+
"Here is the list of input material composition.",
|
|
27
|
+
"",
|
|
28
|
+
"Make e2e test functions based on the following information.",
|
|
29
|
+
"",
|
|
30
|
+
"## Secnario Plan",
|
|
31
|
+
"```json",
|
|
32
|
+
JSON.stringify(props.scenario),
|
|
33
|
+
"```",
|
|
34
|
+
"",
|
|
35
|
+
"## DTO Definitions",
|
|
36
|
+
"```json",
|
|
37
|
+
JSON.stringify(props.artifacts.dto),
|
|
38
|
+
"```",
|
|
39
|
+
"",
|
|
40
|
+
"## API (SDK) Functions",
|
|
41
|
+
"```json",
|
|
42
|
+
JSON.stringify(props.artifacts.sdk),
|
|
43
|
+
"```",
|
|
44
|
+
"",
|
|
45
|
+
"## E2E Mockup Functions",
|
|
46
|
+
"```json",
|
|
47
|
+
JSON.stringify(props.artifacts.e2e),
|
|
48
|
+
"```",
|
|
49
|
+
"",
|
|
50
|
+
].join("\n"),
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
};
|
|
@@ -1,25 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface defining behavioral configuration for AutoBeAgent localization and
|
|
3
|
+
* context.
|
|
4
|
+
*
|
|
5
|
+
* This interface customizes the agent's communication style, language
|
|
6
|
+
* preferences, and geographical context to provide personalized vibe coding
|
|
7
|
+
* experiences. The configuration enables culturally appropriate interactions
|
|
8
|
+
* and regionally aware development decisions throughout the automated
|
|
9
|
+
* development pipeline.
|
|
10
|
+
*
|
|
11
|
+
* Locale and timezone settings influence not only the language of communication
|
|
12
|
+
* but also contextual understanding of regulatory requirements, business
|
|
13
|
+
* practices, and temporal considerations that may affect requirements analysis,
|
|
14
|
+
* database design, API specifications, and implementation approaches.
|
|
15
|
+
*
|
|
16
|
+
* @author Samchon
|
|
17
|
+
*/
|
|
1
18
|
export interface IAutoBeConfig {
|
|
2
19
|
/**
|
|
3
|
-
*
|
|
20
|
+
* Language and cultural locale preference for AI agent communication.
|
|
4
21
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
22
|
+
* Configures the language and cultural context for all AI assistant responses
|
|
23
|
+
* throughout the vibe coding process. When specified, the agent will
|
|
24
|
+
* communicate in the preferred language while respecting cultural conventions
|
|
25
|
+
* and linguistic nuances during requirements gathering, progress updates, and
|
|
26
|
+
* guidance provision.
|
|
27
|
+
*
|
|
28
|
+
* The locale setting also influences the agent's understanding of regional
|
|
29
|
+
* business practices, regulatory considerations, and cultural expectations
|
|
30
|
+
* that may impact software design decisions and implementation approaches.
|
|
31
|
+
*
|
|
32
|
+
* Common formats follow BCP 47 language tags such as "en-US", "ko-KR",
|
|
33
|
+
* "ja-JP", "zh-CN", "de-DE", etc. Platform-specific detection methods:
|
|
7
34
|
*
|
|
8
35
|
* - Browser: `navigator.language`
|
|
9
|
-
* -
|
|
36
|
+
* - Node.js: `process.env.LANG.split(".")[0]`
|
|
10
37
|
*
|
|
11
|
-
* @default
|
|
38
|
+
* @default System locale or "en" if unavailable
|
|
12
39
|
*/
|
|
13
40
|
locale?: string;
|
|
14
41
|
|
|
15
42
|
/**
|
|
16
|
-
*
|
|
43
|
+
* Geographic timezone for temporal context and time-sensitive operations.
|
|
44
|
+
*
|
|
45
|
+
* Provides timezone awareness for proper handling of time-related
|
|
46
|
+
* considerations during the vibe coding process. This includes scheduling
|
|
47
|
+
* references, temporal business logic requirements, timestamp handling in
|
|
48
|
+
* generated code, and time-based communications that need to be
|
|
49
|
+
* contextualized for the user's local time.
|
|
50
|
+
*
|
|
51
|
+
* Timezone awareness ensures that generated applications properly handle time
|
|
52
|
+
* zones, that scheduling-related requirements are interpreted correctly, and
|
|
53
|
+
* that temporal references in documentation and code comments reflect the
|
|
54
|
+
* user's geographical context.
|
|
17
55
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
56
|
+
* Format follows IANA Time Zone Database identifiers such as
|
|
57
|
+
* "America/New_York", "Asia/Seoul", "Europe/London", "Pacific/Auckland", etc.
|
|
58
|
+
* Platform detection: `Intl.DateTimeFormat().resolvedOptions().timeZone`
|
|
21
59
|
*
|
|
22
|
-
* @default
|
|
60
|
+
* @default System timezone or "UTC" if unavailable
|
|
23
61
|
*/
|
|
24
62
|
timezone?: string;
|
|
25
63
|
}
|
|
@@ -4,10 +4,101 @@ import { ILlmSchema } from "@samchon/openapi";
|
|
|
4
4
|
import { IAutoBeConfig } from "./IAutoBeConfig";
|
|
5
5
|
import { IAutoBeVendor } from "./IAutoBeVendor";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Configuration properties for initializing an AutoBeAgent instance.
|
|
9
|
+
*
|
|
10
|
+
* This interface defines all the essential parameters required to create and
|
|
11
|
+
* configure an AutoBeAgent for vibe coding operations. The properties establish
|
|
12
|
+
* the AI model capabilities, vendor connectivity, compilation infrastructure,
|
|
13
|
+
* behavioral context, and optional session continuity through conversation
|
|
14
|
+
* histories.
|
|
15
|
+
*
|
|
16
|
+
* The configuration enables type-safe AI function calling through
|
|
17
|
+
* model-specific schema generation, ensures compatibility with various AI
|
|
18
|
+
* service providers, and provides the compilation tools necessary for the
|
|
19
|
+
* sophisticated AST-based development pipeline that transforms conversations
|
|
20
|
+
* into working software.
|
|
21
|
+
*
|
|
22
|
+
* @author Samchon
|
|
23
|
+
*/
|
|
7
24
|
export interface IAutoBeProps<Model extends ILlmSchema.Model> {
|
|
25
|
+
/**
|
|
26
|
+
* AI model type specification for type-safe function calling schema
|
|
27
|
+
* generation.
|
|
28
|
+
*
|
|
29
|
+
* Determines the specific AI model schema used for generating function
|
|
30
|
+
* calling interfaces through
|
|
31
|
+
* [`typia.llm.application()`](https://typia.io/docs/llm/application). This
|
|
32
|
+
* type parameter ensures compile-time type safety and enables model-specific
|
|
33
|
+
* optimizations in the AI function calling interface generation process.
|
|
34
|
+
*
|
|
35
|
+
* Common values include "chatgpt" for OpenAI models, "claude" for Anthropic
|
|
36
|
+
* models, "deepseek" for DeepSeek models, and "llama" for Meta Llama models.
|
|
37
|
+
* The choice affects function calling capabilities, parameter limitations,
|
|
38
|
+
* and schema requirements throughout the vibe coding pipeline.
|
|
39
|
+
*
|
|
40
|
+
* Note that Google Gemini ("gemini") is not supported due to its lack of
|
|
41
|
+
* reference types and union types support required for OpenAPI document
|
|
42
|
+
* composition in the vibe coding process.
|
|
43
|
+
*/
|
|
8
44
|
model: Model;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* AI vendor configuration for service provider integration.
|
|
48
|
+
*
|
|
49
|
+
* Defines the complete AI service connection including the OpenAI SDK
|
|
50
|
+
* instance, model identifier, request options, and concurrency controls. This
|
|
51
|
+
* configuration enables the AutoBeAgent to connect with various AI providers
|
|
52
|
+
* while maintaining consistent functionality across the entire automated
|
|
53
|
+
* development workflow.
|
|
54
|
+
*
|
|
55
|
+
* The vendor settings determine the AI capabilities available for
|
|
56
|
+
* requirements analysis, database design, API specification, testing, and
|
|
57
|
+
* implementation phases of the vibe coding process.
|
|
58
|
+
*/
|
|
9
59
|
vendor: IAutoBeVendor;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Compilation infrastructure for TypeScript, Prisma, and OpenAPI operations.
|
|
63
|
+
*
|
|
64
|
+
* Provides the essential compilation tools required for the sophisticated
|
|
65
|
+
* AST-based development pipeline. The compiler handles validation,
|
|
66
|
+
* transformation, and code generation across all development phases including
|
|
67
|
+
* Prisma schema compilation, OpenAPI document validation, and TypeScript code
|
|
68
|
+
* compilation.
|
|
69
|
+
*
|
|
70
|
+
* For high-performance scenarios with multiple concurrent users, the compiler
|
|
71
|
+
* can be separated into dedicated worker processes to prevent blocking the
|
|
72
|
+
* main agent during computationally intensive compilation operations.
|
|
73
|
+
*/
|
|
10
74
|
compiler: IAutoBeCompiler;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Optional conversation and development histories for session continuation.
|
|
78
|
+
*
|
|
79
|
+
* Enables resuming previous vibe coding sessions by providing the
|
|
80
|
+
* chronological record of past conversations, development activities, and
|
|
81
|
+
* generated artifacts. When provided, the agent reconstructs its internal
|
|
82
|
+
* state from these histories, allowing seamless continuation of development
|
|
83
|
+
* work.
|
|
84
|
+
*
|
|
85
|
+
* This capability supports iterative development workflows where users can
|
|
86
|
+
* return to modify, enhance, or extend previously generated applications
|
|
87
|
+
* while maintaining full context of earlier decisions and implementations.
|
|
88
|
+
*/
|
|
11
89
|
histories?: AutoBeHistory[] | undefined;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Optional behavioral configuration for localization and context.
|
|
93
|
+
*
|
|
94
|
+
* Customizes the agent's communication style, language preferences, and
|
|
95
|
+
* geographical context to provide personalized vibe coding experiences.
|
|
96
|
+
* Configuration includes locale settings for internationalized responses and
|
|
97
|
+
* timezone information for temporal context awareness.
|
|
98
|
+
*
|
|
99
|
+
* These settings influence how the agent communicates with users, interprets
|
|
100
|
+
* regional requirements (such as regulatory considerations), and handles
|
|
101
|
+
* time-sensitive operations throughout the development process.
|
|
102
|
+
*/
|
|
12
103
|
config?: IAutoBeConfig | undefined;
|
|
13
104
|
}
|
|
@@ -1,47 +1,89 @@
|
|
|
1
1
|
import OpenAI from "openai";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Interface representing AI vendor configuration for the AutoBeAgent.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Defines the connection parameters and settings required to integrate with AI
|
|
7
|
+
* service providers that power the vibe coding pipeline. While utilizing the
|
|
8
|
+
* OpenAI SDK as the connection interface, this configuration supports various
|
|
9
|
+
* LLM vendors beyond OpenAI through flexible endpoint and authentication
|
|
10
|
+
* configuration, enabling integration with Claude, DeepSeek, Meta Llama, and
|
|
11
|
+
* other providers that follow OpenAI-compatible API patterns.
|
|
8
12
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
+
* The vendor configuration determines the AI capabilities available throughout
|
|
14
|
+
* the entire automated development workflow, from requirements analysis and
|
|
15
|
+
* database design through API specification, testing, and final implementation.
|
|
16
|
+
* Different vendors may offer varying performance characteristics, cost
|
|
17
|
+
* structures, and feature support that can be optimized for specific vibe
|
|
18
|
+
* coding needs.
|
|
13
19
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
20
|
+
* Concurrent request management is built-in to prevent API rate limiting and
|
|
21
|
+
* optimize resource utilization across multiple development phases and parallel
|
|
22
|
+
* operations within the vibe coding pipeline.
|
|
17
23
|
*
|
|
18
24
|
* @author Samchon
|
|
19
25
|
*/
|
|
20
26
|
export interface IAutoBeVendor {
|
|
21
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* OpenAI SDK instance configured for the target AI vendor.
|
|
29
|
+
*
|
|
30
|
+
* Provides the API connection interface used by the AutoBeAgent to
|
|
31
|
+
* communicate with AI services. While this uses the OpenAI SDK, it can be
|
|
32
|
+
* configured to connect with various LLM providers by setting the appropriate
|
|
33
|
+
* `baseURL` and authentication credentials. The SDK serves as a universal
|
|
34
|
+
* connector that abstracts the underlying API communication protocols.
|
|
35
|
+
*
|
|
36
|
+
* For non-OpenAI vendors, configure the SDK with the vendor's API endpoint
|
|
37
|
+
* and authentication requirements to enable seamless integration with the
|
|
38
|
+
* vibe coding system.
|
|
39
|
+
*/
|
|
22
40
|
api: OpenAI;
|
|
23
41
|
|
|
24
42
|
/**
|
|
25
|
-
*
|
|
43
|
+
* Specific model identifier to use for AI operations.
|
|
44
|
+
*
|
|
45
|
+
* Specifies the exact model name or identifier that should be used for vibe
|
|
46
|
+
* coding tasks. Supports both official OpenAI chat models and custom model
|
|
47
|
+
* identifiers for third-party hosting services, cloud providers, or
|
|
48
|
+
* alternative LLM vendors. The model choice significantly impacts the
|
|
49
|
+
* quality, performance, and cost of the automated development process.
|
|
26
50
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
51
|
+
* Examples include "gpt-4", "gpt-3.5-turbo" for OpenAI, or vendor-specific
|
|
52
|
+
* identifiers like "claude-3-sonnet", "deepseek-chat-v3", "llama3.3-70b" when
|
|
53
|
+
* using alternative providers through compatible APIs.
|
|
29
54
|
*/
|
|
30
55
|
model: OpenAI.ChatModel | ({} & string);
|
|
31
56
|
|
|
32
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Optional request configuration for API calls.
|
|
59
|
+
*
|
|
60
|
+
* Additional request options that will be applied to all API calls made
|
|
61
|
+
* through the OpenAI SDK. This can include custom headers, timeouts, retry
|
|
62
|
+
* policies, or other HTTP client configuration that may be required for
|
|
63
|
+
* specific vendor integrations or enterprise environments.
|
|
64
|
+
*
|
|
65
|
+
* These options provide fine-grained control over the API communication
|
|
66
|
+
* behavior and can be used to optimize performance or meet specific
|
|
67
|
+
* infrastructure requirements.
|
|
68
|
+
*/
|
|
33
69
|
options?: OpenAI.RequestOptions | undefined;
|
|
34
70
|
|
|
35
71
|
/**
|
|
36
|
-
*
|
|
72
|
+
* Maximum number of concurrent API requests allowed.
|
|
73
|
+
*
|
|
74
|
+
* Controls the concurrency level for AI API calls to prevent rate limiting,
|
|
75
|
+
* manage resource consumption, and optimize system performance. The vibe
|
|
76
|
+
* coding pipeline may make multiple parallel requests during development
|
|
77
|
+
* phases, and this setting ensures controlled resource utilization.
|
|
37
78
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
79
|
+
* A reasonable default provides balanced performance while respecting typical
|
|
80
|
+
* API rate limits. Lower values reduce resource consumption but may slow
|
|
81
|
+
* development progress, while higher values can improve performance but risk
|
|
82
|
+
* hitting rate limits or overwhelming the AI service.
|
|
42
83
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
84
|
+
* Set to undefined to disable concurrency limiting, allowing unlimited
|
|
85
|
+
* parallel requests (use with caution based on your API limits and
|
|
86
|
+
* infrastructure capacity).
|
|
45
87
|
*
|
|
46
88
|
* @default 16
|
|
47
89
|
*/
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { RetryOptions } from "./types/BackoffOptions";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param fn Function to Apply the retry logic.
|
|
5
|
+
* @param maxRetries How many time to try. Max Retry is 5.
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export async function randomBackoffRetry<T>(
|
|
9
|
+
fn: () => Promise<T>,
|
|
10
|
+
options: Partial<RetryOptions> = {},
|
|
11
|
+
): Promise<T> {
|
|
12
|
+
const {
|
|
13
|
+
maxRetries = 5,
|
|
14
|
+
baseDelay = 4_000,
|
|
15
|
+
maxDelay = 60_000,
|
|
16
|
+
jitter = 0.8,
|
|
17
|
+
handleError = isRetryError,
|
|
18
|
+
} = options;
|
|
19
|
+
|
|
20
|
+
let lastError: unknown;
|
|
21
|
+
|
|
22
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
23
|
+
try {
|
|
24
|
+
return await fn();
|
|
25
|
+
} catch (err) {
|
|
26
|
+
lastError = err;
|
|
27
|
+
|
|
28
|
+
if (attempt === maxRetries - 1) throw err;
|
|
29
|
+
|
|
30
|
+
if (!handleError(err)) throw err;
|
|
31
|
+
|
|
32
|
+
const tempDelay = Math.min(baseDelay * 2 ** attempt, maxDelay);
|
|
33
|
+
const delay = tempDelay * (1 + Math.random() * jitter);
|
|
34
|
+
|
|
35
|
+
await new Promise((res) => setTimeout(res, delay));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
throw lastError;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isRetryError(error: any): boolean {
|
|
43
|
+
// 1) Quota exceeded → No retry
|
|
44
|
+
if (
|
|
45
|
+
error?.code === "insufficient_quota" ||
|
|
46
|
+
error?.error?.type === "insufficient_quota"
|
|
47
|
+
) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 2) 5xx / server_error → Retry
|
|
52
|
+
if (
|
|
53
|
+
(typeof error?.status === "number" && error.status >= 500) ||
|
|
54
|
+
error?.error?.type === "server_error"
|
|
55
|
+
) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 3) HTTP 429
|
|
60
|
+
if (error?.status === 429) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 4) undici / network related
|
|
65
|
+
const code = error?.code || error?.cause?.code;
|
|
66
|
+
if (
|
|
67
|
+
[
|
|
68
|
+
"UND_ERR_SOCKET",
|
|
69
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
70
|
+
"ETIMEDOUT",
|
|
71
|
+
"ECONNRESET",
|
|
72
|
+
"EPIPE",
|
|
73
|
+
].includes(code)
|
|
74
|
+
) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 5) fetch abort
|
|
79
|
+
if (error?.message === "terminated" || error?.name === "AbortError") {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Random exponential backoff retry utility for handling rate limits
|
|
3
|
+
*/
|
|
4
|
+
export interface RetryOptions {
|
|
5
|
+
/** Maximum number of retry attempts (default: 5) */
|
|
6
|
+
maxRetries: number;
|
|
7
|
+
/** Base delay in milliseconds (default: 2000) */
|
|
8
|
+
baseDelay: number;
|
|
9
|
+
/** Maximum delay in milliseconds (default: 60_000) */
|
|
10
|
+
maxDelay: number;
|
|
11
|
+
/** Jitter factor for randomization (0-1, default: 0.3) */
|
|
12
|
+
jitter: number;
|
|
13
|
+
/** Function to determine if error should trigger retry (default: isRetryError) */
|
|
14
|
+
handleError: (error: any) => boolean;
|
|
15
|
+
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AutoBeTest, AutoBeTestProgressEvent } from "@autobe/interface";
|
|
2
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestrateTestProgress<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenarios: AutoBeTest.Scenario[]): Promise<AutoBeTestProgressEvent[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateTestProgress.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestProgress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,0DA+BC;;AA1CD,yCAAoE;AAIpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,qFAAkF;AAElF,SAAsB,uBAAuB,CAC3C,GAAyB,EACzB,SAAgC;;QAEhC,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,IAAI,QAAQ,GAAW,CAAC,CAAC;QAEzB,MAAM,MAAM,GAA8B,MAAM,OAAO,CAAC,GAAG;QACzD;;;;WAIG;QACH,SAAS,CAAC,GAAG,CAAC,CAAO,QAAQ,EAAE,EAAE;;YAC/B,MAAM,IAAI,G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