fix: improve error handling, test options, and model configuration

- Enhance error validation in parse-prd.js and update-tasks.js
- Fix bug where mcpLog was incorrectly passed as logWrapper
- Improve error messages and response formatting
- Add --skip-verification flag to E2E tests
- Update MCP server config that ships with init to match new API key structure
- Fix task force/append handling in parse-prd command
- Increase column width in update-tasks display
This commit is contained in:
Eyal Toledano
2025-05-02 23:11:39 -04:00
parent fd1e78c69a
commit e5b7306e4d
8 changed files with 248 additions and 195 deletions

View File

@@ -761,21 +761,22 @@ function setupMCPConfiguration(targetDir) {
const newMCPServer = {
'task-master-ai': {
command: 'npx',
args: ['-y', 'task-master-mcp'],
args: ['-y', '--package=task-master-ai', 'task-master-ai'],
env: {
ANTHROPIC_API_KEY: 'YOUR_ANTHROPIC_API_KEY',
PERPLEXITY_API_KEY: 'YOUR_PERPLEXITY_API_KEY',
MODEL: 'claude-3-7-sonnet-20250219',
PERPLEXITY_MODEL: 'sonar-pro',
MAX_TOKENS: '64000',
TEMPERATURE: '0.2',
DEFAULT_SUBTASKS: '5',
DEFAULT_PRIORITY: 'medium'
ANTHROPIC_API_KEY: 'ANTHROPIC_API_KEY_HERE',
PERPLEXITY_API_KEY: 'PERPLEXITY_API_KEY_HERE',
OPENAI_API_KEY: 'OPENAI_API_KEY_HERE',
GOOGLE_API_KEY: 'GOOGLE_API_KEY_HERE',
XAI_API_KEY: 'XAI_API_KEY_HERE',
OPENROUTER_API_KEY: 'OPENROUTER_API_KEY_HERE',
MISTRAL_API_KEY: 'MISTRAL_API_KEY_HERE',
AZURE_OPENAI_API_KEY: 'AZURE_OPENAI_API_KEY_HERE',
OLLAMA_API_KEY: 'OLLAMA_API_KEY_HERE'
}
}
};
// Check if mcp.json already exists
// Check if mcp.json already existsimage.png
if (fs.existsSync(mcpJsonPath)) {
log(
'info',

View File

@@ -514,15 +514,19 @@ function registerCommands(programInstance) {
const outputPath = options.output;
const force = options.force || false;
const append = options.append || false;
let useForce = false;
let useAppend = false;
// Helper function to check if tasks.json exists and confirm overwrite
async function confirmOverwriteIfNeeded() {
if (fs.existsSync(outputPath) && !force && !append) {
const shouldContinue = await confirmTaskOverwrite(outputPath);
if (!shouldContinue) {
console.log(chalk.yellow('Operation cancelled by user.'));
return false;
const overwrite = await confirmTaskOverwrite(outputPath); // Calls inquirer prompt
if (!overwrite) {
log('info', 'Operation cancelled.');
return false; // Exit if user selects 'N'
}
// If user confirms 'y', we should set useForce = true for the parsePRD call
useForce = true;
}
return true;
}
@@ -536,7 +540,10 @@ function registerCommands(programInstance) {
if (!(await confirmOverwriteIfNeeded())) return;
console.log(chalk.blue(`Generating ${numTasks} tasks...`));
await parsePRD(defaultPrdPath, outputPath, numTasks, { append });
await parsePRD(defaultPrdPath, outputPath, numTasks, {
useAppend,
useForce
});
return;
}

View File

@@ -275,7 +275,7 @@ async function updateTasks(
chalk.cyan.bold('Title'),
chalk.cyan.bold('Status')
],
colWidths: [5, 60, 10]
colWidths: [5, 70, 20]
});
tasksToUpdate.forEach((task) => {

View File

@@ -1,3 +0,0 @@
Task Master PRD
Create a CLI tool for task management