@task-mcp/cli 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +48 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,7 +52,13 @@ import {
|
|
|
52
52
|
} from "@task-mcp/shared";
|
|
53
53
|
|
|
54
54
|
// src/storage.ts
|
|
55
|
-
import {
|
|
55
|
+
import {
|
|
56
|
+
TaskStore,
|
|
57
|
+
InboxStore,
|
|
58
|
+
StateStore,
|
|
59
|
+
SessionStore,
|
|
60
|
+
getDefaultTasksDir
|
|
61
|
+
} from "@task-mcp/mcp-server/storage";
|
|
56
62
|
var _taskStore = null;
|
|
57
63
|
var _inboxStore = null;
|
|
58
64
|
var _stateStore = null;
|
|
@@ -514,7 +520,6 @@ async function smartDashboard() {
|
|
|
514
520
|
}
|
|
515
521
|
const workspace = getCurrentWorkspace();
|
|
516
522
|
const tasks = await listTasks();
|
|
517
|
-
const activeTasks = tasks.filter((t) => t.status !== "completed" && t.status !== "cancelled");
|
|
518
523
|
const stats = calculateStats(tasks);
|
|
519
524
|
const lastSessionInfo = await getLastSessionInfo();
|
|
520
525
|
const lines = [];
|
|
@@ -644,7 +649,7 @@ function buildReasons(task, tasks) {
|
|
|
644
649
|
}
|
|
645
650
|
return reasons;
|
|
646
651
|
}
|
|
647
|
-
function renderTaskDetail(task,
|
|
652
|
+
function renderTaskDetail(task, _tasks) {
|
|
648
653
|
const lines = [];
|
|
649
654
|
const status = formatStatusSymbol(task.status);
|
|
650
655
|
const priority = formatPriorityBadge(task.priority);
|
|
@@ -701,10 +706,7 @@ function renderImpact(task, tasks) {
|
|
|
701
706
|
}
|
|
702
707
|
function renderAlternatives(currentStrategy) {
|
|
703
708
|
const others = Object.keys(STRATEGY_DESCRIPTIONS).filter((s) => s !== currentStrategy);
|
|
704
|
-
const lines = [
|
|
705
|
-
"",
|
|
706
|
-
c.gray(" Alternative strategies:")
|
|
707
|
-
];
|
|
709
|
+
const lines = ["", c.gray(" Alternative strategies:")];
|
|
708
710
|
for (const strategy of others) {
|
|
709
711
|
lines.push(` ${c.cyan(`task next --strategy ${strategy}`)}`);
|
|
710
712
|
}
|
|
@@ -772,17 +774,44 @@ function buildTree(tasks) {
|
|
|
772
774
|
sortNodes(roots);
|
|
773
775
|
return roots;
|
|
774
776
|
}
|
|
775
|
-
function
|
|
777
|
+
function countProgress(node) {
|
|
778
|
+
let completed = node.task.status === "completed" ? 1 : 0;
|
|
779
|
+
let total = 1;
|
|
780
|
+
for (const child of node.children) {
|
|
781
|
+
const childProgress = countProgress(child);
|
|
782
|
+
completed += childProgress.completed;
|
|
783
|
+
total += childProgress.total;
|
|
784
|
+
}
|
|
785
|
+
return { completed, total };
|
|
786
|
+
}
|
|
787
|
+
function formatTaskLine2(task, progress) {
|
|
776
788
|
const status = formatStatusSymbol(task.status);
|
|
777
789
|
const shortId = c.gray(task.id.slice(-4));
|
|
778
|
-
const title = task.title;
|
|
779
790
|
const priority = task.priority !== "medium" ? formatPriorityBadge(task.priority) : "";
|
|
780
|
-
|
|
791
|
+
let progressStr = "";
|
|
792
|
+
if (progress && progress.total > 1) {
|
|
793
|
+
const childCompleted = progress.completed - (task.status === "completed" ? 1 : 0);
|
|
794
|
+
const childTotal = progress.total - 1;
|
|
795
|
+
if (childTotal > 0) {
|
|
796
|
+
const pct = Math.round(childCompleted / childTotal * 100);
|
|
797
|
+
progressStr = c.gray(` (${childCompleted}/${childTotal})`);
|
|
798
|
+
if (pct === 100) {
|
|
799
|
+
progressStr = c.green(` (${childCompleted}/${childTotal} \u2713)`);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
if (task.status === "completed" || task.status === "cancelled") {
|
|
804
|
+
const title2 = c.gray(task.title);
|
|
805
|
+
return `${status} ${shortId} ${title2}${progressStr}`;
|
|
806
|
+
}
|
|
807
|
+
const title = task.title;
|
|
808
|
+
return `${status} ${shortId} ${title}${progressStr}${priority ? " " + priority : ""}`;
|
|
781
809
|
}
|
|
782
810
|
function renderNode(node, prefix, isLast, isRoot, lines) {
|
|
783
811
|
const branch = isRoot ? "" : isLast ? "\\-- " : "|-- ";
|
|
784
812
|
const continuation = isLast ? " " : "| ";
|
|
785
|
-
const
|
|
813
|
+
const progress = node.children.length > 0 ? countProgress(node) : undefined;
|
|
814
|
+
const taskLine = formatTaskLine2(node.task, progress);
|
|
786
815
|
lines.push(`${prefix}${branch}${taskLine}`);
|
|
787
816
|
const childPrefix = isRoot ? prefix : prefix + continuation;
|
|
788
817
|
const childCount = node.children.length;
|
|
@@ -804,11 +833,11 @@ function renderTree(roots) {
|
|
|
804
833
|
}
|
|
805
834
|
async function treeCmd(options = {}) {
|
|
806
835
|
const allTasks = await listTasks();
|
|
807
|
-
const tasks = options.
|
|
836
|
+
const tasks = options.hideCompleted ? allTasks.filter((t) => t.status !== "completed" && t.status !== "cancelled") : allTasks;
|
|
808
837
|
if (tasks.length === 0) {
|
|
809
838
|
console.log(c.yellow("No tasks found."));
|
|
810
|
-
if (
|
|
811
|
-
console.log(c.gray("Use --
|
|
839
|
+
if (options.hideCompleted) {
|
|
840
|
+
console.log(c.gray("Use without --hide-completed to include completed tasks."));
|
|
812
841
|
}
|
|
813
842
|
return;
|
|
814
843
|
}
|
|
@@ -1368,10 +1397,7 @@ function renderStaleWarnings(staleItems) {
|
|
|
1368
1397
|
if (staleItems.length === 0)
|
|
1369
1398
|
return [];
|
|
1370
1399
|
const message = `${staleItems.length} task${staleItems.length > 1 ? "s" : ""} blocked for 3+ days`;
|
|
1371
|
-
return [
|
|
1372
|
-
"",
|
|
1373
|
-
...renderAlert(message, { severity: "warning" })
|
|
1374
|
-
];
|
|
1400
|
+
return ["", ...renderAlert(message, { severity: "warning" })];
|
|
1375
1401
|
}
|
|
1376
1402
|
function renderSummary(totalBlocked, staleCount, byPriority) {
|
|
1377
1403
|
const stats = [
|
|
@@ -1433,10 +1459,7 @@ async function blockedCmd(options = {}) {
|
|
|
1433
1459
|
}
|
|
1434
1460
|
|
|
1435
1461
|
// src/commands/health.ts
|
|
1436
|
-
import {
|
|
1437
|
-
detectCircularDependencies,
|
|
1438
|
-
buildDependencyIndices
|
|
1439
|
-
} from "@task-mcp/shared";
|
|
1462
|
+
import { detectCircularDependencies, buildDependencyIndices } from "@task-mcp/shared";
|
|
1440
1463
|
function getOverdueTasks2(tasks) {
|
|
1441
1464
|
const today = new Date;
|
|
1442
1465
|
today.setHours(0, 0, 0, 0);
|
|
@@ -1627,10 +1650,7 @@ function renderBottlenecks(bottlenecks) {
|
|
|
1627
1650
|
secondary: c.yellow(`blocks ${b.blockingCount} task${b.blockingCount > 1 ? "s" : ""}`),
|
|
1628
1651
|
prefix: formatStatusSymbol(b.task.status)
|
|
1629
1652
|
}));
|
|
1630
|
-
return [
|
|
1631
|
-
"",
|
|
1632
|
-
...renderSection("Bottlenecks", items, { icon: "" })
|
|
1633
|
-
];
|
|
1653
|
+
return ["", ...renderSection("Bottlenecks", items, { icon: "" })];
|
|
1634
1654
|
}
|
|
1635
1655
|
function renderRecommendations(recommendations) {
|
|
1636
1656
|
const lines = [];
|
|
@@ -1690,7 +1710,7 @@ async function healthCmd(options = {}) {
|
|
|
1690
1710
|
// package.json
|
|
1691
1711
|
var package_default = {
|
|
1692
1712
|
name: "@task-mcp/cli",
|
|
1693
|
-
version: "1.0.
|
|
1713
|
+
version: "1.0.30",
|
|
1694
1714
|
description: "Zero-dependency CLI for task-mcp with Bun native visualization",
|
|
1695
1715
|
type: "module",
|
|
1696
1716
|
bin: {
|
|
@@ -1922,7 +1942,7 @@ async function main() {
|
|
|
1922
1942
|
case "tree":
|
|
1923
1943
|
case "t":
|
|
1924
1944
|
await treeCmd({
|
|
1925
|
-
|
|
1945
|
+
hideCompleted: flags["hide-completed"] === true
|
|
1926
1946
|
});
|
|
1927
1947
|
break;
|
|
1928
1948
|
case "health":
|