mycontext-cli 2.0.27 → 2.0.29

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 (173) hide show
  1. package/README.md +71 -342
  2. package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
  3. package/dist/agents/implementations/CodeGenSubAgent.js +67 -14
  4. package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -1
  5. package/dist/agents/implementations/DesignPipelineAgent.d.ts +80 -0
  6. package/dist/agents/implementations/DesignPipelineAgent.d.ts.map +1 -0
  7. package/dist/agents/implementations/DesignPipelineAgent.js +1406 -0
  8. package/dist/agents/implementations/DesignPipelineAgent.js.map +1 -0
  9. package/dist/agents/implementations/FeatureAssemblyAgent.d.ts +67 -0
  10. package/dist/agents/implementations/FeatureAssemblyAgent.d.ts.map +1 -0
  11. package/dist/agents/implementations/FeatureAssemblyAgent.js +564 -0
  12. package/dist/agents/implementations/FeatureAssemblyAgent.js.map +1 -0
  13. package/dist/agents/implementations/PromptConstructorAgent.d.ts +10 -0
  14. package/dist/agents/implementations/PromptConstructorAgent.d.ts.map +1 -1
  15. package/dist/agents/implementations/PromptConstructorAgent.js +172 -12
  16. package/dist/agents/implementations/PromptConstructorAgent.js.map +1 -1
  17. package/dist/agents/implementations/RoleBasedGenerator.d.ts +52 -0
  18. package/dist/agents/implementations/RoleBasedGenerator.d.ts.map +1 -0
  19. package/dist/agents/implementations/RoleBasedGenerator.js +370 -0
  20. package/dist/agents/implementations/RoleBasedGenerator.js.map +1 -0
  21. package/dist/cli.js +111 -56
  22. package/dist/cli.js.map +1 -1
  23. package/dist/clients/ClaudeSDKClient.d.ts +48 -0
  24. package/dist/clients/ClaudeSDKClient.d.ts.map +1 -0
  25. package/dist/clients/ClaudeSDKClient.js +158 -0
  26. package/dist/clients/ClaudeSDKClient.js.map +1 -0
  27. package/dist/clients/MyContextAIClient.d.ts +73 -0
  28. package/dist/clients/MyContextAIClient.d.ts.map +1 -0
  29. package/dist/clients/MyContextAIClient.js +280 -0
  30. package/dist/clients/MyContextAIClient.js.map +1 -0
  31. package/dist/clients/ProviderChain.d.ts +87 -0
  32. package/dist/clients/ProviderChain.d.ts.map +1 -0
  33. package/dist/clients/ProviderChain.js +246 -0
  34. package/dist/clients/ProviderChain.js.map +1 -0
  35. package/dist/clients/XAIClient.d.ts +48 -0
  36. package/dist/clients/XAIClient.d.ts.map +1 -0
  37. package/dist/clients/XAIClient.js +152 -0
  38. package/dist/clients/XAIClient.js.map +1 -0
  39. package/dist/commands/assemble-features.d.ts +40 -0
  40. package/dist/commands/assemble-features.d.ts.map +1 -0
  41. package/dist/commands/assemble-features.js +383 -0
  42. package/dist/commands/assemble-features.js.map +1 -0
  43. package/dist/commands/clone-starter.d.ts +32 -0
  44. package/dist/commands/clone-starter.d.ts.map +1 -0
  45. package/dist/commands/clone-starter.js +218 -0
  46. package/dist/commands/clone-starter.js.map +1 -0
  47. package/dist/commands/design-analyze.d.ts +46 -0
  48. package/dist/commands/design-analyze.d.ts.map +1 -0
  49. package/dist/commands/design-analyze.js +232 -0
  50. package/dist/commands/design-analyze.js.map +1 -0
  51. package/dist/commands/generate-components.d.ts +11 -0
  52. package/dist/commands/generate-components.d.ts.map +1 -1
  53. package/dist/commands/generate-components.js +342 -12
  54. package/dist/commands/generate-components.js.map +1 -1
  55. package/dist/commands/generate-context-files.d.ts +9 -0
  56. package/dist/commands/generate-context-files.d.ts.map +1 -1
  57. package/dist/commands/generate-context-files.js +57 -0
  58. package/dist/commands/generate-context-files.js.map +1 -1
  59. package/dist/commands/generate.d.ts +5 -0
  60. package/dist/commands/generate.d.ts.map +1 -1
  61. package/dist/commands/generate.js +109 -2
  62. package/dist/commands/generate.js.map +1 -1
  63. package/dist/commands/init.d.ts +1 -0
  64. package/dist/commands/init.d.ts.map +1 -1
  65. package/dist/commands/init.js +32 -10
  66. package/dist/commands/init.js.map +1 -1
  67. package/dist/commands/preview-components.d.ts +12 -0
  68. package/dist/commands/preview-components.d.ts.map +1 -0
  69. package/dist/commands/preview-components.js +122 -0
  70. package/dist/commands/preview-components.js.map +1 -0
  71. package/dist/commands/refine-component.d.ts +43 -0
  72. package/dist/commands/refine-component.d.ts.map +1 -0
  73. package/dist/commands/refine-component.js +313 -0
  74. package/dist/commands/refine-component.js.map +1 -0
  75. package/dist/commands/review-context.d.ts +47 -0
  76. package/dist/commands/review-context.d.ts.map +1 -0
  77. package/dist/commands/review-context.js +335 -0
  78. package/dist/commands/review-context.js.map +1 -0
  79. package/dist/commands/setup-complete.d.ts.map +1 -1
  80. package/dist/commands/setup-complete.js +38 -2
  81. package/dist/commands/setup-complete.js.map +1 -1
  82. package/dist/commands/workflow.d.ts.map +1 -1
  83. package/dist/commands/workflow.js +86 -7
  84. package/dist/commands/workflow.js.map +1 -1
  85. package/dist/config/intent-dictionary.json +3700 -0
  86. package/dist/package.json +12 -1
  87. package/dist/services/ContextValidator.d.ts +99 -0
  88. package/dist/services/ContextValidator.d.ts.map +1 -0
  89. package/dist/services/ContextValidator.js +433 -0
  90. package/dist/services/ContextValidator.js.map +1 -0
  91. package/dist/services/IntentEnricher.d.ts +61 -0
  92. package/dist/services/IntentEnricher.d.ts.map +1 -0
  93. package/dist/services/IntentEnricher.js +318 -0
  94. package/dist/services/IntentEnricher.js.map +1 -0
  95. package/dist/services/IntentValidator.d.ts +114 -0
  96. package/dist/services/IntentValidator.d.ts.map +1 -0
  97. package/dist/services/IntentValidator.js +680 -0
  98. package/dist/services/IntentValidator.js.map +1 -0
  99. package/dist/services/MutationLogger.d.ts +54 -0
  100. package/dist/services/MutationLogger.d.ts.map +1 -0
  101. package/dist/services/MutationLogger.js +164 -0
  102. package/dist/services/MutationLogger.js.map +1 -0
  103. package/dist/services/RegressionRunner.d.ts +49 -0
  104. package/dist/services/RegressionRunner.d.ts.map +1 -0
  105. package/dist/services/RegressionRunner.js +285 -0
  106. package/dist/services/RegressionRunner.js.map +1 -0
  107. package/dist/services/TriggerLogger.d.ts +101 -0
  108. package/dist/services/TriggerLogger.d.ts.map +1 -0
  109. package/dist/services/TriggerLogger.js +263 -0
  110. package/dist/services/TriggerLogger.js.map +1 -0
  111. package/dist/types/design-pipeline.d.ts +300 -0
  112. package/dist/types/design-pipeline.d.ts.map +1 -0
  113. package/dist/types/design-pipeline.js +9 -0
  114. package/dist/types/design-pipeline.js.map +1 -0
  115. package/dist/types/feature-bundle.d.ts +239 -0
  116. package/dist/types/feature-bundle.d.ts.map +1 -0
  117. package/dist/types/feature-bundle.js +9 -0
  118. package/dist/types/feature-bundle.js.map +1 -0
  119. package/dist/types/index.d.ts +2 -0
  120. package/dist/types/index.d.ts.map +1 -1
  121. package/dist/types/index.js +2 -0
  122. package/dist/types/index.js.map +1 -1
  123. package/dist/types/intent-dictionary.d.ts +525 -0
  124. package/dist/types/intent-dictionary.d.ts.map +1 -0
  125. package/dist/types/intent-dictionary.js +11 -0
  126. package/dist/types/intent-dictionary.js.map +1 -0
  127. package/dist/types/role-permissions.d.ts +167 -0
  128. package/dist/types/role-permissions.d.ts.map +1 -0
  129. package/dist/types/role-permissions.js +9 -0
  130. package/dist/types/role-permissions.js.map +1 -0
  131. package/dist/utils/contextEnricher.d.ts +41 -0
  132. package/dist/utils/contextEnricher.d.ts.map +1 -0
  133. package/dist/utils/contextEnricher.js +327 -0
  134. package/dist/utils/contextEnricher.js.map +1 -0
  135. package/dist/utils/designFallbacks.d.ts +48 -0
  136. package/dist/utils/designFallbacks.d.ts.map +1 -0
  137. package/dist/utils/designFallbacks.js +885 -0
  138. package/dist/utils/designFallbacks.js.map +1 -0
  139. package/dist/utils/designManifestManager.d.ts +89 -0
  140. package/dist/utils/designManifestManager.d.ts.map +1 -0
  141. package/dist/utils/designManifestManager.js +533 -0
  142. package/dist/utils/designManifestManager.js.map +1 -0
  143. package/dist/utils/designPipelineStateManager.d.ts +63 -0
  144. package/dist/utils/designPipelineStateManager.d.ts.map +1 -0
  145. package/dist/utils/designPipelineStateManager.js +174 -0
  146. package/dist/utils/designPipelineStateManager.js.map +1 -0
  147. package/dist/utils/envExampleGenerator.d.ts.map +1 -1
  148. package/dist/utils/envExampleGenerator.js +41 -171
  149. package/dist/utils/envExampleGenerator.js.map +1 -1
  150. package/dist/utils/featureBundleManager.d.ts +90 -0
  151. package/dist/utils/featureBundleManager.d.ts.map +1 -0
  152. package/dist/utils/featureBundleManager.js +340 -0
  153. package/dist/utils/featureBundleManager.js.map +1 -0
  154. package/dist/utils/githubCloner.d.ts +93 -0
  155. package/dist/utils/githubCloner.d.ts.map +1 -0
  156. package/dist/utils/githubCloner.js +305 -0
  157. package/dist/utils/githubCloner.js.map +1 -0
  158. package/dist/utils/hybridAIClient.d.ts.map +1 -1
  159. package/dist/utils/hybridAIClient.js +21 -0
  160. package/dist/utils/hybridAIClient.js.map +1 -1
  161. package/dist/utils/openRouterClient.d.ts +10 -0
  162. package/dist/utils/openRouterClient.d.ts.map +1 -0
  163. package/dist/utils/openRouterClient.js +61 -0
  164. package/dist/utils/openRouterClient.js.map +1 -0
  165. package/dist/utils/rolePermissionMapper.d.ts +89 -0
  166. package/dist/utils/rolePermissionMapper.d.ts.map +1 -0
  167. package/dist/utils/rolePermissionMapper.js +337 -0
  168. package/dist/utils/rolePermissionMapper.js.map +1 -0
  169. package/dist/utils/unifiedDesignContextLoader.d.ts +76 -0
  170. package/dist/utils/unifiedDesignContextLoader.d.ts.map +1 -0
  171. package/dist/utils/unifiedDesignContextLoader.js +344 -0
  172. package/dist/utils/unifiedDesignContextLoader.js.map +1 -0
  173. package/package.json +12 -1
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mycontext-cli",
3
- "version": "2.0.27",
3
+ "version": "2.0.29",
4
4
  "description": "Component-first visual builder with zero-error guarantees. Generate and validate React/Next.js components one at a time, preview them visually, then scale to complete applications using Claude Agent SDK.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -49,18 +49,28 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@anthropic-ai/claude-agent-sdk": "^0.1.1",
