codebakers 2.5.3 → 3.0.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 (60) hide show
  1. package/README.md +54 -255
  2. package/dist/chunk-HOWR3YTF.js +146 -0
  3. package/dist/index.d.ts +0 -3
  4. package/dist/index.js +10489 -7994
  5. package/dist/terminal-6ZQVP6R7.js +10 -0
  6. package/package.json +26 -41
  7. package/AUDIT_REPORT.md +0 -138
  8. package/dist/advisors-RWRTSJRR.js +0 -7
  9. package/dist/chunk-ASIJIQYC.js +0 -320
  10. package/dist/chunk-D44U3IEA.js +0 -565
  11. package/dist/chunk-LANM5XQW.js +0 -326
  12. package/dist/prd-RYITSL6Q.js +0 -7
  13. package/install.bat +0 -9
  14. package/installers/CodeBakers-Install.bat +0 -207
  15. package/installers/CodeBakers-Install.command +0 -232
  16. package/installers/README.md +0 -157
  17. package/installers/mac/assets/README.txt +0 -31
  18. package/installers/mac/build-mac-installer.sh +0 -240
  19. package/installers/windows/CodeBakers.iss +0 -256
  20. package/installers/windows/assets/README.txt +0 -16
  21. package/installers/windows/scripts/post-install.bat +0 -15
  22. package/src/channels/discord.ts +0 -5
  23. package/src/channels/slack.ts +0 -5
  24. package/src/channels/sms.ts +0 -4
  25. package/src/channels/telegram.ts +0 -5
  26. package/src/channels/whatsapp.ts +0 -7
  27. package/src/commands/advisors.ts +0 -699
  28. package/src/commands/build.ts +0 -1025
  29. package/src/commands/check.ts +0 -365
  30. package/src/commands/code.ts +0 -806
  31. package/src/commands/connect.ts +0 -12
  32. package/src/commands/deploy.ts +0 -448
  33. package/src/commands/design.ts +0 -298
  34. package/src/commands/fix.ts +0 -20
  35. package/src/commands/gateway.ts +0 -604
  36. package/src/commands/generate.ts +0 -178
  37. package/src/commands/init.ts +0 -634
  38. package/src/commands/integrate.ts +0 -884
  39. package/src/commands/learn.ts +0 -36
  40. package/src/commands/migrate.ts +0 -419
  41. package/src/commands/prd-maker.ts +0 -588
  42. package/src/commands/prd.ts +0 -419
  43. package/src/commands/security.ts +0 -102
  44. package/src/commands/setup.ts +0 -600
  45. package/src/commands/status.ts +0 -56
  46. package/src/commands/website.ts +0 -741
  47. package/src/index.ts +0 -627
  48. package/src/patterns/loader.ts +0 -337
  49. package/src/services/github.ts +0 -61
  50. package/src/services/supabase.ts +0 -147
  51. package/src/services/vercel.ts +0 -61
  52. package/src/utils/claude-md.ts +0 -287
  53. package/src/utils/config.ts +0 -375
  54. package/src/utils/display.ts +0 -338
  55. package/src/utils/files.ts +0 -418
  56. package/src/utils/nlp.ts +0 -312
  57. package/src/utils/ui.ts +0 -441
  58. package/src/utils/updates.ts +0 -8
  59. package/src/utils/voice.ts +0 -323
  60. package/tsconfig.json +0 -26
