@autobe/benchmark 0.29.2 → 0.30.0-dev.20260315
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 -661
- package/README.md +261 -0
- package/lib/example/AutoBeExampleArchiver.d.ts +2 -1
- package/lib/example/AutoBeExampleArchiver.js +41 -19
- package/lib/example/AutoBeExampleArchiver.js.map +1 -1
- package/lib/example/AutoBeExampleBenchmark.d.ts +5 -1
- package/lib/example/AutoBeExampleBenchmark.js +53 -42
- package/lib/example/AutoBeExampleBenchmark.js.map +1 -1
- package/lib/example/{AutoBeExampleDocumentation.d.ts → AutoBeExampleLogger.d.ts} +1 -1
- package/lib/example/{AutoBeExampleDocumentation.js → AutoBeExampleLogger.js} +39 -37
- package/lib/example/AutoBeExampleLogger.js.map +1 -0
- package/lib/example/AutoBeExampleStorage.d.ts +9 -2
- package/lib/example/AutoBeExampleStorage.js +74 -24
- package/lib/example/AutoBeExampleStorage.js.map +1 -1
- package/lib/example/index.d.ts +1 -1
- package/lib/example/index.js +1 -1
- package/lib/example/index.js.map +1 -1
- package/lib/replay/AutoBeReplayComputer.js +35 -28
- package/lib/replay/AutoBeReplayComputer.js.map +1 -1
- package/lib/replay/AutoBeReplayDocumentation.js +44 -42
- package/lib/replay/AutoBeReplayDocumentation.js.map +1 -1
- package/lib/replay/AutoBeReplayStorage.js +10 -3
- package/lib/replay/AutoBeReplayStorage.js.map +1 -1
- package/lib/structures/IAutoBeExampleBenchmarkState.d.ts +1 -1
- package/package.json +5 -6
- package/src/example/AutoBeExampleArchiver.ts +381 -337
- package/src/example/AutoBeExampleBenchmark.ts +190 -159
- package/src/example/{AutoBeExampleDocumentation.ts → AutoBeExampleLogger.ts} +85 -84
- package/src/example/AutoBeExampleStorage.ts +289 -218
- package/src/example/index.ts +4 -4
- package/src/index.ts +2 -2
- package/src/replay/AutoBeReplayComputer.ts +183 -189
- package/src/replay/AutoBeReplayDocumentation.ts +176 -174
- package/src/replay/AutoBeReplayStorage.ts +116 -109
- package/src/replay/index.ts +3 -3
- package/src/structures/IAutoBeExampleBenchmarkState.ts +30 -30
- package/src/structures/index.ts +1 -1
- package/lib/example/AutoBeExampleDocumentation.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# AutoBE - AI backend builder for prototype to production
|
|
2
|
+
|
|
3
|
+
[](https://github.com/wrtnlabs/autobe/blob/master/LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/@autobe/agent)
|
|
5
|
+
[](https://www.npmjs.com/package/@autobe/agent)
|
|
6
|
+
[](https://github.com/wrtnlabs/autobe/actions?query=workflow%3Abuild)
|
|
7
|
+
[](https://autobe.dev/docs/)
|
|
8
|
+
[](https://discord.gg/aMhRmzkqCx)
|
|
9
|
+
|
|
10
|
+
Describe your backend requirements in natural language through AutoBE's chat interface.
|
|
11
|
+
|
|
12
|
+
AutoBE will analyze your requirements and build the backend application for you. The generated backend application is designed to be 100% buildable by AI-friendly compilers and ensures stability through powerful e2e test functions.
|
|
13
|
+
|
|
14
|
+
With such AutoBE, build your first backend application quickly, then maintain and extend it with AI code assistants like Claude Code for enhanced productivity and stability.
|
|
15
|
+
|
|
16
|
+
AutoBE will generate complete specifications, detailed database and API documentation, comprehensive test coverage for stability, and clean implementation logic that serves as a learning foundation for juniors while significantly improving senior developer productivity.
|
|
17
|
+
|
|
18
|
+
Check out these complete backend application examples generated by AutoBE:
|
|
19
|
+
|
|
20
|
+
https://github.com/user-attachments/assets/b995dd2a-23bd-43c9-96cb-96d5c805f19f
|
|
21
|
+
|
|
22
|
+
1. **To Do List**: [`todo`](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/todo)
|
|
23
|
+
2. **Discussion Board**: [`bbs`](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs)
|
|
24
|
+
3. **Reddit Community**: [`reddit](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/reddit)
|
|
25
|
+
4. **E-Commerce**: [`shopping`](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping)
|
|
26
|
+
- Requirements Analysis: [Report](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping/docs/analysis)
|
|
27
|
+
- Database Design: [Entity Relationship Diagram](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping/docs/ERD.md) / [Prisma Schema](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping/prisma/schema)
|
|
28
|
+
- API Design: [API Controllers](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping/src/controllers) / [DTO Structures](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping/src/api/structures)
|
|
29
|
+
- E2E Test Functions: [`test/features/api`](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping/test/features/api)
|
|
30
|
+
- API Implementations: [`src/providers`](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/shopping/src/providers)
|
|
31
|
+
|
|
32
|
+
## Getting Started
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/wrtnlabs/autobe --depth=1
|
|
36
|
+
cd autobe
|
|
37
|
+
pnpm install
|
|
38
|
+
pnpm run playground
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To use AutoBE, clone the repository and run the playground application locally. This allows you to chat with AutoBE's AI agents, manage multiple sessions, and use various LLM providers including local models like `qwen3-next-80b-a3b-instruct`.
|
|
42
|
+
|
|
43
|
+
After installation, the playground will be available at http://localhost:5713. You can interact with AutoBE through a chat interface - simply describe what you want to build, and AutoBE will generate the backend application for you.
|
|
44
|
+
|
|
45
|
+
Here's an example conversation script that guides AutoBE to create an "Economic/Political Discussion Board":
|
|
46
|
+
|
|
47
|
+
1. **Requirements Analysis**: "I want to create an economic/political discussion board. Since I'm not familiar with programming, please write a requirements analysis report as you see fit."
|
|
48
|
+
2. **Database Design**: "Design the database schema."
|
|
49
|
+
3. **API Specification**: "Create the API interface specification."
|
|
50
|
+
4. **Testing**: "Make the e2e test functions."
|
|
51
|
+
5. **Implementation**: "Implement API functions."
|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
> The playground includes a replay feature at http://localhost:5713/replay/index.html where you can view chat sessions from the AutoBE development team's testing and benchmarks.
|
|
56
|
+
|
|
57
|
+
## Documentation Resources
|
|
58
|
+
|
|
59
|
+
Find comprehensive resources at our [official website](https://autobe.dev).
|
|
60
|
+
|
|
61
|
+
### 🏠 Home
|
|
62
|
+
|
|
63
|
+
- 🙋🏻♂️ [Introduction](https://autobe.dev/docs)
|
|
64
|
+
- 📦 [Setup](https://autobe.dev/docs/setup)
|
|
65
|
+
- 🔍 Concepts
|
|
66
|
+
- [Waterfall Model](https://autobe.dev/docs/concepts/waterfall)
|
|
67
|
+
- [Compiler Strategy](https://autobe.dev/docs/concepts/compiler)
|
|
68
|
+
- [AI Function Calling](https://autobe.dev/docs/concepts/function-calling)
|
|
69
|
+
|
|
70
|
+
### 📖 Features
|
|
71
|
+
|
|
72
|
+
- 🤖 Agent Library
|
|
73
|
+
- [Facade Controller](https://autobe.dev/docs/agent/facade)
|
|
74
|
+
- [Configuration](https://autobe.dev/docs/agent/config)
|
|
75
|
+
- [Event Handling](https://autobe.dev/docs/agent/event)
|
|
76
|
+
- [Prompt Histories](https://autobe.dev/docs/agent/history)
|
|
77
|
+
- 📡 WebSocket Protocol
|
|
78
|
+
- [Remote Procedure Call](https://autobe.dev/docs/websocket/rpc)
|
|
79
|
+
- [NestJS Server](https://autobe.dev/docs/websocket/nestjs)
|
|
80
|
+
- [NodeJS Server](https://autobe.dev/docs/websocket/nodejs)
|
|
81
|
+
- [Client Application](https://autobe.dev/docs/websocket/client)
|
|
82
|
+
- 🛠️ Backend Stack
|
|
83
|
+
- [TypeScript](https://autobe.dev/docs/stack/typescript)
|
|
84
|
+
- [Prisma ORM](https://autobe.dev/docs/stack/prisma)
|
|
85
|
+
- [NestJS Framework](https://autobe.dev/docs/stack/nestjs)
|
|
86
|
+
|
|
87
|
+
### 🔗 Appendix
|
|
88
|
+
|
|
89
|
+
- 🌐 [No-Code Ecosystem](https://autobe.dev/docs/ecosystem)
|
|
90
|
+
- 📅 Roadmap
|
|
91
|
+
- [Alpha Release (done)](https://autobe.dev/docs/roadmap/alpha)
|
|
92
|
+
- [Beta Release (done)](https://autobe.dev/docs/roadmap/beta)
|
|
93
|
+
- [Gamma Release (done)](https://autobe.dev/docs/roadmap/gamma)
|
|
94
|
+
- [Delta Release (active)](https://autobe.dev/docs/roadmap/delta)
|
|
95
|
+
- 🔧 [API Documentation](https://autobe.dev/api)
|
|
96
|
+
|
|
97
|
+
## How AutoBE Works
|
|
98
|
+
|
|
99
|
+
```mermaid
|
|
100
|
+
flowchart
|
|
101
|
+
subgraph "Backend Coding Agent"
|
|
102
|
+
coder("Facade Controller")
|
|
103
|
+
end
|
|
104
|
+
subgraph "Functional Agents"
|
|
105
|
+
coder --"Requirements Analysis"--> analyze("Analyze")
|
|
106
|
+
coder --"ERD"--> database("Database")
|
|
107
|
+
coder --"API Design"--> interface("Interface")
|
|
108
|
+
coder --"Test Codes" --> test("Test")
|
|
109
|
+
coder --"Main Program" --> realize("Realize")
|
|
110
|
+
end
|
|
111
|
+
subgraph "Compiler Feedback"
|
|
112
|
+
database --"validates" --> prismaCompiler("<a href="https://github.com/wrtnlabs/autobe/blob/main/packages/interface/src/database/AutoBeDatabase.ts" target="_blank">Prisma Compiler</a>")
|
|
113
|
+
interface --"generates" --> openapiCompiler("<a href="https://github.com/wrtnlabs/autobe/blob/main/packages/interface/src/openapi/AutoBeOpenApi.ts" target="_blank">OpenAPI Compiler</a>")
|
|
114
|
+
test --"analyzes" --> testCompiler("<a href="https://github.com/wrtnlabs/autobe/blob/main/packages/interface/src/test/AutoBeTest.ts" target="_blank">Test Compiler</a>")
|
|
115
|
+
realize --"compiles" --> realizeCompiler("TypeScript Compiler")
|
|
116
|
+
end
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
AutoBE follows a waterfall methodology to generate backend applications, with 40+ specialized agents handling each phase. The agents work in coordinated teams throughout the development process.
|
|
120
|
+
|
|
121
|
+
Each waterfall stage includes AI-friendly compilers that guarantee type safety of the generated code. Rather than generating code directly, AutoBE's agents first construct language-neutral Abstract Syntax Trees using predefined schemas. Each AST node undergoes validation against type rules before any code generation occurs, catching structural errors at the conceptual level rather than during compilation.
|
|
122
|
+
|
|
123
|
+
This approach is designed to ensure that the final generated TypeScript and Prisma code is 100% buildable. Based on our testing with multiple example projects including e-commerce platforms, discussion boards, and task management systems, AutoBE maintains this compilation guarantee across diverse application types.
|
|
124
|
+
|
|
125
|
+
To illustrate this process, here are the phase outputs from our "Economic/Political Discussion Board" example:
|
|
126
|
+
|
|
127
|
+
1. **Requirements Analysis**: [Report](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs/docs/analysis)
|
|
128
|
+
2. **Database Design**: [Entity Relationship Diagram](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs/docs/ERD.md) / [Prisma Schema](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs/prisma/schema)
|
|
129
|
+
3. **API Specification**: [API Controllers](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs/src/controllers) / [DTO Structures](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs/src/api/structures)
|
|
130
|
+
4. **E2E Test Functions**: [`test/features/api`](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs/test/features/api)
|
|
131
|
+
5. **API Implementations**: [`src/providers`](https://github.com/wrtnlabs/autobe-examples/tree/main/openai/gpt-4.1/bbs/src/providers)
|
|
132
|
+
|
|
133
|
+
Also, you don't need to use all phases - stop at any stage that fits your needs. Whether you want just requirements analysis, database design, API specification, or e2e testing, AutoBE adapts to your workflow.
|
|
134
|
+
|
|
135
|
+
Additionally, if you're skipping the full pipeline because of language preference rather than workflow needs, this capability is in development - AutoBE's language-neutral AST structure will soon support additional programming languages beyond TypeScript.
|
|
136
|
+
|
|
137
|
+
## Type-Safe Client SDK
|
|
138
|
+
|
|
139
|
+
Every AutoBE-generated backend automatically includes a type-safe client SDK, making frontend integration seamless and error-free. This SDK provides:
|
|
140
|
+
|
|
141
|
+
- **Zero Configuration**: SDK is auto-generated alongside your backend - no manual setup required
|
|
142
|
+
- **100% Type Safety**: Full TypeScript support with autocomplete and compile-time validation
|
|
143
|
+
- **Framework Agnostic**: Works with React, Vue, Angular, or any TypeScript/JavaScript project
|
|
144
|
+
- **E2E Test Integration**: Powers AI-generated test suites for comprehensive backend testing
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
import api, { IPost } from "autobe-generated-sdk";
|
|
148
|
+
|
|
149
|
+
// Type-safe API calls with full autocomplete
|
|
150
|
+
const connection: api.IConnection = {
|
|
151
|
+
host: "http://localhost:1234",
|
|
152
|
+
};
|
|
153
|
+
await api.functional.users.login(connection, {
|
|
154
|
+
body: {
|
|
155
|
+
email: "user@example.com",
|
|
156
|
+
password: "secure-password",
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// TypeScript catches errors at compile time
|
|
161
|
+
const post: IPost = await api.functional.posts.create(connection, {
|
|
162
|
+
body: {
|
|
163
|
+
title: "Hello World",
|
|
164
|
+
content: "My first post",
|
|
165
|
+
// authorId: "123" <- TypeScript error if this field is missing!
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
This SDK eliminates the traditional pain points of API integration - no more manual type definitions, no more runtime surprises, and no more API documentation lookups. Your frontend developers can focus on building features, not wrestling with API contracts.
|
|
171
|
+
|
|
172
|
+
**Beyond Frontend Integration**: The SDK powers both frontend development and E2E test generation. AutoBE uses the same type-safe SDK internally to generate comprehensive test suites, ensuring every API endpoint is thoroughly tested. This creates a robust feedback loop that enhances backend stability - AI writes tests using the SDK, the SDK ensures type safety, and your backend becomes more reliable with every generated test.
|
|
173
|
+
|
|
174
|
+
## Roadmap Schedule
|
|
175
|
+
|
|
176
|
+
```mermaid
|
|
177
|
+
gantt
|
|
178
|
+
dateFormat YYYY-MM-DD
|
|
179
|
+
title AutoBE Delta Roadmap Timeline (2026 Q1)
|
|
180
|
+
|
|
181
|
+
section Local LLM Benchmark
|
|
182
|
+
Qwen3 Database Phase : done, 2026-01-01, 31d
|
|
183
|
+
Qwen3 Interface Phase : done, 2026-01-16, 31d
|
|
184
|
+
Qwen3 Test Phase : done, 2026-02-01, 21d
|
|
185
|
+
Qwen3 Realize Phase : done, 2026-02-01, 59d
|
|
186
|
+
|
|
187
|
+
section Validation Logic Enhancement
|
|
188
|
+
Dynamic Function Calling Schema : done, 2026-01-01, 7d
|
|
189
|
+
Validation Feedback Stringify : done, 2026-01-08, 12d
|
|
190
|
+
JSON Schema Validator : done, 2026-01-08, 12d
|
|
191
|
+
Schema Review Validation Logic : done, 2026-01-20, 35d
|
|
192
|
+
Test Mapping Plan Enhancement : done, 2026-02-05, 24d
|
|
193
|
+
Realize Mapping Plan Enhancement : done, 2026-02-15, 45d
|
|
194
|
+
|
|
195
|
+
section RAG Optimization
|
|
196
|
+
Hybrid Search (Vector + BM25) : done, 2026-01-01, 14d
|
|
197
|
+
Dynamic K Retrieval : done, 2026-01-15, 14d
|
|
198
|
+
RAG Preliminary Prompting : done, 2026-01-15, 28d
|
|
199
|
+
RAG Benchmark & Tuning : done, 2026-02-01, 28d
|
|
200
|
+
Analyze Agent Restructuring : done, 2026-02-01, 28d
|
|
201
|
+
|
|
202
|
+
section Design Integrity
|
|
203
|
+
DB Coverage Agent : done, 2026-01-15, 28d
|
|
204
|
+
API Endpoint Coverage Agent : done, 2026-01-22, 28d
|
|
205
|
+
Schema Relation Agent : done, 2026-02-01, 28d
|
|
206
|
+
Schema Structure Agent : done, 2026-02-01, 28d
|
|
207
|
+
Schema Content Agent : done, 2026-03-01, 28d
|
|
208
|
+
|
|
209
|
+
section Multi-lingual Support
|
|
210
|
+
Java Compiler PoC : done, 2026-01-01, 30d
|
|
211
|
+
Java Database : done, 2026-01-01, 14d
|
|
212
|
+
Java Interface : done, 2026-01-15, 21d
|
|
213
|
+
Java Test : active, 2026-02-05, 28d
|
|
214
|
+
Java Realize : active, 2026-03-01, 31d
|
|
215
|
+
|
|
216
|
+
section Human Modification Support
|
|
217
|
+
Database Schema Parser : active, 2026-02-15, 28d
|
|
218
|
+
Interface Schema Parser : active, 2026-02-22, 28d
|
|
219
|
+
Requirements Sync Agent : planned, 2026-03-08, 24d
|
|
220
|
+
|
|
221
|
+
section Miscellaneous
|
|
222
|
+
System Prompt Simplification : done, 2026-02-01, 28d
|
|
223
|
+
Estimation Agent : done, 2026-02-01, 28d
|
|
224
|
+
Playground Service Enhancement : active, 2026-02-15, 28d
|
|
225
|
+
PR Articles Writing : active, 2026-02-15, 30d
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
AutoBE has successfully completed Alpha, Beta, and Gamma development phases, establishing a solid foundation with **100% compilation success rate**. The current **Delta Release** focuses on transitioning from horizontal expansion to vertical deepening.
|
|
229
|
+
|
|
230
|
+
**Strategic Shift**: In Gamma, we rapidly implemented features like RAG, Modularization, and Complementation under a "just ship it" philosophy. Delta fills the stability gaps that remained by systematically discovering and fixing hidden defects through Local LLM benchmarks.
|
|
231
|
+
|
|
232
|
+
**Key Focus Areas**:
|
|
233
|
+
|
|
234
|
+
- **Local LLM Benchmark**: Using open-source models like Qwen3 as a touchstone to discover hidden defects that commercial models mask, ensuring more robust operation across all model types
|
|
235
|
+
- **Validation Logic Enhancement**: Strengthening schemas and validation logic through dynamic function calling schemas, JSON Schema validators, and progressive validation pipelines
|
|
236
|
+
- **RAG Optimization**: Completing the Hybrid Search system (Vector + BM25) with dynamic K retrieval and comprehensive benchmark tuning
|
|
237
|
+
- **Design Integrity**: Building mechanisms to verify and ensure design consistency between Database and Interface phases through coverage and schema review agents
|
|
238
|
+
- **Multi-lingual Support**: Launching Java/Spring code generation alongside TypeScript/NestJS, with language-neutral AST structures enabling future language additions
|
|
239
|
+
- **Human Modification Support**: Enabling maintenance continuity by parsing user-modified code back into AutoBE's internal AST representation, ensuring AutoBE remains useful beyond initial generation
|
|
240
|
+
|
|
241
|
+
This roadmap prioritizes stability and depth over feature breadth, informed by real-world production experience from Gamma.
|
|
242
|
+
|
|
243
|
+
## Current Limitations
|
|
244
|
+
|
|
245
|
+
While AutoBE achieves 100% compilation success, please note these current limitations:
|
|
246
|
+
|
|
247
|
+
**Runtime Behavior**: Generated applications compile successfully, but runtime behavior may require testing and refinement. Unexpected runtime errors can occur during server execution, such as database connection issues, API endpoint failures, or business logic exceptions that weren't caught during compilation. We strongly recommend thorough testing in development environments before deploying to production. Our v1.0 release targets 100% runtime success to address these issues.
|
|
248
|
+
|
|
249
|
+
**Design Interpretation**: AutoBE's database and API designs may differ from your expectations. We recommend thoroughly reviewing generated specifications before proceeding with implementation, especially before production deployment.
|
|
250
|
+
|
|
251
|
+
**Token Consumption**: AutoBE requires significant AI token usage for complex projects. Based on our testing, projects typically consume 30M-250M+ tokens depending on complexity (simple todo apps use ~4M tokens, while complex e-commerce platforms may require 250M+ tokens). We are working on RAG optimization to reduce this overhead in future releases.
|
|
252
|
+
|
|
253
|
+
**Maintenance**: AutoBE focuses on initial generation and does not provide ongoing maintenance capabilities. Once your backend is generated, you'll need to handle bug fixes, feature additions, performance optimizations, and security updates manually. We recommend establishing a development workflow that combines the generated codebase with AI coding assistants like Claude Code for efficient ongoing development and maintenance tasks.
|
|
254
|
+
|
|
255
|
+

|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
AutoBE is licensed under the [GNU Affero General Public License v3.0 (AGPL-3.0)](LICENSE). If you modify AutoBE itself or offer it as a network service, you must make your source code available under the same license.
|
|
260
|
+
|
|
261
|
+
However, backend applications generated by AutoBE can be relicensed under any license you choose, such as MIT. This means you can freely use AutoBE-generated code in commercial projects without open source obligations, similar to how other code generation tools work.
|
|
@@ -3,8 +3,9 @@ export declare namespace AutoBeExampleArchiver {
|
|
|
3
3
|
interface IContext {
|
|
4
4
|
vendor: string;
|
|
5
5
|
project: AutoBeExampleProject;
|
|
6
|
+
imagePath?: string;
|
|
6
7
|
agent: (props: IAgentProps) => Promise<IAutoBeAgent>;
|
|
7
|
-
on: (snapshot: AutoBeEventSnapshot) => void;
|
|
8
|
+
on: (snapshot: AutoBeEventSnapshot, agent: IAutoBeAgent) => void;
|
|
8
9
|
}
|
|
9
10
|
interface IAgentProps {
|
|
10
11
|
vendor: string;
|
|
@@ -26,20 +26,22 @@ var AutoBeExampleArchiver;
|
|
|
26
26
|
return (yield conversate(yield AutoBeExampleStorage_1.AutoBeExampleStorage.getUserMessage({
|
|
27
27
|
project: ctx.project,
|
|
28
28
|
phase: "analyze",
|
|
29
|
-
|
|
29
|
+
imagePath: ctx.imagePath,
|
|
30
|
+
}))) ||
|
|
30
31
|
(yield conversate("I'm not familiar with the analyze feature. Please determine everything by yourself, and just show me the analysis report.")) ||
|
|
31
|
-
(yield conversate("I already told you to publish the analysis report. Never ask me anything, and just do
|
|
32
|
+
(yield conversate("I already told you to publish the analysis report. Never ask me anything, and just do anything right now by your decision.")) ||
|
|
33
|
+
(yield conversate("Call analyze() function right now, never ask me anything again. You can do whatever you want."));
|
|
32
34
|
}),
|
|
33
35
|
predicate: (histories) => histories.some((h) => h.type === "analyze"),
|
|
34
36
|
});
|
|
35
37
|
AutoBeExampleArchiver.archivePrisma = (ctx) => archive(ctx, {
|
|
36
|
-
phase: "
|
|
38
|
+
phase: "database",
|
|
37
39
|
trial: getTrial({
|
|
38
40
|
project: ctx.project,
|
|
39
|
-
phase: "
|
|
41
|
+
phase: "database",
|
|
40
42
|
}),
|
|
41
43
|
predicate: (histories) => {
|
|
42
|
-
const prisma = histories.find((h) => h.type === "
|
|
44
|
+
const prisma = histories.find((h) => h.type === "database");
|
|
43
45
|
return prisma !== undefined && prisma.compiled.type === "success";
|
|
44
46
|
},
|
|
45
47
|
});
|
|
@@ -90,9 +92,9 @@ var AutoBeExampleArchiver;
|
|
|
90
92
|
agent.on(type, (e) => {
|
|
91
93
|
const s = {
|
|
92
94
|
event: e,
|
|
93
|
-
tokenUsage: agent.getTokenUsage(),
|
|
95
|
+
tokenUsage: typia_1.default.misc.clone(agent.getTokenUsage()),
|
|
94
96
|
};
|
|
95
|
-
ctx.on(s);
|
|
97
|
+
ctx.on(s, agent);
|
|
96
98
|
snapshots.push(s);
|
|
97
99
|
});
|
|
98
100
|
}
|
|
@@ -102,7 +104,7 @@ var AutoBeExampleArchiver;
|
|
|
102
104
|
project: ctx.project,
|
|
103
105
|
histories,
|
|
104
106
|
analyze: null,
|
|
105
|
-
|
|
107
|
+
database: null,
|
|
106
108
|
interface: null,
|
|
107
109
|
test: null,
|
|
108
110
|
realize: null,
|
|
@@ -142,25 +144,44 @@ var AutoBeExampleArchiver;
|
|
|
142
144
|
});
|
|
143
145
|
});
|
|
144
146
|
try {
|
|
147
|
+
let lastFunctionCallErrorMessage = null;
|
|
145
148
|
// CONVERSATE
|
|
146
149
|
const go = (c) => __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
|
|
148
|
-
|
|
150
|
+
try {
|
|
151
|
+
const result = yield agent.conversate(c);
|
|
152
|
+
const hasMeaningfulOutput = result.some((h) => h.type !== "userMessage");
|
|
153
|
+
return (result.some((h) => h.type === props.phase) ||
|
|
154
|
+
(hasMeaningfulOutput &&
|
|
155
|
+
result.every((h) => h.type !== "assistantMessage")));
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
if (error instanceof Error &&
|
|
159
|
+
error.message.includes("Failed to function calling")) {
|
|
160
|
+
lastFunctionCallErrorMessage = error.message;
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
149
165
|
});
|
|
150
166
|
const done = yield props.trial(go);
|
|
151
|
-
if (done === false)
|
|
152
|
-
throw new Error(`Failed to function calling in the "${props.phase}" phase of the "${ctx.project}" project.`);
|
|
153
|
-
// AGGREGATE
|
|
154
167
|
const histories = agent.getHistories();
|
|
168
|
+
if (done === false ||
|
|
169
|
+
histories.some((h) => h.type === props.phase) === false) {
|
|
170
|
+
const detail = lastFunctionCallErrorMessage;
|
|
171
|
+
throw new Error(detail
|
|
172
|
+
? `Failed to function calling in the "${props.phase}" phase of the "${ctx.project}" project.\n\n${detail}`
|
|
173
|
+
: `Failed to function calling in the "${props.phase}" phase of the "${ctx.project}" project.`);
|
|
174
|
+
}
|
|
175
|
+
// AGGREGATE
|
|
155
176
|
try {
|
|
156
177
|
yield filesystem_1.FileSystemIterator.save({
|
|
157
178
|
root: `${AutoBeExampleStorage_1.AutoBeExampleStorage.TEST_ROOT}/results/${AutoBeExampleStorage_1.AutoBeExampleStorage.slugModel(ctx.vendor, false)}/${ctx.project}/${props.phase}`,
|
|
158
|
-
files: Object.assign(Object.assign({}, (yield agent.getFiles())), Object.fromEntries(histories
|
|
159
|
-
.filter((h) => h.type === "
|
|
179
|
+
files: Object.assign(Object.assign(Object.assign({}, (yield agent.getFiles())), Object.fromEntries(histories
|
|
180
|
+
.filter((h) => h.type === "database" ||
|
|
160
181
|
h.type === "interface" ||
|
|
161
182
|
h.type === "test" ||
|
|
162
183
|
h.type === "realize")
|
|
163
|
-
.map((h) => [`autobe/${h.type}.instruction.md`, h.instruction]))),
|
|
184
|
+
.map((h) => [`autobe/${h.type}.instruction.md`, h.instruction]))), { "pnpm-workspace.yaml": "" }),
|
|
164
185
|
});
|
|
165
186
|
}
|
|
166
187
|
catch (_a) { }
|
|
@@ -183,6 +204,7 @@ var AutoBeExampleArchiver;
|
|
|
183
204
|
project: ctx.project,
|
|
184
205
|
files: {
|
|
185
206
|
[`${props.phase}.snapshots.json`]: JSON.stringify(snapshots),
|
|
207
|
+
[`${props.phase}.histories.json`]: JSON.stringify(agent.getHistories()),
|
|
186
208
|
[`${props.phase}.error.json`]: JSON.stringify(Object.assign(Object.assign({}, error), { name: error.name, message: error.message, stack: error.stack })),
|
|
187
209
|
},
|
|
188
210
|
});
|
|
@@ -191,7 +213,7 @@ var AutoBeExampleArchiver;
|
|
|
191
213
|
}
|
|
192
214
|
});
|
|
193
215
|
const getTrial = (props) => (conversate) => __awaiter(this, void 0, void 0, function* () {
|
|
194
|
-
return (yield conversate(yield AutoBeExampleStorage_1.AutoBeExampleStorage.getUserMessage(props)
|
|
216
|
+
return (yield conversate(yield AutoBeExampleStorage_1.AutoBeExampleStorage.getUserMessage(props))) ||
|
|
195
217
|
(yield conversate("Don't ask me to do that, and just do it right now.")) ||
|
|
196
218
|
(yield conversate(`I already told you to do ${props.phase} process. Never ask me anything, and just do it right now. Go go go!`));
|
|
197
219
|
});
|
|
@@ -206,7 +228,7 @@ var AutoBeExampleArchiver;
|
|
|
206
228
|
aggregate: utils_1.TokenUsageComputer.zero(),
|
|
207
229
|
facade: utils_1.TokenUsageComputer.zero(),
|
|
208
230
|
analyze: utils_1.TokenUsageComputer.zero(),
|
|
209
|
-
|
|
231
|
+
database: utils_1.TokenUsageComputer.zero(),
|
|
210
232
|
interface: utils_1.TokenUsageComputer.zero(),
|
|
211
233
|
test: utils_1.TokenUsageComputer.zero(),
|
|
212
234
|
realize: utils_1.TokenUsageComputer.zero(),
|
|
@@ -231,7 +253,7 @@ var AutoBeExampleArchiver;
|
|
|
231
253
|
})(AutoBeExampleArchiver || (exports.AutoBeExampleArchiver = AutoBeExampleArchiver = {}));
|
|
232
254
|
const PHASES = [
|
|
233
255
|
"analyze",
|
|
234
|
-
"
|
|
256
|
+
"database",
|
|
235
257
|
"interface",
|
|
236
258
|
"test",
|
|
237
259
|
"realize",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeExampleArchiver.js","sourceRoot":"","sources":["../../src/example/AutoBeExampleArchiver.ts"],"names":[],"mappings":";;;;;;;;;;;;;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,2CAAoB,CAAC,aAAa,CAAC;YACvC,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;QACL,OAAO;YACL,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,SAAS;YACT,UAAU;SACX,CAAC;IACJ,CAAC,CAAA,CAAC;AACJ,CAAC,EA5VgB,qBAAqB,qCAArB,qBAAqB,QA4VrC;AAED,MAAM,MAAM,GAAkB;IAC5B,SAAS;IACT,UAAU;IACV,WAAW;IACX,MAAM;IACN,SAAS;CACV,CAAC"}
|
|
@@ -9,7 +9,11 @@ export declare namespace AutoBeExampleBenchmark {
|
|
|
9
9
|
vendors: string[];
|
|
10
10
|
projects?: AutoBeExampleProject[];
|
|
11
11
|
phases?: AutoBePhase[];
|
|
12
|
+
imagePath?: string;
|
|
12
13
|
progress: (state: IAutoBeExampleBenchmarkState) => void;
|
|
13
|
-
on?: (event: AutoBeEvent
|
|
14
|
+
on?: (event: AutoBeEvent, agent: IAutoBeAgent, context: {
|
|
15
|
+
vendor: string;
|
|
16
|
+
project: AutoBeExampleProject;
|
|
17
|
+
}) => void;
|
|
14
18
|
}) => Promise<void>;
|
|
15
19
|
}
|
|
@@ -27,16 +27,20 @@ var AutoBeExampleBenchmark;
|
|
|
27
27
|
})),
|
|
28
28
|
};
|
|
29
29
|
const report = () => props.progress(state);
|
|
30
|
-
yield Promise.all(state.vendors.map((vendor) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
yield Promise.all(state.vendors.map((vendor) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
yield executeVendor(ctx, {
|
|
32
|
+
imagePath: props.imagePath,
|
|
33
|
+
phases: props.phases,
|
|
34
|
+
vendorState: vendor,
|
|
35
|
+
on: props.on,
|
|
36
|
+
report,
|
|
37
|
+
});
|
|
35
38
|
})));
|
|
36
39
|
});
|
|
37
40
|
const executeVendor = (ctx, props) => __awaiter(this, void 0, void 0, function* () {
|
|
38
41
|
for (const project of props.vendorState.projects)
|
|
39
42
|
yield executeProject(ctx, {
|
|
43
|
+
imagePath: props.imagePath,
|
|
40
44
|
vendor: props.vendorState.name,
|
|
41
45
|
projectState: project,
|
|
42
46
|
phases: props.phases,
|
|
@@ -55,43 +59,43 @@ var AutoBeExampleBenchmark;
|
|
|
55
59
|
success: null,
|
|
56
60
|
started_at: new Date(),
|
|
57
61
|
completed_at: null,
|
|
58
|
-
|
|
62
|
+
count: 0,
|
|
59
63
|
};
|
|
60
64
|
props.projectState.phases.push(phaseState);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
65
|
+
try {
|
|
66
|
+
phaseState.started_at = new Date();
|
|
67
|
+
phaseState.completed_at = null;
|
|
68
|
+
phaseState.count = 0;
|
|
69
|
+
const success = yield getArchiver(phase)({
|
|
70
|
+
vendor: props.vendor,
|
|
71
|
+
project: props.projectState.name,
|
|
72
|
+
imagePath: props.imagePath,
|
|
73
|
+
agent: (next) => ctx.createAgent(next),
|
|
74
|
+
on: (s, agent) => {
|
|
75
|
+
++phaseState.count;
|
|
76
|
+
const event = s.event;
|
|
77
|
+
if (event.type !== "jsonValidateError" &&
|
|
78
|
+
event.type !== "jsonParseError" &&
|
|
79
|
+
event.type !== "preliminary" &&
|
|
80
|
+
event.type !== "consentFunctionCall")
|
|
81
|
+
phaseState.snapshot = s;
|
|
82
|
+
props.report();
|
|
83
|
+
if (props.on)
|
|
84
|
+
props.on(s.event, agent, {
|
|
85
|
+
vendor: props.vendor,
|
|
86
|
+
project: props.projectState.name,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
phaseState.success = success;
|
|
91
|
+
phaseState.completed_at = new Date();
|
|
92
|
+
props.report();
|
|
91
93
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.log(props.vendor, props.projectState.name, phaseState.name, error);
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
if (phaseState.success === null || phaseState.success === false)
|
|
95
99
|
break;
|
|
96
100
|
}
|
|
97
101
|
props.projectState.completed_at = new Date();
|
|
@@ -102,7 +106,7 @@ var AutoBeExampleBenchmark;
|
|
|
102
106
|
const getArchiver = (phase) => {
|
|
103
107
|
if (phase === "analyze")
|
|
104
108
|
return AutoBeExampleArchiver_1.AutoBeExampleArchiver.archiveAnalyze;
|
|
105
|
-
else if (phase === "
|
|
109
|
+
else if (phase === "database")
|
|
106
110
|
return AutoBeExampleArchiver_1.AutoBeExampleArchiver.archivePrisma;
|
|
107
111
|
else if (phase === "interface")
|
|
108
112
|
return AutoBeExampleArchiver_1.AutoBeExampleArchiver.archiveInterface;
|
|
@@ -113,10 +117,17 @@ const getArchiver = (phase) => {
|
|
|
113
117
|
phase;
|
|
114
118
|
throw new Error(`Unknown phase: ${phase}`);
|
|
115
119
|
};
|
|
116
|
-
const PROJECT_SEQUENCE = [
|
|
120
|
+
const PROJECT_SEQUENCE = [
|
|
121
|
+
"todo",
|
|
122
|
+
"bbs",
|
|
123
|
+
"reddit",
|
|
124
|
+
"shopping",
|
|
125
|
+
"account",
|
|
126
|
+
"erp",
|
|
127
|
+
];
|
|
117
128
|
const PHASE_SEQUENCE = [
|
|
118
129
|
"analyze",
|
|
119
|
-
"
|
|
130
|
+
"database",
|
|
120
131
|
"interface",
|
|
121
132
|
"test",
|
|
122
133
|
"realize",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeExampleBenchmark.js","sourceRoot":"","sources":["../../src/example/AutoBeExampleBenchmark.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,mEAAgE;AAEhE,IAAiB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"AutoBeExampleBenchmark.js","sourceRoot":"","sources":["../../src/example/AutoBeExampleBenchmark.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,mEAAgE;AAEhE,IAAiB,sBAAsB,CAyJtC;AAzJD,WAAiB,sBAAsB;IAOxB,8BAAO,GAAG,CACrB,GAAa,EACb,KAWC,EACc,EAAE;QACjB,MAAM,KAAK,GAAiC;YAC1C,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CACxB,CAAC,MAAM,EAA0C,EAAE,CAAC,CAAC;gBACnD,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAC/B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CACrD,CAAC,GAAG,CACH,CAAC,OAAO,EAA2C,EAAE,CAAC,CAAC;oBACrD,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,EAAE;oBACV,OAAO,EAAE,IAAI;oBACb,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,IAAI;iBACnB,CAAC,CACH;aACF,CAAC,CACH;SACF,CAAC;QACF,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,OAAO,CAAC,GAAG,CACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAO,MAAM,EAAE,EAAE;YACjC,MAAM,aAAa,CAAC,GAAG,EAAE;gBACvB,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,MAAM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