Recovers lost files and commits work from the past 5-6 days. Holy shit that was a close call.

This commit is contained in:
Eyal Toledano
2025-04-07 19:55:03 -04:00
parent b3e7ebefd9
commit b7580e038d
42 changed files with 5180 additions and 1988 deletions

View File

@@ -146,7 +146,7 @@ function registerCommands(programInstance) {
// update command
programInstance
.command('update')
.description('Update tasks based on new information or implementation changes')
.description('Update multiple tasks with ID >= "from" based on new information or implementation changes')
.option('-f, --file <file>', 'Path to the tasks file', 'tasks/tasks.json')
.option('--from <id>', 'Task ID to start updating from (tasks with ID >= this value will be updated)', '1')
.option('-p, --prompt <text>', 'Prompt explaining the changes or new context (required)')
@@ -157,6 +157,16 @@ function registerCommands(programInstance) {
const prompt = options.prompt;
const useResearch = options.research || false;
// Check if there's an 'id' option which is a common mistake (instead of 'from')
if (process.argv.includes('--id') || process.argv.some(arg => arg.startsWith('--id='))) {
console.error(chalk.red('Error: The update command uses --from=<id>, not --id=<id>'));
console.log(chalk.yellow('\nTo update multiple tasks:'));
console.log(` task-master update --from=${fromId} --prompt="Your prompt here"`);
console.log(chalk.yellow('\nTo update a single specific task, use the update-task command instead:'));
console.log(` task-master update-task --id=<id> --prompt="Your prompt here"`);
process.exit(1);
}
if (!prompt) {
console.error(chalk.red('Error: --prompt parameter is required. Please provide information about the changes.'));
process.exit(1);
@@ -175,7 +185,7 @@ function registerCommands(programInstance) {
// update-task command
programInstance
.command('update-task')
.description('Update a single task by ID with new information')
.description('Update a single specific task by ID with new information (use --id parameter)')
.option('-f, --file <file>', 'Path to the tasks file', 'tasks/tasks.json')
.option('-i, --id <id>', 'Task ID to update (required)')
.option('-p, --prompt <text>', 'Prompt explaining the changes or new context (required)')
@@ -416,18 +426,14 @@ function registerCommands(programInstance) {
.option('-p, --prompt <text>', 'Additional context to guide subtask generation')
.option('--force', 'Force regeneration of subtasks for tasks that already have them')
.action(async (options) => {
const tasksPath = options.file;
const idArg = options.id ? parseInt(options.id, 10) : null;
const allFlag = options.all;
const numSubtasks = parseInt(options.num, 10);
const forceFlag = options.force;
const useResearch = options.research === true;
const idArg = options.id;
const numSubtasks = options.num || CONFIG.defaultSubtasks;
const useResearch = options.research || false;
const additionalContext = options.prompt || '';
const forceFlag = options.force || false;
const tasksPath = options.file || 'tasks/tasks.json';
// Debug log to verify the value
log('debug', `Research enabled: ${useResearch}`);
if (allFlag) {
if (options.all) {
console.log(chalk.blue(`Expanding all tasks with ${numSubtasks} subtasks each...`));
if (useResearch) {
console.log(chalk.blue('Using Perplexity AI for research-backed subtask generation'));
@@ -437,7 +443,7 @@ function registerCommands(programInstance) {
if (additionalContext) {
console.log(chalk.blue(`Additional context: "${additionalContext}"`));
}
await expandAllTasks(numSubtasks, useResearch, additionalContext, forceFlag);
await expandAllTasks(tasksPath, numSubtasks, useResearch, additionalContext, forceFlag);
} else if (idArg) {
console.log(chalk.blue(`Expanding task ${idArg} with ${numSubtasks} subtasks...`));
if (useResearch) {
@@ -448,7 +454,7 @@ function registerCommands(programInstance) {
if (additionalContext) {
console.log(chalk.blue(`Additional context: "${additionalContext}"`));
}
await expandTask(idArg, numSubtasks, useResearch, additionalContext);
await expandTask(tasksPath, idArg, numSubtasks, useResearch, additionalContext);
} else {
console.error(chalk.red('Error: Please specify a task ID with --id=<id> or use --all to expand all tasks.'));
}