@@ -1,338 +0,0 @@
1
- import chalk from 'chalk';
2
-
3
- // ============================================================================
4
- // ANTHROPIC RESPONSE HELPER
5
- // ============================================================================
6
-
7
- /**
8
- * Safely extract text from Anthropic API response
9
- */
10
- export function getResponseText(response: { content: Array<{ type: string; text?: string }> }): string {
11
- const firstContent = response.content?.[0];
12
- if (!firstContent) return '';
13
- return firstContent.type === 'text' && firstContent.text ? firstContent.text : '';
14
- }
15
-
16
- // ============================================================================
17
- // STEP TRACKER - Shows progress through multiple steps
18
- // ============================================================================
19
-
20
- export interface Step {
21
- name: string;
22
- status: 'pending' | 'running' | 'done' | 'error' | 'skipped';
23
- }
24
-
25
- export class StepTracker {
26
- private steps: Step[];
27
- private currentIndex: number = -1;
28
- private startTime: number = Date.now();
29
-
30
- constructor(stepNames: string[]) {
31
- this.steps = stepNames.map(name => ({ name, status: 'pending' }));
32
- }
33
-
34
- start(index?: number): void {
35
- if (index !== undefined) {
36
- this.currentIndex = index;
37
- } else {
38
- this.currentIndex++;
39
- }
40
-
41
- if (this.currentIndex < this.steps.length) {
42
- this.steps[this.currentIndex].status = 'running';
43
- }
44
- this.render();
45
- }
46
-
47
- complete(): void {
48
- if (this.currentIndex >= 0 && this.currentIndex < this.steps.length) {
49
- this.steps[this.currentIndex].status = 'done';
50
- }
51
- this.render();
52
- }
53
-
54
- error(): void {
55
- if (this.currentIndex >= 0 && this.currentIndex < this.steps.length) {
56
- this.steps[this.currentIndex].status = 'error';
57
- }
58
- this.render();
59
- }
60
-
61
- skip(): void {
62
- if (this.currentIndex >= 0 && this.currentIndex < this.steps.length) {
63
- this.steps[this.currentIndex].status = 'skipped';
64
- }
65
- this.render();
66
- }
67
-
68
- private render(): void {
69
- // Clear previous output (move up and clear lines)
70
- const output: string[] = [];
71
-
72
- output.push(''); // Empty line for spacing
73
-
74
- for (let i = 0; i < this.steps.length; i++) {
75
- const step = this.steps[i];
76
- const icon = this.getIcon(step.status);
77
- const color = this.getColor(step.status);
78
- const suffix = step.status === 'running' ? chalk.dim(' ...') : '';
79
-
80
- output.push(` ${icon} ${color(step.name)}${suffix}`);
81
- }
82
-
83
- // Progress bar
84
- const completed = this.steps.filter(s => s.status === 'done').length;
85
- const total = this.steps.length;
86
- const percent = Math.round((completed / total) * 100);
87
- const barWidth = 30;
88
- const filled = Math.round((completed / total) * barWidth);
89
- const empty = barWidth - filled;
90
-
91
- output.push('');
92
- output.push(` ${chalk.green('█'.repeat(filled))}${chalk.gray('░'.repeat(empty))} ${percent}%`);
93
- output.push('');
94
-
95
- console.log(output.join('\n'));
96
- }
97
-
98
- private getIcon(status: Step['status']): string {
99
- switch (status) {
100
- case 'pending': return chalk.gray('○');
101
- case 'running': return chalk.blue('●');
102
- case 'done': return chalk.green('✓');
103
- case 'error': return chalk.red('✗');
104
- case 'skipped': return chalk.yellow('⊘');
105
- }
106
- }
107
-
108
- private getColor(status: Step['status']): (s: string) => string {
109
- switch (status) {
110
- case 'pending': return chalk.gray;
111
- case 'running': return chalk.white;
112
- case 'done': return chalk.green;
113
- case 'error': return chalk.red;
114
- case 'skipped': return chalk.yellow;
115
- }
116
- }
117
-
118
- getElapsedTime(): string {
119
- const elapsed = Math.round((Date.now() - this.startTime) / 1000);
120
- const minutes = Math.floor(elapsed / 60);
121
- const seconds = elapsed % 60;
122
- return minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`;
123
- }
124
- }
125
-
126
- // ============================================================================
127
- // ERROR DISPLAY - Beautiful error messages
128
- // ============================================================================
129
-
130
- export interface ErrorInfo {
131
- title: string;
132
- message: string;
133
- fixes?: string[];
134
- command?: string;
135
- docs?: string;
136
- }
137
-
138
- export function showError(error: ErrorInfo): void {
139
- console.log('');
140
- console.log(chalk.red(` ❌ ${error.title}`));
141
- console.log('');
142
- console.log(chalk.white(` What went wrong:`));
143
- console.log(chalk.gray(` ${error.message}`));
144
-
145
- if (error.fixes && error.fixes.length > 0) {
146
- console.log('');
147
- console.log(chalk.white(` Possible fixes:`));
148
- error.fixes.forEach((fix, i) => {
149
- console.log(chalk.gray(` ${i + 1}. ${fix}`));
150
- });
151
- }
152
-
153
- if (error.command) {
154
- console.log('');
155
- console.log(chalk.white(` Try running:`));
156
- console.log(chalk.cyan(` ${error.command}`));
157
- }
158
-
159
- if (error.docs) {
160
- console.log('');
161
- console.log(chalk.dim(` Docs: ${error.docs}`));
162
- }
163
-
164
- console.log('');
165
- }
166
-
167
- // ============================================================================
168
- // SUCCESS DISPLAY - Beautiful success messages
169
- // ============================================================================
170
-
171
- export interface SuccessInfo {
172
- title: string;
173
- message?: string;
174
- stats?: { label: string; value: string }[];
175
- nextSteps?: string[];
176
- command?: string;
177
- }
178
-
179
- export function showSuccess(success: SuccessInfo): void {
180
- console.log('');
181
- console.log(chalk.green(` ✅ ${success.title}`));
182
-
183
- if (success.message) {
184
- console.log(chalk.gray(` ${success.message}`));
185
- }
186
-
187
- if (success.stats && success.stats.length > 0) {
188
- console.log('');
189
- console.log(chalk.white(` 📊 Summary:`));
190
- success.stats.forEach(stat => {
191
- console.log(chalk.gray(` ${stat.label}: ${chalk.white(stat.value)}`));
192
- });
193
- }
194
-
195
- if (success.nextSteps && success.nextSteps.length > 0) {
196
- console.log('');
197
- console.log(chalk.white(` Next steps:`));
198
- success.nextSteps.forEach(step => {
199
- console.log(chalk.cyan(` ${step}`));
200
- });
201
- }
202
-
203
- if (success.command) {
204
- console.log('');
205
- console.log(chalk.white(` Quick start:`));
206
- console.log(chalk.cyan(` ${success.command}`));
207
- }
208
-
209
- console.log('');
210
- }
211
-
212
- // ============================================================================
213
- // INFO BOX - Boxed information display
214
- // ============================================================================
215
-
216
- export function showBox(title: string, content: string[], style: 'info' | 'warning' | 'success' = 'info'): void {
217
- const colors = {
218
- info: chalk.cyan,
219
- warning: chalk.yellow,
220
- success: chalk.green,
221
- };
222
- const color = colors[style];
223
-
224
- const maxLength = Math.max(title.length, ...content.map(c => c.length));
225
- const width = maxLength + 4;
226
-
227
- const top = `╭${'─'.repeat(width)}╮`;
228
- const bottom = `╰${'─'.repeat(width)}╯`;
229
- const titleLine = `│ ${color(title.padEnd(maxLength))} │`;
230
- const separator = `├${'─'.repeat(width)}┤`;
231
-
232
- console.log('');
233
- console.log(color(top));
234
- console.log(color(titleLine));
235
- console.log(color(separator));
236
- content.forEach(line => {
237
- console.log(color(`│ ${line.padEnd(maxLength)} │`));
238
- });
239
- console.log(color(bottom));
240
- console.log('');
241
- }
242
-
243
- // ============================================================================
244
- // FILE LIST - Show created/modified files
245
- // ============================================================================
246
-
247
- export function showFileList(title: string, files: string[]): void {
248
- console.log('');
249
- console.log(chalk.white(` 📁 ${title}`));
250
-
251
- files.forEach((file, i) => {
252
- const isLast = i === files.length - 1;
253
- const prefix = isLast ? '└──' : '├──';
254
- const icon = getFileIcon(file);
255
- console.log(chalk.gray(` ${prefix} ${icon} ${file}`));
256
- });
257
-
258
- console.log('');
259
- }
260
-
261
- function getFileIcon(filename: string): string {
262
- const ext = filename.split('.').pop()?.toLowerCase();
263
- const icons: Record<string, string> = {
264
- 'tsx': '⚛️',
265
- 'ts': '📘',
266
- 'js': '📒',
267
- 'jsx': '⚛️',
268
- 'css': '🎨',
269
- 'json': '📋',
270
- 'md': '📝',
271
- 'html': '🌐',
272
- };
273
- return icons[ext || ''] || '📄';
274
- }
275
-
276
- // ============================================================================
277
- // COMMON ERROR MESSAGES
278
- // ============================================================================
279
-
280
- export const ERRORS = {
281
- nodeNotInstalled: {
282
- title: 'Node.js not found',
283
- message: 'Node.js 18 or higher is required',
284
- fixes: [
285
- 'Install Node.js from https://nodejs.org',
286
- 'Use nvm to install: nvm install 18',
287
- 'Restart your terminal after installing',
288
- ],
289
- docs: 'https://nodejs.org/en/download',
290
- },
291
-
292
- npmFailed: {
293
- title: 'Package installation failed',
294
- message: 'npm install encountered an error',
295
- fixes: [
296
- 'Check your internet connection',
297
- 'Clear npm cache: npm cache clean --force',
298
- 'Delete node_modules and try again',
299
- 'Try using yarn instead: yarn install',
300
- ],
301
- },
302
-
303
- createNextAppFailed: {
304
- title: 'Project creation failed',
305
- message: 'create-next-app could not complete',
306
- fixes: [
307
- 'Make sure Node.js 18+ is installed',
308
- 'Check your internet connection',
309
- 'Try running manually: npx create-next-app@latest',
310
- ],
311
- },
312
-
313
- apiKeyMissing: {
314
- title: 'API key not configured',
315
- message: 'Anthropic API key is required for AI features',
316
- fixes: [
317
- 'Run: codebakers setup',
318
- 'Get an API key at: https://console.anthropic.com',
319
- ],
320
- command: 'codebakers setup',
321
- },
322
-
323
- notConfigured: {
324
- title: 'CodeBakers not configured',
325
- message: 'Run setup before using this command',
326
- command: 'codebakers setup',
327
- },
328
-
329
- notInProject: {
330
- title: 'Not in a project folder',
331
- message: 'This command must be run inside a project',
332
- fixes: [
333
- 'Navigate to your project: cd my-project',
334
- 'Create a new project: codebakers init',
335
- 'Or build a website: codebakers website',
336
- ],
337
- },
338
- };