Compare commits

..

2 Commits

Author SHA1 Message Date
Ralph Khreish
455cd1ca3a fix: resolve release issue 2025-09-22 22:15:47 +02:00
Ralph Khreish
f8ede8886a chore: fix CI failing to release 2025-09-22 21:33:12 +02:00
102 changed files with 218 additions and 536 deletions

View File

@@ -0,0 +1,5 @@
---
"task-master-ai": patch
---
Fix module not found for new 0.27.0 release

View File

@@ -1,41 +1,5 @@
# task-master-ai # task-master-ai
## 0.27.3
### Patch Changes
- [#1254](https://github.com/eyaltoledano/claude-task-master/pull/1254) [`af53525`](https://github.com/eyaltoledano/claude-task-master/commit/af53525cbc660a595b67d4bb90d906911c71f45d) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fixed issue where `tm show` command could not find subtasks using dotted notation IDs (e.g., '8.1').
- The command now properly searches within parent task subtasks and returns the correct subtask information.
## 0.27.2
### Patch Changes
- [#1248](https://github.com/eyaltoledano/claude-task-master/pull/1248) [`044a7bf`](https://github.com/eyaltoledano/claude-task-master/commit/044a7bfc98049298177bc655cf341d7a8b6a0011) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix set-status for subtasks:
- Parent tasks are now set as `done` when subtasks are all `done`
- Parent tasks are now set as `in-progress` when at least one subtask is `in-progress` or `done`
## 0.27.1
### Patch Changes
- [#1232](https://github.com/eyaltoledano/claude-task-master/pull/1232) [`f487736`](https://github.com/eyaltoledano/claude-task-master/commit/f487736670ef8c484059f676293777eabb249c9e) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix module not found for new 0.27.0 release
- [#1233](https://github.com/eyaltoledano/claude-task-master/pull/1233) [`c911608`](https://github.com/eyaltoledano/claude-task-master/commit/c911608f60454253f4e024b57ca84e5a5a53f65c) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix Zed MCP configuration by adding required "source" property
- Add "source": "custom" property to task-master-ai server in Zed settings.json
## 0.27.1-rc.1
### Patch Changes
- [#1233](https://github.com/eyaltoledano/claude-task-master/pull/1233) [`1a18794`](https://github.com/eyaltoledano/claude-task-master/commit/1a1879483b86c118a4e46c02cbf4acebfcf6bcf9) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - One last testing final final
## 0.27.1-rc.0
### Patch Changes
- [#1232](https://github.com/eyaltoledano/claude-task-master/pull/1232) [`f487736`](https://github.com/eyaltoledano/claude-task-master/commit/f487736670ef8c484059f676293777eabb249c9e) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix module not found for new 0.27.0 release
## 0.27.0 ## 0.27.0
### Minor Changes ### Minor Changes

View File

@@ -1,12 +1,5 @@
# @tm/cli # @tm/cli
## null
### Patch Changes
- Updated dependencies []:
- @tm/core@null
## 0.27.0 ## 0.27.0
### Patch Changes ### Patch Changes

View File

@@ -18,8 +18,7 @@ export * as ui from './utils/ui.js';
export { export {
checkForUpdate, checkForUpdate,
performAutoUpdate, performAutoUpdate,
displayUpgradeNotification, displayUpgradeNotification
compareVersions
} from './utils/auto-update.js'; } from './utils/auto-update.js';
// Re-export commonly used types from tm-core // Re-export commonly used types from tm-core

View File

@@ -7,6 +7,7 @@ import https from 'https';
import chalk from 'chalk'; import chalk from 'chalk';
import ora from 'ora'; import ora from 'ora';
import boxen from 'boxen'; import boxen from 'boxen';
import packageJson from '../../../../package.json' with { type: 'json' };
export interface UpdateInfo { export interface UpdateInfo {
currentVersion: string; currentVersion: string;
@@ -15,18 +16,15 @@ export interface UpdateInfo {
} }
/** /**
* Get current version from build-time injected environment variable * Get current version from package.json
*/ */
function getCurrentVersion(): string { function getCurrentVersion(): string {
// Version is injected at build time via TM_PUBLIC_VERSION try {
const version = process.env.TM_PUBLIC_VERSION; return packageJson.version;
if (version && version !== 'unknown') { } catch (error) {
return version; console.warn('Could not read package.json for version info');
return '0.0.0';
} }
// Fallback for development or if injection failed
console.warn('Could not read version from TM_PUBLIC_VERSION, using fallback');
return '0.0.0';
} }
/** /**
@@ -35,7 +33,7 @@ function getCurrentVersion(): string {
* @param v2 - Second version * @param v2 - Second version
* @returns -1 if v1 < v2, 0 if v1 = v2, 1 if v1 > v2 * @returns -1 if v1 < v2, 0 if v1 = v2, 1 if v1 > v2
*/ */
export function compareVersions(v1: string, v2: string): number { function compareVersions(v1: string, v2: string): number {
const toParts = (v: string) => { const toParts = (v: string) => {
const [core, pre = ''] = v.split('-', 2); const [core, pre = ''] = v.split('-', 2);
const nums = core.split('.').map((n) => Number.parseInt(n, 10) || 0); const nums = core.split('.').map((n) => Number.parseInt(n, 10) || 0);

View File

@@ -1,7 +1,5 @@
# docs # docs
## 0.0.4
## 0.0.3 ## 0.0.3
## 0.0.2 ## 0.0.2

View File

@@ -1,6 +1,6 @@
{ {
"name": "docs", "name": "docs",
"version": "0.0.4", "version": "0.0.3",
"private": true, "private": true,
"description": "Task Master documentation powered by Mintlify", "description": "Task Master documentation powered by Mintlify",
"scripts": { "scripts": {

View File

@@ -1,40 +1,5 @@
# Change Log # Change Log
## 0.25.4
### Patch Changes
- Updated dependencies [[`af53525`](https://github.com/eyaltoledano/claude-task-master/commit/af53525cbc660a595b67d4bb90d906911c71f45d)]:
- task-master-ai@0.27.3
## 0.25.3
### Patch Changes
- Updated dependencies [[`044a7bf`](https://github.com/eyaltoledano/claude-task-master/commit/044a7bfc98049298177bc655cf341d7a8b6a0011)]:
- task-master-ai@0.27.2
## 0.25.2
### Patch Changes
- Updated dependencies [[`f487736`](https://github.com/eyaltoledano/claude-task-master/commit/f487736670ef8c484059f676293777eabb249c9e), [`c911608`](https://github.com/eyaltoledano/claude-task-master/commit/c911608f60454253f4e024b57ca84e5a5a53f65c), [`1a18794`](https://github.com/eyaltoledano/claude-task-master/commit/1a1879483b86c118a4e46c02cbf4acebfcf6bcf9)]:
- task-master-ai@0.27.1
## 0.25.2-rc.1
### Patch Changes
- Updated dependencies [[`1a18794`](https://github.com/eyaltoledano/claude-task-master/commit/1a1879483b86c118a4e46c02cbf4acebfcf6bcf9)]:
- task-master-ai@0.27.1-rc.1
## 0.25.2-rc.0
### Patch Changes
- Updated dependencies [[`f487736`](https://github.com/eyaltoledano/claude-task-master/commit/f487736670ef8c484059f676293777eabb249c9e)]:
- task-master-ai@0.27.1-rc.0
## 0.25.0 ## 0.25.0
### Minor Changes ### Minor Changes

View File

@@ -3,7 +3,7 @@
"private": true, "private": true,
"displayName": "TaskMaster", "displayName": "TaskMaster",
"description": "A visual Kanban board interface for TaskMaster projects in VS Code", "description": "A visual Kanban board interface for TaskMaster projects in VS Code",
"version": "0.25.4", "version": "0.25.1",
"publisher": "Hamster", "publisher": "Hamster",
"icon": "assets/icon.png", "icon": "assets/icon.png",
"engines": { "engines": {
@@ -240,7 +240,7 @@
"check-types": "tsc --noEmit" "check-types": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"task-master-ai": "0.27.3" "task-master-ai": "*"
}, },
"devDependencies": { "devDependencies": {
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",

55
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.27.3", "version": "0.27.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.27.3", "version": "0.27.0",
"license": "MIT WITH Commons-Clause", "license": "MIT WITH Commons-Clause",
"workspaces": [ "workspaces": [
"apps/*", "apps/*",
@@ -29,7 +29,7 @@
"@inquirer/search": "^3.0.15", "@inquirer/search": "^3.0.15",
"@openrouter/ai-sdk-provider": "^0.4.5", "@openrouter/ai-sdk-provider": "^0.4.5",
"@streamparser/json": "^0.0.22", "@streamparser/json": "^0.0.22",
"@supabase/supabase-js": "^2.57.4", "@supabase/supabase-js": "^2.48.0",
"ai": "^4.3.10", "ai": "^4.3.10",
"ajv": "^8.17.1", "ajv": "^8.17.1",
"ajv-formats": "^3.0.1", "ajv-formats": "^3.0.1",
@@ -38,7 +38,7 @@
"cli-highlight": "^2.1.11", "cli-highlight": "^2.1.11",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"cli-table3": "^0.6.5", "cli-table3": "^0.6.5",
"commander": "^12.1.0", "commander": "^11.1.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"express": "^4.21.2", "express": "^4.21.2",
@@ -86,9 +86,9 @@
"supertest": "^7.1.0", "supertest": "^7.1.0",
"ts-jest": "^29.4.2", "ts-jest": "^29.4.2",
"tsdown": "^0.15.2", "tsdown": "^0.15.2",
"tsx": "^4.20.4", "tsx": "^4.16.2",
"turbo": "^2.5.6", "turbo": "^2.5.6",
"typescript": "^5.7.3" "typescript": "^5.9.2"
}, },
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"
@@ -104,12 +104,12 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@tm/core": "*", "@tm/core": "*",
"boxen": "^8.0.1", "boxen": "^7.1.1",
"chalk": "5.6.2", "chalk": "5.6.2",
"cli-table3": "^0.6.5", "cli-table3": "^0.6.5",
"commander": "^12.1.0", "commander": "^12.1.0",
"inquirer": "^12.5.0", "inquirer": "^9.2.10",
"ora": "^8.2.0" "ora": "^8.1.0"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^1.9.4", "@biomejs/biome": "^1.9.4",
@@ -190,6 +190,15 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT" "license": "MIT"
}, },
"apps/cli/node_modules/commander": {
"version": "12.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
"integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"apps/cli/node_modules/emoji-regex": { "apps/cli/node_modules/emoji-regex": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
@@ -351,15 +360,15 @@
} }
}, },
"apps/docs": { "apps/docs": {
"version": "0.0.4", "version": "0.0.3",
"devDependencies": { "devDependencies": {
"mintlify": "^4.2.111" "mintlify": "^4.2.111"
} }
}, },
"apps/extension": { "apps/extension": {
"version": "0.25.4", "version": "0.25.1",
"dependencies": { "dependencies": {
"task-master-ai": "0.27.3" "task-master-ai": "*"
}, },
"devDependencies": { "devDependencies": {
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",
@@ -375,7 +384,7 @@
"@tailwindcss/postcss": "^4.1.11", "@tailwindcss/postcss": "^4.1.11",
"@tanstack/react-query": "^5.83.0", "@tanstack/react-query": "^5.83.0",
"@types/mocha": "^10.0.10", "@types/mocha": "^10.0.10",
"@types/node": "^22.10.5", "@types/node": "20.x",
"@types/react": "19.1.8", "@types/react": "19.1.8",
"@types/react-dom": "19.1.6", "@types/react-dom": "19.1.6",
"@types/vscode": "^1.101.0", "@types/vscode": "^1.101.0",
@@ -395,7 +404,7 @@
"react-dom": "^19.0.0", "react-dom": "^19.0.0",
"tailwind-merge": "^3.3.1", "tailwind-merge": "^3.3.1",
"tailwindcss": "4.1.11", "tailwindcss": "4.1.11",
"typescript": "^5.7.3" "typescript": "^5.8.3"
}, },
"engines": { "engines": {
"vscode": "^1.93.0" "vscode": "^1.93.0"
@@ -14304,12 +14313,12 @@
} }
}, },
"node_modules/commander": { "node_modules/commander": {
"version": "12.1.0", "version": "11.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
"integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=18" "node": ">=16"
} }
}, },
"node_modules/component-emitter": { "node_modules/component-emitter": {
@@ -32169,18 +32178,18 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@supabase/supabase-js": "^2.57.4", "@supabase/supabase-js": "^2.57.4",
"zod": "^3.23.8" "zod": "^3.22.4"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^1.9.4", "@biomejs/biome": "^1.9.4",
"@tm/build-config": "*", "@tm/build-config": "*",
"@types/node": "^22.10.5", "@types/node": "^20.11.30",
"@vitest/coverage-v8": "^2.0.5", "@vitest/coverage-v8": "^2.0.5",
"dotenv-mono": "^1.5.1", "dotenv-mono": "^1.3.14",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"tsup": "^8.5.0", "tsup": "^8.5.0",
"typescript": "^5.7.3", "typescript": "^5.4.3",
"vitest": "^2.1.8" "vitest": "^2.0.5"
}, },
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"

View File

@@ -1,6 +1,6 @@
{ {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.27.3", "version": "0.27.0",
"description": "A task management system for ambitious AI-driven development that doesn't overwhelm and confuse Cursor.", "description": "A task management system for ambitious AI-driven development that doesn't overwhelm and confuse Cursor.",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",

View File

@@ -1,5 +1,3 @@
# @tm/build-config # @tm/build-config
## null
## 1.0.1 ## 1.0.1

View File

@@ -1,7 +1,5 @@
# Changelog # Changelog
## null
## 0.26.1 ## 0.26.1
All notable changes to the @task-master/tm-core package will be documented in this file. All notable changes to the @task-master/tm-core package will be documented in this file.

View File

@@ -3,17 +3,7 @@
* This file defines the contract for all storage implementations * This file defines the contract for all storage implementations
*/ */
import type { Task, TaskMetadata, TaskStatus } from '../types/index.js'; import type { Task, TaskMetadata } from '../types/index.js';
/**
* Result type for updateTaskStatus operations
*/
export interface UpdateStatusResult {
success: boolean;
oldStatus: TaskStatus;
newStatus: TaskStatus;
taskId: string;
}
/** /**
* Interface for storage operations on tasks * Interface for storage operations on tasks
@@ -64,19 +54,6 @@ export interface IStorage {
tag?: string tag?: string
): Promise<void>; ): Promise<void>;
/**
* Update task or subtask status by ID
* @param taskId - ID of the task or subtask (e.g., "1" or "1.2")
* @param newStatus - New status to set
* @param tag - Optional tag context for the task
* @returns Promise that resolves to update result with old and new status
*/
updateTaskStatus(
taskId: string,
newStatus: TaskStatus,
tag?: string
): Promise<UpdateStatusResult>;
/** /**
* Delete a task by ID * Delete a task by ID
* @param taskId - ID of the task to delete * @param taskId - ID of the task to delete
@@ -214,11 +191,6 @@ export abstract class BaseStorage implements IStorage {
updates: Partial<Task>, updates: Partial<Task>,
tag?: string tag?: string
): Promise<void>; ): Promise<void>;
abstract updateTaskStatus(
taskId: string,
newStatus: TaskStatus,
tag?: string
): Promise<UpdateStatusResult>;
abstract deleteTask(taskId: string, tag?: string): Promise<void>; abstract deleteTask(taskId: string, tag?: string): Promise<void>;
abstract exists(tag?: string): Promise<boolean>; abstract exists(tag?: string): Promise<boolean>;
abstract loadMetadata(tag?: string): Promise<TaskMetadata | null>; abstract loadMetadata(tag?: string): Promise<TaskMetadata | null>;

View File

@@ -135,28 +135,15 @@ export class TaskService {
} }
/** /**
* Get a single task by ID - delegates to storage layer * Get a single task by ID
*/ */
async getTask(taskId: string, tag?: string): Promise<Task | null> { async getTask(taskId: string, tag?: string): Promise<Task | null> {
// Use provided tag or get active tag const result = await this.getTaskList({
const activeTag = tag || this.getActiveTag(); tag,
includeSubtasks: true
});
try { return result.tasks.find((t) => t.id === taskId) || null;
// Delegate to storage layer which handles the specific logic for tasks vs subtasks
return await this.storage.loadTask(String(taskId), activeTag);
} catch (error) {
throw new TaskMasterError(
`Failed to get task ${taskId}`,
ERROR_CODES.STORAGE_ERROR,
{
operation: 'getTask',
resource: 'task',
taskId: String(taskId),
tag: activeTag
},
error as Error
);
}
} }
/** /**
@@ -459,7 +446,7 @@ export class TaskService {
} }
/** /**
* Update task status - delegates to storage layer which handles storage-specific logic * Update task status
*/ */
async updateTaskStatus( async updateTaskStatus(
taskId: string | number, taskId: string | number,
@@ -481,28 +468,49 @@ export class TaskService {
// Use provided tag or get active tag // Use provided tag or get active tag
const activeTag = tag || this.getActiveTag(); const activeTag = tag || this.getActiveTag();
const taskIdStr = String(taskId); const taskIdStr = String(taskId);
try { // TODO: For now, assume it's a regular task and just try to update directly
// Delegate to storage layer which handles the specific logic for tasks vs subtasks // In the future, we can add subtask support if needed
return await this.storage.updateTaskStatus( if (taskIdStr.includes('.')) {
taskIdStr, throw new TaskMasterError(
newStatus, 'Subtask status updates not yet supported in API storage',
activeTag ERROR_CODES.NOT_IMPLEMENTED
); );
}
// Get the current task to get old status (simple, direct approach)
let currentTask: Task | null;
try {
// Try to get the task directly
currentTask = await this.storage.loadTask(taskIdStr, activeTag);
} catch (error) { } catch (error) {
throw new TaskMasterError( throw new TaskMasterError(
`Failed to update task status for ${taskIdStr}`, `Failed to load task ${taskIdStr}`,
ERROR_CODES.STORAGE_ERROR, ERROR_CODES.TASK_NOT_FOUND,
{ { taskId: taskIdStr },
operation: 'updateTaskStatus',
resource: 'task',
taskId: taskIdStr,
newStatus,
tag: activeTag
},
error as Error error as Error
); );
} }
if (!currentTask) {
throw new TaskMasterError(
`Task ${taskIdStr} not found`,
ERROR_CODES.TASK_NOT_FOUND
);
}
const oldStatus = currentTask.status;
// Simple, direct update - just change the status
await this.storage.updateTask(taskIdStr, { status: newStatus }, activeTag);
return {
success: true,
oldStatus,
newStatus,
taskId: taskIdStr
};
} }
} }

View File

@@ -5,15 +5,9 @@
import type { import type {
IStorage, IStorage,
StorageStats, StorageStats
UpdateStatusResult
} from '../interfaces/storage.interface.js'; } from '../interfaces/storage.interface.js';
import type { import type { Task, TaskMetadata, TaskTag } from '../types/index.js';
Task,
TaskMetadata,
TaskTag,
TaskStatus
} from '../types/index.js';
import { ERROR_CODES, TaskMasterError } from '../errors/task-master-error.js'; import { ERROR_CODES, TaskMasterError } from '../errors/task-master-error.js';
import { TaskRepository } from '../repositories/task-repository.interface.js'; import { TaskRepository } from '../repositories/task-repository.interface.js';
import { SupabaseTaskRepository } from '../repositories/supabase-task-repository.js'; import { SupabaseTaskRepository } from '../repositories/supabase-task-repository.js';
@@ -491,62 +485,6 @@ export class ApiStorage implements IStorage {
} }
} }
/**
* Update task or subtask status by ID - for API storage
*/
async updateTaskStatus(
taskId: string,
newStatus: TaskStatus,
tag?: string
): Promise<UpdateStatusResult> {
await this.ensureInitialized();
try {
const existingTask = await this.retryOperation(() =>
this.repository.getTask(this.projectId, taskId)
);
if (!existingTask) {
throw new Error(`Task ${taskId} not found`);
}
const oldStatus = existingTask.status;
if (oldStatus === newStatus) {
return {
success: true,
oldStatus,
newStatus,
taskId
};
}
// Update the task/subtask status
await this.retryOperation(() =>
this.repository.updateTask(this.projectId, taskId, {
status: newStatus,
updatedAt: new Date().toISOString()
})
);
// Note: Parent status auto-adjustment is handled by the backend API service
// which has its own business logic for managing task relationships
return {
success: true,
oldStatus,
newStatus,
taskId
};
} catch (error) {
throw new TaskMasterError(
'Failed to update task status via API',
ERROR_CODES.STORAGE_ERROR,
{ operation: 'updateTaskStatus', taskId, newStatus, tag },
error as Error
);
}
}
/** /**
* Get all available tags * Get all available tags
*/ */

View File

@@ -2,11 +2,10 @@
* @fileoverview Refactored file-based storage implementation for Task Master * @fileoverview Refactored file-based storage implementation for Task Master
*/ */
import type { Task, TaskMetadata, TaskStatus } from '../../types/index.js'; import type { Task, TaskMetadata } from '../../types/index.js';
import type { import type {
IStorage, IStorage,
StorageStats, StorageStats
UpdateStatusResult
} from '../../interfaces/storage.interface.js'; } from '../../interfaces/storage.interface.js';
import { FormatHandler } from './format-handler.js'; import { FormatHandler } from './format-handler.js';
import { FileOperations } from './file-operations.js'; import { FileOperations } from './file-operations.js';
@@ -105,65 +104,9 @@ export class FileStorage implements IStorage {
/** /**
* Load a single task by ID from the tasks.json file * Load a single task by ID from the tasks.json file
* Handles both regular tasks and subtasks (with dotted notation like "1.2")
*/ */
async loadTask(taskId: string, tag?: string): Promise<Task | null> { async loadTask(taskId: string, tag?: string): Promise<Task | null> {
const tasks = await this.loadTasks(tag); const tasks = await this.loadTasks(tag);
// Check if this is a subtask (contains a dot)
if (taskId.includes('.')) {
const [parentId, subtaskId] = taskId.split('.');
const parentTask = tasks.find((t) => String(t.id) === parentId);
if (!parentTask || !parentTask.subtasks) {
return null;
}
const subtask = parentTask.subtasks.find(
(st) => String(st.id) === subtaskId
);
if (!subtask) {
return null;
}
const toFullSubId = (maybeDotId: string | number): string => {
const depId = String(maybeDotId);
return depId.includes('.') ? depId : `${parentTask.id}.${depId}`;
};
const resolvedDependencies =
subtask.dependencies?.map((dep) => toFullSubId(dep)) ?? [];
// Return a Task-like object for the subtask with the full dotted ID
// Following the same pattern as findTaskById in utils.js
const subtaskResult = {
...subtask,
id: taskId, // Use the full dotted ID
title: subtask.title || `Subtask ${subtaskId}`,
description: subtask.description || '',
status: subtask.status || 'pending',
priority: subtask.priority || parentTask.priority || 'medium',
dependencies: resolvedDependencies,
details: subtask.details || '',
testStrategy: subtask.testStrategy || '',
subtasks: [],
tags: parentTask.tags || [],
assignee: subtask.assignee || parentTask.assignee,
complexity: subtask.complexity || parentTask.complexity,
createdAt: subtask.createdAt || parentTask.createdAt,
updatedAt: subtask.updatedAt || parentTask.updatedAt,
// Add reference to parent task for context (like utils.js does)
parentTask: {
id: parentTask.id,
title: parentTask.title,
status: parentTask.status
},
isSubtask: true
};
return subtaskResult;
}
// Handle regular task lookup
return tasks.find((task) => String(task.id) === String(taskId)) || null; return tasks.find((task) => String(task.id) === String(taskId)) || null;
} }
@@ -338,156 +281,6 @@ export class FileStorage implements IStorage {
await this.saveTasks(tasks, tag); await this.saveTasks(tasks, tag);
} }
/**
* Update task or subtask status by ID - handles file storage logic with parent/subtask relationships
*/
async updateTaskStatus(
taskId: string,
newStatus: TaskStatus,
tag?: string
): Promise<UpdateStatusResult> {
const tasks = await this.loadTasks(tag);
// Check if this is a subtask (contains a dot)
if (taskId.includes('.')) {
return this.updateSubtaskStatusInFile(tasks, taskId, newStatus, tag);
}
// Handle regular task update
const taskIndex = tasks.findIndex((t) => String(t.id) === String(taskId));
if (taskIndex === -1) {
throw new Error(`Task ${taskId} not found`);
}
const oldStatus = tasks[taskIndex].status;
if (oldStatus === newStatus) {
return {
success: true,
oldStatus,
newStatus,
taskId: String(taskId)
};
}
tasks[taskIndex] = {
...tasks[taskIndex],
status: newStatus,
updatedAt: new Date().toISOString()
};
await this.saveTasks(tasks, tag);
return {
success: true,
oldStatus,
newStatus,
taskId: String(taskId)
};
}
/**
* Update subtask status within file storage - handles parent status auto-adjustment
*/
private async updateSubtaskStatusInFile(
tasks: Task[],
subtaskId: string,
newStatus: TaskStatus,
tag?: string
): Promise<UpdateStatusResult> {
// Parse the subtask ID to get parent ID and subtask ID
const parts = subtaskId.split('.');
if (parts.length !== 2) {
throw new Error(
`Invalid subtask ID format: ${subtaskId}. Expected format: parentId.subtaskId`
);
}
const [parentId, subIdRaw] = parts;
const subId = subIdRaw.trim();
if (!/^\d+$/.test(subId)) {
throw new Error(
`Invalid subtask ID: ${subId}. Subtask ID must be a positive integer.`
);
}
const subtaskNumericId = Number(subId);
// Find the parent task
const parentTaskIndex = tasks.findIndex(
(t) => String(t.id) === String(parentId)
);
if (parentTaskIndex === -1) {
throw new Error(`Parent task ${parentId} not found`);
}
const parentTask = tasks[parentTaskIndex];
// Find the subtask within the parent task
const subtaskIndex = parentTask.subtasks.findIndex(
(st) => st.id === subtaskNumericId || String(st.id) === subId
);
if (subtaskIndex === -1) {
throw new Error(
`Subtask ${subtaskId} not found in parent task ${parentId}`
);
}
const oldStatus = parentTask.subtasks[subtaskIndex].status || 'pending';
if (oldStatus === newStatus) {
return {
success: true,
oldStatus,
newStatus,
taskId: subtaskId
};
}
const now = new Date().toISOString();
// Update the subtask status
parentTask.subtasks[subtaskIndex] = {
...parentTask.subtasks[subtaskIndex],
status: newStatus,
updatedAt: now
};
// Auto-adjust parent status based on subtask statuses
const subs = parentTask.subtasks;
let parentNewStatus = parentTask.status;
if (subs.length > 0) {
const norm = (s: any) => s.status || 'pending';
const isDoneLike = (s: any) => {
const st = norm(s);
return st === 'done' || st === 'completed';
};
const allDone = subs.every(isDoneLike);
const anyInProgress = subs.some((s) => norm(s) === 'in-progress');
const anyDone = subs.some(isDoneLike);
if (allDone) parentNewStatus = 'done';
else if (anyInProgress || anyDone) parentNewStatus = 'in-progress';
}
// Always bump updatedAt; update status only if changed
tasks[parentTaskIndex] = {
...parentTask,
...(parentNewStatus !== parentTask.status
? { status: parentNewStatus }
: {}),
updatedAt: now
};
await this.saveTasks(tasks, tag);
return {
success: true,
oldStatus,
newStatus,
taskId: subtaskId
};
}
/** /**
* Delete a task * Delete a task
*/ */

View File

@@ -16,6 +16,8 @@
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import readline from 'readline'; import readline from 'readline';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import chalk from 'chalk'; import chalk from 'chalk';
import figlet from 'figlet'; import figlet from 'figlet';
import boxen from 'boxen'; import boxen from 'boxen';
@@ -47,6 +49,9 @@ import {
GITIGNORE_FILE GITIGNORE_FILE
} from '../src/constants/paths.js'; } from '../src/constants/paths.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Define log levels // Define log levels
const LOG_LEVELS = { const LOG_LEVELS = {
debug: 0, debug: 0,
@@ -614,7 +619,13 @@ function createProjectStructure(
// Copy .gitignore with GitTasks preference // Copy .gitignore with GitTasks preference
try { try {
const templateContent = readAsset('gitignore', 'utf8'); const gitignoreTemplatePath = path.join(
__dirname,
'..',
'assets',
'gitignore'
);
const templateContent = fs.readFileSync(gitignoreTemplatePath, 'utf8');
manageGitignoreFile( manageGitignoreFile(
path.join(targetDir, GITIGNORE_FILE), path.join(targetDir, GITIGNORE_FILE),
templateContent, templateContent,

View File

@@ -3,7 +3,7 @@
* Command-line interface for the Task Master CLI * Command-line interface for the Task Master CLI
*/ */
import { Command } from 'commander'; import { program } from 'commander';
import path from 'path'; import path from 'path';
import chalk from 'chalk'; import chalk from 'chalk';
import boxen from 'boxen'; import boxen from 'boxen';
@@ -5076,10 +5076,28 @@ Examples:
*/ */
function setupCLI() { function setupCLI() {
// Create a new program instance // Create a new program instance
const programInstance = new Command() const programInstance = program
.name('task-master') .name('dev')
.description('AI-driven development task management') .description('AI-driven development task management')
.version(process.env.TM_PUBLIC_VERSION || 'unknown') .version(() => {
// Read version directly from package.json ONLY
try {
const packageJsonPath = path.join(process.cwd(), 'package.json');
if (fs.existsSync(packageJsonPath)) {
const packageJson = JSON.parse(
fs.readFileSync(packageJsonPath, 'utf8')
);
return packageJson.version;
}
} catch (error) {
// Silently fall back to 'unknown'
log(
'warn',
'Could not read package.json for version info in .version()'
);
}
return 'unknown'; // Default fallback if package.json fails
})
.helpOption('-h, --help', 'Display help') .helpOption('-h, --help', 'Display help')
.addHelpCommand(false); // Disable default help command .addHelpCommand(false); // Disable default help command
@@ -5108,9 +5126,8 @@ function setupCLI() {
*/ */
async function runCLI(argv = process.argv) { async function runCLI(argv = process.argv) {
try { try {
// Display banner if not in a pipe (except for init command which has its own banner) // Display banner if not in a pipe
const isInitCommand = argv.includes('init'); if (process.stdout.isTTY) {
if (process.stdout.isTTY && !isInitCommand) {
displayBanner(); displayBanner();
} }

View File

@@ -142,14 +142,6 @@ function onPostConvertRulesProfile(targetDir, assetsDir) {
// Transform to Zed format // Transform to Zed format
const zedConfig = transformToZedFormat(mcpConfig); const zedConfig = transformToZedFormat(mcpConfig);
// Add "source": "custom" to task-master-ai server for Zed
if (
zedConfig['context_servers'] &&
zedConfig['context_servers']['task-master-ai']
) {
zedConfig['context_servers']['task-master-ai'].source = 'custom';
}
// Write back the transformed config with proper formatting // Write back the transformed config with proper formatting
fs.writeFileSync( fs.writeFileSync(
mcpConfigPath, mcpConfigPath,

View File

@@ -463,17 +463,6 @@ export function findConfigPath(explicitPath = null, args = null, log = null) {
} }
} }
// Only warn once per command execution to prevent spam during init logger.warn?.(`No configuration file found in project: ${projectRoot}`);
const warningKey = `config_warning_${projectRoot}`;
if (!global._tmConfigWarningsThisRun) {
global._tmConfigWarningsThisRun = new Set();
}
if (!global._tmConfigWarningsThisRun.has(warningKey)) {
global._tmConfigWarningsThisRun.add(warningKey);
logger.warn?.(`No configuration file found in project: ${projectRoot}`);
}
return null; return null;
} }

View File

@@ -100,13 +100,17 @@ describe('Roo Files Inclusion in Package', () => {
}); });
}); });
test('source Roo files exist in assets directory', () => { test('source Roo files exist in public/assets directory', () => {
// Verify that the source files for Roo integration exist // Verify that the source files for Roo integration exist
expect( expect(
fs.existsSync(path.join(process.cwd(), 'assets', 'roocode', '.roo')) fs.existsSync(
path.join(process.cwd(), 'public', 'assets', 'roocode', '.roo')
)
).toBe(true); ).toBe(true);
expect( expect(
fs.existsSync(path.join(process.cwd(), 'assets', 'roocode', '.roomodes')) fs.existsSync(
path.join(process.cwd(), 'public', 'assets', 'roocode', '.roomodes')
)
).toBe(true); ).toBe(true);
}); });
}); });

View File

@@ -16,9 +16,9 @@ describe('Rules Files Inclusion in Package', () => {
expect(packageJson.files).toContain('dist/**'); expect(packageJson.files).toContain('dist/**');
}); });
test('source rules files exist in assets/rules directory', () => { test('source rules files exist in public/assets/rules directory', () => {
// Verify that the actual rules files exist // Verify that the actual rules files exist
const rulesDir = path.join(process.cwd(), 'assets', 'rules'); const rulesDir = path.join(process.cwd(), 'public', 'assets', 'rules');
expect(fs.existsSync(rulesDir)).toBe(true); expect(fs.existsSync(rulesDir)).toBe(true);
// Check for the 4 files that currently exist // Check for the 4 files that currently exist
@@ -86,13 +86,17 @@ describe('Rules Files Inclusion in Package', () => {
expect(rooJsContent.includes('${mode}-rules')).toBe(true); expect(rooJsContent.includes('${mode}-rules')).toBe(true);
}); });
test('source Roo files exist in assets directory', () => { test('source Roo files exist in public/assets directory', () => {
// Verify that the source files for Roo integration exist // Verify that the source files for Roo integration exist
expect( expect(
fs.existsSync(path.join(process.cwd(), 'assets', 'roocode', '.roo')) fs.existsSync(
path.join(process.cwd(), 'public', 'assets', 'roocode', '.roo')
)
).toBe(true); ).toBe(true);
expect( expect(
fs.existsSync(path.join(process.cwd(), 'assets', 'roocode', '.roomodes')) fs.existsSync(
path.join(process.cwd(), 'public', 'assets', 'roocode', '.roomodes')
)
).toBe(true); ).toBe(true);
}); });
}); });

Some files were not shown because too many files have changed in this diff Show More