mycontext-cli 0.2.0 → 0.2.2
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/README.md +17 -16
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +118 -11
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +8 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/config/dependencies.json +180 -0
- package/package.json +9 -8
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts +0 -44
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts.map +0 -1
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js +0 -1374
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js.map +0 -1
- package/dist/cli/src/agents/implementations/DocsSubAgent.d.ts +0 -35
- package/dist/cli/src/agents/implementations/DocsSubAgent.d.ts.map +0 -1
- package/dist/cli/src/agents/implementations/DocsSubAgent.js +0 -351
- package/dist/cli/src/agents/implementations/DocsSubAgent.js.map +0 -1
- package/dist/cli/src/agents/implementations/EnhancementAgent.d.ts +0 -120
- package/dist/cli/src/agents/implementations/EnhancementAgent.d.ts.map +0 -1
- package/dist/cli/src/agents/implementations/EnhancementAgent.js +0 -606
- package/dist/cli/src/agents/implementations/EnhancementAgent.js.map +0 -1
- package/dist/cli/src/agents/implementations/QASubAgent.d.ts +0 -31
- package/dist/cli/src/agents/implementations/QASubAgent.d.ts.map +0 -1
- package/dist/cli/src/agents/implementations/QASubAgent.js +0 -190
- package/dist/cli/src/agents/implementations/QASubAgent.js.map +0 -1
- package/dist/cli/src/agents/interfaces/SubAgent.d.ts +0 -287
- package/dist/cli/src/agents/interfaces/SubAgent.d.ts.map +0 -1
- package/dist/cli/src/agents/interfaces/SubAgent.js +0 -7
- package/dist/cli/src/agents/interfaces/SubAgent.js.map +0 -1
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.d.ts +0 -59
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.d.ts.map +0 -1
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.js +0 -305
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.js.map +0 -1
- package/dist/cli/src/agents/personalities/definitions.d.ts +0 -34
- package/dist/cli/src/agents/personalities/definitions.d.ts.map +0 -1
- package/dist/cli/src/agents/personalities/definitions.js +0 -389
- package/dist/cli/src/agents/personalities/definitions.js.map +0 -1
- package/dist/cli/src/cli.d.ts +0 -3
- package/dist/cli/src/cli.d.ts.map +0 -1
- package/dist/cli/src/cli.js +0 -298
- package/dist/cli/src/cli.js.map +0 -1
- package/dist/cli/src/commands/auth.d.ts +0 -23
- package/dist/cli/src/commands/auth.d.ts.map +0 -1
- package/dist/cli/src/commands/auth.js +0 -212
- package/dist/cli/src/commands/auth.js.map +0 -1
- package/dist/cli/src/commands/enhance.d.ts +0 -28
- package/dist/cli/src/commands/enhance.d.ts.map +0 -1
- package/dist/cli/src/commands/enhance.js +0 -246
- package/dist/cli/src/commands/enhance.js.map +0 -1
- package/dist/cli/src/commands/generate-components.d.ts +0 -27
- package/dist/cli/src/commands/generate-components.d.ts.map +0 -1
- package/dist/cli/src/commands/generate-components.js +0 -680
- package/dist/cli/src/commands/generate-components.js.map +0 -1
- package/dist/cli/src/commands/generate.d.ts +0 -108
- package/dist/cli/src/commands/generate.d.ts.map +0 -1
- package/dist/cli/src/commands/generate.js +0 -1970
- package/dist/cli/src/commands/generate.js.map +0 -1
- package/dist/cli/src/commands/init.d.ts +0 -13
- package/dist/cli/src/commands/init.d.ts.map +0 -1
- package/dist/cli/src/commands/init.js +0 -91
- package/dist/cli/src/commands/init.js.map +0 -1
- package/dist/cli/src/commands/list.d.ts +0 -17
- package/dist/cli/src/commands/list.d.ts.map +0 -1
- package/dist/cli/src/commands/list.js +0 -210
- package/dist/cli/src/commands/list.js.map +0 -1
- package/dist/cli/src/commands/model.d.ts +0 -25
- package/dist/cli/src/commands/model.d.ts.map +0 -1
- package/dist/cli/src/commands/model.js +0 -317
- package/dist/cli/src/commands/model.js.map +0 -1
- package/dist/cli/src/commands/preview.d.ts +0 -23
- package/dist/cli/src/commands/preview.d.ts.map +0 -1
- package/dist/cli/src/commands/preview.js +0 -1200
- package/dist/cli/src/commands/preview.js.map +0 -1
- package/dist/cli/src/commands/setup.d.ts +0 -35
- package/dist/cli/src/commands/setup.d.ts.map +0 -1
- package/dist/cli/src/commands/setup.js +0 -412
- package/dist/cli/src/commands/setup.js.map +0 -1
- package/dist/cli/src/commands/status.d.ts +0 -21
- package/dist/cli/src/commands/status.d.ts.map +0 -1
- package/dist/cli/src/commands/status.js +0 -287
- package/dist/cli/src/commands/status.js.map +0 -1
- package/dist/cli/src/commands/validate.d.ts +0 -22
- package/dist/cli/src/commands/validate.d.ts.map +0 -1
- package/dist/cli/src/commands/validate.js +0 -259
- package/dist/cli/src/commands/validate.js.map +0 -1
- package/dist/cli/src/types/index.d.ts +0 -152
- package/dist/cli/src/types/index.d.ts.map +0 -1
- package/dist/cli/src/types/index.js +0 -3
- package/dist/cli/src/types/index.js.map +0 -1
- package/dist/cli/src/utils/apiKeyManager.d.ts +0 -137
- package/dist/cli/src/utils/apiKeyManager.d.ts.map +0 -1
- package/dist/cli/src/utils/apiKeyManager.js +0 -471
- package/dist/cli/src/utils/apiKeyManager.js.map +0 -1
- package/dist/cli/src/utils/componentValidator.d.ts +0 -60
- package/dist/cli/src/utils/componentValidator.d.ts.map +0 -1
- package/dist/cli/src/utils/componentValidator.js +0 -191
- package/dist/cli/src/utils/componentValidator.js.map +0 -1
- package/dist/cli/src/utils/designTokenExtractor.d.ts +0 -94
- package/dist/cli/src/utils/designTokenExtractor.d.ts.map +0 -1
- package/dist/cli/src/utils/designTokenExtractor.js +0 -231
- package/dist/cli/src/utils/designTokenExtractor.js.map +0 -1
- package/dist/cli/src/utils/errorHandler.d.ts +0 -105
- package/dist/cli/src/utils/errorHandler.d.ts.map +0 -1
- package/dist/cli/src/utils/errorHandler.js +0 -332
- package/dist/cli/src/utils/errorHandler.js.map +0 -1
- package/dist/cli/src/utils/fileSystem.d.ts +0 -58
- package/dist/cli/src/utils/fileSystem.d.ts.map +0 -1
- package/dist/cli/src/utils/fileSystem.js +0 -230
- package/dist/cli/src/utils/fileSystem.js.map +0 -1
- package/dist/cli/src/utils/githubModels.d.ts +0 -53
- package/dist/cli/src/utils/githubModels.d.ts.map +0 -1
- package/dist/cli/src/utils/githubModels.js +0 -239
- package/dist/cli/src/utils/githubModels.js.map +0 -1
- package/dist/cli/src/utils/ollamaClient.d.ts +0 -37
- package/dist/cli/src/utils/ollamaClient.d.ts.map +0 -1
- package/dist/cli/src/utils/ollamaClient.js +0 -213
- package/dist/cli/src/utils/ollamaClient.js.map +0 -1
- package/dist/cli/src/utils/spinner.d.ts +0 -30
- package/dist/cli/src/utils/spinner.d.ts.map +0 -1
- package/dist/cli/src/utils/spinner.js +0 -119
- package/dist/cli/src/utils/spinner.js.map +0 -1
- package/dist/cli/src/utils/xaiClient.d.ts +0 -59
- package/dist/cli/src/utils/xaiClient.d.ts.map +0 -1
- package/dist/cli/src/utils/xaiClient.js +0 -244
- package/dist/cli/src/utils/xaiClient.js.map +0 -1
- package/dist/lib/analytics/usage-tracker.d.ts +0 -125
- package/dist/lib/analytics/usage-tracker.d.ts.map +0 -1
- package/dist/lib/analytics/usage-tracker.js +0 -429
- package/dist/lib/analytics/usage-tracker.js.map +0 -1
- package/dist/utils/githubModels.d.ts +0 -53
- package/dist/utils/githubModels.d.ts.map +0 -1
- package/dist/utils/githubModels.js +0 -239
- package/dist/utils/githubModels.js.map +0 -1
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* EnhancementAgent Implementation
|
|
4
|
-
*
|
|
5
|
-
* Specialized sub-agent for iterative component design refinement.
|
|
6
|
-
* Focuses on enhancing single React components through user prompts,
|
|
7
|
-
* maintaining design consistency, and extracting design tokens.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.EnhancementAgent = void 0;
|
|
11
|
-
const definitions_1 = require("../personalities/definitions");
|
|
12
|
-
const xaiClient_1 = require("../../utils/xaiClient");
|
|
13
|
-
const designTokenExtractor_1 = require("../../utils/designTokenExtractor");
|
|
14
|
-
const componentValidator_1 = require("../../utils/componentValidator");
|
|
15
|
-
class EnhancementAgent {
|
|
16
|
-
constructor() {
|
|
17
|
-
this.name = "EnhancementAgent";
|
|
18
|
-
this.description = "Specialized agent for iterative component design refinement and enhancement";
|
|
19
|
-
const personality = (0, definitions_1.getSubAgentPersonality)(this.name);
|
|
20
|
-
if (!personality) {
|
|
21
|
-
throw new Error(`Personality not found for ${this.name}`);
|
|
22
|
-
}
|
|
23
|
-
this.personality = personality.personality;
|
|
24
|
-
this.llmProvider = personality.llmProvider;
|
|
25
|
-
this.expertise = personality.expertise;
|
|
26
|
-
// Initialize utilities
|
|
27
|
-
this.xaiClient = new xaiClient_1.XAIClient({
|
|
28
|
-
apiKey: process.env.XAI_API_KEY || "",
|
|
29
|
-
temperature: 0.7,
|
|
30
|
-
maxTokens: 4000,
|
|
31
|
-
baseUrl: process.env.XAI_BASE_URL || undefined,
|
|
32
|
-
});
|
|
33
|
-
this.tokenExtractor = new designTokenExtractor_1.DesignTokenExtractor();
|
|
34
|
-
this.validator = new componentValidator_1.ComponentValidator();
|
|
35
|
-
}
|
|
36
|
-
async run(input) {
|
|
37
|
-
const { currentComponent, userPrompt, designContext, constraints } = input;
|
|
38
|
-
try {
|
|
39
|
-
// 1. Analyze current component
|
|
40
|
-
const analysis = await this.analyzeComponent(currentComponent);
|
|
41
|
-
// 2. Clarify the user's prompt to remove ambiguity and infer symmetric behavior
|
|
42
|
-
const clarified = await this.clarifyUserRequest(currentComponent, userPrompt, analysis, designContext);
|
|
43
|
-
// 3. Generate enhancement based on clarified prompt
|
|
44
|
-
const gen = await this.generateEnhancement(currentComponent, clarified?.clarifiedText || userPrompt, analysis, designContext);
|
|
45
|
-
const enhancedComponent = gen.enhancedComponent;
|
|
46
|
-
// 4. Extract design tokens from enhanced component
|
|
47
|
-
const designTokens = await this.tokenExtractor.extractTokens(enhancedComponent);
|
|
48
|
-
// 5. Validate enhancement against constraints
|
|
49
|
-
const validation = await this.validator.validateEnhancement(enhancedComponent, constraints);
|
|
50
|
-
// 6. Generate enhancement suggestions
|
|
51
|
-
const suggestions = await this.generateSuggestions(enhancedComponent, designTokens);
|
|
52
|
-
// 7. Calculate changes between versions
|
|
53
|
-
const changes = this.diffComponents(currentComponent, enhancedComponent);
|
|
54
|
-
return {
|
|
55
|
-
enhancedComponent,
|
|
56
|
-
designTokens,
|
|
57
|
-
changes,
|
|
58
|
-
validation,
|
|
59
|
-
suggestions,
|
|
60
|
-
analysis: {
|
|
61
|
-
originalAnalysis: analysis,
|
|
62
|
-
enhancedAnalysis: await this.analyzeComponent(enhancedComponent),
|
|
63
|
-
},
|
|
64
|
-
promptUsed: {
|
|
65
|
-
system: gen.systemPrompt,
|
|
66
|
-
composed: gen.composedPrompt,
|
|
67
|
-
clarified: clarified?.clarifiedText,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
console.error("EnhancementAgent failed:", error);
|
|
73
|
-
throw new Error(`Enhancement failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async validate(input) {
|
|
77
|
-
// Validate required fields
|
|
78
|
-
if (!input.currentComponent || !input.userPrompt) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
// Validate component syntax
|
|
82
|
-
try {
|
|
83
|
-
await this.validator.validateSyntax(input.currentComponent);
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
async getStatus() {
|
|
91
|
-
return {
|
|
92
|
-
name: this.name,
|
|
93
|
-
status: "idle",
|
|
94
|
-
errorCount: 0,
|
|
95
|
-
successCount: 0,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
async analyzeComponent(componentCode) {
|
|
99
|
-
const analysis = {
|
|
100
|
-
type: this.detectComponentType(componentCode),
|
|
101
|
-
complexity: this.assessComplexity(componentCode),
|
|
102
|
-
dependencies: this.extractDependencies(componentCode),
|
|
103
|
-
designPatterns: this.extractDesignPatterns(componentCode),
|
|
104
|
-
accessibility: this.assessAccessibility(componentCode),
|
|
105
|
-
performance: this.assessPerformance(componentCode),
|
|
106
|
-
linesOfCode: componentCode.split("\n").length,
|
|
107
|
-
hasState: this.hasStateManagement(componentCode),
|
|
108
|
-
hasEffects: this.hasSideEffects(componentCode),
|
|
109
|
-
hasProps: this.hasProps(componentCode),
|
|
110
|
-
};
|
|
111
|
-
return analysis;
|
|
112
|
-
}
|
|
113
|
-
async generateEnhancement(currentComponent, prompt, analysis, designContext) {
|
|
114
|
-
const systemPrompt = this.buildEnhancementPrompt(analysis, designContext);
|
|
115
|
-
const composedPrompt = `${systemPrompt}\n\nUser Request: ${prompt}\n\nCurrent Component:\n\`\`\`tsx\n${currentComponent}\n\`\`\`\n\nEnhanced Component:`;
|
|
116
|
-
// Try multiple AI providers with fallback
|
|
117
|
-
const providers = [
|
|
118
|
-
{ name: "xai", client: this.xaiClient },
|
|
119
|
-
{ name: "claude-sonnet", client: null }, // TODO: Add Claude client
|
|
120
|
-
{ name: "gemini-pro", client: null }, // TODO: Add Gemini client
|
|
121
|
-
{ name: "github-models", client: null }, // TODO: Add GitHub client
|
|
122
|
-
];
|
|
123
|
-
let lastRawOutput;
|
|
124
|
-
let lastError;
|
|
125
|
-
for (const provider of providers) {
|
|
126
|
-
try {
|
|
127
|
-
if (provider.client) {
|
|
128
|
-
if (process.env.DEBUG_ENHANCER === "true") {
|
|
129
|
-
console.log(`[enhancer] provider=${provider.name} calling generate`);
|
|
130
|
-
}
|
|
131
|
-
const result = await provider.client.generate({
|
|
132
|
-
prompt: composedPrompt,
|
|
133
|
-
systemPrompt,
|
|
134
|
-
temperature: 0.7,
|
|
135
|
-
maxTokens: 4000,
|
|
136
|
-
});
|
|
137
|
-
if (process.env.DEBUG_ENHANCER === "true") {
|
|
138
|
-
console.log(`[enhancer] provider=${provider.name} raw length=${result.content?.length || 0} sample=`, (result.content || "").slice(0, 240));
|
|
139
|
-
}
|
|
140
|
-
lastRawOutput = result.content || "";
|
|
141
|
-
const enhancedComponent = this.postProcessComponent(lastRawOutput);
|
|
142
|
-
// Validate the enhanced component
|
|
143
|
-
if (await this.validator.validateSyntax(enhancedComponent)) {
|
|
144
|
-
return {
|
|
145
|
-
enhancedComponent,
|
|
146
|
-
systemPrompt,
|
|
147
|
-
composedPrompt,
|
|
148
|
-
rawOutput: lastRawOutput,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
console.warn(`${provider.name} failed, trying next...`, error instanceof Error ? error.message : error);
|
|
155
|
-
lastError = error;
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
// Soft fallback: return original component with warning and raw output
|
|
160
|
-
const allowSoftFallback = process.env.ENHANCER_NO_SOFT_FALLBACK === "true" ? false : true;
|
|
161
|
-
if (allowSoftFallback) {
|
|
162
|
-
return {
|
|
163
|
-
enhancedComponent: currentComponent,
|
|
164
|
-
systemPrompt,
|
|
165
|
-
composedPrompt,
|
|
166
|
-
rawOutput: lastRawOutput,
|
|
167
|
-
warning: `AI generation returned invalid code. Falling back to original component. ${lastError instanceof Error ? lastError.message : ""}`,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
throw new Error("All AI providers failed to generate enhancement");
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Clarify the user's freeform request into a precise, unambiguous instruction.
|
|
174
|
-
* Encourages symmetric behavior (e.g., if increment changes, consider decrement implications)
|
|
175
|
-
* but preserves the rule of minimal change unless explicitly requested.
|
|
176
|
-
*/
|
|
177
|
-
async clarifyUserRequest(currentComponent, userPrompt, analysis, designContext) {
|
|
178
|
-
try {
|
|
179
|
-
const systemPrompt = `You clarify enhancement requests for React components.
|
|
180
|
-
Return a single JSON object only. No prose.
|
|
181
|
-
Infer safe, minimal implications (e.g., if increment logic changes, consider whether decrement should mirror that if user intent implies symmetry).
|
|
182
|
-
Do not add new features unrelated to the user's request.`;
|
|
183
|
-
const prompt = `User Request: ${userPrompt}
|
|
184
|
-
|
|
185
|
-
Component quick facts:
|
|
186
|
-
- Type: ${analysis.type}
|
|
187
|
-
- Has State: ${analysis.hasState}
|
|
188
|
-
- Has Props: ${analysis.hasProps}
|
|
189
|
-
- Lines: ${analysis.linesOfCode}
|
|
190
|
-
|
|
191
|
-
Design Context:
|
|
192
|
-
- Colors: ${designContext.colors.join(", ")}
|
|
193
|
-
- Spacing: ${designContext.spacing}
|
|
194
|
-
- Typography: ${designContext.typography}
|
|
195
|
-
- Interactions: ${designContext.interactions.join(", ")}
|
|
196
|
-
|
|
197
|
-
Clarify into JSON with this exact shape:
|
|
198
|
-
{
|
|
199
|
-
"clarifiedText": string, // one concise instruction that the code generator can follow
|
|
200
|
-
"assumptions": string[], // implicit assumptions you made
|
|
201
|
-
"implications": string[] // symmetrical or related behaviors to adjust, if any
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
Examples:
|
|
205
|
-
- Input: "increment by prime numbers" => clarifiedText might specify both increment behavior and whether decrement should reverse prime step, if implied.
|
|
206
|
-
|
|
207
|
-
Return only JSON.`;
|
|
208
|
-
const res = await this.xaiClient.generate({
|
|
209
|
-
prompt,
|
|
210
|
-
systemPrompt,
|
|
211
|
-
temperature: 0.2,
|
|
212
|
-
maxTokens: 800,
|
|
213
|
-
});
|
|
214
|
-
try {
|
|
215
|
-
const data = JSON.parse(res.content || "{}");
|
|
216
|
-
if (typeof data?.clarifiedText === "string" &&
|
|
217
|
-
data.clarifiedText.trim()) {
|
|
218
|
-
return { clarifiedText: data.clarifiedText.trim() };
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
catch {
|
|
222
|
-
// fall through
|
|
223
|
-
}
|
|
224
|
-
// Fallback: lightly rephrase without JSON parsing
|
|
225
|
-
const fallback = (res.content || "").trim();
|
|
226
|
-
if (fallback)
|
|
227
|
-
return { clarifiedText: fallback };
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
catch {
|
|
231
|
-
return null;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
buildEnhancementPrompt(analysis, designContext) {
|
|
235
|
-
return `
|
|
236
|
-
You are an expert React component designer specializing in iterative refinement and enhancement.
|
|
237
|
-
|
|
238
|
-
Current Component Analysis (for context only):
|
|
239
|
-
- Type: ${analysis.type}
|
|
240
|
-
- Complexity: ${analysis.complexity}
|
|
241
|
-
- Dependencies: ${analysis.dependencies.join(", ")}
|
|
242
|
-
- Design Patterns: ${analysis.designPatterns.join(", ")}
|
|
243
|
-
- Has State: ${analysis.hasState}
|
|
244
|
-
- Has Props: ${analysis.hasProps}
|
|
245
|
-
|
|
246
|
-
Design Context:
|
|
247
|
-
- Colors: ${designContext.colors.join(", ")}
|
|
248
|
-
- Spacing: ${designContext.spacing}
|
|
249
|
-
- Typography: ${designContext.typography}
|
|
250
|
-
- Interactions: ${designContext.interactions.join(", ")}
|
|
251
|
-
|
|
252
|
-
Enhancement Guidelines (visual-first):
|
|
253
|
-
1. Prioritize fulfilling the user's request for visualization and interactivity. Avoid unrelated changes.
|
|
254
|
-
2. Preserve public interfaces (props/state names) unless the user asks to change them.
|
|
255
|
-
3. It's okay for the component to be larger or include internal helper functions and small subcomponents in the same file.
|
|
256
|
-
4. Use shadcn primitives via alias imports (e.g., import { Button } from '@ui/button'). Avoid external libraries. Inline logic and Tailwind are preferred.
|
|
257
|
-
5. Accessibility and responsiveness are encouraged when they don't conflict with the user's request.
|
|
258
|
-
6. Maintain strict TypeScript.
|
|
259
|
-
7. If the user's request is ambiguous, make the smallest reasonable change. If the request implies symmetry (e.g., increment logic), consider mirroring related actions.
|
|
260
|
-
8. Return the full component code; no markdown or prose is allowed.
|
|
261
|
-
|
|
262
|
-
Code Quality Requirements:
|
|
263
|
-
- Use functional components with hooks
|
|
264
|
-
- Implement proper TypeScript interfaces
|
|
265
|
-
- Add JSDoc comments for complex logic
|
|
266
|
-
- Use semantic HTML elements
|
|
267
|
-
- Implement proper event handling
|
|
268
|
-
- Add proper prop validation
|
|
269
|
-
- Use Tailwind CSS for styling
|
|
270
|
-
- Ensure responsive design with mobile-first approach
|
|
271
|
-
|
|
272
|
-
Output rules (critical):
|
|
273
|
-
- Return only valid TSX code. No prose, no markdown fences, no backticks.
|
|
274
|
-
- Must include a single default export: export default function ComponentName() { ... }
|
|
275
|
-
- Use shadcn primitives via alias imports (e.g., import { Button } from '@ui/button').
|
|
276
|
-
- Avoid unused imports. Comments are allowed.
|
|
277
|
-
- Ensure the code compiles as-is.
|
|
278
|
-
|
|
279
|
-
Return only the enhanced React component code with TypeScript, nothing else.
|
|
280
|
-
`;
|
|
281
|
-
}
|
|
282
|
-
postProcessComponent(componentCode) {
|
|
283
|
-
// Clean up and normalize LLM output into a valid default-exported TSX component
|
|
284
|
-
let cleaned = componentCode.trim();
|
|
285
|
-
// 1) Strip markdown code fences and any language hints
|
|
286
|
-
cleaned = cleaned.replace(/```tsx?\n?/gi, "").replace(/```\n?/g, "");
|
|
287
|
-
// 2) Remove leading prose before first likely code token
|
|
288
|
-
const firstCodeIdxCandidates = [
|
|
289
|
-
cleaned.indexOf("\nimport "),
|
|
290
|
-
cleaned.indexOf("import "),
|
|
291
|
-
cleaned.indexOf("export "),
|
|
292
|
-
cleaned.indexOf("function "),
|
|
293
|
-
cleaned.indexOf("const "),
|
|
294
|
-
cleaned.indexOf("class "),
|
|
295
|
-
].filter((idx) => idx >= 0);
|
|
296
|
-
if (firstCodeIdxCandidates.length > 0) {
|
|
297
|
-
const startIdx = Math.min(...firstCodeIdxCandidates);
|
|
298
|
-
cleaned = cleaned.slice(startIdx);
|
|
299
|
-
}
|
|
300
|
-
// 3) Ensure React import if hooks are referenced but no React import is present
|
|
301
|
-
const usesHooks = /(useState|useEffect|useMemo|useCallback|useRef)/.test(cleaned);
|
|
302
|
-
const hasReactImport = /import\s+React/.test(cleaned);
|
|
303
|
-
if (usesHooks && !hasReactImport) {
|
|
304
|
-
cleaned =
|
|
305
|
-
`import React, { useState, useEffect, useMemo, useCallback, useRef } from "react";\n` +
|
|
306
|
-
cleaned;
|
|
307
|
-
}
|
|
308
|
-
// 4) Normalize exports
|
|
309
|
-
if (!/export\s+default/.test(cleaned)) {
|
|
310
|
-
// Convert `export function Name` → `export default function Name`
|
|
311
|
-
if (/export\s+function\s+([A-Z]\w*)\s*\(/.test(cleaned)) {
|
|
312
|
-
cleaned = cleaned.replace(/export\s+function\s+([A-Z]\w*)\s*\(/, "export default function $1(");
|
|
313
|
-
}
|
|
314
|
-
// Convert `export const Name = ...` → `const Name = ...; export default Name;`
|
|
315
|
-
if (!/export\s+default/.test(cleaned)) {
|
|
316
|
-
cleaned = cleaned.replace(/export\s+const\s+([A-Z]\w*)\s*=\s*/g, "const $1 = ");
|
|
317
|
-
}
|
|
318
|
-
// If still no default export, append one for obvious component declarations
|
|
319
|
-
if (!/export\s+default/.test(cleaned)) {
|
|
320
|
-
const fnMatch = cleaned.match(/function\s+([A-Z]\w*)\s*\(/);
|
|
321
|
-
const varMatch = cleaned.match(/const\s+([A-Z]\w*)\s*=\s*(?:\(|<)/);
|
|
322
|
-
const componentName = (fnMatch && fnMatch[1]) || (varMatch && varMatch[1]) || null;
|
|
323
|
-
if (componentName) {
|
|
324
|
-
// Avoid duplicate default export lines
|
|
325
|
-
const hasDefaultLine = new RegExp(`export\\s+default\\s+${componentName}`).test(cleaned);
|
|
326
|
-
if (!hasDefaultLine) {
|
|
327
|
-
cleaned = `${cleaned.trim()}\n\nexport default ${componentName};\n`;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
// 5) Final validation or last-resort JSX wrapper
|
|
333
|
-
if (!/export\s+default/.test(cleaned)) {
|
|
334
|
-
// If the model produced a bare JSX tree, wrap it
|
|
335
|
-
const hasJSX = /<[A-Za-z][\s\S]*>/.test(cleaned);
|
|
336
|
-
const hasImportsOrExports = /\b(import|export)\b/.test(cleaned);
|
|
337
|
-
if (hasJSX && !hasImportsOrExports) {
|
|
338
|
-
const wrapped = `import React from "react";\n\nfunction EnhancedComponent() {\n return (\n${cleaned}\n );\n}\n\nexport default EnhancedComponent;\n`;
|
|
339
|
-
return wrapped;
|
|
340
|
-
}
|
|
341
|
-
// Otherwise, still invalid
|
|
342
|
-
throw new Error("Generated code is not a valid React component");
|
|
343
|
-
}
|
|
344
|
-
return cleaned;
|
|
345
|
-
}
|
|
346
|
-
detectComponentType(componentCode) {
|
|
347
|
-
const componentName = this.extractComponentName(componentCode);
|
|
348
|
-
if (componentName.toLowerCase().includes("form"))
|
|
349
|
-
return "form";
|
|
350
|
-
if (componentName.toLowerCase().includes("modal") ||
|
|
351
|
-
componentName.toLowerCase().includes("dialog"))
|
|
352
|
-
return "modal";
|
|
353
|
-
if (componentName.toLowerCase().includes("card"))
|
|
354
|
-
return "card";
|
|
355
|
-
if (componentName.toLowerCase().includes("button"))
|
|
356
|
-
return "button";
|
|
357
|
-
if (componentName.toLowerCase().includes("input"))
|
|
358
|
-
return "input";
|
|
359
|
-
if (componentName.toLowerCase().includes("list"))
|
|
360
|
-
return "list";
|
|
361
|
-
if (componentName.toLowerCase().includes("grid"))
|
|
362
|
-
return "grid";
|
|
363
|
-
if (componentName.toLowerCase().includes("table"))
|
|
364
|
-
return "table";
|
|
365
|
-
if (componentName.toLowerCase().includes("chart"))
|
|
366
|
-
return "chart";
|
|
367
|
-
if (componentName.toLowerCase().includes("nav"))
|
|
368
|
-
return "navigation";
|
|
369
|
-
return "custom";
|
|
370
|
-
}
|
|
371
|
-
assessComplexity(componentCode) {
|
|
372
|
-
const lines = componentCode.split("\n").length;
|
|
373
|
-
const hasState = this.hasStateManagement(componentCode);
|
|
374
|
-
const hasEffects = this.hasSideEffects(componentCode);
|
|
375
|
-
const hasProps = this.hasProps(componentCode);
|
|
376
|
-
const hasConditionals = (componentCode.match(/if|else|switch|ternary/g) || []).length;
|
|
377
|
-
const hasLoops = (componentCode.match(/map|forEach|for|while/g) || [])
|
|
378
|
-
.length;
|
|
379
|
-
let complexity = 0;
|
|
380
|
-
if (lines > 100)
|
|
381
|
-
complexity += 2;
|
|
382
|
-
if (hasState)
|
|
383
|
-
complexity += 1;
|
|
384
|
-
if (hasEffects)
|
|
385
|
-
complexity += 1;
|
|
386
|
-
if (hasProps)
|
|
387
|
-
complexity += 1;
|
|
388
|
-
if (hasConditionals > 3)
|
|
389
|
-
complexity += 1;
|
|
390
|
-
if (hasLoops > 2)
|
|
391
|
-
complexity += 1;
|
|
392
|
-
if (complexity <= 2)
|
|
393
|
-
return "simple";
|
|
394
|
-
if (complexity <= 4)
|
|
395
|
-
return "medium";
|
|
396
|
-
return "complex";
|
|
397
|
-
}
|
|
398
|
-
extractDependencies(componentCode) {
|
|
399
|
-
const dependencies = [];
|
|
400
|
-
// Extract React imports
|
|
401
|
-
if (componentCode.includes("useState"))
|
|
402
|
-
dependencies.push("useState");
|
|
403
|
-
if (componentCode.includes("useEffect"))
|
|
404
|
-
dependencies.push("useEffect");
|
|
405
|
-
if (componentCode.includes("useCallback"))
|
|
406
|
-
dependencies.push("useCallback");
|
|
407
|
-
if (componentCode.includes("useMemo"))
|
|
408
|
-
dependencies.push("useMemo");
|
|
409
|
-
if (componentCode.includes("useRef"))
|
|
410
|
-
dependencies.push("useRef");
|
|
411
|
-
if (componentCode.includes("useContext"))
|
|
412
|
-
dependencies.push("useContext");
|
|
413
|
-
// Extract shadcn/ui components
|
|
414
|
-
const shadcnComponents = [
|
|
415
|
-
"Button",
|
|
416
|
-
"Input",
|
|
417
|
-
"Card",
|
|
418
|
-
"Dialog",
|
|
419
|
-
"Modal",
|
|
420
|
-
"Select",
|
|
421
|
-
"Checkbox",
|
|
422
|
-
"RadioGroup",
|
|
423
|
-
"Textarea",
|
|
424
|
-
"Switch",
|
|
425
|
-
"Slider",
|
|
426
|
-
"Progress",
|
|
427
|
-
"Badge",
|
|
428
|
-
"Avatar",
|
|
429
|
-
"Alert",
|
|
430
|
-
"Toast",
|
|
431
|
-
"Tooltip",
|
|
432
|
-
"Popover",
|
|
433
|
-
"DropdownMenu",
|
|
434
|
-
];
|
|
435
|
-
shadcnComponents.forEach((component) => {
|
|
436
|
-
if (componentCode.includes(component)) {
|
|
437
|
-
dependencies.push(`@ui/${component.toLowerCase()}`);
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
return dependencies;
|
|
441
|
-
}
|
|
442
|
-
extractDesignPatterns(componentCode) {
|
|
443
|
-
const patterns = [];
|
|
444
|
-
if (componentCode.includes("className="))
|
|
445
|
-
patterns.push("Tailwind CSS");
|
|
446
|
-
if (componentCode.includes("useState"))
|
|
447
|
-
patterns.push("State Management");
|
|
448
|
-
if (componentCode.includes("useEffect"))
|
|
449
|
-
patterns.push("Side Effects");
|
|
450
|
-
if (componentCode.includes("onClick"))
|
|
451
|
-
patterns.push("Event Handling");
|
|
452
|
-
if (componentCode.includes("disabled"))
|
|
453
|
-
patterns.push("Disabled States");
|
|
454
|
-
if (componentCode.includes("loading"))
|
|
455
|
-
patterns.push("Loading States");
|
|
456
|
-
if (componentCode.includes("error"))
|
|
457
|
-
patterns.push("Error Handling");
|
|
458
|
-
if (componentCode.includes("aria-"))
|
|
459
|
-
patterns.push("Accessibility");
|
|
460
|
-
if (componentCode.includes("transition"))
|
|
461
|
-
patterns.push("Animations");
|
|
462
|
-
if (componentCode.includes("hover:"))
|
|
463
|
-
patterns.push("Hover Effects");
|
|
464
|
-
return patterns;
|
|
465
|
-
}
|
|
466
|
-
assessAccessibility(componentCode) {
|
|
467
|
-
let score = 0;
|
|
468
|
-
if (componentCode.includes("aria-label"))
|
|
469
|
-
score += 20;
|
|
470
|
-
if (componentCode.includes("aria-describedby"))
|
|
471
|
-
score += 15;
|
|
472
|
-
if (componentCode.includes("role="))
|
|
473
|
-
score += 15;
|
|
474
|
-
if (componentCode.includes("tabIndex"))
|
|
475
|
-
score += 10;
|
|
476
|
-
if (componentCode.includes("onKeyDown"))
|
|
477
|
-
score += 10;
|
|
478
|
-
if (componentCode.includes("alt="))
|
|
479
|
-
score += 10;
|
|
480
|
-
if (componentCode.includes("semantic"))
|
|
481
|
-
score += 10;
|
|
482
|
-
if (componentCode.includes("focus"))
|
|
483
|
-
score += 10;
|
|
484
|
-
return Math.min(score, 100);
|
|
485
|
-
}
|
|
486
|
-
assessPerformance(componentCode) {
|
|
487
|
-
let score = 100;
|
|
488
|
-
if (componentCode.includes("useMemo"))
|
|
489
|
-
score += 10;
|
|
490
|
-
if (componentCode.includes("useCallback"))
|
|
491
|
-
score += 10;
|
|
492
|
-
if (componentCode.includes("React.memo"))
|
|
493
|
-
score += 10;
|
|
494
|
-
if (componentCode.includes("lazy"))
|
|
495
|
-
score += 10;
|
|
496
|
-
if (componentCode.includes("suspense"))
|
|
497
|
-
score += 10;
|
|
498
|
-
// Penalties for performance issues
|
|
499
|
-
if (componentCode.includes("setInterval") &&
|
|
500
|
-
!componentCode.includes("clearInterval"))
|
|
501
|
-
score -= 20;
|
|
502
|
-
if (componentCode.includes("addEventListener") &&
|
|
503
|
-
!componentCode.includes("removeEventListener"))
|
|
504
|
-
score -= 20;
|
|
505
|
-
if (componentCode.includes("new Date()") &&
|
|
506
|
-
componentCode.includes("useEffect"))
|
|
507
|
-
score -= 15;
|
|
508
|
-
return Math.max(score, 0);
|
|
509
|
-
}
|
|
510
|
-
hasStateManagement(componentCode) {
|
|
511
|
-
return (componentCode.includes("useState") || componentCode.includes("useReducer"));
|
|
512
|
-
}
|
|
513
|
-
hasSideEffects(componentCode) {
|
|
514
|
-
return (componentCode.includes("useEffect") ||
|
|
515
|
-
componentCode.includes("useLayoutEffect"));
|
|
516
|
-
}
|
|
517
|
-
hasProps(componentCode) {
|
|
518
|
-
return (componentCode.includes("props") ||
|
|
519
|
-
componentCode.includes("interface") ||
|
|
520
|
-
componentCode.includes("type Props"));
|
|
521
|
-
}
|
|
522
|
-
extractComponentName(componentCode) {
|
|
523
|
-
const match = componentCode.match(/export\s+default\s+function\s+(\w+)/);
|
|
524
|
-
return match ? match[1] : "UnknownComponent";
|
|
525
|
-
}
|
|
526
|
-
async generateSuggestions(componentCode, designTokens) {
|
|
527
|
-
const suggestions = {
|
|
528
|
-
accessibility: [],
|
|
529
|
-
performance: [],
|
|
530
|
-
design: [],
|
|
531
|
-
functionality: [],
|
|
532
|
-
};
|
|
533
|
-
// Analyze for accessibility improvements
|
|
534
|
-
if (!componentCode.includes("aria-label")) {
|
|
535
|
-
suggestions.accessibility.push("Add ARIA labels for better screen reader support");
|
|
536
|
-
}
|
|
537
|
-
if (!componentCode.includes("onKeyDown")) {
|
|
538
|
-
suggestions.accessibility.push("Add keyboard navigation support");
|
|
539
|
-
}
|
|
540
|
-
if (!componentCode.includes("focus")) {
|
|
541
|
-
suggestions.accessibility.push("Add focus management for better UX");
|
|
542
|
-
}
|
|
543
|
-
// Analyze for performance improvements
|
|
544
|
-
if (componentCode.includes("useState") &&
|
|
545
|
-
!componentCode.includes("useCallback")) {
|
|
546
|
-
suggestions.performance.push("Consider using useCallback for event handlers");
|
|
547
|
-
}
|
|
548
|
-
if (componentCode.includes("map") && !componentCode.includes("key=")) {
|
|
549
|
-
suggestions.performance.push("Add key prop to mapped elements");
|
|
550
|
-
}
|
|
551
|
-
// Analyze for design improvements
|
|
552
|
-
if (!componentCode.includes("transition")) {
|
|
553
|
-
suggestions.design.push("Add smooth transitions for better user experience");
|
|
554
|
-
}
|
|
555
|
-
if (!componentCode.includes("hover:")) {
|
|
556
|
-
suggestions.design.push("Add hover effects for interactive elements");
|
|
557
|
-
}
|
|
558
|
-
if (!componentCode.includes("responsive")) {
|
|
559
|
-
suggestions.design.push("Ensure responsive design for mobile devices");
|
|
560
|
-
}
|
|
561
|
-
// Analyze for functionality improvements
|
|
562
|
-
if (componentCode.includes("onClick") &&
|
|
563
|
-
!componentCode.includes("disabled")) {
|
|
564
|
-
suggestions.functionality.push("Add loading states for async operations");
|
|
565
|
-
}
|
|
566
|
-
if (!componentCode.includes("error")) {
|
|
567
|
-
suggestions.functionality.push("Add error handling for better reliability");
|
|
568
|
-
}
|
|
569
|
-
return suggestions;
|
|
570
|
-
}
|
|
571
|
-
diffComponents(originalComponent, enhancedComponent) {
|
|
572
|
-
const changes = {
|
|
573
|
-
addedLines: [],
|
|
574
|
-
removedLines: [],
|
|
575
|
-
modifiedLines: [],
|
|
576
|
-
totalChanges: 0,
|
|
577
|
-
};
|
|
578
|
-
const originalLines = originalComponent.split("\n");
|
|
579
|
-
const enhancedLines = enhancedComponent.split("\n");
|
|
580
|
-
// Simple line-by-line comparison
|
|
581
|
-
const maxLines = Math.max(originalLines.length, enhancedLines.length);
|
|
582
|
-
for (let i = 0; i < maxLines; i++) {
|
|
583
|
-
const originalLine = originalLines[i] || "";
|
|
584
|
-
const enhancedLine = enhancedLines[i] || "";
|
|
585
|
-
if (originalLine !== enhancedLine) {
|
|
586
|
-
if (!originalLine) {
|
|
587
|
-
changes.addedLines.push({ line: i + 1, content: enhancedLine });
|
|
588
|
-
}
|
|
589
|
-
else if (!enhancedLine) {
|
|
590
|
-
changes.removedLines.push({ line: i + 1, content: originalLine });
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
changes.modifiedLines.push({
|
|
594
|
-
line: i + 1,
|
|
595
|
-
original: originalLine,
|
|
596
|
-
enhanced: enhancedLine,
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
changes.totalChanges++;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
return changes;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
exports.EnhancementAgent = EnhancementAgent;
|
|
606
|
-
//# sourceMappingURL=EnhancementAgent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancementAgent.js","sourceRoot":"","sources":["../../../../../src/agents/implementations/EnhancementAgent.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAOH,8DAAsE;AACtE,qDAAkD;AAClD,2EAAwE;AACxE,uEAAoE;AAEpE,MAAa,gBAAgB;IAc3B;QAXA,SAAI,GAAG,kBAAkB,CAAC;QAC1B,gBAAW,GACT,6EAA6E,CAAC;QAU9E,MAAM,WAAW,GAAG,IAAA,oCAAsB,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5D,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;QAEvC,uBAAuB;QACvB,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,CAAC;YAC7B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE;YACrC,WAAW,EAAE,GAAG;YAChB,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS;SAC/C,CAAC,CAAC;QACH,IAAI,CAAC,cAAc,GAAG,IAAI,2CAAoB,EAAE,CAAC;QACjD,IAAI,CAAC,SAAS,GAAG,IAAI,uCAAkB,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,KAAuB;QAC/B,MAAM,EAAE,gBAAgB,EA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AC;CACF;AA9tBD,4CA8tBC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QASubAgent Implementation
|
|
3
|
-
*
|
|
4
|
-
* Specialized sub-agent for quality assurance and code validation.
|
|
5
|
-
* Uses Claude Sonnet for analytical capabilities.
|
|
6
|
-
*/
|
|
7
|
-
import { SubAgent, QAValidationInput, QAValidationOutput } from "../interfaces/SubAgent";
|
|
8
|
-
export declare class QASubAgent implements SubAgent<QAValidationInput, QAValidationOutput> {
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
personality: string;
|
|
12
|
-
llmProvider: string;
|
|
13
|
-
expertise: string[];
|
|
14
|
-
constructor();
|
|
15
|
-
run(input: QAValidationInput): Promise<QAValidationOutput>;
|
|
16
|
-
validate(input: QAValidationInput): Promise<boolean>;
|
|
17
|
-
getStatus(): Promise<{
|
|
18
|
-
name: string;
|
|
19
|
-
status: "idle" | "running" | "completed" | "error";
|
|
20
|
-
lastRun?: Date;
|
|
21
|
-
executionTime?: number;
|
|
22
|
-
errorCount: number;
|
|
23
|
-
successCount: number;
|
|
24
|
-
}>;
|
|
25
|
-
private checkTypeScriptCompliance;
|
|
26
|
-
private checkReactBestPractices;
|
|
27
|
-
private checkAccessibility;
|
|
28
|
-
private checkPerformance;
|
|
29
|
-
private checkSecurity;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=QASubAgent.d.ts.map
|