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.
Files changed (126) hide show
  1. package/README.md +51 -76
  2. package/dist/agents/implementations/CodeGenSubAgent.d.ts +48 -0
  3. package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -0
  4. package/dist/agents/implementations/CodeGenSubAgent.js +1356 -0
  5. package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -0
  6. package/dist/agents/implementations/DocsSubAgent.d.ts +35 -0
  7. package/dist/agents/implementations/DocsSubAgent.d.ts.map +1 -0
  8. package/dist/agents/implementations/DocsSubAgent.js +351 -0
  9. package/dist/agents/implementations/DocsSubAgent.js.map +1 -0
  10. package/dist/agents/implementations/EnhancementAgent.d.ts +119 -0
  11. package/dist/agents/implementations/EnhancementAgent.d.ts.map +1 -0
  12. package/dist/agents/implementations/EnhancementAgent.js +598 -0
  13. package/dist/agents/implementations/EnhancementAgent.js.map +1 -0
  14. package/dist/agents/implementations/QASubAgent.d.ts +31 -0
  15. package/dist/agents/implementations/QASubAgent.d.ts.map +1 -0
  16. package/dist/agents/implementations/QASubAgent.js +190 -0
  17. package/dist/agents/implementations/QASubAgent.js.map +1 -0
  18. package/dist/agents/interfaces/SubAgent.d.ts +287 -0
  19. package/dist/agents/interfaces/SubAgent.d.ts.map +1 -0
  20. package/dist/agents/interfaces/SubAgent.js +7 -0
  21. package/dist/agents/interfaces/SubAgent.js.map +1 -0
  22. package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts +59 -0
  23. package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts.map +1 -0
  24. package/dist/agents/orchestrator/SubAgentOrchestrator.js +305 -0
  25. package/dist/agents/orchestrator/SubAgentOrchestrator.js.map +1 -0
  26. package/dist/agents/personalities/definitions.d.ts +32 -0
  27. package/dist/agents/personalities/definitions.d.ts.map +1 -0
  28. package/dist/agents/personalities/definitions.js +359 -0
  29. package/dist/agents/personalities/definitions.js.map +1 -0
  30. package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
  31. package/dist/cli/src/agents/implementations/CodeGenSubAgent.js +12 -110
  32. package/dist/cli/src/agents/implementations/CodeGenSubAgent.js.map +1 -1
  33. package/dist/cli/src/cli.js +0 -0
  34. package/dist/cli/src/commands/generate-components.d.ts +0 -1
  35. package/dist/cli/src/commands/generate-components.d.ts.map +1 -1
  36. package/dist/cli/src/commands/generate-components.js +0 -1
  37. package/dist/cli/src/commands/generate-components.js.map +1 -1
  38. package/dist/cli/src/commands/generate.d.ts.map +1 -1
  39. package/dist/cli/src/commands/generate.js +8 -22
  40. package/dist/cli/src/commands/generate.js.map +1 -1
  41. package/dist/cli/src/config/dependencies.json +180 -0
  42. package/dist/cli.d.ts +3 -0
  43. package/dist/cli.d.ts.map +1 -0
  44. package/dist/cli.js +299 -0
  45. package/dist/cli.js.map +1 -0
  46. package/dist/commands/auth.d.ts +23 -0
  47. package/dist/commands/auth.d.ts.map +1 -0
  48. package/dist/commands/auth.js +212 -0
  49. package/dist/commands/auth.js.map +1 -0
  50. package/dist/commands/enhance.d.ts +25 -0
  51. package/dist/commands/enhance.d.ts.map +1 -0
  52. package/dist/commands/enhance.js +242 -0
  53. package/dist/commands/enhance.js.map +1 -0
  54. package/dist/commands/generate-components.d.ts +27 -0
  55. package/dist/commands/generate-components.d.ts.map +1 -0
  56. package/dist/commands/generate-components.js +680 -0
  57. package/dist/commands/generate-components.js.map +1 -0
  58. package/dist/commands/generate.d.ts +23 -0
  59. package/dist/commands/generate.d.ts.map +1 -0
  60. package/dist/commands/generate.js +222 -0
  61. package/dist/commands/generate.js.map +1 -0
  62. package/dist/commands/init.d.ts +13 -0
  63. package/dist/commands/init.d.ts.map +1 -0
  64. package/dist/commands/init.js +91 -0
  65. package/dist/commands/init.js.map +1 -0
  66. package/dist/commands/list.d.ts +17 -0
  67. package/dist/commands/list.d.ts.map +1 -0
  68. package/dist/commands/list.js +210 -0
  69. package/dist/commands/list.js.map +1 -0
  70. package/dist/commands/model.d.ts +25 -0
  71. package/dist/commands/model.d.ts.map +1 -0
  72. package/dist/commands/model.js +317 -0
  73. package/dist/commands/model.js.map +1 -0
  74. package/dist/commands/preview.d.ts +23 -0
  75. package/dist/commands/preview.d.ts.map +1 -0
  76. package/dist/commands/preview.js +1200 -0
  77. package/dist/commands/preview.js.map +1 -0
  78. package/dist/commands/setup.d.ts +35 -0
  79. package/dist/commands/setup.d.ts.map +1 -0
  80. package/dist/commands/setup.js +412 -0
  81. package/dist/commands/setup.js.map +1 -0
  82. package/dist/commands/status.d.ts +21 -0
  83. package/dist/commands/status.d.ts.map +1 -0
  84. package/dist/commands/status.js +287 -0
  85. package/dist/commands/status.js.map +1 -0
  86. package/dist/commands/validate.d.ts +22 -0
  87. package/dist/commands/validate.d.ts.map +1 -0
  88. package/dist/commands/validate.js +259 -0
  89. package/dist/commands/validate.js.map +1 -0
  90. package/dist/types/index.d.ts +154 -0
  91. package/dist/types/index.d.ts.map +1 -0
  92. package/dist/types/index.js +3 -0
  93. package/dist/types/index.js.map +1 -0
  94. package/dist/utils/apiKeyManager.d.ts +137 -0
  95. package/dist/utils/apiKeyManager.d.ts.map +1 -0
  96. package/dist/utils/apiKeyManager.js +471 -0
  97. package/dist/utils/apiKeyManager.js.map +1 -0
  98. package/dist/utils/componentValidator.d.ts +60 -0
  99. package/dist/utils/componentValidator.d.ts.map +1 -0
  100. package/dist/utils/componentValidator.js +191 -0
  101. package/dist/utils/componentValidator.js.map +1 -0
  102. package/dist/utils/designTokenExtractor.d.ts +94 -0
  103. package/dist/utils/designTokenExtractor.d.ts.map +1 -0
  104. package/dist/utils/designTokenExtractor.js +231 -0
  105. package/dist/utils/designTokenExtractor.js.map +1 -0
  106. package/dist/utils/errorHandler.d.ts +105 -0
  107. package/dist/utils/errorHandler.d.ts.map +1 -0
  108. package/dist/utils/errorHandler.js +332 -0
  109. package/dist/utils/errorHandler.js.map +1 -0
  110. package/dist/utils/fileSystem.d.ts +58 -0
  111. package/dist/utils/fileSystem.d.ts.map +1 -0
  112. package/dist/utils/fileSystem.js +230 -0
  113. package/dist/utils/fileSystem.js.map +1 -0
  114. package/dist/utils/githubModels.d.ts +53 -0
  115. package/dist/utils/githubModels.d.ts.map +1 -0
  116. package/dist/utils/githubModels.js +239 -0
  117. package/dist/utils/githubModels.js.map +1 -0
  118. package/dist/utils/ollamaClient.d.ts +37 -0
  119. package/dist/utils/ollamaClient.d.ts.map +1 -0
  120. package/dist/utils/ollamaClient.js +213 -0
  121. package/dist/utils/ollamaClient.js.map +1 -0
  122. package/dist/utils/spinner.d.ts +30 -0
  123. package/dist/utils/spinner.d.ts.map +1 -0
  124. package/dist/utils/spinner.js +119 -0
  125. package/dist/utils/spinner.js.map +1 -0
  126. 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
