Compare commits
3 Commits
extension-
...
fix/vscode
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ddb08558a | ||
|
|
cc8e088e6a | ||
|
|
30359e3cea |
@@ -9,17 +9,9 @@
|
|||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.93.0"
|
"vscode": "^1.93.0"
|
||||||
},
|
},
|
||||||
"categories": [
|
"categories": ["AI", "Visualization", "Education", "Other"],
|
||||||
"AI",
|
|
||||||
"Visualization",
|
|
||||||
"Education",
|
|
||||||
"Other"
|
|
||||||
],
|
|
||||||
"main": "./dist/extension.js",
|
"main": "./dist/extension.js",
|
||||||
"activationEvents": [
|
"activationEvents": ["onStartupFinished", "workspaceContains:.taskmaster/**"],
|
||||||
"onStartupFinished",
|
|
||||||
"workspaceContains:.taskmaster/**"
|
|
||||||
],
|
|
||||||
"contributes": {
|
"contributes": {
|
||||||
"viewsContainers": {
|
"viewsContainers": {
|
||||||
"activitybar": [
|
"activitybar": [
|
||||||
@@ -80,9 +72,7 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"default": [
|
"default": ["task-master-ai"],
|
||||||
"task-master-ai"
|
|
||||||
],
|
|
||||||
"description": "An array of arguments to pass to the MCP server command."
|
"description": "An array of arguments to pass to the MCP server command."
|
||||||
},
|
},
|
||||||
"taskmaster.mcp.cwd": {
|
"taskmaster.mcp.cwd": {
|
||||||
@@ -149,11 +139,7 @@
|
|||||||
},
|
},
|
||||||
"taskmaster.ui.theme": {
|
"taskmaster.ui.theme": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": ["auto", "light", "dark"],
|
||||||
"auto",
|
|
||||||
"light",
|
|
||||||
"dark"
|
|
||||||
],
|
|
||||||
"default": "auto",
|
"default": "auto",
|
||||||
"description": "UI theme preference"
|
"description": "UI theme preference"
|
||||||
},
|
},
|
||||||
@@ -214,12 +200,7 @@
|
|||||||
},
|
},
|
||||||
"taskmaster.debug.logLevel": {
|
"taskmaster.debug.logLevel": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": ["error", "warn", "info", "debug"],
|
||||||
"error",
|
|
||||||
"warn",
|
|
||||||
"info",
|
|
||||||
"debug"
|
|
||||||
],
|
|
||||||
"default": "info",
|
"default": "info",
|
||||||
"description": "Logging level"
|
"description": "Logging level"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,7 +4,13 @@ import { Button } from '@/components/ui/button';
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
import { CollapsibleSection } from '@/components/ui/CollapsibleSection';
|
import { CollapsibleSection } from '@/components/ui/CollapsibleSection';
|
||||||
import { Wand2, Loader2, PlusCircle, TrendingUp, TrendingDown } from 'lucide-react';
|
import {
|
||||||
|
Wand2,
|
||||||
|
Loader2,
|
||||||
|
PlusCircle,
|
||||||
|
TrendingUp,
|
||||||
|
TrendingDown
|
||||||
|
} from 'lucide-react';
|
||||||
import {
|
import {
|
||||||
useUpdateTask,
|
useUpdateTask,
|
||||||
useUpdateSubtask,
|
useUpdateSubtask,
|
||||||
@@ -34,10 +40,12 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const [prompt, setPrompt] = useState('');
|
const [prompt, setPrompt] = useState('');
|
||||||
const [scopePrompt, setScopePrompt] = useState('');
|
const [scopePrompt, setScopePrompt] = useState('');
|
||||||
const [scopeStrength, setScopeStrength] = useState<'light' | 'regular' | 'heavy'>('regular');
|
const [scopeStrength, setScopeStrength] = useState<
|
||||||
const [lastAction, setLastAction] = useState<'regenerate' | 'append' | 'scope-up' | 'scope-down' | null>(
|
'light' | 'regular' | 'heavy'
|
||||||
null
|
>('regular');
|
||||||
);
|
const [lastAction, setLastAction] = useState<
|
||||||
|
'regenerate' | 'append' | 'scope-up' | 'scope-down' | null
|
||||||
|
>(null);
|
||||||
const updateTask = useUpdateTask();
|
const updateTask = useUpdateTask();
|
||||||
const updateSubtask = useUpdateSubtask();
|
const updateSubtask = useUpdateSubtask();
|
||||||
const scopeUpTask = useScopeUpTask();
|
const scopeUpTask = useScopeUpTask();
|
||||||
@@ -117,7 +125,10 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
|
|||||||
setLastAction('scope-up');
|
setLastAction('scope-up');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const taskId = isSubtask && parentTask ? `${parentTask.id}.${currentTask.id}` : currentTask.id;
|
const taskId =
|
||||||
|
isSubtask && parentTask
|
||||||
|
? `${parentTask.id}.${currentTask.id}`
|
||||||
|
: currentTask.id;
|
||||||
|
|
||||||
await scopeUpTask.mutateAsync({
|
await scopeUpTask.mutateAsync({
|
||||||
taskId,
|
taskId,
|
||||||
@@ -143,7 +154,10 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
|
|||||||
setLastAction('scope-down');
|
setLastAction('scope-down');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const taskId = isSubtask && parentTask ? `${parentTask.id}.${currentTask.id}` : currentTask.id;
|
const taskId =
|
||||||
|
isSubtask && parentTask
|
||||||
|
? `${parentTask.id}.${currentTask.id}`
|
||||||
|
: currentTask.id;
|
||||||
|
|
||||||
await scopeDownTask.mutateAsync({
|
await scopeDownTask.mutateAsync({
|
||||||
taskId,
|
taskId,
|
||||||
@@ -162,7 +176,11 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Track loading states based on the last action
|
// Track loading states based on the last action
|
||||||
const isLoading = updateTask.isPending || updateSubtask.isPending || scopeUpTask.isPending || scopeDownTask.isPending;
|
const isLoading =
|
||||||
|
updateTask.isPending ||
|
||||||
|
updateSubtask.isPending ||
|
||||||
|
scopeUpTask.isPending ||
|
||||||
|
scopeDownTask.isPending;
|
||||||
const isRegenerating = isLoading && lastAction === 'regenerate';
|
const isRegenerating = isLoading && lastAction === 'regenerate';
|
||||||
const isAppending = isLoading && lastAction === 'append';
|
const isAppending = isLoading && lastAction === 'append';
|
||||||
const isScopingUp = isLoading && lastAction === 'scope-up';
|
const isScopingUp = isLoading && lastAction === 'scope-up';
|
||||||
@@ -348,10 +366,12 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<p>
|
<p>
|
||||||
<strong>Scope Up:</strong> Increases task complexity with more details, requirements, or implementation steps
|
<strong>Scope Up:</strong> Increases task complexity with more
|
||||||
|
details, requirements, or implementation steps
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>Scope Down:</strong> Decreases task complexity by simplifying or removing unnecessary details
|
<strong>Scope Down:</strong> Decreases task complexity by
|
||||||
|
simplifying or removing unnecessary details
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ export function useScopeUpTask() {
|
|||||||
type: 'mcpRequest',
|
type: 'mcpRequest',
|
||||||
tool: 'scope_up_task',
|
tool: 'scope_up_task',
|
||||||
params: {
|
params: {
|
||||||
id: taskId,
|
id: String(taskId),
|
||||||
strength,
|
strength,
|
||||||
prompt,
|
prompt,
|
||||||
research: options.research || false
|
research: options.research || false
|
||||||
@@ -268,9 +268,7 @@ export function useScopeUpTask() {
|
|||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
onSuccess: async (data, variables) => {
|
onSuccess: async (data, variables) => {
|
||||||
console.log(
|
console.log('✅ Task scope up successful, invalidating all task queries');
|
||||||
'✅ Task scope up successful, invalidating all task queries'
|
|
||||||
);
|
|
||||||
console.log('Task ID:', variables.taskId);
|
console.log('Task ID:', variables.taskId);
|
||||||
|
|
||||||
// Invalidate ALL task-related queries
|
// Invalidate ALL task-related queries
|
||||||
@@ -309,7 +307,7 @@ export function useScopeDownTask() {
|
|||||||
type: 'mcpRequest',
|
type: 'mcpRequest',
|
||||||
tool: 'scope_down_task',
|
tool: 'scope_down_task',
|
||||||
params: {
|
params: {
|
||||||
id: taskId,
|
id: String(taskId),
|
||||||
strength,
|
strength,
|
||||||
prompt,
|
prompt,
|
||||||
research: options.research || false
|
research: options.research || false
|
||||||
|
|||||||
@@ -9,10 +9,7 @@
|
|||||||
"task-master-mcp": "mcp-server/server.js",
|
"task-master-mcp": "mcp-server/server.js",
|
||||||
"task-master-ai": "mcp-server/server.js"
|
"task-master-ai": "mcp-server/server.js"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": ["apps/*", "."],
|
||||||
"apps/*",
|
|
||||||
"."
|
|
||||||
],
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node --experimental-vm-modules node_modules/.bin/jest",
|
"test": "node --experimental-vm-modules node_modules/.bin/jest",
|
||||||
"test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures",
|
"test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures",
|
||||||
|
|||||||
@@ -279,8 +279,9 @@ async function regenerateSubtasksForComplexity(
|
|||||||
'debug',
|
'debug',
|
||||||
`Complexity-aware subtask calculation${complexityInfo}: ${currentPendingCount} pending -> target ${targetSubtaskCount} total`
|
`Complexity-aware subtask calculation${complexityInfo}: ${currentPendingCount} pending -> target ${targetSubtaskCount} total`
|
||||||
);
|
);
|
||||||
console.log(
|
log(
|
||||||
`[DEBUG] Complexity-aware calculation${complexityInfo}: ${currentPendingCount} pending -> ${targetSubtaskCount} total subtasks (${strength} ${direction})`
|
'debug',
|
||||||
|
`Complexity-aware calculation${complexityInfo}: ${currentPendingCount} pending -> ${targetSubtaskCount} total subtasks (${strength} ${direction})`
|
||||||
);
|
);
|
||||||
|
|
||||||
const newSubtasksNeeded = Math.max(1, targetSubtaskCount - preservedCount);
|
const newSubtasksNeeded = Math.max(1, targetSubtaskCount - preservedCount);
|
||||||
@@ -386,8 +387,9 @@ Ensure the JSON is valid and properly formatted.`;
|
|||||||
generated: generatedSubtasks.length
|
generated: generatedSubtasks.length
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(
|
log(
|
||||||
`[WARN] Failed to regenerate subtasks for task ${task.id}: ${error.message}`
|
'warn',
|
||||||
|
`Failed to regenerate subtasks for task ${task.id}: ${error.message}`
|
||||||
);
|
);
|
||||||
// Don't fail the whole operation if subtask regeneration fails
|
// Don't fail the whole operation if subtask regeneration fails
|
||||||
return {
|
return {
|
||||||
@@ -583,7 +585,7 @@ export async function scopeUpTask(
|
|||||||
// Get original complexity score (if available)
|
// Get original complexity score (if available)
|
||||||
const originalComplexity = getCurrentComplexityScore(taskId, context);
|
const originalComplexity = getCurrentComplexityScore(taskId, context);
|
||||||
if (originalComplexity && outputFormat === 'text') {
|
if (originalComplexity && outputFormat === 'text') {
|
||||||
console.log(`[INFO] Original complexity: ${originalComplexity}/10`);
|
log('info', `Original complexity: ${originalComplexity}/10`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const adjustResult = await adjustTaskComplexity(
|
const adjustResult = await adjustTaskComplexity(
|
||||||
@@ -635,8 +637,9 @@ export async function scopeUpTask(
|
|||||||
const complexityChange = newComplexity - originalComplexity;
|
const complexityChange = newComplexity - originalComplexity;
|
||||||
const arrow =
|
const arrow =
|
||||||
complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️';
|
complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️';
|
||||||
console.log(
|
log(
|
||||||
`[INFO] New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})`
|
'info',
|
||||||
|
`New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -733,7 +736,7 @@ export async function scopeDownTask(
|
|||||||
// Get original complexity score (if available)
|
// Get original complexity score (if available)
|
||||||
const originalComplexity = getCurrentComplexityScore(taskId, context);
|
const originalComplexity = getCurrentComplexityScore(taskId, context);
|
||||||
if (originalComplexity && outputFormat === 'text') {
|
if (originalComplexity && outputFormat === 'text') {
|
||||||
console.log(`[INFO] Original complexity: ${originalComplexity}/10`);
|
log('info', `Original complexity: ${originalComplexity}/10`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const adjustResult = await adjustTaskComplexity(
|
const adjustResult = await adjustTaskComplexity(
|
||||||
@@ -785,8 +788,9 @@ export async function scopeDownTask(
|
|||||||
const complexityChange = newComplexity - originalComplexity;
|
const complexityChange = newComplexity - originalComplexity;
|
||||||
const arrow =
|
const arrow =
|
||||||
complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️';
|
complexityChange > 0 ? '↗️' : complexityChange < 0 ? '↘️' : '➡️';
|
||||||
console.log(
|
log(
|
||||||
`[INFO] New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})`
|
'info',
|
||||||
|
`New complexity: ${originalComplexity}/10 ${arrow} ${newComplexity}/10 (${complexityChange > 0 ? '+' : ''}${complexityChange})`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -8,13 +8,17 @@ jest.unstable_mockModule('../../../../../scripts/modules/utils.js', () => ({
|
|||||||
log: jest.fn(),
|
log: jest.fn(),
|
||||||
readJSON: jest.fn(),
|
readJSON: jest.fn(),
|
||||||
writeJSON: jest.fn(),
|
writeJSON: jest.fn(),
|
||||||
getCurrentTag: jest.fn(() => 'master')
|
getCurrentTag: jest.fn(() => 'master'),
|
||||||
|
readComplexityReport: jest.fn(),
|
||||||
|
findTaskInComplexityReport: jest.fn(),
|
||||||
|
findProjectRoot: jest.fn()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.unstable_mockModule(
|
jest.unstable_mockModule(
|
||||||
'../../../../../scripts/modules/ai-services-unified.js',
|
'../../../../../scripts/modules/ai-services-unified.js',
|
||||||
() => ({
|
() => ({
|
||||||
generateObjectService: jest.fn()
|
generateObjectService: jest.fn(),
|
||||||
|
generateTextService: jest.fn()
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -26,10 +30,25 @@ jest.unstable_mockModule(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// Import modules after mocking
|
jest.unstable_mockModule(
|
||||||
const { log, readJSON, writeJSON } = await import(
|
'../../../../../scripts/modules/task-manager/analyze-task-complexity.js',
|
||||||
'../../../../../scripts/modules/utils.js'
|
() => ({
|
||||||
|
default: jest.fn()
|
||||||
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
jest.unstable_mockModule('../../../../../src/utils/path-utils.js', () => ({
|
||||||
|
findComplexityReportPath: jest.fn()
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Import modules after mocking
|
||||||
|
const {
|
||||||
|
log,
|
||||||
|
readJSON,
|
||||||
|
writeJSON,
|
||||||
|
readComplexityReport,
|
||||||
|
findTaskInComplexityReport
|
||||||
|
} = await import('../../../../../scripts/modules/utils.js');
|
||||||
const { generateObjectService } = await import(
|
const { generateObjectService } = await import(
|
||||||
'../../../../../scripts/modules/ai-services-unified.js'
|
'../../../../../scripts/modules/ai-services-unified.js'
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user