52
+ "@huggingface/inference": "^4.11.1",
53
+ "@types/figlet": "^1.7.0",
52
54
  "axios": "^1.6.0",
53
55
  "chalk": "^5.3.0",
54
56
  "commander": "^11.1.0",
57
+ "diff": "^8.0.2",
55
58
  "dotenv": "^17.2.3",
56
59
  "dotenv-expand": "^12.0.3",
60
+ "figlet": "^1.9.3",
57
61
  "fs-extra": "^11.1.1",
62
+ "fuse.js": "^7.1.0",
58
63
  "glob": "^10.3.10",
64
+ "gradient-string": "^3.0.0",
59
65
  "inquirer": "^9.2.12",
66
+ "mdast-util-to-markdown": "^2.1.2",
60
67
  "node-fetch": "^2.7.0",
68
+ "openai": "^6.2.0",
61
69
  "ora": "^7.0.1",
62
70
  "prompts": "^2.4.2",
71
+ "remark-parse": "^11.0.0",
63
72
  "sonner": "^2.0.7",
73
+ "unified": "^11.0.5",
64
74
  "uuid": "^9.0.1",
65
75
  "zod": "^3.25.76"
66
76
  },
@@ -77,6 +87,7 @@
77
87
  "ts-jest": "^29.4.0",
