@auto-engineer/server-implementer 0.4.7 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-format.log +20 -25
- package/.turbo/turbo-lint.log +5 -4
- package/.turbo/turbo-test.log +14 -12
- package/.turbo/turbo-type-check.log +5 -4
- package/CHANGELOG.md +12 -0
- package/README.md +264 -0
- package/dist/cli-manifest.d.ts +3 -0
- package/dist/cli-manifest.d.ts.map +1 -0
- package/dist/cli-manifest.js +23 -0
- package/dist/cli-manifest.js.map +1 -0
- package/dist/commands/implement-server.d.ts +6 -2
- package/dist/commands/implement-server.d.ts.map +1 -1
- package/dist/commands/implement-server.js +33 -3
- package/dist/commands/implement-server.js.map +1 -1
- package/dist/commands/implement-slice.d.ts +22 -0
- package/dist/commands/implement-slice.d.ts.map +1 -0
- package/dist/commands/implement-slice.js +262 -0
- package/dist/commands/implement-slice.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -8
- package/src/cli-manifest.ts +24 -0
- package/src/commands/implement-server.ts +43 -3
- package/src/commands/implement-slice.ts +333 -0
- package/src/index.ts +10 -1
- package/dist/cli/implement-server.d.ts +0 -3
- package/dist/cli/implement-server.d.ts.map +0 -1
- package/dist/cli/implement-server.js +0 -39
- package/dist/cli/implement-server.js.map +0 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -39
- package/dist/cli/index.js.map +0 -1
- package/src/agent/runAllSlices.js +0 -11
- package/src/agent/runFlows.js +0 -16
- package/src/agent/runSlice.js +0 -328
- package/src/agent/runTests.js +0 -100
- package/src/cli/implement-server.ts +0 -46
- package/src/cli/index.js +0 -21
- package/src/cli/index.ts +0 -48
- package/src/prompts/systemPrompt.js +0 -43
- package/src/utils/extractCodeBlock.js +0 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @auto-engineer/server-implementer@0.
|
|
3
|
-
> tsc && tsx ../../scripts/fix-esm-imports.ts
|
|
2
|
+
> @auto-engineer/server-implementer@0.5.0 build /Users/sam/WebstormProjects/top/auto-engineer/packages/server-implementer
|
|
3
|
+
> tsc && tsx ../../scripts/fix-esm-imports.ts
|
|
4
4
|
|
|
5
5
|
Fixed ESM imports in dist/
|
package/.turbo/turbo-format.log
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
src/agent/
|
|
11
|
-
src/agent/runFlows.ts 5ms (unchanged)
|
|
12
|
-
src/agent/runSlice.
|
|
13
|
-
src/agent/
|
|
14
|
-
src/
|
|
15
|
-
src/
|
|
16
|
-
src/
|
|
17
|
-
src/
|
|
18
|
-
src/
|
|
19
|
-
src/
|
|
20
|
-
|
|
21
|
-
src/prompts/systemPrompt.js 0ms (unchanged)
|
|
22
|
-
src/prompts/systemPrompt.ts 1ms (unchanged)
|
|
23
|
-
src/utils/extractCodeBlock.js 1ms (unchanged)
|
|
24
|
-
src/utils/extractCodeBlock.ts 1ms (unchanged)
|
|
25
|
-
tsconfig.json 1ms (unchanged)
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @auto-engineer/server-implementer@0.5.0 format /Users/sam/WebstormProjects/top/auto-engineer/packages/server-implementer
|
|
4
|
+
> prettier --write "**/*.{js,ts,json,md,yml,yaml}" --ignore-path ../../.prettierignore
|
|
5
|
+
|
|
6
|
+
CHANGELOG.md[2K[1G[90mCHANGELOG.md[39m 24ms (unchanged)
|
|
7
|
+
DEBUG.md[2K[1G[90mDEBUG.md[39m 3ms (unchanged)
|
|
8
|
+
package.json[2K[1G[90mpackage.json[39m 32ms (unchanged)
|
|
9
|
+
README.md[2K[1G[90mREADME.md[39m 85ms (unchanged)
|
|
10
|
+
src/agent/runAllSlices.ts[2K[1G[90msrc/agent/runAllSlices.ts[39m 4ms (unchanged)
|
|
11
|
+
src/agent/runFlows.ts[2K[1G[90msrc/agent/runFlows.ts[39m 5ms (unchanged)
|
|
12
|
+
src/agent/runSlice.ts[2K[1G[90msrc/agent/runSlice.ts[39m 52ms (unchanged)
|
|
13
|
+
src/agent/runTests.ts[2K[1G[90msrc/agent/runTests.ts[39m 17ms (unchanged)
|
|
14
|
+
src/cli-manifest.ts[2K[1G[90msrc/cli-manifest.ts[39m 8ms (unchanged)
|
|
15
|
+
src/commands/implement-server.ts[2K[1G[90msrc/commands/implement-server.ts[39m 10ms (unchanged)
|
|
16
|
+
src/commands/implement-slice.ts[2K[1G[90msrc/commands/implement-slice.ts[39m 21ms (unchanged)
|
|
17
|
+
src/index.ts[2K[1G[90msrc/index.ts[39m 1ms (unchanged)
|
|
18
|
+
src/prompts/systemPrompt.ts[2K[1G[90msrc/prompts/systemPrompt.ts[39m 1ms (unchanged)
|
|
19
|
+
src/utils/extractCodeBlock.ts[2K[1G[90msrc/utils/extractCodeBlock.ts[39m 1ms (unchanged)
|
|
20
|
+
tsconfig.json[2K[1G[90mtsconfig.json[39m 1ms (unchanged)
|
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @auto-engineer/server-implementer@0.5.0 lint /Users/sam/WebstormProjects/top/auto-engineer/packages/server-implementer
|
|
4
|
+
> eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts
|
|
5
|
+
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @auto-engineer/server-implementer@0.5.0 test /Users/sam/WebstormProjects/top/auto-engineer/packages/server-implementer
|
|
4
|
+
> vitest run
|
|
5
|
+
|
|
6
|
+
[?25l
|
|
7
|
+
[1m[46m RUN [49m[22m [36mv3.2.4 [39m[90m/Users/sam/WebstormProjects/top/auto-engineer/packages/server-implementer[39m
|
|
8
|
+
|
|
9
|
+
No test files found, exiting with code 0
|
|
10
|
+
|
|
11
|
+
[31m[2minclude: [22m[33m**/*.specs.{js,ts}[39m[39m
|
|
12
|
+
[31m[2mexclude: [22m[33m**/.tmp/**[2m, [22m**/node_modules/**[2m, [22m**/dist/**[39m[39m
|
|
13
|
+
[31m[39m
|
|
14
|
+
[?25h
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @auto-engineer/server-implementer@0.5.0 type-check /Users/sam/WebstormProjects/top/auto-engineer/packages/server-implementer
|
|
4
|
+
> tsc --noEmit
|
|
5
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @auto-engineer/server-implementer
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- • All cli commands now use commands and emit events on the bus
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @auto-engineer/ai-gateway@0.5.0
|
|
13
|
+
- @auto-engineer/message-bus@0.4.0
|
|
14
|
+
|
|
3
15
|
## 0.4.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# @auto-engineer/server-implementer
|
|
2
|
+
|
|
3
|
+
AI-powered implementation plugin for the Auto Engineer CLI that implements server-side code with AI assistance. This plugin takes generated code stubs and business requirements to create implementations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
This is a plugin for the Auto Engineer CLI. Install both the CLI and this plugin:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @auto-engineer/cli
|
|
11
|
+
npm install @auto-engineer/server-implementer
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Configuration
|
|
15
|
+
|
|
16
|
+
Add this plugin to your `auto.config.ts`:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
export default {
|
|
20
|
+
plugins: [
|
|
21
|
+
'@auto-engineer/server-implementer',
|
|
22
|
+
// ... other plugins
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
This plugin provides the following commands:
|
|
30
|
+
|
|
31
|
+
- `implement:server` - Implement server-side code with AI assistance
|
|
32
|
+
- `implement:slice` - Implement a specific server slice with AI assistance
|
|
33
|
+
|
|
34
|
+
## What does this plugin do?
|
|
35
|
+
|
|
36
|
+
The Server Implementer uses AI capabilities to implement business logic, database operations, and integration code for backend services. It bridges the gap between generated code scaffolds and functional implementations.
|
|
37
|
+
|
|
38
|
+
## Key Features
|
|
39
|
+
|
|
40
|
+
### AI Code Generation
|
|
41
|
+
|
|
42
|
+
- Analyzes existing code structure and patterns
|
|
43
|
+
- Understands business requirements from comments and specifications
|
|
44
|
+
- Generates appropriate implementations
|
|
45
|
+
- Maintains consistency with existing codebase patterns
|
|
46
|
+
|
|
47
|
+
### Incremental Implementation
|
|
48
|
+
|
|
49
|
+
- Implements one slice or component at a time
|
|
50
|
+
- Preserves existing implementations
|
|
51
|
+
- Allows for iterative refinement
|
|
52
|
+
- Supports partial implementations and manual overrides
|
|
53
|
+
|
|
54
|
+
### Test-Driven Development
|
|
55
|
+
|
|
56
|
+
- Generates implementations that pass existing tests
|
|
57
|
+
- Creates test cases for edge cases
|
|
58
|
+
- Validates implementations against test suites
|
|
59
|
+
- Supports behavior-driven development patterns
|
|
60
|
+
|
|
61
|
+
### Integration Awareness
|
|
62
|
+
|
|
63
|
+
- Understands dependencies between components
|
|
64
|
+
- Implements integration patterns correctly
|
|
65
|
+
- Handles error scenarios and edge cases
|
|
66
|
+
- Maintains data consistency across operations
|
|
67
|
+
|
|
68
|
+
## Workflow
|
|
69
|
+
|
|
70
|
+
### 1. Full Server Implementation
|
|
71
|
+
|
|
72
|
+
Use `implement:server` to implement an entire server project:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
auto implement:server
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This command:
|
|
79
|
+
|
|
80
|
+
- Scans the entire server project
|
|
81
|
+
- Identifies unimplemented stubs and TODOs
|
|
82
|
+
- Implements business logic based on specifications
|
|
83
|
+
- Ensures all components work together coherently
|
|
84
|
+
|
|
85
|
+
### 2. Slice-by-Slice Implementation
|
|
86
|
+
|
|
87
|
+
Use `implement:slice` for targeted implementation of specific features:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
auto implement:slice --slice="order-management"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This approach:
|
|
94
|
+
|
|
95
|
+
- Focuses on a single business domain
|
|
96
|
+
- Implements related commands, events, and queries
|
|
97
|
+
- Maintains isolation between different slices
|
|
98
|
+
- Allows for parallel development of features
|
|
99
|
+
|
|
100
|
+
## Implementation Patterns
|
|
101
|
+
|
|
102
|
+
### Command Handler Implementation
|
|
103
|
+
|
|
104
|
+
The plugin understands common command handler patterns:
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
// Before (generated stub)
|
|
108
|
+
export class PlaceOrderCommandHandler {
|
|
109
|
+
async handle(command: PlaceOrderCommand): Promise<OrderPlaced[]> {
|
|
110
|
+
// TODO: Implement order placement logic
|
|
111
|
+
throw new Error('Not implemented');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// After (AI implementation)
|
|
116
|
+
export class PlaceOrderCommandHandler {
|
|
117
|
+
async handle(command: PlaceOrderCommand): Promise<OrderPlaced[]> {
|
|
118
|
+
// Validate inventory availability
|
|
119
|
+
const inventory = await this.inventoryService.checkAvailability(command.items);
|
|
120
|
+
if (!inventory.available) {
|
|
121
|
+
throw new InsufficientInventoryError(command.items);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Calculate pricing
|
|
125
|
+
const pricing = await this.pricingService.calculateTotal(command.items);
|
|
126
|
+
|
|
127
|
+
// Create order aggregate
|
|
128
|
+
const order = new Order({
|
|
129
|
+
customerId: command.customerId,
|
|
130
|
+
items: command.items,
|
|
131
|
+
total: pricing.total,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Emit order placed event
|
|
135
|
+
return [
|
|
136
|
+
new OrderPlaced({
|
|
137
|
+
orderId: order.id,
|
|
138
|
+
customerId: command.customerId,
|
|
139
|
+
total: pricing.total,
|
|
140
|
+
timestamp: new Date(),
|
|
141
|
+
}),
|
|
142
|
+
];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Query Implementation
|
|
148
|
+
|
|
149
|
+
Implements read-side query handlers:
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
// Implements projection queries with proper filtering, sorting, and pagination
|
|
153
|
+
export class OrderQueryHandler {
|
|
154
|
+
async getOrderHistory(customerId: string, options: QueryOptions) {
|
|
155
|
+
return await this.orderProjection
|
|
156
|
+
.query()
|
|
157
|
+
.where('customerId', customerId)
|
|
158
|
+
.orderBy('createdAt', 'desc')
|
|
159
|
+
.limit(options.limit)
|
|
160
|
+
.offset(options.offset)
|
|
161
|
+
.execute();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Integration Implementation
|
|
167
|
+
|
|
168
|
+
Handles external service integrations:
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
// Implements integration patterns with proper error handling
|
|
172
|
+
export class PaymentIntegration {
|
|
173
|
+
async processPayment(paymentRequest: PaymentRequest): Promise<PaymentResult> {
|
|
174
|
+
try {
|
|
175
|
+
const result = await this.stripeClient.charges.create({
|
|
176
|
+
amount: paymentRequest.amount * 100, // Convert to cents
|
|
177
|
+
currency: 'usd',
|
|
178
|
+
source: paymentRequest.token,
|
|
179
|
+
description: paymentRequest.description,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
return {
|
|
183
|
+
success: true,
|
|
184
|
+
transactionId: result.id,
|
|
185
|
+
amount: result.amount / 100,
|
|
186
|
+
};
|
|
187
|
+
} catch (error) {
|
|
188
|
+
if (error.type === 'StripeCardError') {
|
|
189
|
+
throw new PaymentDeclinedError(error.message);
|
|
190
|
+
}
|
|
191
|
+
throw new PaymentProcessingError('Payment failed', error);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Configuration Options
|
|
198
|
+
|
|
199
|
+
Customize implementation behavior through environment variables or config:
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
// auto.config.ts
|
|
203
|
+
export default {
|
|
204
|
+
plugins: [
|
|
205
|
+
[
|
|
206
|
+
'@auto-engineer/server-implementer',
|
|
207
|
+
{
|
|
208
|
+
// AI model configuration
|
|
209
|
+
model: 'claude-3-sonnet',
|
|
210
|
+
temperature: 0.1,
|
|
211
|
+
|
|
212
|
+
// Implementation preferences
|
|
213
|
+
includeLogging: true,
|
|
214
|
+
includeMetrics: true,
|
|
215
|
+
errorHandlingPattern: 'domain-exceptions',
|
|
216
|
+
|
|
217
|
+
// Test generation
|
|
218
|
+
generateTests: true,
|
|
219
|
+
testFramework: 'vitest',
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
],
|
|
223
|
+
};
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Integration with Other Plugins
|
|
227
|
+
|
|
228
|
+
Works with the Auto Engineer ecosystem:
|
|
229
|
+
|
|
230
|
+
- **@auto-engineer/emmett-generator**: Implements generated command handlers and queries
|
|
231
|
+
- **@auto-engineer/backend-checks**: Validates implementations pass type checking and tests
|
|
232
|
+
- **@auto-engineer/flowlang**: Uses flow specifications to understand business requirements
|
|
233
|
+
- **@auto-engineer/ai-gateway**: Leverages AI models for intelligent code generation
|
|
234
|
+
|
|
235
|
+
## Quality Assurance
|
|
236
|
+
|
|
237
|
+
The plugin ensures quality implementations through:
|
|
238
|
+
|
|
239
|
+
- Static Analysis: Validates TypeScript compliance and best practices
|
|
240
|
+
- Test Execution: Runs existing tests to ensure implementations work
|
|
241
|
+
- Code Review: Uses AI to review generated code for potential issues
|
|
242
|
+
- Pattern Consistency: Maintains consistency with existing codebase patterns
|
|
243
|
+
- Documentation: Generates inline documentation for complex logic
|
|
244
|
+
|
|
245
|
+
## Advanced Features
|
|
246
|
+
|
|
247
|
+
### Context-Aware Implementation
|
|
248
|
+
|
|
249
|
+
The AI understands:
|
|
250
|
+
|
|
251
|
+
- Existing project patterns and conventions
|
|
252
|
+
- Database schema and relationships
|
|
253
|
+
- External API contracts and integration patterns
|
|
254
|
+
- Error handling strategies used in the project
|
|
255
|
+
- Testing approaches and mocking patterns
|
|
256
|
+
|
|
257
|
+
### Iterative Refinement
|
|
258
|
+
|
|
259
|
+
- Analyzes test failures and refines implementations
|
|
260
|
+
- Learns from manual corrections and adjustments
|
|
261
|
+
- Adapts to project-specific requirements and constraints
|
|
262
|
+
- Supports incremental improvement over time
|
|
263
|
+
|
|
264
|
+
The Server Implementer transforms code scaffolds into implementations, accelerating backend development while maintaining code quality and consistency.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-manifest.d.ts","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAErE,eAAO,MAAM,YAAY,EAAE,WAqB1B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const CLI_MANIFEST = {
|
|
2
|
+
category: '@auto-engineer/server-implementer',
|
|
3
|
+
commands: {
|
|
4
|
+
'implement:server': {
|
|
5
|
+
handler: () => import('./commands/implement-server.js'),
|
|
6
|
+
description: 'AI implements server TODOs and tests',
|
|
7
|
+
usage: 'implement:server <server-dir>',
|
|
8
|
+
examples: ['$ auto implement:server ./server'],
|
|
9
|
+
args: [{ name: 'server-dir', description: 'Server directory path', required: true }],
|
|
10
|
+
},
|
|
11
|
+
'implement:slice': {
|
|
12
|
+
handler: () => import('./commands/implement-slice.js'),
|
|
13
|
+
description: 'AI implements a specific server slice',
|
|
14
|
+
usage: 'implement:slice <server-dir> <slice-name>',
|
|
15
|
+
examples: ['$ auto implement:slice ./server enters-shopping-criteria'],
|
|
16
|
+
args: [
|
|
17
|
+
{ name: 'server-dir', description: 'Server directory path', required: true },
|
|
18
|
+
{ name: 'slice-name', description: 'Name of the slice to implement', required: true },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=cli-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-manifest.js","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,QAAQ,EAAE,mCAAmC;IAC7C,QAAQ,EAAE;QACR,kBAAkB,EAAE;YAClB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,6BAA6B,CAAC;YACpD,WAAW,EAAE,sCAAsC;YACnD,KAAK,EAAE,+BAA+B;YACtC,QAAQ,EAAE,CAAC,kCAAkC,CAAC;YAC9C,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SACrF;QACD,iBAAiB,EAAE;YACjB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,4BAA4B,CAAC;YACnD,WAAW,EAAE,uCAAuC;YACpD,KAAK,EAAE,2CAA2C;YAClD,QAAQ,EAAE,CAAC,0DAA0D,CAAC;YACtE,IAAI,EAAE;gBACJ,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC5E,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,gCAAgC,EAAE,QAAQ,EAAE,IAAI,EAAE;aACtF;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { type CommandHandler, type Command, type Event } from '@auto-engineer/message-bus';
|
|
3
2
|
export type ImplementServerCommand = Command<'ImplementServer', {
|
|
4
3
|
serverDirectory: string;
|
|
@@ -11,6 +10,11 @@ export type ServerImplementationFailedEvent = Event<'ServerImplementationFailed'
|
|
|
11
10
|
serverDirectory: string;
|
|
12
11
|
error: string;
|
|
13
12
|
}>;
|
|
14
|
-
export declare function handleImplementServerCommand(command: ImplementServerCommand): Promise<ServerImplementedEvent | ServerImplementationFailedEvent>;
|
|
15
13
|
export declare const implementServerCommandHandler: CommandHandler<ImplementServerCommand>;
|
|
14
|
+
interface CliArgs {
|
|
15
|
+
_: string[];
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: (commandOrArgs: ImplementServerCommand | CliArgs) => Promise<void>;
|
|
19
|
+
export default _default;
|
|
16
20
|
//# sourceMappingURL=implement-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implement-server.d.ts","sourceRoot":"","sources":["../../src/commands/implement-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implement-server.d.ts","sourceRoot":"","sources":["../../src/commands/implement-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAW3F,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,iBAAiB,EACjB;IACE,eAAe,EAAE,MAAM,CAAC;CACzB,CACF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CACxC,mBAAmB,EACnB;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CACF,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,KAAK,CACjD,4BAA4B,EAC5B;IACE,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AA8EF,eAAO,MAAM,6BAA6B,EAAE,cAAc,CAAC,sBAAsB,CAkBhF,CAAC;AAGF,UAAU,OAAO;IACf,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;yBAcqB,eAAe,sBAAsB,GAAG,OAAO;AAArE,wBAqBE"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import path from 'path';
|
|
3
2
|
import { existsSync } from 'fs';
|
|
4
3
|
import { runFlows } from '../agent/runFlows.js';
|
|
@@ -7,7 +6,7 @@ const debug = createDebug('server-impl:command');
|
|
|
7
6
|
const debugHandler = createDebug('server-impl:command:handler');
|
|
8
7
|
const debugProcess = createDebug('server-impl:command:process');
|
|
9
8
|
const debugResult = createDebug('server-impl:command:result');
|
|
10
|
-
|
|
9
|
+
async function handleImplementServerCommandInternal(command) {
|
|
11
10
|
const { serverDirectory } = command.data;
|
|
12
11
|
debug('Handling ImplementServerCommand');
|
|
13
12
|
debug(' Server directory: %s', serverDirectory);
|
|
@@ -73,7 +72,7 @@ export const implementServerCommandHandler = {
|
|
|
73
72
|
name: 'ImplementServer',
|
|
74
73
|
handle: async (command) => {
|
|
75
74
|
debug('CommandHandler executing for ImplementServer');
|
|
76
|
-
const result = await
|
|
75
|
+
const result = await handleImplementServerCommandInternal(command);
|
|
77
76
|
if (result.type === 'ServerImplemented') {
|
|
78
77
|
debug('Command handler completed: success');
|
|
79
78
|
console.log(`✅ Server implementation completed successfully`);
|
|
@@ -88,4 +87,35 @@ export const implementServerCommandHandler = {
|
|
|
88
87
|
}
|
|
89
88
|
},
|
|
90
89
|
};
|
|
90
|
+
// Type guard to check if it's an ImplementServerCommand
|
|
91
|
+
function isImplementServerCommand(obj) {
|
|
92
|
+
return (typeof obj === 'object' &&
|
|
93
|
+
obj !== null &&
|
|
94
|
+
'type' in obj &&
|
|
95
|
+
'data' in obj &&
|
|
96
|
+
obj.type === 'ImplementServer');
|
|
97
|
+
}
|
|
98
|
+
// Default export for CLI usage
|
|
99
|
+
export default async (commandOrArgs) => {
|
|
100
|
+
const command = isImplementServerCommand(commandOrArgs)
|
|
101
|
+
? commandOrArgs
|
|
102
|
+
: {
|
|
103
|
+
type: 'ImplementServer',
|
|
104
|
+
data: {
|
|
105
|
+
serverDirectory: commandOrArgs._?.[0] ?? 'server',
|
|
106
|
+
},
|
|
107
|
+
timestamp: new Date(),
|
|
108
|
+
};
|
|
109
|
+
const result = await handleImplementServerCommandInternal(command);
|
|
110
|
+
if (result.type === 'ServerImplemented') {
|
|
111
|
+
console.log(`✅ Server implementation completed successfully`);
|
|
112
|
+
if (result.data.flowsImplemented > 0) {
|
|
113
|
+
console.log(` ${result.data.flowsImplemented} flows implemented`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
console.error(`❌ Server implementation failed: ${result.data.error}`);
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
91
121
|
//# sourceMappingURL=implement-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implement-server.js","sourceRoot":"","sources":["../../src/commands/implement-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implement-server.js","sourceRoot":"","sources":["../../src/commands/implement-server.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AACjD,MAAM,YAAY,GAAG,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAChE,MAAM,YAAY,GAAG,WAAW,CAAC,6BAA6B,CAAC,CAAC;AAChE,MAAM,WAAW,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC;AAyB9D,KAAK,UAAU,oCAAoC,CACjD,OAA+B;IAE/B,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAEzC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzC,KAAK,CAAC,wBAAwB,EAAE,eAAe,CAAC,CAAC;IACjD,KAAK,CAAC,kBAAkB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7C,KAAK,CAAC,sBAAsB,EAAE,OAAO,CAAC,aAAa,IAAI,MAAM,CAAC,CAAC;IAE/D,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEjE,YAAY,CAAC,iBAAiB,CAAC,CAAC;QAChC,YAAY,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;QAC9C,YAAY,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;QAEhD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAA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OAAO,GAAG,wBAAwB,CAAC,aAAa,CAAC;QACrD,CAAC,CAAC,aAAa;QACf,CAAC,CAAC;YACE,IAAI,EAAE,iBAA0B;YAChC,IAAI,EAAE;gBACJ,eAAe,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ;aAClD;YACD,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC;IAEN,MAAM,MAAM,GAAG,MAAM,oCAAoC,CAAC,OAAO,CAAC,CAAC;IACnE,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAC9D,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,oBAAoB,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,mCAAmC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type CommandHandler, type Command, type Event } from '@auto-engineer/message-bus';
|
|
2
|
+
export type ImplementSliceCommand = Command<'ImplementSlice', {
|
|
3
|
+
sliceDirectory: string;
|
|
4
|
+
flowName: string;
|
|
5
|
+
context?: {
|
|
6
|
+
previousOutputs?: string;
|
|
7
|
+
attemptNumber?: number;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
export type SliceImplementedEvent = Event<'SliceImplemented', {
|
|
11
|
+
sliceDirectory: string;
|
|
12
|
+
flowName: string;
|
|
13
|
+
filesImplemented: string[];
|
|
14
|
+
}>;
|
|
15
|
+
export type SliceImplementationFailedEvent = Event<'SliceImplementationFailed', {
|
|
16
|
+
sliceDirectory: string;
|
|
17
|
+
flowName: string;
|
|
18
|
+
error: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function handleImplementSliceCommand(command: ImplementSliceCommand): Promise<SliceImplementedEvent | SliceImplementationFailedEvent>;
|
|
21
|
+
export declare const implementSliceCommandHandler: CommandHandler<ImplementSliceCommand>;
|
|
22
|
+
//# sourceMappingURL=implement-slice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implement-slice.d.ts","sourceRoot":"","sources":["../../src/commands/implement-slice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AA0D3F,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,gBAAgB,EAChB;IACE,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CACvC,kBAAkB,EAClB;IACE,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CACF,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,2BAA2B,EAC3B;IACE,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AA8LF,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,qBAAqB,GAAG,8BAA8B,CAAC,CAmCjE;AAED,eAAO,MAAM,4BAA4B,EAAE,cAAc,CAAC,qBAAqB,CAiB9E,CAAC"}
|