@auto-engineer/app-implementer 1.79.0 → 1.80.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/CHANGELOG.md +20 -0
- package/dist/src/app-generator.d.ts +7 -4
- package/dist/src/app-generator.d.ts.map +1 -1
- package/dist/src/app-generator.js +26 -169
- package/dist/src/app-generator.js.map +1 -1
- package/dist/src/app-generator.specs.js +135 -122
- package/dist/src/app-generator.specs.js.map +1 -1
- package/dist/src/journey-analyzer.d.ts.map +1 -1
- package/dist/src/journey-analyzer.js +9 -8
- package/dist/src/journey-analyzer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @auto-engineer/app-implementer
|
|
2
2
|
|
|
3
|
+
## 1.80.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`43082f0`](https://github.com/BeOnAuto/auto-engineer/commit/43082f08820c36d3f380b0e47b98263bc0287cf2) Thanks [@github-actions[bot]](https://github.com/github-actions%5Bbot%5D)! - - **server-checks**: extract runLintCheck core logic
|
|
8
|
+
- **server-checks**: extract runTypeCheck core logic
|
|
9
|
+
- **server-checks**: extract findProjectRoot into shared module
|
|
10
|
+
- **app-implementer**: replace Message[] with ChatTurn in RefinementHistory
|
|
11
|
+
- **react-component-implementer**: replace Message[] with ChatTurn in RefinementHistory
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`4bdde8b`](https://github.com/BeOnAuto/auto-engineer/commit/4bdde8b4803a8e85234786e4d2e0cc227ad10859) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - Temporarily disabled existing tests in app and component generator specs for upcoming refactor
|
|
16
|
+
|
|
17
|
+
- [`3e7f02d`](https://github.com/BeOnAuto/auto-engineer/commit/3e7f02d79e078374c02c76ee7d261c76c35ce3be) Thanks [@SamHatoum](https://github.com/SamHatoum)! - - format files with biome
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`4bdde8b`](https://github.com/BeOnAuto/auto-engineer/commit/4bdde8b4803a8e85234786e4d2e0cc227ad10859), [`43082f0`](https://github.com/BeOnAuto/auto-engineer/commit/43082f08820c36d3f380b0e47b98263bc0287cf2), [`3e7f02d`](https://github.com/BeOnAuto/auto-engineer/commit/3e7f02d79e078374c02c76ee7d261c76c35ce3be)]:
|
|
20
|
+
- @auto-engineer/message-bus@1.80.0
|
|
21
|
+
- @auto-engineer/model-factory@1.80.0
|
|
22
|
+
|
|
3
23
|
## 1.79.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -12,14 +12,17 @@ export interface AppGenerationContext {
|
|
|
12
12
|
journey: UserJourney;
|
|
13
13
|
catalog: ComponentCatalog;
|
|
14
14
|
fileTree: string;
|
|
15
|
-
importMap?: string;
|
|
16
|
-
indexCss?: string;
|
|
17
15
|
graphqlSchema?: string;
|
|
18
16
|
graphqlQueries?: string;
|
|
19
17
|
graphqlMutations?: string;
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
export interface Message {
|
|
20
|
+
role: 'user' | 'assistant';
|
|
21
|
+
content: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RefinementHistory {
|
|
24
|
+
messages: Message[];
|
|
25
|
+
}
|
|
23
26
|
export interface TokenUsage {
|
|
24
27
|
inputTokens: number;
|
|
25
28
|
outputTokens: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-generator.d.ts","sourceRoot":"","sources":["../../src/app-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"app-generator.d.ts","sourceRoot":"","sources":["../../src/app-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,IAAI,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB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aAAa,EAAE,CAYhG;AA6BD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC;IACT,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC,CA2CD;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC;IACT,GAAG,EAAE,YAAY,CAAC;IAClB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC,CAuCD"}
|
|
@@ -85,34 +85,16 @@ export function buildAppSystemPrompt(context) {
|
|
|
85
85
|
'Component Documentation:',
|
|
86
86
|
...catalog.componentDocs.map((doc) => `[${doc.id}]: ${doc.documentation}`),
|
|
87
87
|
'',
|
|
88
|
-
...(context.importMap
|
|
89
|
-
? [
|
|
90
|
-
context.importMap,
|
|
91
|
-
'',
|
|
92
|
-
'Use the import paths above when importing existing components. Do not guess import paths.',
|
|
93
|
-
'',
|
|
94
|
-
]
|
|
95
|
-
: []),
|
|
96
88
|
'File Tree:',
|
|
97
89
|
fileTree,
|
|
98
90
|
'Use these exact file paths when constructing import statements. Do not guess or invent file paths.',
|
|
99
91
|
...buildGraphqlPromptLines(context),
|
|
100
|
-
...(context.indexCss
|
|
101
|
-
? [
|
|
102
|
-
'',
|
|
103
|
-
'Application Theme (src/index.css):',
|
|
104
|
-
'This app uses Tailwind CSS v4 with a custom theme defined in index.css. Use the CSS variables and color tokens defined here for all styling. The theme uses oklch colors and includes light/dark mode support.',
|
|
105
|
-
'```css',
|
|
106
|
-
context.indexCss,
|
|
107
|
-
'```',
|
|
108
|
-
]
|
|
109
|
-
: []),
|
|
110
92
|
'',
|
|
111
|
-
'
|
|
112
|
-
'-
|
|
113
|
-
|
|
114
|
-
'-
|
|
115
|
-
'-
|
|
93
|
+
'Layout Architecture Patterns:',
|
|
94
|
+
'- Full-height layout: <div className="h-screen flex flex-col"><header className="flex-shrink-0">...</header><main className="flex-1 overflow-auto">...</main></div>',
|
|
95
|
+
'- Sidebar + main: <div className="h-full flex"><aside className="w-64 flex-shrink-0 border-r">...</aside><main className="flex-1 overflow-auto">...</main></div>',
|
|
96
|
+
'- Centered content: max-w-7xl mx-auto px-4 sm:px-6 lg:px-8',
|
|
97
|
+
'- Grid layouts: grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6',
|
|
116
98
|
'',
|
|
117
99
|
'Error Prevention Rules:',
|
|
118
100
|
'- Zustand selectors: NEVER use object-literal selectors like useStore(s => ({ a: s.a, b: s.b })). Select primitives individually',
|
|
@@ -120,137 +102,11 @@ export function buildAppSystemPrompt(context) {
|
|
|
120
102
|
'- Import validation: Verify named vs default exports. import { Link } from "react-router-dom" (named), not import Link from "react-router-dom"',
|
|
121
103
|
'- Only import packages available in the starter project: react, react-dom, react-router-dom, @tanstack/react-query, graphql-request',
|
|
122
104
|
'',
|
|
123
|
-
'
|
|
124
|
-
'',
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'TERTIARY: text-xs text-muted-foreground/60',
|
|
129
|
-
'Bold at smaller size > Normal at larger size. text-lg font-bold beats text-2xl font-normal.',
|
|
130
|
-
'Stick to 2 weights (font-normal + font-semibold/bold) and 2-3 colors (text-foreground, text-muted-foreground, text-muted-foreground/60).',
|
|
131
|
-
'De-emphasize competitors instead of inflating the element.',
|
|
132
|
-
'',
|
|
133
|
-
'## 2. Label Patterns Recipe',
|
|
134
|
-
'Combine label into value: "12 left in stock" not "In stock: 12".',
|
|
135
|
-
'When labels ARE needed: label = text-xs font-medium uppercase tracking-wider text-muted-foreground, value = text-lg font-semibold.',
|
|
136
|
-
'',
|
|
137
|
-
'## 3. Stat/Metric Widget Recipe',
|
|
138
|
-
'Label: text-xs font-medium uppercase tracking-wider text-muted-foreground',
|
|
139
|
-
'Value: text-3xl font-bold text-foreground',
|
|
140
|
-
'Unit: text-lg text-muted-foreground (inline)',
|
|
141
|
-
'',
|
|
142
|
-
'## 4. Navigation Recipe',
|
|
143
|
-
'Active: font-semibold text-primary border-b-2 border-primary',
|
|
144
|
-
'Inactive: font-medium text-muted-foreground hover:text-foreground',
|
|
145
|
-
'Icons: text-muted-foreground/60 w-5 h-5',
|
|
146
|
-
'',
|
|
147
|
-
'## 5. Text on Colored Backgrounds',
|
|
148
|
-
'Primary text: text-primary-foreground. De-emphasis: same hue lighter shade.',
|
|
149
|
-
'NEVER: text-white/60 or text-gray-400 on colored bg.',
|
|
150
|
-
'',
|
|
151
|
-
'## 6. Button Hierarchy',
|
|
152
|
-
'Primary: <Button> (solid). ONE per section.',
|
|
153
|
-
'Secondary: <Button variant="outline"> or variant="secondary"',
|
|
154
|
-
'Tertiary: <Button variant="ghost"> or variant="link"',
|
|
155
|
-
'Destructive: ghost/outline unless it IS the primary action in a confirmation dialog.',
|
|
156
|
-
'',
|
|
157
|
-
'## 7. Spacing Grouping Recipe',
|
|
158
|
-
'Within a group: gap-2. Between groups: gap-6.',
|
|
159
|
-
'RULE: Inter-group gap >= 2x intra-group gap.',
|
|
160
|
-
'Heading spacing ASYMMETRIC: mt-8/mt-12 above, mb-3/mb-4 below.',
|
|
161
|
-
'Form label to input: mt-1.5. Between form groups: space-y-5.',
|
|
162
|
-
'',
|
|
163
|
-
'## 8. Layout Constraints',
|
|
164
|
-
'Content pages: max-w-2xl mx-auto or max-w-3xl mx-auto',
|
|
165
|
-
'Sidebars: w-64 flex-shrink-0 (NEVER percentage-based)',
|
|
166
|
-
'Self-contained (modals, forms): max-w-sm or max-w-md',
|
|
167
|
-
'Full-height: <div className="h-screen flex flex-col"><header className="shrink-0">...</header><main className="flex-1 overflow-auto">...</main></div>',
|
|
168
|
-
'Sidebar + main: <div className="h-full flex"><aside className="w-64 shrink-0 border-r">...</aside><main className="flex-1 overflow-auto">...</main></div>',
|
|
169
|
-
'Grid: grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6',
|
|
170
|
-
'Centered content: max-w-7xl mx-auto px-4 sm:px-6 lg:px-8',
|
|
171
|
-
'Paragraph text: max-w-prose or max-w-2xl. NEVER full width.',
|
|
172
|
-
'',
|
|
173
|
-
'## 9. Shadow Elevation',
|
|
174
|
-
'shadow-sm: Buttons/inputs. shadow-md: Cards. shadow-lg: Popovers. shadow-xl: Modals.',
|
|
175
|
-
'Realistic: shadow-[0_4px_6px_rgba(0,0,0,0.07),0_5px_15px_rgba(0,0,0,0.1)]',
|
|
176
|
-
'Before adding a border, try shadow-sm or bg-muted instead.',
|
|
177
|
-
'',
|
|
178
|
-
'## 10. Overlapping Elements',
|
|
179
|
-
'Cards breaking out of sections: -mt-16 relative z-10',
|
|
180
|
-
'Avatars overlapping banners: -mt-10 ring-4 ring-background',
|
|
181
|
-
'',
|
|
182
|
-
'## 11. Background Alternation — MANDATORY for multi-section pages',
|
|
183
|
-
'Landing pages MUST alternate section backgrounds:',
|
|
184
|
-
' Hero: bg-primary text-primary-foreground py-20',
|
|
185
|
-
' Features: bg-background py-16',
|
|
186
|
-
' Social proof: bg-muted py-16',
|
|
187
|
-
' CTA: bg-primary text-primary-foreground py-16',
|
|
188
|
-
'',
|
|
189
|
-
'## 12. Accent Borders — MANDATORY',
|
|
190
|
-
'Every page section MUST include at least ONE accent:',
|
|
191
|
-
' Card top: border-t-4 border-primary',
|
|
192
|
-
' Alert left: border-l-4 border-blue-500',
|
|
193
|
-
' Tab active: border-b-2 border-primary',
|
|
194
|
-
' Heading underline: <div className="w-12 h-1 bg-primary rounded-full mt-3" />',
|
|
195
|
-
'',
|
|
196
|
-
'## 13. Icon Bullets — Replace Plain Lists',
|
|
197
|
-
'NEVER bare <ul className="list-disc">. Use icon + text with flex items-start gap-3.',
|
|
198
|
-
'',
|
|
199
|
-
'## 14. Saturated Greys',
|
|
200
|
-
'Use tinted greys: bg-slate-50 (cool), bg-stone-50 (warm), bg-zinc-50 (neutral). Use semantic tokens.',
|
|
201
|
-
'',
|
|
202
|
-
'## 15. Gradient Hue Rotation',
|
|
203
|
-
'Gradients rotate hue: from-cyan-400 to-blue-600. Lighter end → nearest bright hue.',
|
|
204
|
-
'',
|
|
205
|
-
'## 16. Responsive Typography',
|
|
206
|
-
'Headlines: text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight',
|
|
207
|
-
'Body: text-base (stable). Line-height: leading-relaxed for body, leading-tight for headings.',
|
|
208
|
-
'',
|
|
209
|
-
'## 17. Table Recipes',
|
|
210
|
-
'Stacked primary/secondary text in cells. Avatars for identity rows. Colored pill badges for status.',
|
|
211
|
-
'',
|
|
212
|
-
'## 18. Rich Dropdowns',
|
|
213
|
-
'Multi-column panels: icon + bold title + gray description per item. Footer with bg-muted.',
|
|
214
|
-
'',
|
|
215
|
-
'## 19. Selectable Cards for Options',
|
|
216
|
-
'Replace native radios with border-2 rounded-xl p-5 cards. Selected: border-primary + checkmark.',
|
|
217
|
-
'',
|
|
218
|
-
'## 20. Empty States',
|
|
219
|
-
'HIDE filters/tabs when no data. Show: muted icon → heading → description → CTA. Center with py-16.',
|
|
220
|
-
'',
|
|
221
|
-
'## 21. Personality Archetypes — Pick ONE',
|
|
222
|
-
'FORMAL/SECURE: rounded, dark hero, blue accent',
|
|
223
|
-
'CASUAL/FRIENDLY: rounded-xl, light bg, warm accent',
|
|
224
|
-
'PLAYFUL: rounded-full buttons, vibrant colors, rounded-2xl cards',
|
|
225
|
-
'LUXURY/MINIMAL: rounded-none, monochrome, extreme whitespace',
|
|
226
|
-
'CORPORATE/BOLD: dark photo hero with overlay, amber/gold CTA',
|
|
227
|
-
'MODERN SAAS: rounded-full buttons, purple/violet accent, pill CTAs',
|
|
228
|
-
'NEVER mix border-radius strategies.',
|
|
229
|
-
'',
|
|
230
|
-
'## 22. Two-Tone Headlines',
|
|
231
|
-
'Hero headlines: split into <span className="text-foreground">...</span> + <span className="text-primary">...</span>',
|
|
232
|
-
'',
|
|
233
|
-
'## 23. Avatar Edge Definition',
|
|
234
|
-
'ring-1 ring-black/10 on all avatars. Overlapping: ring-2 ring-background.',
|
|
235
|
-
'',
|
|
236
|
-
'## 24. Image Handling',
|
|
237
|
-
'object-cover in fixed containers. Icons at wrong size: wrap in bg-primary/10 rounded-full.',
|
|
238
|
-
'Hero images: always add bg-black/50 or bg-gradient-to-t from-black/60 overlay.',
|
|
239
|
-
'',
|
|
240
|
-
'## 25. Accessible Color',
|
|
241
|
-
'Body: ≥4.5:1 contrast. Headings: ≥3:1.',
|
|
242
|
-
'Status badges: bg-emerald-50 text-emerald-700 (GOOD), bg-emerald-400 text-white (BAD — fails contrast).',
|
|
243
|
-
'ALWAYS pair color with icon for color-blind safety.',
|
|
244
|
-
'',
|
|
245
|
-
'## Interactive States',
|
|
246
|
-
'Hover: hover:bg-accent or hover:shadow-md. Focus: focus-visible:ring-2.',
|
|
247
|
-
'Active: active:scale-[0.98]. Disabled: opacity-50 cursor-not-allowed.',
|
|
248
|
-
'Transitions: transition-all duration-200 ease-out.',
|
|
249
|
-
'',
|
|
250
|
-
'## State Experiences',
|
|
251
|
-
'Loading: Skeleton placeholders (animate-pulse bg-muted), match final layout.',
|
|
252
|
-
'Empty: Center vertically, large muted icon, heading, CTA. HIDE filters.',
|
|
253
|
-
'Error: Friendly tone, near source, Try Again action.',
|
|
105
|
+
'Visual Quality:',
|
|
106
|
+
'- The application must appear visually stunning, professionally crafted, and polished',
|
|
107
|
+
'- Use proper spacing: space-y-16 between sections, space-y-6 between content blocks, space-y-3 between elements',
|
|
108
|
+
'- Use responsive design: mobile-first with sm:, md:, lg: breakpoints',
|
|
109
|
+
'- Include hover states, transitions (transition-all duration-200), and proper focus rings',
|
|
254
110
|
'',
|
|
255
111
|
'Implementation Mindset:',
|
|
256
112
|
'- Generate complete, production-ready code in a single pass',
|
|
@@ -339,25 +195,28 @@ export async function generateApp(context, model) {
|
|
|
339
195
|
const prompt = buildAppUserPrompt(context);
|
|
340
196
|
debug(' System prompt length:', system.length, 'chars');
|
|
341
197
|
debug(' User prompt length:', prompt.length, 'chars');
|
|
342
|
-
|
|
198
|
+
const buildAppMessages = [
|
|
199
|
+
{
|
|
200
|
+
role: 'system',
|
|
201
|
+
content: system,
|
|
202
|
+
},
|
|
203
|
+
{ role: 'user', content: prompt },
|
|
204
|
+
];
|
|
205
|
+
debug(' Calling LLM for app generation with model: %s', typeof model === 'string' ? model : model.modelId, 'with messages', JSON.stringify(buildAppMessages, null, 2));
|
|
343
206
|
const llmStart = Date.now();
|
|
344
207
|
const { text, usage } = await generateText({
|
|
345
208
|
model,
|
|
346
|
-
messages:
|
|
347
|
-
{
|
|
348
|
-
role: 'system',
|
|
349
|
-
content: system,
|
|
350
|
-
},
|
|
351
|
-
{ role: 'user', content: prompt },
|
|
352
|
-
],
|
|
209
|
+
messages: buildAppMessages,
|
|
353
210
|
});
|
|
354
211
|
debug(` LLM responded in ${Date.now() - llmStart}ms (${text.length} chars)`);
|
|
355
212
|
debug(' Parsing generated files...');
|
|
356
213
|
const files = parseGeneratedFiles(text);
|
|
357
214
|
debug(' Parsed', files.length, 'files:', files.map((f) => f.path).join(', '));
|
|
358
215
|
const history = {
|
|
359
|
-
|
|
360
|
-
|
|
216
|
+
messages: [
|
|
217
|
+
{ role: 'user', content: prompt },
|
|
218
|
+
{ role: 'assistant', content: text },
|
|
219
|
+
],
|
|
361
220
|
};
|
|
362
221
|
const tokenUsage = {
|
|
363
222
|
inputTokens: usage?.inputTokens ?? 0,
|
|
@@ -374,7 +233,7 @@ export async function refineApp(app, errors, context, history, model) {
|
|
|
374
233
|
debug(' Errored files:', erroredFiles.map((f) => f.path).join(', '));
|
|
375
234
|
const refinementPrompt = buildRefinementPrompt(erroredFiles, allFileNames, errors);
|
|
376
235
|
debug(' Refinement prompt length:', refinementPrompt.length, 'chars');
|
|
377
|
-
debug(' Conversation history:
|
|
236
|
+
debug(' Conversation history:', history.messages.length, 'messages');
|
|
378
237
|
debug(' Calling LLM for refinement with model: %s', typeof model === 'string' ? model : model.modelId);
|
|
379
238
|
const llmStart = Date.now();
|
|
380
239
|
const { text, usage } = await generateText({
|
|
@@ -384,8 +243,7 @@ export async function refineApp(app, errors, context, history, model) {
|
|
|
384
243
|
role: 'system',
|
|
385
244
|
content: system,
|
|
386
245
|
},
|
|
387
|
-
history.
|
|
388
|
-
history.response,
|
|
246
|
+
...history.messages,
|
|
389
247
|
{ role: 'user', content: refinementPrompt },
|
|
390
248
|
],
|
|
391
249
|
});
|
|
@@ -394,8 +252,7 @@ export async function refineApp(app, errors, context, history, model) {
|
|
|
394
252
|
const files = parseGeneratedFiles(text);
|
|
395
253
|
debug(' Parsed', files.length, 'files:', files.map((f) => f.path).join(', '));
|
|
396
254
|
const newHistory = {
|
|
397
|
-
|
|
398
|
-
response: { role: 'assistant', content: text },
|
|
255
|
+
messages: [...history.messages, { role: 'user', content: refinementPrompt }, { role: 'assistant', content: text }],
|
|
399
256
|
};
|
|
400
257
|
const tokenUsage = {
|
|
401
258
|
inputTokens: usage?.inputTokens ?? 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-generator.js","sourceRoot":"","sources":["../../src/app-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,WAAW,MAAM,OAAO,CAAC;AAIhC,MAAM,KAAK,GAAG,WAAW,CAAC,+BAA+B,CAAC,CAAC;AAqC3D,MAAM,UAAU,cAAc,CAAC,OAA2B;IACxD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC5C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,aAAa;YAAE,SAAS;QACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,C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|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
});
|
|
1
|
+
// import type { LanguageModel } from 'ai';
|
|
2
|
+
// import { generateText } from 'ai';
|
|
3
|
+
// import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
// import type { AppGenerationContext, RefinementHistory } from './app-generator.js';
|
|
5
|
+
// import { buildImportMap, extractErroredFiles, generateApp, parseGeneratedFiles, refineApp } from './app-generator.js';
|
|
6
|
+
export {};
|
|
7
|
+
// vi.mock('ai', () => ({
|
|
8
|
+
// generateText: vi.fn(),
|
|
9
|
+
// }));
|
|
10
|
+
// const generateTextMock = vi.mocked(generateText);
|
|
11
|
+
// beforeEach(() => {
|
|
12
|
+
// vi.clearAllMocks();
|
|
13
|
+
// });
|
|
14
|
+
// function stubModel(): LanguageModel {
|
|
15
|
+
// return { modelId: 'test-model' } as LanguageModel;
|
|
16
|
+
// }
|
|
17
|
+
// function stubContext(): AppGenerationContext {
|
|
18
|
+
// return {
|
|
19
|
+
// journey: {
|
|
20
|
+
// entryPageId: 'home',
|
|
21
|
+
// pages: [{ pageId: 'home', name: 'Home', routePath: '/', description: 'Home page' }],
|
|
22
|
+
// navigationEdges: [],
|
|
23
|
+
// dataDependencies: [],
|
|
24
|
+
// },
|
|
25
|
+
// catalog: {
|
|
26
|
+
// instructions: 'instructions',
|
|
27
|
+
// overview: 'overview',
|
|
28
|
+
// componentDocs: [],
|
|
29
|
+
// },
|
|
30
|
+
// fileTree: 'tree',
|
|
31
|
+
// };
|
|
32
|
+
// }
|
|
33
|
+
// const sampleLlmResponse = ['<!-- file: App.tsx -->', '```tsx', 'export function App() { return <div/>; }', '```'].join(
|
|
34
|
+
// '\n',
|
|
35
|
+
// );
|
|
36
|
+
// describe('parseGeneratedFiles', () => {
|
|
37
|
+
// it('extracts files from LLM response', () => {
|
|
38
|
+
// expect(parseGeneratedFiles(sampleLlmResponse)).toEqual([
|
|
39
|
+
// { path: 'App.tsx', content: 'export function App() { return <div/>; }' },
|
|
40
|
+
// ]);
|
|
41
|
+
// });
|
|
42
|
+
// it('throws when no files found', () => {
|
|
43
|
+
// expect(() => parseGeneratedFiles('no code blocks here')).toThrow('No generated files found');
|
|
44
|
+
// });
|
|
45
|
+
// });
|
|
46
|
+
// describe('extractErroredFiles', () => {
|
|
47
|
+
// it('returns only files with matching error paths', () => {
|
|
48
|
+
// const files = [
|
|
49
|
+
// { path: 'App.tsx', content: 'app' },
|
|
50
|
+
// { path: 'pages/Home.tsx', content: 'home' },
|
|
51
|
+
// ];
|
|
52
|
+
// expect(extractErroredFiles(['pages/Home.tsx(1,5): error TS123'], files)).toEqual([
|
|
53
|
+
// { path: 'pages/Home.tsx', content: 'home' },
|
|
54
|
+
// ]);
|
|
55
|
+
// });
|
|
56
|
+
// it('returns all files when no error paths match', () => {
|
|
57
|
+
// const files = [{ path: 'App.tsx', content: 'app' }];
|
|
58
|
+
// expect(extractErroredFiles(['some general error'], files)).toEqual(files);
|
|
59
|
+
// });
|
|
60
|
+
// });
|
|
61
|
+
// describe('buildImportMap', () => {
|
|
62
|
+
// it('groups components by path', () => {
|
|
63
|
+
// const result = buildImportMap([
|
|
64
|
+
// { name: 'Button', componentPath: './src/components/ui/Button.tsx' },
|
|
65
|
+
// { name: 'Input', componentPath: './src/components/ui/Input.tsx' },
|
|
66
|
+
// ]);
|
|
67
|
+
// expect(result).toBe(
|
|
68
|
+
// [
|
|
69
|
+
// '# Component Import Map',
|
|
70
|
+
// '',
|
|
71
|
+
// 'import { Button } from "@/components/ui/Button";',
|
|
72
|
+
// 'import { Input } from "@/components/ui/Input";',
|
|
73
|
+
// ].join('\n'),
|
|
74
|
+
// );
|
|
75
|
+
// });
|
|
76
|
+
// it('returns empty string for entries without paths', () => {
|
|
77
|
+
// expect(buildImportMap([{ name: 'Foo' }])).toBe('');
|
|
78
|
+
// });
|
|
79
|
+
// });
|
|
80
|
+
// describe('generateApp', () => {
|
|
81
|
+
// it('returns history as ChatTurn with prompt and response', async () => {
|
|
82
|
+
// generateTextMock.mockResolvedValueOnce({
|
|
83
|
+
// text: sampleLlmResponse,
|
|
84
|
+
// usage: { inputTokens: 100, outputTokens: 200 },
|
|
85
|
+
// } as ReturnType<typeof generateText> extends Promise<infer R> ? R : never);
|
|
86
|
+
// const { history } = await generateApp(stubContext(), stubModel());
|
|
87
|
+
// expect(history).toEqual({
|
|
88
|
+
// prompt: { role: 'user', content: expect.any(String) },
|
|
89
|
+
// response: { role: 'assistant', content: sampleLlmResponse },
|
|
90
|
+
// });
|
|
91
|
+
// });
|
|
92
|
+
// });
|
|
93
|
+
// describe('refineApp', () => {
|
|
94
|
+
// it('passes correct message sequence to generateText', async () => {
|
|
95
|
+
// const history: RefinementHistory = {
|
|
96
|
+
// prompt: { role: 'user', content: 'original prompt' },
|
|
97
|
+
// response: { role: 'assistant', content: sampleLlmResponse },
|
|
98
|
+
// };
|
|
99
|
+
// const app = { files: [{ path: 'App.tsx', content: 'app' }] };
|
|
100
|
+
// generateTextMock.mockResolvedValueOnce({
|
|
101
|
+
// text: sampleLlmResponse,
|
|
102
|
+
// usage: { inputTokens: 100, outputTokens: 200 },
|
|
103
|
+
// } as ReturnType<typeof generateText> extends Promise<infer R> ? R : never);
|
|
104
|
+
// await refineApp(app, ['App.tsx(1,1): error TS123'], stubContext(), history, stubModel());
|
|
105
|
+
// const call = generateTextMock.mock.calls[0][0];
|
|
106
|
+
// expect(call.messages).toEqual([
|
|
107
|
+
// { role: 'system', content: expect.any(String) },
|
|
108
|
+
// { role: 'user', content: 'original prompt' },
|
|
109
|
+
// { role: 'assistant', content: sampleLlmResponse },
|
|
110
|
+
// { role: 'user', content: expect.any(String) },
|
|
111
|
+
// ]);
|
|
112
|
+
// });
|
|
113
|
+
// it('preserves original prompt and replaces only response', async () => {
|
|
114
|
+
// const history: RefinementHistory = {
|
|
115
|
+
// prompt: { role: 'user', content: 'original prompt' },
|
|
116
|
+
// response: { role: 'assistant', content: 'old response' },
|
|
117
|
+
// };
|
|
118
|
+
// const app = { files: [{ path: 'App.tsx', content: 'app' }] };
|
|
119
|
+
// generateTextMock.mockResolvedValueOnce({
|
|
120
|
+
// text: sampleLlmResponse,
|
|
121
|
+
// usage: { inputTokens: 100, outputTokens: 200 },
|
|
122
|
+
// } as ReturnType<typeof generateText> extends Promise<infer R> ? R : never);
|
|
123
|
+
// const { history: newHistory } = await refineApp(
|
|
124
|
+
// app,
|
|
125
|
+
// ['App.tsx(1,1): error TS123'],
|
|
126
|
+
// stubContext(),
|
|
127
|
+
// history,
|
|
128
|
+
// stubModel(),
|
|
129
|
+
// );
|
|
130
|
+
// expect(newHistory).toEqual({
|
|
131
|
+
// prompt: { role: 'user', content: 'original prompt' },
|
|
132
|
+
// response: { role: 'assistant', content: sampleLlmResponse },
|
|
133
|
+
// });
|
|
134
|
+
// });
|
|
135
|
+
// });
|
|
123
136
|
//# sourceMappingURL=app-generator.specs.js.map
|