codebakers 2.3.8 → 2.5.3

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  prdCommand
3
- } from "./chunk-ND6T4UDY.js";
3
+ } from "./chunk-LANM5XQW.js";
4
4
  import "./chunk-ASIJIQYC.js";
5
5
  export {
6
6
  prdCommand
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebakers",
3
- "version": "2.3.8",
3
+ "version": "2.5.3",
4
4
  "description": "AI dev team that follows the rules. Build apps from anywhere with pattern enforcement.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import Anthropic from '@anthropic-ai/sdk';
6
6
  import { Config } from '../utils/config.js';
@@ -328,7 +328,7 @@ async function getAdvisorFeedback(
328
328
  brief: ProjectBrief
329
329
  ): Promise<AdvisorFeedback> {
330
330
  const response = await anthropic.messages.create({
331
- model: 'claude-sonnet-4-20250514',
331
+ model: 'claude-sonnet-4-5-20250929',
332
332
  max_tokens: 2048,
333
333
  messages: [{
334
334
  role: 'user',
@@ -397,7 +397,7 @@ async function generateReport(
397
397
  const avgScore = advisorFeedback.reduce((sum, f) => sum + f.score, 0) / advisorFeedback.length;
398
398
 
399
399
  const response = await anthropic.messages.create({
400
- model: 'claude-sonnet-4-20250514',
400
+ model: 'claude-sonnet-4-5-20250929',
401
401
  max_tokens: 8192,
402
402
  messages: [{
403
403
  role: 'user',
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import Anthropic from '@anthropic-ai/sdk';
6
6
  import { execa } from 'execa';
@@ -206,8 +206,13 @@ export async function buildCommand(prdPath?: string, options: { sequential?: boo
206
206
 
207
207
  // Step 7: Final setup
208
208
  spinner.start('Installing dependencies...');
209
- await execa('npm', ['install'], { cwd: projectPath, reject: false });
210
- spinner.stop('Dependencies installed');
209
+ try {
210
+ await execa('npm', ['install'], { cwd: projectPath, stdio: 'inherit' });
211
+ spinner.stop('Dependencies installed');
212
+ } catch (error) {
213
+ spinner.stop('Dependencies installation failed');
214
+ console.log(chalk.yellow(' ⚠️ Run "npm install" manually in the project folder'));
215
+ }
211
216
 
212
217
  // Done!
213
218
  const elapsed = Math.round((Date.now() - startTime) / 1000);
@@ -237,7 +242,7 @@ export async function buildCommand(prdPath?: string, options: { sequential?: boo
237
242
 
238
243
  async function analyzePRD(anthropic: Anthropic, prdContent: string): Promise<BuildPlan> {
239
244
  const response = await anthropic.messages.create({
240
- model: 'claude-sonnet-4-20250514',
245
+ model: 'claude-sonnet-4-5-20250929',
241
246
  max_tokens: 4096,
242
247
  messages: [{
243
248
  role: 'user',
@@ -362,7 +367,7 @@ async function runSetupPhase(
362
367
 
363
368
  // Generate shared setup code
364
369
  const setupResponse = await anthropic.messages.create({
365
- model: 'claude-sonnet-4-20250514',
370
+ model: 'claude-sonnet-4-5-20250929',
366
371
  max_tokens: 8192,
367
372
  messages: [{
368
373
  role: 'user',
@@ -648,7 +653,7 @@ Start with the index.ts that exports everything.`
648
653
  iteration++;
649
654
 
650
655
  const response = await anthropic.messages.create({
651
- model: 'claude-sonnet-4-20250514',
656
+ model: 'claude-sonnet-4-5-20250929',
652
657
  max_tokens: 8192,
653
658
  messages,
654
659
  });
@@ -783,7 +788,7 @@ async function healerAgent(
783
788
  plan: BuildPlan
784
789
  ): Promise<HealerSolution> {
785
790
  const response = await anthropic.messages.create({
786
- model: 'claude-sonnet-4-20250514',
791
+ model: 'claude-sonnet-4-5-20250929',
787
792
  max_tokens: 4096,
788
793
  messages: [{
789
794
  role: 'user',
@@ -852,7 +857,7 @@ async function runIntegrationPhase(
852
857
  const features = plan.waves.flatMap(w => w.agents);
853
858
 
854
859
  const response = await anthropic.messages.create({
855
- model: 'claude-sonnet-4-20250514',
860
+ model: 'claude-sonnet-4-5-20250929',
856
861
  max_tokens: 8192,
857
862
  messages: [{
858
863
  role: 'user',
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import glob from 'fast-glob';
6
6
  import { Config } from '../utils/config.js';
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import Anthropic from '@anthropic-ai/sdk';
6
6
  import { execa } from 'execa';
@@ -266,7 +266,7 @@ async function processUserInput(
266
266
 
267
267
  // Call Claude
268
268
  const response = await anthropic.messages.create({
269
- model: 'claude-sonnet-4-20250514',
269
+ model: 'claude-sonnet-4-5-20250929',
270
270
  max_tokens: 8192,
271
271
  system: systemPrompt,
272
272
  messages: messages.map(m => ({
@@ -787,7 +787,7 @@ ${content}
787
787
  Output only the fixed file content, no explanation.`;
788
788
 
789
789
  const response = await anthropic.messages.create({
790
- model: 'claude-sonnet-4-20250514',
790
+ model: 'claude-sonnet-4-5-20250929',
791
791
  max_tokens: 8192,
792
792
  system: systemPrompt,
793
793
  messages: [{ role: 'user', content: fixPrompt }],
@@ -1,7 +1,7 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
3
  import { execa } from 'execa';
4
- import * as fs from 'fs-extra';
4
+ import fs from 'fs-extra';
5
5
  import * as path from 'path';
6
6
  import Anthropic from '@anthropic-ai/sdk';
7
7
  import { Config } from '../utils/config.js';
@@ -230,7 +230,7 @@ ${chalk.bold('Type:')} ${deployType}
230
230
  ${chalk.bold('Time:')} ${new Date().toLocaleTimeString()}
231
231
 
232
232
  ${chalk.dim('View in Vercel Dashboard:')}
233
- ${chalk.dim(deployment.dashboardUrl || 'https://vercel.com/dashboard')}
233
+ ${chalk.dim('https://vercel.com/dashboard')}
234
234
  `));
235
235
 
236
236
  } catch (error) {
@@ -295,7 +295,7 @@ ${content}
295
295
  Output ONLY the corrected file content, no explanations. Keep all existing functionality.`;
296
296
 
297
297
  const response = await anthropic.messages.create({
298
- model: 'claude-sonnet-4-20250514',
298
+ model: 'claude-sonnet-4-5-20250929',
299
299
  max_tokens: 8192,
300
300
  messages: [{ role: 'user', content: prompt }],
301
301
  });
@@ -359,7 +359,7 @@ ${content}
359
359
  Output ONLY the corrected file content, no explanations.`;
360
360
 
361
361
  const response = await anthropic.messages.create({
362
- model: 'claude-sonnet-4-20250514',
362
+ model: 'claude-sonnet-4-5-20250929',
363
363
  max_tokens: 8192,
364
364
  messages: [{ role: 'user', content: prompt }],
365
365
  });
@@ -417,7 +417,7 @@ Output ONLY the corrected file content, no explanations.`;
417
417
 
418
418
  try {
419
419
  const response = await anthropic.messages.create({
420
- model: 'claude-sonnet-4-20250514',
420
+ model: 'claude-sonnet-4-5-20250929',
421
421
  max_tokens: 8192,
422
422
  messages: [{ role: 'user', content: prompt }],
423
423
  });
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import { Config } from '../utils/config.js';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
 
6
6
  export async function generateCommand(type?: string): Promise<void> {
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import { execa } from 'execa';
6
6
  import { Config } from '../utils/config.js';
@@ -190,65 +190,108 @@ Domain: ${domain || 'Vercel default'}`,
190
190
  spinner.start('Installing dependencies...');
191
191
 
192
192
  // Try npm first (most common), fall back to pnpm or yarn
193
+ let installSuccess = false;
193
194
  try {
194
- await execa('npm', ['install'], { cwd: projectPath });
195
+ await execa('npm', ['install'], { cwd: projectPath, stdio: 'inherit' });
196
+ installSuccess = true;
195
197
  } catch {
196
198
  try {
197
- await execa('pnpm', ['install'], { cwd: projectPath });
199
+ await execa('pnpm', ['install'], { cwd: projectPath, stdio: 'inherit' });
200
+ installSuccess = true;
198
201
  } catch {
199
- await execa('yarn', ['install'], { cwd: projectPath });
202
+ try {
203
+ await execa('yarn', ['install'], { cwd: projectPath, stdio: 'inherit' });
204
+ installSuccess = true;
205
+ } catch {
206
+ // All failed
207
+ }
200
208
  }
201
209
  }
202
- spinner.stop('Dependencies installed');
210
+
211
+ if (installSuccess) {
212
+ spinner.stop('Dependencies installed');
213
+ } else {
214
+ spinner.stop('Dependencies installation failed');
215
+ console.log(chalk.yellow(' ⚠️ Run "npm install" manually in the project folder'));
216
+ }
203
217
 
204
218
  // Step 3: GitHub
205
219
  if ((services as string[]).includes('github')) {
206
220
  spinner.start('Creating GitHub repository...');
207
- const github = new GitHubService(config);
208
- const repo = await github.createRepo(projectName, { private: true });
209
- spinner.stop(`GitHub repo created: ${repo.html_url}`);
210
-
211
- // Init git and push
212
- await execa('git', ['init'], { cwd: projectPath });
213
- await execa('git', ['add', '.'], { cwd: projectPath });
214
- await execa('git', ['commit', '-m', 'Initial commit by CodeBakers'], { cwd: projectPath });
215
- await execa('git', ['remote', 'add', 'origin', repo.clone_url], { cwd: projectPath });
216
- await execa('git', ['push', '-u', 'origin', 'main'], { cwd: projectPath });
221
+ try {
222
+ const github = new GitHubService(config);
223
+ const repo = await github.createRepo(projectName, { private: true });
224
+ spinner.stop(`GitHub repo created: ${repo.html_url}`);
225
+
226
+ // Init git and push
227
+ try {
228
+ await execa('git', ['init'], { cwd: projectPath });
229
+ await execa('git', ['add', '.'], { cwd: projectPath });
230
+ await execa('git', ['commit', '-m', 'Initial commit by CodeBakers'], { cwd: projectPath });
231
+ await execa('git', ['remote', 'add', 'origin', repo.clone_url], { cwd: projectPath });
232
+ await execa('git', ['push', '-u', 'origin', 'main'], { cwd: projectPath });
233
+ } catch (gitError) {
234
+ console.log(chalk.yellow(' ⚠️ Git push failed. You can push manually later.'));
235
+ }
236
+ } catch (error) {
237
+ spinner.stop('GitHub setup failed');
238
+ console.log(chalk.yellow(' ⚠️ Could not create GitHub repo. Check your GitHub token.'));
239
+ }
217
240
  }
218
241
 
219
242
  // Step 4: Supabase
220
243
  if ((services as string[]).includes('supabase')) {
221
244
  spinner.start('Creating Supabase project...');
222
- const supabase = new SupabaseService(config);
223
- const project = await supabase.createProject(projectName);
224
- spinner.stop(`Supabase project created: ${project.name}`);
225
-
226
- // Save Supabase config
227
- await fs.writeJson(
228
- path.join(projectPath, '.codebakers', 'supabase.json'),
229
- { projectId: project.id, projectUrl: project.api_url },
230
- { spaces: 2 }
231
- );
245
+ try {
246
+ const supabase = new SupabaseService(config);
247
+ const project = await supabase.createProject(projectName);
248
+ spinner.stop(`Supabase project created: ${project.name}`);
249
+
250
+ // Save Supabase config
251
+ await fs.writeJson(
252
+ path.join(projectPath, '.codebakers', 'supabase.json'),
253
+ { projectId: project.id, projectUrl: project.api_url },
254
+ { spaces: 2 }
255
+ );
256
+ } catch (error) {
257
+ spinner.stop('Supabase setup failed');
258
+ console.log(chalk.yellow(' ⚠️ Could not create Supabase project. Check your Supabase token.'));
259
+ }
232
260
  }
233
261
 
234
262
  // Step 5: Vercel
235
263
  if ((services as string[]).includes('vercel')) {
236
264
  spinner.start('Creating Vercel project...');
237
- const vercel = new VercelService(config);
238
- const project = await vercel.createProject(projectName);
239
- spinner.stop(`Vercel project created`);
240
-
241
- // Configure domain if specified
242
- if (domain) {
243
- spinner.start(`Configuring domain: ${domain}...`);
244
- await vercel.addDomain(projectName, domain);
245
- spinner.stop('Domain configured');
265
+ try {
266
+ const vercel = new VercelService(config);
267
+ const project = await vercel.createProject(projectName);
268
+ spinner.stop(`Vercel project created`);
269
+
270
+ // Configure domain if specified
271
+ if (domain) {
272
+ spinner.start(`Configuring domain: ${domain}...`);
273
+ try {
274
+ await vercel.addDomain(projectName, domain);
275
+ spinner.stop('Domain configured');
276
+ } catch {
277
+ spinner.stop('Domain configuration failed');
278
+ console.log(chalk.yellow(' ⚠️ Could not configure domain. Add it manually in Vercel.'));
279
+ }
280
+ }
281
+
282
+ // Deploy
283
+ spinner.start('Deploying to Vercel...');
284
+ try {
285
+ const deployment = await vercel.deploy(projectPath);
286
+ spinner.stop(`Deployed: ${deployment.url}`);
287
+ } catch {
288
+ spinner.stop('Deployment failed');
289
+ console.log(chalk.yellow(' ⚠️ Could not deploy. Run "vercel" manually later.'));
290
+ }
291
+ } catch (error) {
292
+ spinner.stop('Vercel setup failed');
293
+ console.log(chalk.yellow(' ⚠️ Could not create Vercel project. Check your Vercel token.'));
246
294
  }
247
-
248
- // Deploy
249
- spinner.start('Deploying to Vercel...');
250
- const deployment = await vercel.deploy(projectPath);
251
- spinner.stop(`Deployed: ${deployment.url}`);
252
295
  }
253
296
 
254
297
  // Step 6: Generate CLAUDE.md
@@ -321,7 +364,14 @@ async function createLocalProject(
321
364
  await fs.ensureDir(path.join(projectPath, 'src', 'services'));
322
365
 
323
366
  // Create package.json
324
- const packageJson = {
367
+ const packageJson: {
368
+ name: string;
369
+ version: string;
370
+ private: boolean;
371
+ scripts: Record<string, string>;
372
+ dependencies: Record<string, string>;
373
+ devDependencies: Record<string, string>;
374
+ } = {
325
375
  name: path.basename(projectPath),
326
376
  version: '0.1.0',
327
377
  private: true,
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import open from 'open';
6
6
  import { Config } from '../utils/config.js';
@@ -1,7 +1,7 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
3
  import { execa } from 'execa';
4
- import * as fs from 'fs-extra';
4
+ import fs from 'fs-extra';
5
5
  import * as path from 'path';
6
6
  import { Config } from '../utils/config.js';
7
7
 
@@ -1,10 +1,11 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import Anthropic from '@anthropic-ai/sdk';
6
+ import { execa } from 'execa';
6
7
  import { Config } from '../utils/config.js';
7
- import { textWithVoice, getVoiceInput, checkVoiceAvailability } from '../utils/voice.js';
8
+ import { textWithVoice } from '../utils/voice.js';
8
9
 
9
10
  interface PRDInput {
10
11
  projectName: string;
@@ -507,7 +508,7 @@ async function recordWithLinux(): Promise<string> {
507
508
 
508
509
  async function generatePRD(anthropic: Anthropic, input: PRDInput): Promise<string> {
509
510
  const response = await anthropic.messages.create({
510
- model: 'claude-sonnet-4-20250514',
511
+ model: 'claude-sonnet-4-5-20250929',
511
512
  max_tokens: 8192,
512
513
  messages: [{
513
514
  role: 'user',
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import * as path from 'path';
5
5
  import Anthropic from '@anthropic-ai/sdk';
6
6
  import { Config } from '../utils/config.js';
@@ -141,7 +141,7 @@ export async function prdCommand(filePath?: string): Promise<void> {
141
141
 
142
142
  async function parsePRD(anthropic: Anthropic, content: string): Promise<ParsedPRD> {
143
143
  const response = await anthropic.messages.create({
144
- model: 'claude-sonnet-4-20250514',
144
+ model: 'claude-sonnet-4-5-20250929',
145
145
  max_tokens: 4096,
146
146
  messages: [{
147
147
  role: 'user',
@@ -308,7 +308,7 @@ async function generateBuildPlan(
308
308
  designProfile: string
309
309
  ): Promise<{ phases: Array<{ name: string; tasks: string[] }> }> {
310
310
  const response = await anthropic.messages.create({
311
- model: 'claude-sonnet-4-20250514',
311
+ model: 'claude-sonnet-4-5-20250929',
312
312
  max_tokens: 4096,
313
313
  messages: [{
314
314
  role: 'user',
@@ -362,7 +362,7 @@ async function executeTask(
362
362
  designProfile: string
363
363
  ): Promise<void> {
364
364
  const response = await anthropic.messages.create({
365
- model: 'claude-sonnet-4-20250514',
365
+ model: 'claude-sonnet-4-5-20250929',
366
366
  max_tokens: 8192,
367
367
  messages: [{
368
368
  role: 'user',
@@ -1,6 +1,6 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import chalk from 'chalk';
3
- import * as fs from 'fs-extra';
3
+ import fs from 'fs-extra';
4
4
  import glob from 'fast-glob';
5
5
  import * as path from 'path';
6
6
 
@@ -1,7 +1,7 @@
1
1
  // src/commands/status.ts
2
2
  import * as p from '@clack/prompts';
3
3
  import chalk from 'chalk';
4
- import * as fs from 'fs-extra';
4
+ import fs from 'fs-extra';
5
5
  import * as path from 'path';
6
6
  import { Config } from '../utils/config.js';
7
7