@autobe/agent 0.15.1 → 0.16.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/LICENSE +661 -21
- package/lib/AutoBeAgent.js +2 -2
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.d.ts +1 -0
- package/lib/AutoBeMockAgent.js +18 -4
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +3 -3
- package/lib/factory/getAutoBeGenerated.js +2 -1
- package/lib/factory/getAutoBeGenerated.js.map +1 -1
- package/lib/index.mjs +739 -577
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.d.ts +0 -15
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js +0 -3
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +19 -12
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.d.ts +1 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js +3 -5
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.d.ts +7 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +363 -4
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +3 -3
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +3 -118
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.d.ts +11 -4
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +61 -45
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +17 -10
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/realize/ProviderCodeComparator.d.ts +5 -0
- package/lib/orchestrate/realize/ProviderCodeComparator.js +16 -0
- package/lib/orchestrate/realize/ProviderCodeComparator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +41 -53
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +13 -87
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +32 -43
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +3 -2
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +25 -39
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +15 -15
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +11 -17
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +4 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +21 -17
- package/lib/orchestrate/realize/transformRealizeAuthorization.js +5 -9
- package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +9 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +3 -2
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +58 -27
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.d.ts +5 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js +10 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +4 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +38 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +2 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +15 -2
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.d.ts +9 -2
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +158 -100
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +1 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/package.json +7 -7
- package/src/AutoBeAgent.ts +1 -1
- package/src/AutoBeMockAgent.ts +20 -6
- package/src/constants/AutoBeSystemPromptConstant.ts +3 -3
- package/src/factory/getAutoBeGenerated.ts +2 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeFileSystem.ts +0 -15
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +17 -17
- package/src/orchestrate/analyze/orchestrateAnalyzeComposer.ts +4 -7
- package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +100 -6
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -21
- package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +76 -59
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +17 -10
- package/src/orchestrate/realize/ProviderCodeComparator.ts +15 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +54 -59
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +12 -120
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +21 -5
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +10 -9
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +15 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +11 -18
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +4 -2
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +24 -17
- package/src/orchestrate/realize/transformRealizeAuthorization.ts +5 -9
- package/src/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.ts +9 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +73 -25
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.ts +9 -0
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +64 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +41 -2
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +219 -145
- package/src/orchestrate/test/orchestrateTest.ts +1 -1
package/src/AutoBeMockAgent.ts
CHANGED
|
@@ -68,15 +68,13 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
|
68
68
|
|
|
69
69
|
// ALREADY REALIZED CASE
|
|
70
70
|
const state: AutoBeState = createAutoBeState(this.histories_);
|
|
71
|
-
if (state.
|
|
71
|
+
if (state.realize !== null) {
|
|
72
72
|
await sleep_for(2_000);
|
|
73
73
|
const assistantMessage: AutoBeAssistantMessageHistory = {
|
|
74
74
|
id: v4(),
|
|
75
75
|
type: "assistantMessage",
|
|
76
76
|
text: [
|
|
77
|
-
"
|
|
78
|
-
"",
|
|
79
|
-
"The realize agent would be developed until 2025-08-31.",
|
|
77
|
+
"AutoBE has successfully realized the application.",
|
|
80
78
|
"",
|
|
81
79
|
"Thanks for using AutoBE!",
|
|
82
80
|
].join("\n"),
|
|
@@ -88,7 +86,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
|
88
86
|
return this.histories_;
|
|
89
87
|
}
|
|
90
88
|
const take = async (
|
|
91
|
-
type: "analyze" | "prisma" | "interface" | "test",
|
|
89
|
+
type: "analyze" | "prisma" | "interface" | "test" | "realize",
|
|
92
90
|
): Promise<void> => {
|
|
93
91
|
for (const s of this.getEventSnapshots(type)) {
|
|
94
92
|
const time: number = sleepMap[s.event.type] ?? 500;
|
|
@@ -105,6 +103,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
|
105
103
|
else if (state.prisma === null) await take("prisma");
|
|
106
104
|
else if (state.interface === null) await take("interface");
|
|
107
105
|
else if (state.test === null) await take("test");
|
|
106
|
+
else if (state.realize === null) await take("realize");
|
|
108
107
|
return this.histories_;
|
|
109
108
|
}
|
|
110
109
|
|
|
@@ -117,7 +116,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
private getEventSnapshots(
|
|
120
|
-
state: "analyze" | "prisma" | "interface" | "test",
|
|
119
|
+
state: "analyze" | "prisma" | "interface" | "test" | "realize",
|
|
121
120
|
): AutoBeEventSnapshot[] {
|
|
122
121
|
return this.props_.preset[state];
|
|
123
122
|
}
|
|
@@ -135,14 +134,17 @@ export namespace AutoBeMockAgent {
|
|
|
135
134
|
prisma: AutoBeEventSnapshot[];
|
|
136
135
|
interface: AutoBeEventSnapshot[];
|
|
137
136
|
test: AutoBeEventSnapshot[];
|
|
137
|
+
realize: AutoBeEventSnapshot[];
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
const sleepMap: Partial<Record<AutoBeEvent.Type, number>> = {
|
|
142
|
+
// ANALYZE
|
|
142
143
|
analyzeStart: 1_000,
|
|
143
144
|
analyzeWrite: 500,
|
|
144
145
|
analyzeReview: 300,
|
|
145
146
|
analyzeComplete: 1_000,
|
|
147
|
+
// PRISMA
|
|
146
148
|
prismaStart: 1_000,
|
|
147
149
|
prismaComponents: 1_000,
|
|
148
150
|
prismaSchemas: 500,
|
|
@@ -150,16 +152,28 @@ const sleepMap: Partial<Record<AutoBeEvent.Type, number>> = {
|
|
|
150
152
|
prismaCorrect: 500,
|
|
151
153
|
prismaInsufficient: 1_000,
|
|
152
154
|
prismaComplete: 1_000,
|
|
155
|
+
// INTERFACE
|
|
153
156
|
interfaceStart: 1_000,
|
|
154
157
|
interfaceEndpoints: 1_000,
|
|
155
158
|
interfaceOperations: 400,
|
|
156
159
|
interfaceSchemas: 400,
|
|
157
160
|
interfaceComplement: 2_000,
|
|
158
161
|
interfaceComplete: 1_000,
|
|
162
|
+
// TEST
|
|
159
163
|
testStart: 1_000,
|
|
160
164
|
testScenario: 1_000,
|
|
161
165
|
testWrite: 40,
|
|
162
166
|
testValidate: 100,
|
|
163
167
|
testCorrect: 100,
|
|
164
168
|
testComplete: 1_000,
|
|
169
|
+
// REALIZE
|
|
170
|
+
realizeStart: 1_000,
|
|
171
|
+
realizeComplete: 1_000,
|
|
172
|
+
realizeWrite: 80,
|
|
173
|
+
realizeCorrect: 80,
|
|
174
|
+
realizeValidate: 200,
|
|
175
|
+
realizeAuthorizationStart: 1_000,
|
|
176
|
+
realizeAuthorizationWrite: 200,
|
|
177
|
+
realizeAuthorizationValidate: 200,
|
|
178
|
+
realizeAuthorizationComplete: 1_000,
|
|
165
179
|
};
|