@hasna/todos 0.9.66 → 0.9.68
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 +28 -2
- package/dist/server/index.js +13 -0
- package/dist/server/serve.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -11966,6 +11966,19 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
|
|
|
11966
11966
|
return json({ error: e instanceof Error ? e.message : "Failed" }, 500, port);
|
|
11967
11967
|
}
|
|
11968
11968
|
}
|
|
11969
|
+
if (path === "/api/doctor" && method === "GET") {
|
|
11970
|
+
const issues = [];
|
|
11971
|
+
const { getStaleTasks: getStaleDiag } = await Promise.resolve().then(() => (init_tasks(), exports_tasks));
|
|
11972
|
+
const staleItems = getStaleDiag(30);
|
|
11973
|
+
if (staleItems.length > 0)
|
|
11974
|
+
issues.push({ severity: "warn", type: "stale_tasks", message: `${staleItems.length} tasks stuck in_progress >30min`, count: staleItems.length });
|
|
11975
|
+
const withParent = getDatabase().query("SELECT COUNT(*) as c FROM tasks t WHERE t.parent_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM tasks p WHERE p.id = t.parent_id)").get();
|
|
11976
|
+
if (withParent.c > 0)
|
|
11977
|
+
issues.push({ severity: "error", type: "orphaned_parents", message: `${withParent.c} tasks reference non-existent parent IDs`, count: withParent.c });
|
|
11978
|
+
if (issues.length === 0)
|
|
11979
|
+
issues.push({ severity: "info", type: "healthy", message: "No issues found" });
|
|
11980
|
+
return json({ ok: !issues.some((i) => i.severity === "error"), issues }, 200, port);
|
|
11981
|
+
}
|
|
11969
11982
|
if (path === "/api/report" && method === "GET") {
|
|
11970
11983
|
const days = parseInt(url.searchParams.get("days") || "7", 10);
|
|
11971
11984
|
const projectId = url.searchParams.get("project_id") || undefined;
|
|
@@ -13997,10 +14010,23 @@ program2.command("comment <id> <text>").description("Add a comment to a task").a
|
|
|
13997
14010
|
console.log(chalk.green("Comment added."));
|
|
13998
14011
|
}
|
|
13999
14012
|
});
|
|
14000
|
-
program2.command("search <query>").description("Search tasks").action((query) => {
|
|
14013
|
+
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) => {
|
|
14001
14014
|
const globalOpts = program2.opts();
|
|
14002
14015
|
const projectId = autoProject(globalOpts);
|
|
14003
|
-
const
|
|
14016
|
+
const searchOpts = { query, project_id: projectId };
|
|
14017
|
+
if (opts.status)
|
|
14018
|
+
searchOpts.status = opts.status;
|
|
14019
|
+
if (opts.priority)
|
|
14020
|
+
searchOpts.priority = opts.priority;
|
|
14021
|
+
if (opts.assigned)
|
|
14022
|
+
searchOpts.assigned_to = opts.assigned;
|
|
14023
|
+
if (opts.since)
|
|
14024
|
+
searchOpts.updated_after = opts.since;
|
|
14025
|
+
if (opts.blocked)
|
|
14026
|
+
searchOpts.is_blocked = true;
|
|
14027
|
+
if (opts.hasDeps)
|
|
14028
|
+
searchOpts.has_dependencies = true;
|
|
14029
|
+
const tasks = searchTasks(searchOpts);
|
|
14004
14030
|
if (globalOpts.json) {
|
|
14005
14031
|
output(tasks, true);
|
|
14006
14032
|
return;
|
package/dist/server/index.js
CHANGED
|
@@ -3105,6 +3105,19 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
|
|
|
3105
3105
|
return json({ error: e instanceof Error ? e.message : "Failed" }, 500, port);
|
|
3106
3106
|
}
|
|
3107
3107
|
}
|
|
3108
|
+
if (path === "/api/doctor" && method === "GET") {
|
|
3109
|
+
const issues = [];
|
|
3110
|
+
const { getStaleTasks: getStaleDiag } = await Promise.resolve().then(() => (init_tasks(), exports_tasks));
|
|
3111
|
+
const staleItems = getStaleDiag(30);
|
|
3112
|
+
if (staleItems.length > 0)
|
|
3113
|
+
issues.push({ severity: "warn", type: "stale_tasks", message: `${staleItems.length} tasks stuck in_progress >30min`, count: staleItems.length });
|
|
3114
|
+
const withParent = getDatabase().query("SELECT COUNT(*) as c FROM tasks t WHERE t.parent_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM tasks p WHERE p.id = t.parent_id)").get();
|
|
3115
|
+
if (withParent.c > 0)
|
|
3116
|
+
issues.push({ severity: "error", type: "orphaned_parents", message: `${withParent.c} tasks reference non-existent parent IDs`, count: withParent.c });
|
|
3117
|
+
if (issues.length === 0)
|
|
3118
|
+
issues.push({ severity: "info", type: "healthy", message: "No issues found" });
|
|
3119
|
+
return json({ ok: !issues.some((i) => i.severity === "error"), issues }, 200, port);
|
|
3120
|
+
}
|
|
3108
3121
|
if (path === "/api/report" && method === "GET") {
|
|
3109
3122
|
const days = parseInt(url.searchParams.get("days") || "7", 10);
|
|
3110
3123
|
const projectId = url.searchParams.get("project_id") || undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/server/serve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiHH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/server/serve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiHH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAu1B1G"}
|