Compare commits
1 Commits
v0.16.2-rc
...
fix/mcp.to
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b540fe7da |
@@ -22,15 +22,6 @@ export async function updateTasksDirect(args, log, context = {}) {
|
|||||||
const { session } = context; // Extract session
|
const { session } = context; // Extract session
|
||||||
const { tasksJsonPath, from, prompt, research, projectRoot } = args;
|
const { tasksJsonPath, from, prompt, research, projectRoot } = args;
|
||||||
|
|
||||||
// Create the standard logger wrapper
|
|
||||||
const logWrapper = {
|
|
||||||
info: (message, ...args) => log.info(message, ...args),
|
|
||||||
warn: (message, ...args) => log.warn(message, ...args),
|
|
||||||
error: (message, ...args) => log.error(message, ...args),
|
|
||||||
debug: (message, ...args) => log.debug && log.debug(message, ...args),
|
|
||||||
success: (message, ...args) => log.info(message, ...args)
|
|
||||||
};
|
|
||||||
|
|
||||||
// --- Input Validation (Keep existing checks) ---
|
// --- Input Validation (Keep existing checks) ---
|
||||||
if (!tasksJsonPath) {
|
if (!tasksJsonPath) {
|
||||||
log.error('updateTasksDirect called without tasksJsonPath');
|
log.error('updateTasksDirect called without tasksJsonPath');
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import chalk from 'chalk';
|
|||||||
import boxen from 'boxen';
|
import boxen from 'boxen';
|
||||||
import Table from 'cli-table3';
|
import Table from 'cli-table3';
|
||||||
|
|
||||||
import { log, readJSON, writeJSON, truncate } from '../utils.js';
|
import { log, readJSON, writeJSON, truncate, isSilentMode } from '../utils.js';
|
||||||
import { displayBanner } from '../ui.js';
|
import { displayBanner } from '../ui.js';
|
||||||
import generateTaskFiles from './generate-task-files.js';
|
import generateTaskFiles from './generate-task-files.js';
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ function clearSubtasks(tasksPath, taskIds) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isSilentMode()) {
|
||||||
console.log(
|
console.log(
|
||||||
boxen(chalk.white.bold('Clearing Subtasks'), {
|
boxen(chalk.white.bold('Clearing Subtasks'), {
|
||||||
padding: 1,
|
padding: 1,
|
||||||
@@ -30,6 +31,7 @@ function clearSubtasks(tasksPath, taskIds) {
|
|||||||
margin: { top: 1, bottom: 1 }
|
margin: { top: 1, bottom: 1 }
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Handle multiple task IDs (comma-separated)
|
// Handle multiple task IDs (comma-separated)
|
||||||
const taskIdArray = taskIds.split(',').map((id) => id.trim());
|
const taskIdArray = taskIds.split(',').map((id) => id.trim());
|
||||||
@@ -85,6 +87,7 @@ function clearSubtasks(tasksPath, taskIds) {
|
|||||||
writeJSON(tasksPath, data);
|
writeJSON(tasksPath, data);
|
||||||
|
|
||||||
// Show summary table
|
// Show summary table
|
||||||
|
if (!isSilentMode()) {
|
||||||
console.log(
|
console.log(
|
||||||
boxen(chalk.white.bold('Subtask Clearing Summary:'), {
|
boxen(chalk.white.bold('Subtask Clearing Summary:'), {
|
||||||
padding: { left: 2, right: 2, top: 0, bottom: 0 },
|
padding: { left: 2, right: 2, top: 0, bottom: 0 },
|
||||||
@@ -94,12 +97,14 @@ function clearSubtasks(tasksPath, taskIds) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
console.log(summaryTable.toString());
|
console.log(summaryTable.toString());
|
||||||
|
}
|
||||||
|
|
||||||
// Regenerate task files to reflect changes
|
// Regenerate task files to reflect changes
|
||||||
log('info', 'Regenerating task files...');
|
log('info', 'Regenerating task files...');
|
||||||
generateTaskFiles(tasksPath, path.dirname(tasksPath));
|
generateTaskFiles(tasksPath, path.dirname(tasksPath));
|
||||||
|
|
||||||
// Success message
|
// Success message
|
||||||
|
if (!isSilentMode()) {
|
||||||
console.log(
|
console.log(
|
||||||
boxen(
|
boxen(
|
||||||
chalk.green(
|
chalk.green(
|
||||||
@@ -129,7 +134,9 @@ function clearSubtasks(tasksPath, taskIds) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!isSilentMode()) {
|
||||||
console.log(
|
console.log(
|
||||||
boxen(chalk.yellow('No subtasks were cleared'), {
|
boxen(chalk.yellow('No subtasks were cleared'), {
|
||||||
padding: 1,
|
padding: 1,
|
||||||
@@ -140,5 +147,6 @@ function clearSubtasks(tasksPath, taskIds) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default clearSubtasks;
|
export default clearSubtasks;
|
||||||
|
|||||||
@@ -9,7 +9,13 @@ import boxen from 'boxen';
|
|||||||
import ora from 'ora';
|
import ora from 'ora';
|
||||||
import Table from 'cli-table3';
|
import Table from 'cli-table3';
|
||||||
import gradient from 'gradient-string';
|
import gradient from 'gradient-string';
|
||||||
import { log, findTaskById, readJSON, truncate } from './utils.js';
|
import {
|
||||||
|
log,
|
||||||
|
findTaskById,
|
||||||
|
readJSON,
|
||||||
|
truncate,
|
||||||
|
isSilentMode
|
||||||
|
} from './utils.js';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { findNextTask, analyzeTaskComplexity } from './task-manager.js';
|
import { findNextTask, analyzeTaskComplexity } from './task-manager.js';
|
||||||
@@ -23,6 +29,8 @@ const warmGradient = gradient(['#fb8b24', '#e36414', '#9a031e']);
|
|||||||
* Display a fancy banner for the CLI
|
* Display a fancy banner for the CLI
|
||||||
*/
|
*/
|
||||||
function displayBanner() {
|
function displayBanner() {
|
||||||
|
if (isSilentMode()) return;
|
||||||
|
|
||||||
console.clear();
|
console.clear();
|
||||||
const bannerText = figlet.textSync('Task Master', {
|
const bannerText = figlet.textSync('Task Master', {
|
||||||
font: 'Standard',
|
font: 'Standard',
|
||||||
|
|||||||
Reference in New Issue
Block a user