- **Options:**
181
+ ### Command Options
182
182
 
183
- - `--use-claude-code-sdk` - Use Claude Code SDK for generation
184
- - `--use-gemini` - Use Gemini for generation
185
- - `--use-xai` - Use XAI (Grok) for generation
186
- - `--temperature <number>` - Generation temperature (0-1)
187
- - `--max-tokens <number>` - Maximum tokens for generation
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 auth
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 specific options
201
- mycontext generate-components all --use-xai --temperature 0.7
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 single component
219
- mycontext enhance TodoApp.tsx --prompt "Make it more accessible"
223
+ # Enhance specific component
224
+ mycontext enhance Button.tsx --prompt "Add loading states"
220
225
 
221
- # Enhance component group
222
- mycontext enhance forms-input --prompt "Add better error handling"
226
+ # Enhance all components
227
+ mycontext enhance components --prompt "Improve accessibility"
223
228
 
224
- # Enhance with specific options
225
- mycontext enhance Button.tsx --prompt "Add loading states" --use-xai
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
- ### Enterprise-Grade API Key Management
304
+ ### Local AI Model Management
300
305
 
301
- MyContext CLI includes production-ready security features for managing AI provider API keys:
306
+ MyContext CLI includes production-ready security features for managing your local AI environment:
302
307
 
303
308
  ```bash
304
- # Interactive setup for all providers
305
- mycontext auth setup
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
- # Import keys from backup
320
- mycontext auth import --file backup.json --password "secure-password"
312
+ # Check model status
313
+ mycontext model status
321
314
 
322
- # Remove all API keys
323
- mycontext auth clear
315
+ # Test model generation
316
+ mycontext model test
324
317
 
325
- # Check authentication status
326
- mycontext auth:status
318
+ # Update specialized model
319
+ mycontext model update
327
320
 
328
- # Remove authentication
329
- mycontext auth:logout
321
+ # View model statistics
322
+ mycontext model stats
330
323
  ```
331
324
 
332
325
  **Security Features:**
333
326
 
334
- - **AES-256-CBC Encryption** with PBKDF2 key derivation
335
- - **Local Storage** in `~/.mycontext/api-keys.json`
336
- - **Environment Variable Integration** - Automatically detects `XAI_API_KEY`, `OPENAI_API_KEY`, etc.
337
- - **Password-Protected Backup/Restore**
338
- - **Key Validation** - Tests API keys with provider endpoints
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
- ### Supported AI Providers
333
+ ### Specialized MyContext Models
342
334
 
343
- | Provider | Key Format | Environment Variable |
344
- | -------------- | ---------- | -------------------- |
345
- | **XAI (Grok)** | `xai-*` | `XAI_API_KEY` |
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
- - **Multi-Provider AI Support** - Choose between XAI, OpenAI, Anthropic, or Google
483
- - **Local AI Models** - Ollama integration for cost-free generation
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
- # AI Provider API Keys (automatically detected)
544
- export XAI_API_KEY="your-xai-key"
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 TodoApp.tsx --prompt "Add loading states" --yes
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 real API keys
603
- mycontext auth setup
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"}