mycontext-cli 0.1.3 โ 0.2.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/README.md +51 -76
- package/dist/agents/implementations/CodeGenSubAgent.d.ts +48 -0
- package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -0
- package/dist/agents/implementations/CodeGenSubAgent.js +1356 -0
- package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -0
- package/dist/agents/implementations/DocsSubAgent.d.ts +35 -0
- package/dist/agents/implementations/DocsSubAgent.d.ts.map +1 -0
- package/dist/agents/implementations/DocsSubAgent.js +351 -0
- package/dist/agents/implementations/DocsSubAgent.js.map +1 -0
- package/dist/agents/implementations/EnhancementAgent.d.ts +119 -0
- package/dist/agents/implementations/EnhancementAgent.d.ts.map +1 -0
- package/dist/agents/implementations/EnhancementAgent.js +598 -0
- package/dist/agents/implementations/EnhancementAgent.js.map +1 -0
- package/dist/agents/implementations/QASubAgent.d.ts +31 -0
- package/dist/agents/implementations/QASubAgent.d.ts.map +1 -0
- package/dist/agents/implementations/QASubAgent.js +190 -0
- package/dist/agents/implementations/QASubAgent.js.map +1 -0
- package/dist/agents/interfaces/SubAgent.d.ts +287 -0
- package/dist/agents/interfaces/SubAgent.d.ts.map +1 -0
- package/dist/agents/interfaces/SubAgent.js +7 -0
- package/dist/agents/interfaces/SubAgent.js.map +1 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts +59 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts.map +1 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.js +305 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.js.map +1 -0
- package/dist/agents/personalities/definitions.d.ts +32 -0
- package/dist/agents/personalities/definitions.d.ts.map +1 -0
- package/dist/agents/personalities/definitions.js +359 -0
- package/dist/agents/personalities/definitions.js.map +1 -0
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js +12 -110
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js.map +1 -1
- package/dist/cli/src/cli.js +0 -0
- package/dist/cli/src/commands/generate-components.d.ts +0 -1
- package/dist/cli/src/commands/generate-components.d.ts.map +1 -1
- package/dist/cli/src/commands/generate-components.js +0 -1
- package/dist/cli/src/commands/generate-components.js.map +1 -1
- package/dist/cli/src/commands/generate.d.ts.map +1 -1
- package/dist/cli/src/commands/generate.js +8 -22
- package/dist/cli/src/commands/generate.js.map +1 -1
- package/dist/cli/src/config/dependencies.json +180 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +299 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.d.ts +23 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +212 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/enhance.d.ts +25 -0
- package/dist/commands/enhance.d.ts.map +1 -0
- package/dist/commands/enhance.js +242 -0
- package/dist/commands/enhance.js.map +1 -0
- package/dist/commands/generate-components.d.ts +27 -0
- package/dist/commands/generate-components.d.ts.map +1 -0
- package/dist/commands/generate-components.js +680 -0
- package/dist/commands/generate-components.js.map +1 -0
- package/dist/commands/generate.d.ts +23 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +222 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +91 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +17 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +210 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/model.d.ts +25 -0
- package/dist/commands/model.d.ts.map +1 -0
- package/dist/commands/model.js +317 -0
- package/dist/commands/model.js.map +1 -0
- package/dist/commands/preview.d.ts +23 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +1200 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/setup.d.ts +35 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +412 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +21 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +287 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/validate.d.ts +22 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +259 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/types/index.d.ts +154 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/apiKeyManager.d.ts +137 -0
- package/dist/utils/apiKeyManager.d.ts.map +1 -0
- package/dist/utils/apiKeyManager.js +471 -0
- package/dist/utils/apiKeyManager.js.map +1 -0
- package/dist/utils/componentValidator.d.ts +60 -0
- package/dist/utils/componentValidator.d.ts.map +1 -0
- package/dist/utils/componentValidator.js +191 -0
- package/dist/utils/componentValidator.js.map +1 -0
- package/dist/utils/designTokenExtractor.d.ts +94 -0
- package/dist/utils/designTokenExtractor.d.ts.map +1 -0
- package/dist/utils/designTokenExtractor.js +231 -0
- package/dist/utils/designTokenExtractor.js.map +1 -0
- package/dist/utils/errorHandler.d.ts +105 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +332 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/dist/utils/fileSystem.d.ts +58 -0
- package/dist/utils/fileSystem.d.ts.map +1 -0
- package/dist/utils/fileSystem.js +230 -0
- package/dist/utils/fileSystem.js.map +1 -0
- package/dist/utils/githubModels.d.ts +53 -0
- package/dist/utils/githubModels.d.ts.map +1 -0
- package/dist/utils/githubModels.js +239 -0
- package/dist/utils/githubModels.js.map +1 -0
- package/dist/utils/ollamaClient.d.ts +37 -0
- package/dist/utils/ollamaClient.d.ts.map +1 -0
- package/dist/utils/ollamaClient.js +213 -0
- package/dist/utils/ollamaClient.js.map +1 -0
- package/dist/utils/spinner.d.ts +30 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +119 -0
- package/dist/utils/spinner.js.map +1 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -178,13 +178,15 @@ mycontext generate app-structure
|
|
|
178
178
|
- `components` - Individual component generation
|
|
179
179
|
- `app-structure` - Application structure and routing
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
### Command Options
|
|
182
182
|
|
|
183
|
-
- `--
|
|
184
|
-
- `--
|
|
185
|
-
- `--
|
|
186
|
-
- `--temperature
|
|
187
|
-
- `--
|
|
183
|
+
- `--yes` - Skip all prompts and use defaults
|
|
184
|
+
- `--verbose` - Show detailed output
|
|
185
|
+
- `--debug` - Enable debug logging
|
|
186
|
+
- `--temperature` - Set AI generation temperature (0.1-1.0)
|
|
187
|
+
- `--group` - Specify component group for generation
|
|
188
|
+
- `--prompt` - Custom enhancement prompt
|
|
189
|
+
- `--output` - Output directory for generated files
|
|
188
190
|
|
|
189
191
|
### `mycontext generate-components <target>`
|
|
190
192
|
|
|
@@ -195,10 +197,13 @@ Generate React components using AI.
|
|
|
195
197
|
mycontext generate-components all
|
|
196
198
|
|
|
197
199
|
# Generate specific component group
|
|
198
|
-
mycontext generate-components
|
|
200
|
+
mycontext generate-components group --group "authentication"
|
|
201
|
+
|
|
202
|
+
# Generate single component
|
|
203
|
+
mycontext generate-components component --name "UserProfile" --description "User profile display component"
|
|
199
204
|
|
|
200
|
-
# Generate with
|
|
201
|
-
mycontext generate-components all --
|
|
205
|
+
# Generate with custom temperature
|
|
206
|
+
mycontext generate-components all --temperature 0.7
|
|
202
207
|
```
|
|
203
208
|
|
|
204
209
|
**Options:**
|
|
@@ -215,14 +220,14 @@ mycontext generate-components all --use-xai --temperature 0.7
|
|
|
215
220
|
Enhance existing React components with AI-powered improvements.
|
|
216
221
|
|
|
217
222
|
```bash
|
|
218
|
-
# Enhance
|
|
219
|
-
mycontext enhance
|
|
223
|
+
# Enhance specific component
|
|
224
|
+
mycontext enhance Button.tsx --prompt "Add loading states"
|
|
220
225
|
|
|
221
|
-
# Enhance
|
|
222
|
-
mycontext enhance
|
|
226
|
+
# Enhance all components
|
|
227
|
+
mycontext enhance components --prompt "Improve accessibility"
|
|
223
228
|
|
|
224
|
-
# Enhance with
|
|
225
|
-
mycontext enhance
|
|
229
|
+
# Enhance with custom temperature
|
|
230
|
+
mycontext enhance components --prompt "Add error handling" --temperature 0.8
|
|
226
231
|
```
|
|
227
232
|
|
|
228
233
|
**Options:**
|
|
@@ -296,56 +301,40 @@ mycontext auth --yes # Non-interactive mode
|
|
|
296
301
|
|
|
297
302
|
## ๐ Authentication & Security
|
|
298
303
|
|
|
299
|
-
###
|
|
304
|
+
### Local AI Model Management
|
|
300
305
|
|
|
301
|
-
MyContext CLI includes production-ready security features for managing
|
|
306
|
+
MyContext CLI includes production-ready security features for managing your local AI environment:
|
|
302
307
|
|
|
303
308
|
```bash
|
|
304
|
-
#
|
|
305
|
-
mycontext
|
|
306
|
-
|
|
307
|
-
# Set up specific providers
|
|
308
|
-
mycontext auth setup --provider xai
|
|
309
|
-
mycontext auth setup --provider openai
|
|
310
|
-
mycontext auth setup --provider anthropic
|
|
311
|
-
mycontext auth setup --provider google
|
|
312
|
-
|
|
313
|
-
# List configured API keys
|
|
314
|
-
mycontext auth list
|
|
315
|
-
|
|
316
|
-
# Export keys for backup (password-protected)
|
|
317
|
-
mycontext auth export --password "secure-password"
|
|
309
|
+
# Set up local AI environment
|
|
310
|
+
mycontext setup
|
|
318
311
|
|
|
319
|
-
#
|
|
320
|
-
mycontext
|
|
312
|
+
# Check model status
|
|
313
|
+
mycontext model status
|
|
321
314
|
|
|
322
|
-
#
|
|
323
|
-
mycontext
|
|
315
|
+
# Test model generation
|
|
316
|
+
mycontext model test
|
|
324
317
|
|
|
325
|
-
#
|
|
326
|
-
mycontext
|
|
318
|
+
# Update specialized model
|
|
319
|
+
mycontext model update
|
|
327
320
|
|
|
328
|
-
#
|
|
329
|
-
mycontext
|
|
321
|
+
# View model statistics
|
|
322
|
+
mycontext model stats
|
|
330
323
|
```
|
|
331
324
|
|
|
332
325
|
**Security Features:**
|
|
333
326
|
|
|
334
|
-
- **
|
|
335
|
-
- **
|
|
336
|
-
- **
|
|
337
|
-
- **
|
|
338
|
-
- **
|
|
339
|
-
- **Rate Limiting Information** - Tracks usage and limits per provider
|
|
327
|
+
- **Local AI Only** - Your code never leaves your machine
|
|
328
|
+
- **Specialized Models** - MyContext-optimized AI models for React/Shadcn
|
|
329
|
+
- **No API Keys Required** - Zero external dependencies
|
|
330
|
+
- **Complete Privacy** - All processing happens locally
|
|
331
|
+
- **Model Validation** - CLI validates model functionality and health
|
|
340
332
|
|
|
341
|
-
###
|
|
333
|
+
### Specialized MyContext Models
|
|
342
334
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
| **OpenAI** | `sk-*` | `OPENAI_API_KEY` |
|
|
347
|
-
| **Anthropic** | `sk-ant-*` | `ANTHROPIC_API_KEY` |
|
|
348
|
-
| **Google AI** | Various | `GOOGLE_AI_API_KEY` |
|
|
335
|
+
- **mycontext-react** - Specialized for React component generation
|
|
336
|
+
- **mycontext-architect** - Specialized for project architecture and context
|
|
337
|
+
- **Custom Models** - Create your own specialized models for specific use cases
|
|
349
338
|
|
|
350
339
|
## ๐ค Local AI Models
|
|
351
340
|
|
|
@@ -449,7 +438,6 @@ mycontext enhance components
|
|
|
449
438
|
### Enterprise-Grade Security & Authentication
|
|
450
439
|
|
|
451
440
|
- **Production-Ready API Key Management** - AES-256-CBC encryption with PBKDF2
|
|
452
|
-
- **Multi-Provider Support** - XAI, OpenAI, Anthropic, Google AI
|
|
453
441
|
- **Secure Local Storage** - Encrypted storage in `~/.mycontext/api-keys.json`
|
|
454
442
|
- **Password-Protected Backup/Restore** - Secure key export/import
|
|
455
443
|
- **Environment Variable Integration** - Seamless CI/CD integration
|
|
@@ -479,12 +467,13 @@ mycontext enhance components
|
|
|
479
467
|
### AI-Powered Generation
|
|
480
468
|
|
|
481
469
|
- **Production-Ready CLI** - Fully functional command-line interface
|
|
482
|
-
- **
|
|
483
|
-
- **Local AI
|
|
470
|
+
- **Specialized Local AI Models** - MyContext-optimized models for specific tasks
|
|
471
|
+
- **Local AI Generation** - Ollama integration for cost-free generation
|
|
484
472
|
- **Dynamic app analysis** - Automatically detects app type and generates appropriate components
|
|
485
473
|
- **Brand-compliant component generation** - Components follow your design system
|
|
486
474
|
- **Type-safe TypeScript interfaces** - Full type safety throughout
|
|
487
475
|
- **Robust Error Handling** - Comprehensive error management and recovery
|
|
476
|
+
- **Component Enhancement** - AI-powered refinement of existing components
|
|
488
477
|
|
|
489
478
|
### Dynamic Component Generation
|
|
490
479
|
|
|
@@ -540,17 +529,11 @@ mycontext generate components-list
|
|
|
540
529
|
### Environment Variables
|
|
541
530
|
|
|
542
531
|
```bash
|
|
543
|
-
#
|
|
544
|
-
export
|
|
545
|
-
export OPENAI_API_KEY="your-openai-key"
|
|
546
|
-
export ANTHROPIC_API_KEY="your-anthropic-key"
|
|
547
|
-
export GOOGLE_AI_API_KEY="your-google-key"
|
|
532
|
+
# Ollama configuration
|
|
533
|
+
export OLLAMA_BASE_URL="http://localhost:11434"
|
|
548
534
|
|
|
549
|
-
# Optional: Custom API endpoint
|
|
535
|
+
# Optional: Custom MyContext API endpoint (for enterprise features)
|
|
550
536
|
export MYCONTEXT_API_ENDPOINT="https://custom-endpoint.com"
|
|
551
|
-
|
|
552
|
-
# Optional: Ollama configuration
|
|
553
|
-
export OLLAMA_BASE_URL="http://localhost:11434"
|
|
554
537
|
```
|
|
555
538
|
|
|
556
539
|
## ๐งช Testing
|
|
@@ -561,10 +544,6 @@ mycontext setup --yes
|
|
|
561
544
|
mycontext model status
|
|
562
545
|
mycontext model test
|
|
563
546
|
|
|
564
|
-
# Test API key setup
|
|
565
|
-
mycontext auth setup --provider xai --key "test-key"
|
|
566
|
-
mycontext auth list
|
|
567
|
-
|
|
568
547
|
# Test project initialization
|
|
569
548
|
mycontext init test-app --description "Test application" --yes
|
|
570
549
|
|
|
@@ -578,19 +557,15 @@ mycontext validate prd --yes
|
|
|
578
557
|
# Test component list generation
|
|
579
558
|
mycontext generate components-list --yes
|
|
580
559
|
|
|
581
|
-
# Test component generation
|
|
560
|
+
# Test component generation (requires Ollama)
|
|
582
561
|
mycontext generate-components all --yes
|
|
583
562
|
|
|
584
563
|
# Test component enhancement
|
|
585
|
-
mycontext enhance
|
|
564
|
+
mycontext enhance components --prompt "Add loading states" --yes
|
|
586
565
|
|
|
587
566
|
# Test status checking
|
|
588
567
|
mycontext status --detailed --yes
|
|
589
568
|
|
|
590
|
-
# Test authentication commands
|
|
591
|
-
mycontext auth:status
|
|
592
|
-
mycontext auth clear
|
|
593
|
-
|
|
594
569
|
# Clean up
|
|
595
570
|
cd ..
|
|
596
571
|
rm -rf test-app
|
|
@@ -599,8 +574,8 @@ rm -rf test-app
|
|
|
599
574
|
### Production Testing
|
|
600
575
|
|
|
601
576
|
```bash
|
|
602
|
-
# Test with
|
|
603
|
-
mycontext
|
|
577
|
+
# Test with Ollama installed
|
|
578
|
+
mycontext setup
|
|
604
579
|
mycontext init production-test --description "Production testing app"
|
|
605
580
|
cd production-test
|
|
606
581
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeGenSubAgent Implementation
|
|
3
|
+
*
|
|
4
|
+
* Specialized sub-agent for generating production-ready React components and TypeScript code.
|
|
5
|
+
* Uses Claude Code for optimal code generation capabilities.
|
|
6
|
+
* Enhanced with shadcn/ui primitives and modern React patterns for Next.js 14+.
|
|
7
|
+
*/
|
|
8
|
+
import { SubAgent, ComponentGenerationInput, ComponentGenerationOutput } from "../interfaces/SubAgent";
|
|
9
|
+
export declare class CodeGenSubAgent implements SubAgent<ComponentGenerationInput, ComponentGenerationOutput> {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
personality: string;
|
|
13
|
+
traits: string[];
|
|
14
|
+
llmProvider: string;
|
|
15
|
+
expertise: string[];
|
|
16
|
+
modelName: string;
|
|
17
|
+
temperature: number;
|
|
18
|
+
maxTokens: number;
|
|
19
|
+
systemPrompt: string;
|
|
20
|
+
constructor();
|
|
21
|
+
run(input: ComponentGenerationInput): Promise<ComponentGenerationOutput>;
|
|
22
|
+
validate(input: ComponentGenerationInput): Promise<boolean>;
|
|
23
|
+
getStatus(): Promise<{
|
|
24
|
+
name: string;
|
|
25
|
+
status: "idle" | "running" | "completed" | "error";
|
|
26
|
+
lastRun?: Date;
|
|
27
|
+
executionTime?: number;
|
|
28
|
+
errorCount: number;
|
|
29
|
+
successCount: number;
|
|
30
|
+
}>;
|
|
31
|
+
private generateProductionReadyComponent;
|
|
32
|
+
private getReactImportsForType;
|
|
33
|
+
private getShadcnImportsForType;
|
|
34
|
+
private getCustomImportsForType;
|
|
35
|
+
private generateTypeDefinitions;
|
|
36
|
+
private generateDetailedPropsForType;
|
|
37
|
+
private generateExampleProps;
|
|
38
|
+
private generateEnhancedPropsDestructuring;
|
|
39
|
+
private generateProductionComponentLogic;
|
|
40
|
+
private generateAccessibleComponentJSX;
|
|
41
|
+
private generateProductionActionFunctions;
|
|
42
|
+
private extractDependencies;
|
|
43
|
+
private extractShadcnComponents;
|
|
44
|
+
private calculateQualityScore;
|
|
45
|
+
private generateComponentName;
|
|
46
|
+
private generateWithOllama;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=CodeGenSubAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeGenSubAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/implementations/CodeGenSubAgent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAuChC,qBAAa,eACX,YAAW,QAAQ,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;IAExE,IAAI,SAAqB;IACzB,WAAW,SACkG;IAC7G,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;;IAkBf,GAAG,CACP,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAuC/B,QAAQ,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB3D,SAAS,IAAI,OAAO,CAAC;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;QACnD,OAAO,CAAC,EAAE,IAAI,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;YASY,gCAAgC;IAS9C,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,uBAAuB;IAoI/B,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,uBAAuB;IA2E/B,OAAO,CAAC,4BAA4B;IAmIpC,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,kCAAkC;IA4E1C,OAAO,CAAC,gCAAgC;IAwIxC,OAAO,CAAC,8BAA8B;IAyetC,OAAO,CAAC,iCAAiC;IA0HzC,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,qBAAqB;YASf,kBAAkB;CA0CjC"}
|