78
88
  "ts-node": "^10.9.0",
79
89
  "tsc-alias": "^1.8.16",
90
+ "tsx": "^4.20.6",
80
91
  "typescript": "^5.0.0"
81
92
  },
82
93
  "engines": {
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Context Validator Service
3
+ *
4
+ * Detects gaps in context files and tracks auto-generated features
5
+ * to ensure user approval before proceeding with generation.
6
+ */
7
+ export interface ContextGap {
8
+ id: string;
9
+ category: "critical" | "important" | "optional";
10
+ question: string;
11
+ context: string;
12
+ suggestedAnswers?: string[];
13
+ reasoning: string;
14
+ userAnswer?: string;
15
+ }
16
+ export interface AutoGeneratedFeature {
17
+ id: string;
18
+ feature: string;
19
+ reasoning: string;
20
+ confidence: "high" | "medium" | "low";
21
+ contextSource: string;
22
+ approved?: boolean | null;
23
+ modified?: boolean;
24
+ }
25
+ export interface ContextValidationResult {
26
+ gaps: ContextGap[];
27
+ autoGeneratedFeatures: AutoGeneratedFeature[];
28
+ hasCriticalGaps: boolean;
29
+ canProceed: boolean;
30
+ }
31
+ export declare class ContextValidator {
32
+ private gaps;
33
+ private autoGeneratedFeatures;
34
+ /**
35
+ * Validate context files for completeness and detect gaps
36
+ */
37
+ validateContext(contextFiles: {
38
+ prd?: string;
39
+ brand?: string;
40
+ techStack?: string;
41
+ description?: string;
42
+ }): Promise<ContextValidationResult>;
43
+ /**
44
+ * Deduplicate gaps by ID
45
+ */
46
+ private deduplicateGaps;
47
+ /**
48
+ * Deduplicate features by ID
49
+ */
50
+ private deduplicateFeatures;
51
+ /**
52
+ * Analyze PRD for missing critical information
53
+ */
54
+ private analyzePRDGaps;
55
+ /**
56
+ * Analyze initial description for gaps
57
+ */
58
+ private analyzeDescriptionGaps;
59
+ /**
60
+ * Analyze tech stack for gaps
61
+ */
62
+ private analyzeTechStackGaps;
63
+ /**
64
+ * Check for game-specific gaps
65
+ */
66
+ private checkGameGaps;
67
+ /**
68
+ * Helper methods for text analysis
69
+ */
70
+ private containsGameKeywords;
71
+ private mentionsUsers;
72
+ private mentionsAuth;
73
+ private mentionsDataPersistence;
74
+ private mentionsDatabase;
75
+ private mentionsPayments;
76
+ private isVagueGameDescription;
77
+ private isVagueAppDescription;
78
+ private mentionsTargetAudience;
79
+ private mentionsMultiplayer;
80
+ private mentionsDeployment;
81
+ private mentionsEnvironmentConfig;
82
+ /**
83
+ * Get gaps by category
84
+ */
85
+ getGapsByCategory(category: "critical" | "important" | "optional"): ContextGap[];
86
+ /**
87
+ * Get auto-generated features by confidence
88
+ */
89
+ getFeaturesByConfidence(confidence: "high" | "medium" | "low"): AutoGeneratedFeature[];
90
+ /**
91
+ * Add auto-generated feature
92
+ */
93
+ addAutoGeneratedFeature(feature: Omit<AutoGeneratedFeature, "id">): void;
94
+ /**
95
+ * Generate unique ID for feature
96
+ */
97
+ private generateFeatureId;
98
+ }
99
+ //# sourceMappingURL=ContextValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextValidator.d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O,CAAC,cAAc;IAiEtB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkD9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAmC5B;;OAEG;IACH,OAAO,CAAC,aAAa;IAuCrB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,yBAAyB;IAYjC;;OAEG;IACH,iBAAiB,CACf,QAAQ,EAAE,UAAU,GAAG,WAAW,GAAG,UAAU,GAC9C,UAAU,EAAE;IAIf;;OAEG;IACH,uBAAuB,CACrB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,GACpC,oBAAoB,EAAE;IAMzB;;OAEG;IACH,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,GAAG,IAAI;IAQxE;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAO1B"}
@@ -0,0 +1,433 @@
1
+ "use strict";
2
+ /**
3
+ * Context Validator Service
4
+ *
5
+ * Detects gaps in context files and tracks auto-generated features
6
+ * to ensure user approval before proceeding with generation.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ContextValidator = void 0;
10
+ class ContextValidator {
11
+ constructor() {
12
+ this.gaps = [];
13
+ this.autoGeneratedFeatures = [];
14
+ }
15
+ /**
16
+ * Validate context files for completeness and detect gaps
17
+ */
18
+ async validateContext(contextFiles) {
19
+ this.gaps = [];
20
+ this.autoGeneratedFeatures = [];
21
+ // Analyze PRD for gaps
22
+ if (contextFiles.prd) {
23
+ this.analyzePRDGaps(contextFiles.prd);
24
+ }
25
+ // Analyze description for gaps
26
+ if (contextFiles.description) {
27
+ this.analyzeDescriptionGaps(contextFiles.description);
28
+ }
29
+ // Analyze tech stack for gaps
30
+ if (contextFiles.techStack) {
31
+ this.analyzeTechStackGaps(contextFiles.techStack);
32
+ }
33
+ // Deduplicate gaps by ID
34
+ this.gaps = this.deduplicateGaps(this.gaps);
35
+ // Deduplicate features by ID
36
+ this.autoGeneratedFeatures = this.deduplicateFeatures(this.autoGeneratedFeatures);
37
+ const hasCriticalGaps = this.gaps.some((gap) => gap.category === "critical");
38
+ const canProceed = !hasCriticalGaps;
39
+ return {
40
+ gaps: this.gaps,
41
+ autoGeneratedFeatures: this.autoGeneratedFeatures,
42
+ hasCriticalGaps,
43
+ canProceed,
44
+ };
45
+ }
46
+ /**
47
+ * Deduplicate gaps by ID
48
+ */
49
+ deduplicateGaps(gaps) {
50
+ const seen = new Set();
51
+ return gaps.filter((gap) => {
52
+ if (seen.has(gap.id))
53
+ return false;
54
+ seen.add(gap.id);
55
+ return true;
56
+ });
57
+ }
58
+ /**
59
+ * Deduplicate features by ID
60
+ */
61
+ deduplicateFeatures(features) {
62
+ const seen = new Set();
63
+ return features.filter((feature) => {
64
+ if (seen.has(feature.id))
65
+ return false;
66
+ seen.add(feature.id);
67
+ return true;
68
+ });
69
+ }
70
+ /**
71
+ * Analyze PRD for missing critical information
72
+ */
73
+ analyzePRDGaps(prd) {
74
+ const prdLower = prd.toLowerCase();
75
+ // Check for game-related gaps
76
+ if (this.containsGameKeywords(prdLower)) {
77
+ this.checkGameGaps(prdLower, "prd");
78
+ }
79
+ // Check for user authentication gaps
80
+ if (this.mentionsUsers(prdLower) && !this.mentionsAuth(prdLower)) {
81
+ this.gaps.push({
82
+ id: "auth-method",
83
+ category: "critical",
84
+ question: "How should users authenticate?",
85
+ context: "prd",
86
+ suggestedAnswers: [
87
+ "Email/password",
88
+ "Social login (Google, GitHub)",
89
+ "Magic link",
90
+ "No authentication needed",
91
+ ],
92
+ reasoning: "PRD mentions users but no authentication method specified",
93
+ });
94
+ }
95
+ // Check for database gaps
96
+ if (this.mentionsDataPersistence(prdLower) &&
97
+ !this.mentionsDatabase(prdLower)) {
98
+ this.gaps.push({
99
+ id: "database-choice",
100
+ category: "critical",
101
+ question: "What database should be used?",
102
+ context: "prd",
103
+ suggestedAnswers: [
104
+ "InstantDB (recommended)",
105
+ "PostgreSQL",
106
+ "MongoDB",
107
+ "SQLite",
108
+ "No database needed",
109
+ ],
110
+ reasoning: "PRD mentions data persistence but no database specified",
111
+ });
112
+ }
113
+ // Check for payment gaps
114
+ if (this.mentionsPayments(prdLower)) {
115
+ this.gaps.push({
116
+ id: "payment-method",
117
+ category: "critical",
118
+ question: "What payment method should be integrated?",
119
+ context: "prd",
120
+ suggestedAnswers: [
121
+ "Stripe",
122
+ "PayPal",
123
+ "Apple Pay",
124
+ "Google Pay",
125
+ "Other",
126
+ ],
127
+ reasoning: "PRD mentions payments but no payment method specified",
128
+ });
129
+ }
130
+ }
131
+ /**
132
+ * Analyze initial description for gaps
133
+ */
134
+ analyzeDescriptionGaps(description) {
135
+ const descLower = description.toLowerCase();
136
+ // Check for vague game descriptions
137
+ if (this.isVagueGameDescription(descLower)) {
138
+ this.checkGameGaps(descLower, "description");
139
+ }
140
+ // Check for vague app descriptions
141
+ if (this.isVagueAppDescription(descLower)) {
142
+ this.gaps.push({
143
+ id: "app-purpose",
144
+ category: "critical",
145
+ question: "What is the main purpose of this app?",
146
+ context: "description",
147
+ suggestedAnswers: [
148
+ "Productivity tool",
149
+ "Social platform",
150
+ "E-commerce store",
151
+ "Educational platform",
152
+ "Entertainment app",
153
+ "Other",
154
+ ],
155
+ reasoning: "Description is too vague to determine app purpose",
156
+ });
157
+ }
158
+ // Check for missing target audience
159
+ if (this.mentionsUsers(descLower) &&
160
+ !this.mentionsTargetAudience(descLower)) {
161
+ this.gaps.push({
162
+ id: "target-audience",
163
+ category: "important",
164
+ question: "Who is the target audience?",
165
+ context: "description",
166
+ suggestedAnswers: [
167
+ "General public",
168
+ "Business professionals",
169
+ "Students",
170
+ "Developers",
171
+ "Specific industry",
172
+ "Other",
173
+ ],
174
+ reasoning: "App mentions users but target audience is unclear",
175
+ });
176
+ }
177
+ }
178
+ /**
179
+ * Analyze tech stack for gaps
180
+ */
181
+ analyzeTechStackGaps(techStack) {
182
+ const techLower = techStack.toLowerCase();
183
+ // Check for missing deployment strategy
184
+ if (!this.mentionsDeployment(techLower)) {
185
+ this.gaps.push({
186
+ id: "deployment-strategy",
187
+ category: "important",
188
+ question: "How should the app be deployed?",
189
+ context: "tech-stack",
190
+ suggestedAnswers: [
191
+ "Vercel (recommended for Next.js)",
192
+ "Netlify",
193
+ "AWS",
194
+ "Railway",
195
+ "Self-hosted",
196
+ "Other",
197
+ ],
198
+ reasoning: "Tech stack specified but no deployment strategy mentioned",
199
+ });
200
+ }
201
+ // Check for missing environment configuration
202
+ if (!this.mentionsEnvironmentConfig(techLower)) {
203
+ this.gaps.push({
204
+ id: "environment-config",
205
+ category: "optional",
206
+ question: "What environment variables are needed?",
207
+ context: "tech-stack",
208
+ reasoning: "Consider adding environment configuration for API keys and secrets",
209
+ });
210
+ }
211
+ }
212
+ /**
213
+ * Check for game-specific gaps
214
+ */
215
+ checkGameGaps(text, context) {
216
+ // Game type gap
217
+ this.gaps.push({
218
+ id: "game-type",
219
+ category: "critical",
220
+ question: "What type of game is this?",
221
+ context: context,
222
+ suggestedAnswers: [
223
+ "Turn-based (Tic-tac-toe, Chess)",
224
+ "Real-time (Racing, Shooting)",
225
+ "Puzzle (Matching, Strategy)",
226
+ "Card game",
227
+ "Board game",
228
+ "Other",
229
+ ],
230
+ reasoning: "Game mentioned but type not specified",
231
+ });
232
+ // Game rules gap
233
+ this.gaps.push({
234
+ id: "game-rules",
235
+ category: "critical",
236
+ question: "What are the core game rules?",
237
+ context: context,
238
+ reasoning: "Game rules need to be defined for proper implementation",
239
+ });
240
+ // Multiplayer gap
241
+ if (this.mentionsMultiplayer(text)) {
242
+ this.autoGeneratedFeatures.push({
243
+ id: "realtime-multiplayer",
244
+ feature: "Real-time multiplayer with Socket.io",
245
+ reasoning: "User mentioned playing against each other",
246
+ confidence: "medium",
247
+ contextSource: "description",
248
+ });
249
+ }
250
+ }
251
+ /**
252
+ * Helper methods for text analysis
253
+ */
254
+ containsGameKeywords(text) {
255
+ const gameKeywords = [
256
+ "game",
257
+ "play",
258
+ "player",
259
+ "score",
260
+ "win",
261
+ "lose",
262
+ "match",
263
+ "tournament",
264
+ ];
265
+ return gameKeywords.some((keyword) => text.includes(keyword));
266
+ }
267
+ mentionsUsers(text) {
268
+ const userKeywords = [
269
+ "user",
270
+ "users",
271
+ "player",
272
+ "players",
273
+ "member",
274
+ "members",
275
+ "account",
276
+ "accounts",
277
+ ];
278
+ return userKeywords.some((keyword) => text.includes(keyword));
279
+ }
280
+ mentionsAuth(text) {
281
+ const authKeywords = [
282
+ "login",
283
+ "signin",
284
+ "signup",
285
+ "register",
286
+ "authentication",
287
+ "auth",
288
+ "password",
289
+ "oauth",
290
+ ];
291
+ return authKeywords.some((keyword) => text.includes(keyword));
292
+ }
293
+ mentionsDataPersistence(text) {
294
+ const dataKeywords = [
295
+ "save",
296
+ "store",
297
+ "data",
298
+ "database",
299
+ "persist",
300
+ "memory",
301
+ "history",
302
+ "record",
303
+ ];
304
+ return dataKeywords.some((keyword) => text.includes(keyword));
305
+ }
306
+ mentionsDatabase(text) {
307
+ const dbKeywords = [
308
+ "database",
309
+ "db",
310
+ "postgres",
311
+ "mysql",
312
+ "mongodb",
313
+ "sqlite",
314
+ "instantdb",
315
+ "supabase",
316
+ ];
317
+ return dbKeywords.some((keyword) => text.includes(keyword));
318
+ }
319
+ mentionsPayments(text) {
320
+ const paymentKeywords = [
321
+ "payment",
322
+ "pay",
323
+ "buy",
324
+ "purchase",
325
+ "subscription",
326
+ "billing",
327
+ "stripe",
328
+ "paypal",
329
+ ];
330
+ return paymentKeywords.some((keyword) => text.includes(keyword));
331
+ }
332
+ isVagueGameDescription(text) {
333
+ const vaguePatterns = [
334
+ "fun game",
335
+ "simple game",
336
+ "game where",
337
+ "play against",
338
+ "multiplayer game",
339
+ ];
340
+ return vaguePatterns.some((pattern) => text.includes(pattern));
341
+ }
342
+ isVagueAppDescription(text) {
343
+ const vaguePatterns = [
344
+ "simple app",
345
+ "basic app",
346
+ "useful app",
347
+ "helpful app",
348
+ "cool app",
349
+ ];
350
+ return vaguePatterns.some((pattern) => text.includes(pattern));
351
+ }
352
+ mentionsTargetAudience(text) {
353
+ const audienceKeywords = [
354
+ "for",
355
+ "target",
356
+ "audience",
357
+ "users",
358
+ "people",
359
+ "business",
360
+ "students",
361
+ "developers",
362
+ ];
363
+ return audienceKeywords.some((keyword) => text.includes(keyword));
364
+ }
365
+ mentionsMultiplayer(text) {
366
+ const multiplayerKeywords = [
367
+ "against each other",
368
+ "multiplayer",
369
+ "together",
370
+ "compete",
371
+ "versus",
372
+ "vs",
373
+ ];
374
+ return multiplayerKeywords.some((keyword) => text.includes(keyword));
375
+ }
376
+ mentionsDeployment(text) {
377
+ const deploymentKeywords = [
378
+ "deploy",
379
+ "hosting",
380
+ "vercel",
381
+ "netlify",
382
+ "aws",
383
+ "railway",
384
+ "production",
385
+ ];
386
+ return deploymentKeywords.some((keyword) => text.includes(keyword));
387
+ }
388
+ mentionsEnvironmentConfig(text) {
389
+ const envKeywords = [
390
+ "environment",
391
+ "env",
392
+ "config",
393
+ "variables",
394
+ "secrets",
395
+ "api key",
396
+ ];
397
+ return envKeywords.some((keyword) => text.includes(keyword));
398
+ }
399
+ /**
400
+ * Get gaps by category
401
+ */
402
+ getGapsByCategory(category) {
403
+ return this.gaps.filter((gap) => gap.category === category);
404
+ }
405
+ /**
406
+ * Get auto-generated features by confidence
407
+ */
408
+ getFeaturesByConfidence(confidence) {
409
+ return this.autoGeneratedFeatures.filter((feature) => feature.confidence === confidence);
410
+ }
411
+ /**
412
+ * Add auto-generated feature
413
+ */
414
+ addAutoGeneratedFeature(feature) {
415
+ const id = this.generateFeatureId(feature.feature);
416
+ this.autoGeneratedFeatures.push({
417
+ id,
418
+ ...feature,
419
+ });
420
+ }
421
+ /**
422
+ * Generate unique ID for feature
423
+ */
424
+ generateFeatureId(feature) {
425
+ return feature
426
+ .toLowerCase()
427
+ .replace(/[^a-z0-9\s]/g, "")
428
+ .replace(/\s+/g, "-")
429
+ .substring(0, 50);
430
+ }
431
+ }
432
+ exports.ContextValidator = ContextValidator;
433
+ //# sourceMappingURL=ContextValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextValidator.js","sourceRoot":"","sources":["../../src/services/ContextValidator.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA6BH,MAAa,gBAAgB;IAA7B;QACU,SAAI,GAAiB,EAAE,CAAC;QACxB,0BAAqB,GAA2B,EAAE,CAAC;IA8d7D,CAAC;IA5dC;;OAEG;IACH,KAAK,CAAC,eAAe,CAAC,YAKrB;QACC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;QAEhC,uBAAuB;QACvB,IAAI,YAAY,CAAC,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACxC,CAAC;QAED,+BAA+B;QAC/B,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC;YAC7B,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACxD,CAAC;QAED,8BAA8B;QAC9B,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACpD,CAAC;QAED,yBAAyB;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5C,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,m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G,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,uBAAuB,CACrB,UAAqC;QAErC,OAAO,IAAI,CAAC,qBAAqB,CAAC,MAAM,CACtC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,KAAK,UAAU,CAC/C,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,uBAAuB,CAAC,OAAyC;QAC/D,MAAM,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;YAC9B,EAAE;YACF,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,OAAe;QACvC,OAAO,OAAO;aACX,WAAW,EAAE;aACb,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;aAC3B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;aACpB,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACtB,CAAC;CACF;AAheD,4CAgeC"}
@@ -0,0 +1,61 @@
1
+ import { IntentValidationReport, EnrichedComponentSpec } from "../types/intent-dictionary";
2
+ import { FunctionalSummary, VisualSystem } from "../types/design-pipeline";
3
+ /**
4
+ * IntentEnricher Service
5
+ *
6
+ * Transforms validated intents into enriched component specifications
7
+ * with expanded templates, design token mappings, and full type definitions.
8
+ */
9
+ export declare class IntentEnricher {
10
+ private dictionaryPath;
11
+ constructor();
12
+ /**
13
+ * Enrich validated intents into component specifications
14
+ */
15
+ enrichComponentDefinitions(summary: FunctionalSummary, validation: IntentValidationReport, visualSystem?: VisualSystem): Promise<EnrichedComponentSpec[]>;
16
+ /**
17
+ * Enrich a single validated intent
18
+ */
19
+ private enrichSingleIntent;
20
+ /**
21
+ * Generate component name from intent and context
22
+ */
23
+ private generateComponentName;
24
+ /**
25
+ * Get appropriate suffix for component type
26
+ */
27
+ private getComponentSuffix;
28
+ /**
29
+ * Convert string to PascalCase
30
+ */
31
+ private toPascalCase;
32
+ /**
33
+ * Expand template with placeholder values
34
+ */
35
+ private expandTemplate;
36
+ /**
37
+ * Extract label from intent text
38
+ */
39
+ private extractLabel;
40
+ /**
41
+ * Map design tokens from visual system
42
+ */
43
+ private mapDesignTokens;
44
+ /**
45
+ * Generate TypeScript type definitions for component
46
+ */
47
+ private generateTypeDefinitions;
48
+ /**
49
+ * Get component category from canonical name
50
+ */
51
+ getComponentCategory(canonicalName: string): string;
52
+ /**
53
+ * Generate usage example for component
54
+ */
55
+ generateUsageExample(spec: EnrichedComponentSpec): string;
56
+ /**
57
+ * Calculate complexity score for enriched spec
58
+ */
59
+ calculateComplexity(spec: EnrichedComponentSpec): number;
60
+ }
61
+ //# sourceMappingURL=IntentEnricher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntentEnricher.d.ts","sourceRoot":"","sources":["../../src/services/IntentEnricher.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,qBAAqB,EAEtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK3E;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,cAAc,CAAS;;IAW/B;;OAEG;IACG,0BAA0B,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,sBAAsB,EAClC,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAkCnC;;OAEG;YACW,kBAAkB;IAwDhC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA2B7B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAU1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACH,OAAO,CAAC,cAAc;IA+BtB;;OAEG;IACH,OAAO,CAAC,YAAY;IAuBpB;;OAEG;IACH,OAAO,CAAC,eAAe;IA4BvB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IA2B/B;;OAEG;IACH,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAiBnD;;OAEG;IACH,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM;IAoBzD;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM;CAqBzD"}