@hasna/todos 0.9.67 → 0.9.69
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/cli/index.js +39 -2
- package/dist/mcp/index.js +24 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -10908,6 +10908,29 @@ No pending tasks available.`);
|
|
|
10908
10908
|
}
|
|
10909
10909
|
});
|
|
10910
10910
|
}
|
|
10911
|
+
if (shouldRegisterTool("get_health")) {
|
|
10912
|
+
server.tool("get_health", "Check todos DB health. Returns status and issue summary.", {
|
|
10913
|
+
project_id: exports_external.string().optional()
|
|
10914
|
+
}, async ({ project_id }) => {
|
|
10915
|
+
try {
|
|
10916
|
+
const checks = [];
|
|
10917
|
+
const all = listTasks({});
|
|
10918
|
+
checks.push({ name: "tasks", status: "ok", value: `${all.length} total` });
|
|
10919
|
+
const stale = getStaleTasks(30, project_id ? { project_id: resolveId(project_id, "projects") } : undefined);
|
|
10920
|
+
checks.push({ name: "stale", status: stale.length > 0 ? "warn" : "ok", value: `${stale.length} stuck in_progress >30min` });
|
|
10921
|
+
const nowStr = new Date().toISOString();
|
|
10922
|
+
const overdue = all.filter((t) => t.recurrence_rule && t.status === "pending" && t.due_at && t.due_at < nowStr);
|
|
10923
|
+
checks.push({ name: "overdue_recurring", status: overdue.length > 0 ? "warn" : "ok", value: `${overdue.length} overdue` });
|
|
10924
|
+
const status = checks.some((c) => c.status === "error") ? "error" : checks.some((c) => c.status === "warn") ? "warn" : "ok";
|
|
10925
|
+
const text = `Status: ${status}
|
|
10926
|
+
${checks.map((c) => ` ${c.status === "ok" ? "\u2713" : "\u26A0"} ${c.name}: ${c.value}`).join(`
|
|
10927
|
+
`)}`;
|
|
10928
|
+
return { content: [{ type: "text", text }] };
|
|
10929
|
+
} catch (e) {
|
|
10930
|
+
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
10931
|
+
}
|
|
10932
|
+
});
|
|
10933
|
+
}
|
|
10911
10934
|
if (shouldRegisterTool("get_context")) {
|
|
10912
10935
|
server.tool("get_context", "Get a compact task summary for agent prompt injection. Returns formatted text.", {
|
|
10913
10936
|
agent_id: exports_external.string().optional(),
|
|
@@ -11001,6 +11024,7 @@ No pending tasks available.`);
|
|
|
11001
11024
|
"get_stale_tasks",
|
|
11002
11025
|
"get_status",
|
|
11003
11026
|
"get_context",
|
|
11027
|
+
"get_health",
|
|
11004
11028
|
"decompose_task",
|
|
11005
11029
|
"set_task_status",
|
|
11006
11030
|
"set_task_priority",
|
|
@@ -14010,10 +14034,23 @@ program2.command("comment <id> <text>").description("Add a comment to a task").a
|
|
|
14010
14034
|
console.log(chalk.green("Comment added."));
|
|
14011
14035
|
}
|
|
14012
14036
|
});
|
|
14013
|
-
program2.command("search <query>").description("Search tasks").action((query) => {
|
|
14037
|
+
program2.command("search <query>").description("Search tasks").option("--status <status>", "Filter by status").option("--priority <p>", "Filter by priority").option("--assigned <agent>", "Filter by assigned agent").option("--since <date>", "Only tasks updated after this date (ISO)").option("--blocked", "Only blocked tasks (incomplete dependencies)").option("--has-deps", "Only tasks with dependencies").action((query, opts) => {
|
|
14014
14038
|
const globalOpts = program2.opts();
|
|
14015
14039
|
const projectId = autoProject(globalOpts);
|
|
14016
|
-
const
|
|
14040
|
+
const searchOpts = { query, project_id: projectId };
|
|
14041
|
+
if (opts.status)
|
|
14042
|
+
searchOpts.status = opts.status;
|
|
14043
|
+
if (opts.priority)
|
|
14044
|
+
searchOpts.priority = opts.priority;
|
|
14045
|
+
if (opts.assigned)
|
|
14046
|
+
searchOpts.assigned_to = opts.assigned;
|
|
14047
|
+
if (opts.since)
|
|
14048
|
+
searchOpts.updated_after = opts.since;
|
|
14049
|
+
if (opts.blocked)
|
|
14050
|
+
searchOpts.is_blocked = true;
|
|
14051
|
+
if (opts.hasDeps)
|
|
14052
|
+
searchOpts.has_dependencies = true;
|
|
14053
|
+
const tasks = searchTasks(searchOpts);
|
|
14017
14054
|
if (globalOpts.json) {
|
|
14018
14055
|
output(tasks, true);
|
|
14019
14056
|
return;
|
package/dist/mcp/index.js
CHANGED
|
@@ -8659,6 +8659,29 @@ if (shouldRegisterTool("set_task_priority")) {
|
|
|
8659
8659
|
}
|
|
8660
8660
|
});
|
|
8661
8661
|
}
|
|
8662
|
+
if (shouldRegisterTool("get_health")) {
|
|
8663
|
+
server.tool("get_health", "Check todos DB health. Returns status and issue summary.", {
|
|
8664
|
+
project_id: exports_external.string().optional()
|
|
8665
|
+
}, async ({ project_id }) => {
|
|
8666
|
+
try {
|
|
8667
|
+
const checks = [];
|
|
8668
|
+
const all = listTasks({});
|
|
8669
|
+
checks.push({ name: "tasks", status: "ok", value: `${all.length} total` });
|
|
8670
|
+
const stale = getStaleTasks(30, project_id ? { project_id: resolveId(project_id, "projects") } : undefined);
|
|
8671
|
+
checks.push({ name: "stale", status: stale.length > 0 ? "warn" : "ok", value: `${stale.length} stuck in_progress >30min` });
|
|
8672
|
+
const nowStr = new Date().toISOString();
|
|
8673
|
+
const overdue = all.filter((t) => t.recurrence_rule && t.status === "pending" && t.due_at && t.due_at < nowStr);
|
|
8674
|
+
checks.push({ name: "overdue_recurring", status: overdue.length > 0 ? "warn" : "ok", value: `${overdue.length} overdue` });
|
|
8675
|
+
const status = checks.some((c) => c.status === "error") ? "error" : checks.some((c) => c.status === "warn") ? "warn" : "ok";
|
|
8676
|
+
const text = `Status: ${status}
|
|
8677
|
+
${checks.map((c) => ` ${c.status === "ok" ? "\u2713" : "\u26A0"} ${c.name}: ${c.value}`).join(`
|
|
8678
|
+
`)}`;
|
|
8679
|
+
return { content: [{ type: "text", text }] };
|
|
8680
|
+
} catch (e) {
|
|
8681
|
+
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
8682
|
+
}
|
|
8683
|
+
});
|
|
8684
|
+
}
|
|
8662
8685
|
if (shouldRegisterTool("get_context")) {
|
|
8663
8686
|
server.tool("get_context", "Get a compact task summary for agent prompt injection. Returns formatted text.", {
|
|
8664
8687
|
agent_id: exports_external.string().optional(),
|
|
@@ -8752,6 +8775,7 @@ if (shouldRegisterTool("search_tools")) {
|
|
|
8752
8775
|
"get_stale_tasks",
|
|
8753
8776
|
"get_status",
|
|
8754
8777
|
"get_context",
|
|
8778
|
+
"get_health",
|
|
8755
8779
|
"decompose_task",
|
|
8756
8780
|
"set_task_status",
|
|
8757
8781
|
"set_task_priority",
|