diff --git a/.changeset/beige-doodles-type.md b/.changeset/beige-doodles-type.md deleted file mode 100644 index dd347052..00000000 --- a/.changeset/beige-doodles-type.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Resolve all issues related to MCP diff --git a/.changeset/floppy-plants-marry.md b/.changeset/floppy-plants-marry.md deleted file mode 100644 index 401fed18..00000000 --- a/.changeset/floppy-plants-marry.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix CLI --force flag for parse-prd command - -Previously, the --force flag was not respected when running `parse-prd`, causing the command to prompt for confirmation or fail even when --force was provided. This patch ensures that the flag is correctly passed and handled, allowing users to overwrite existing tasks.json files as intended. - -- Fixes #477 \ No newline at end of file diff --git a/.changeset/forty-plums-stay.md b/.changeset/forty-plums-stay.md deleted file mode 100644 index d49e0653..00000000 --- a/.changeset/forty-plums-stay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': minor ---- - -.taskmasterconfig now supports a baseUrl field per model role (main, research, fallback), allowing endpoint overrides for any provider. diff --git a/.changeset/free-bikes-smile.md b/.changeset/free-bikes-smile.md deleted file mode 100644 index 669437e6..00000000 --- a/.changeset/free-bikes-smile.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'task-master-ai': minor ---- - -Add Ollama as a supported AI provider. - -- You can now add it by running `task-master models --setup` and selecting it. -- Ollama is a local model provider, so no API key is required. -- Ollama models are available at `http://localhost:11434/api` by default. -- You can change the default URL by setting the `OLLAMA_BASE_URL` environment variable or by adding a `baseUrl` property to the `ollama` model role in `.taskmasterconfig`. - - If you want to use a custom API key, you can set it in the `OLLAMA_API_KEY` environment variable. diff --git a/.changeset/many-wasps-sell.md b/.changeset/many-wasps-sell.md deleted file mode 100644 index 75631311..00000000 --- a/.changeset/many-wasps-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Task Master no longer tells you to update when you're already up to date diff --git a/.changeset/nice-lies-cover.md b/.changeset/nice-lies-cover.md deleted file mode 100644 index 2cc66470..00000000 --- a/.changeset/nice-lies-cover.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Adds costs information to AI commands using input/output tokens and model costs. diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 80fad120..00000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "mode": "exit", - "tag": "rc", - "initialVersions": { - "task-master-ai": "0.14.0-rc.0" - }, - "changesets": [ - "beige-doodles-type", - "floppy-plants-marry", - "forty-plums-stay", - "free-bikes-smile", - "many-wasps-sell", - "nice-lies-cover", - "red-oranges-attend", - "red-suns-wash", - "sharp-dingos-melt", - "six-cloths-happen", - "slow-singers-swim", - "small-toys-fly", - "social-masks-fold", - "soft-zoos-flow", - "ten-ways-mate", - "tricky-wombats-spend", - "wide-eyes-relax" - ] -} diff --git a/.changeset/red-oranges-attend.md b/.changeset/red-oranges-attend.md deleted file mode 100644 index 4b86f7d2..00000000 --- a/.changeset/red-oranges-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix ERR_MODULE_NOT_FOUND when trying to run MCP Server diff --git a/.changeset/red-suns-wash.md b/.changeset/red-suns-wash.md deleted file mode 100644 index fcf49b82..00000000 --- a/.changeset/red-suns-wash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Add src directory to exports diff --git a/.changeset/sharp-dingos-melt.md b/.changeset/sharp-dingos-melt.md deleted file mode 100644 index 4c2d9fd9..00000000 --- a/.changeset/sharp-dingos-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix the error handling of task status settings diff --git a/.changeset/six-cloths-happen.md b/.changeset/six-cloths-happen.md deleted file mode 100644 index 28e27856..00000000 --- a/.changeset/six-cloths-happen.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'task-master-ai': patch ---- - -Remove caching layer from MCP direct functions for task listing, next task, and complexity report - -- Fixes issues users where having where they were getting stale data diff --git a/.changeset/slow-singers-swim.md b/.changeset/slow-singers-swim.md deleted file mode 100644 index dadfda63..00000000 --- a/.changeset/slow-singers-swim.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix for issue #409 LOG_LEVEL Pydantic validation error diff --git a/.changeset/small-toys-fly.md b/.changeset/small-toys-fly.md deleted file mode 100644 index 34027402..00000000 --- a/.changeset/small-toys-fly.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'task-master-ai': patch ---- - -Small fixes - - `next` command no longer incorrectly suggests that subtasks be broken down into subtasks in the CLI - - fixes the `append` flag so it properly works in the CLI diff --git a/.changeset/social-masks-fold.md b/.changeset/social-masks-fold.md deleted file mode 100644 index 4a2d4158..00000000 --- a/.changeset/social-masks-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': minor ---- - -Display task complexity scores in task lists, next task, and task details views. diff --git a/.changeset/soft-zoos-flow.md b/.changeset/soft-zoos-flow.md deleted file mode 100644 index d908fa64..00000000 --- a/.changeset/soft-zoos-flow.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix initial .env.example to work out of the box - -- Closes #419 diff --git a/.changeset/ten-ways-mate.md b/.changeset/ten-ways-mate.md deleted file mode 100644 index 993d6e2d..00000000 --- a/.changeset/ten-ways-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix default fallback model and maxTokens in Taskmaster initialization diff --git a/.changeset/tricky-wombats-spend.md b/.changeset/tricky-wombats-spend.md deleted file mode 100644 index 2b961c9c..00000000 --- a/.changeset/tricky-wombats-spend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix bug when updating tasks on the MCP server (#412) diff --git a/.changeset/twenty-plums-act.md b/.changeset/twenty-plums-act.md new file mode 100644 index 00000000..2a62f5de --- /dev/null +++ b/.changeset/twenty-plums-act.md @@ -0,0 +1,6 @@ +--- +'task-master-ai': minor +--- + +Add next task to set task status response +Status: DONE \ No newline at end of file diff --git a/.changeset/wide-eyes-relax.md b/.changeset/wide-eyes-relax.md deleted file mode 100644 index 1684d1a5..00000000 --- a/.changeset/wide-eyes-relax.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'task-master-ai': patch ---- - -Fix duplicate output on CLI help screen - -- Prevent the Task Master CLI from printing the help screen more than once when using `-h` or `--help`. -- Removed redundant manual event handlers and guards for help output; now only the Commander `.helpInformation` override is used for custom help. -- Simplified logic so that help is only shown once for both "no arguments" and help flag flows. -- Ensures a clean, branded help experience with no repeated content. -- Fixes #339 diff --git a/CHANGELOG.md b/CHANGELOG.md index e4357d3f..1582a4d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # task-master-ai +## 0.14.0 + +### Minor Changes + +- [#521](https://github.com/eyaltoledano/claude-task-master/pull/521) [`ed17cb0`](https://github.com/eyaltoledano/claude-task-master/commit/ed17cb0e0a04dedde6c616f68f24f3660f68dd04) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - .taskmasterconfig now supports a baseUrl field per model role (main, research, fallback), allowing endpoint overrides for any provider. + +- [#536](https://github.com/eyaltoledano/claude-task-master/pull/536) [`f4a83ec`](https://github.com/eyaltoledano/claude-task-master/commit/f4a83ec047b057196833e3a9b861d4bceaec805d) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add Ollama as a supported AI provider. + + - You can now add it by running `task-master models --setup` and selecting it. + - Ollama is a local model provider, so no API key is required. + - Ollama models are available at `http://localhost:11434/api` by default. + - You can change the default URL by setting the `OLLAMA_BASE_URL` environment variable or by adding a `baseUrl` property to the `ollama` model role in `.taskmasterconfig`. + - If you want to use a custom API key, you can set it in the `OLLAMA_API_KEY` environment variable. + +- [#528](https://github.com/eyaltoledano/claude-task-master/pull/528) [`58b417a`](https://github.com/eyaltoledano/claude-task-master/commit/58b417a8ce697e655f749ca4d759b1c20014c523) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Display task complexity scores in task lists, next task, and task details views. + +### Patch Changes + +- [#402](https://github.com/eyaltoledano/claude-task-master/pull/402) [`01963af`](https://github.com/eyaltoledano/claude-task-master/commit/01963af2cb6f77f43b2ad8a6e4a838ec205412bc) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Resolve all issues related to MCP + +- [#478](https://github.com/eyaltoledano/claude-task-master/pull/478) [`4117f71`](https://github.com/eyaltoledano/claude-task-master/commit/4117f71c18ee4d321a9c91308d00d5d69bfac61e) Thanks [@joedanz](https://github.com/joedanz)! - Fix CLI --force flag for parse-prd command + + Previously, the --force flag was not respected when running `parse-prd`, causing the command to prompt for confirmation or fail even when --force was provided. This patch ensures that the flag is correctly passed and handled, allowing users to overwrite existing tasks.json files as intended. + + - Fixes #477 + +- [#511](https://github.com/eyaltoledano/claude-task-master/pull/511) [`17294ff`](https://github.com/eyaltoledano/claude-task-master/commit/17294ff25918d64278674e558698a1a9ad785098) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Task Master no longer tells you to update when you're already up to date + +- [#442](https://github.com/eyaltoledano/claude-task-master/pull/442) [`2b3ae8b`](https://github.com/eyaltoledano/claude-task-master/commit/2b3ae8bf89dc471c4ce92f3a12ded57f61faa449) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Adds costs information to AI commands using input/output tokens and model costs. + +- [#402](https://github.com/eyaltoledano/claude-task-master/pull/402) [`01963af`](https://github.com/eyaltoledano/claude-task-master/commit/01963af2cb6f77f43b2ad8a6e4a838ec205412bc) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix ERR_MODULE_NOT_FOUND when trying to run MCP Server + +- [#402](https://github.com/eyaltoledano/claude-task-master/pull/402) [`01963af`](https://github.com/eyaltoledano/claude-task-master/commit/01963af2cb6f77f43b2ad8a6e4a838ec205412bc) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add src directory to exports + +- [#523](https://github.com/eyaltoledano/claude-task-master/pull/523) [`da317f2`](https://github.com/eyaltoledano/claude-task-master/commit/da317f2607ca34db1be78c19954996f634c40923) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix the error handling of task status settings + +- [#527](https://github.com/eyaltoledano/claude-task-master/pull/527) [`a8dabf4`](https://github.com/eyaltoledano/claude-task-master/commit/a8dabf44856713f488960224ee838761716bba26) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Remove caching layer from MCP direct functions for task listing, next task, and complexity report + + - Fixes issues users where having where they were getting stale data + +- [#417](https://github.com/eyaltoledano/claude-task-master/pull/417) [`a1f8d52`](https://github.com/eyaltoledano/claude-task-master/commit/a1f8d52474fdbdf48e17a63e3f567a6d63010d9f) Thanks [@ksylvan](https://github.com/ksylvan)! - Fix for issue #409 LOG_LEVEL Pydantic validation error + +- [#442](https://github.com/eyaltoledano/claude-task-master/pull/442) [`0288311`](https://github.com/eyaltoledano/claude-task-master/commit/0288311965ae2a343ebee4a0c710dde94d2ae7e7) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Small fixes - `next` command no longer incorrectly suggests that subtasks be broken down into subtasks in the CLI - fixes the `append` flag so it properly works in the CLI + +- [#501](https://github.com/eyaltoledano/claude-task-master/pull/501) [`0a61184`](https://github.com/eyaltoledano/claude-task-master/commit/0a611843b56a856ef0a479dc34078326e05ac3a8) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix initial .env.example to work out of the box + + - Closes #419 + +- [#435](https://github.com/eyaltoledano/claude-task-master/pull/435) [`a96215a`](https://github.com/eyaltoledano/claude-task-master/commit/a96215a359b25061fd3b3f3c7b10e8ac0390c062) Thanks [@lebsral](https://github.com/lebsral)! - Fix default fallback model and maxTokens in Taskmaster initialization + +- [#517](https://github.com/eyaltoledano/claude-task-master/pull/517) [`e96734a`](https://github.com/eyaltoledano/claude-task-master/commit/e96734a6cc6fec7731de72eb46b182a6e3743d02) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix bug when updating tasks on the MCP server (#412) + +- [#496](https://github.com/eyaltoledano/claude-task-master/pull/496) [`efce374`](https://github.com/eyaltoledano/claude-task-master/commit/efce37469bc58eceef46763ba32df1ed45242211) Thanks [@joedanz](https://github.com/joedanz)! - Fix duplicate output on CLI help screen + + - Prevent the Task Master CLI from printing the help screen more than once when using `-h` or `--help`. + - Removed redundant manual event handlers and guards for help output; now only the Commander `.helpInformation` override is used for custom help. + - Simplified logic so that help is only shown once for both "no arguments" and help flag flows. + - Ensures a clean, branded help experience with no repeated content. + - Fixes #339 + ## 0.14.0-rc.1 ### Minor Changes diff --git a/mcp-server/src/core/direct-functions/set-task-status.js b/mcp-server/src/core/direct-functions/set-task-status.js index 39845ad1..9711b771 100644 --- a/mcp-server/src/core/direct-functions/set-task-status.js +++ b/mcp-server/src/core/direct-functions/set-task-status.js @@ -9,7 +9,7 @@ import { disableSilentMode, isSilentMode } from '../../../../scripts/modules/utils.js'; - +import { nextTaskDirect } from './next-task.js'; /** * Direct function wrapper for setTaskStatus with error handling. * @@ -19,7 +19,7 @@ import { */ export async function setTaskStatusDirect(args, log) { // Destructure expected args, including the resolved tasksJsonPath - const { tasksJsonPath, id, status } = args; + const { tasksJsonPath, id, status, complexityReportPath } = args; try { log.info(`Setting task status with args: ${JSON.stringify(args)}`); @@ -85,6 +85,39 @@ export async function setTaskStatusDirect(args, log) { }, fromCache: false // This operation always modifies state and should never be cached }; + + // If the task was completed, attempt to fetch the next task + if (result.data.status === 'done') { + try { + log.info(`Attempting to fetch next task for task ${taskId}`); + const nextResult = await nextTaskDirect( + { + tasksJsonPath: tasksJsonPath, + reportPath: complexityReportPath + }, + log + ); + + if (nextResult.success) { + log.info( + `Successfully retrieved next task: ${nextResult.data.nextTask}` + ); + result.data = { + ...result.data, + nextTask: nextResult.data.nextTask, + isNextSubtask: nextResult.data.isSubtask, + nextSteps: nextResult.data.nextSteps + }; + } else { + log.warn( + `Failed to retrieve next task: ${nextResult.error?.message || 'Unknown error'}` + ); + } + } catch (nextErr) { + log.error(`Error retrieving next task: ${nextErr.message}`); + } + } + return result; } catch (error) { log.error(`Error setting task status: ${error.message}`); diff --git a/mcp-server/src/tools/set-task-status.js b/mcp-server/src/tools/set-task-status.js index 04ae9052..8a28658d 100644 --- a/mcp-server/src/tools/set-task-status.js +++ b/mcp-server/src/tools/set-task-status.js @@ -9,8 +9,14 @@ import { createErrorResponse, withNormalizedProjectRoot } from './utils.js'; -import { setTaskStatusDirect } from '../core/task-master-core.js'; -import { findTasksJsonPath } from '../core/utils/path-utils.js'; +import { + setTaskStatusDirect, + nextTaskDirect +} from '../core/task-master-core.js'; +import { + findTasksJsonPath, + findComplexityReportPath +} from '../core/utils/path-utils.js'; import { TASK_STATUS_OPTIONS } from '../../../src/constants/task-status.js'; /** @@ -33,6 +39,12 @@ export function registerSetTaskStatusTool(server) { "New status to set (e.g., 'pending', 'done', 'in-progress', 'review', 'deferred', 'cancelled'." ), file: z.string().optional().describe('Absolute path to the tasks file'), + complexityReport: z + .string() + .optional() + .describe( + 'Path to the complexity report file (relative to project root or absolute)' + ), projectRoot: z .string() .describe('The directory of the project. Must be an absolute path.') @@ -55,11 +67,23 @@ export function registerSetTaskStatusTool(server) { ); } + let complexityReportPath; + try { + complexityReportPath = findComplexityReportPath( + args.projectRoot, + args.complexityReport, + log + ); + } catch (error) { + log.error(`Error finding complexity report: ${error.message}`); + } + const result = await setTaskStatusDirect( { tasksJsonPath: tasksJsonPath, id: args.id, - status: args.status + status: args.status, + complexityReportPath }, log ); diff --git a/package.json b/package.json index 9abffc4f..5ff7adb3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "task-master-ai", - "version": "0.14.0-rc.1", + "version": "0.14.0", "description": "A task management system for ambitious AI-driven development that doesn't overwhelm and confuse Cursor.", "main": "index.js", "type": "module", diff --git a/src/ai-providers/ollama.js b/src/ai-providers/ollama.js index 28779c48..e9527233 100644 --- a/src/ai-providers/ollama.js +++ b/src/ai-providers/ollama.js @@ -3,7 +3,7 @@ * AI provider implementation for Ollama models using the ollama-ai-provider package. */ -import { createOllama, ollama } from 'ollama-ai-provider'; +import { createOllama } from 'ollama-ai-provider'; import { log } from '../../scripts/modules/utils.js'; // Import logging utility import { generateObject, generateText, streamText } from 'ai'; @@ -48,7 +48,13 @@ async function generateOllamaText({ temperature }); log('debug', `Ollama generated text: ${result.text}`); - return result.text; + return { + text: result.text, + usage: { + inputTokens: result.usage.promptTokens, + outputTokens: result.usage.completionTokens + } + }; } catch (error) { log( 'error', @@ -138,7 +144,13 @@ async function generateOllamaObject({ temperature: temperature, maxRetries: maxRetries }); - return result.object; + return { + object: result.object, + usage: { + inputTokens: result.usage.promptTokens, + outputTokens: result.usage.completionTokens + } + }; } catch (error) { log( 'error',