@hasna/todos 0.11.22 → 0.11.23

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +15 -7
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -34471,8 +34471,11 @@ program2.command("focus [project]").description("Focus on a project (or clear fo
34471
34471
  }
34472
34472
  const db = getDatabase();
34473
34473
  if (project) {
34474
- const { getProjectByPath: getProjectByPath2, getProjectByName } = (init_projects(), __toCommonJS(exports_projects));
34475
- const p = getProjectByPath2(process.cwd(), db) || getProjectByName(project, db);
34474
+ const { getProjectByPath: getProjectByPath2 } = (init_projects(), __toCommonJS(exports_projects));
34475
+ const p = getProjectByPath2(project, db) || (() => {
34476
+ const id = resolvePartialId(db, "projects", project);
34477
+ return id ? db.query("SELECT * FROM projects WHERE id = ?").get(id) : null;
34478
+ })() || db.query("SELECT * FROM projects WHERE name = ? OR task_list_id = ?").get(project, project);
34476
34479
  const projectId = p?.id || project;
34477
34480
  db.run("UPDATE agents SET active_project_id = ? WHERE id = ? OR name = ?", [projectId, agentId, agentId]);
34478
34481
  console.log(chalk3.green(`Focused on: ${p?.name || projectId}`));
@@ -34961,10 +34964,15 @@ program2.command("dashboard").description("Live-updating dashboard showing proje
34961
34964
  render2(React.createElement(Dashboard2, { projectId, refreshMs: parseInt(opts.refresh, 10) }));
34962
34965
  });
34963
34966
  program2.command("next").description("Show the best pending task to work on next").option("--agent <id>", "Prefer tasks assigned to this agent").option("--project <id>", "Filter to project").option("--json", "Output as JSON").action(async (opts) => {
34967
+ const globalOpts = program2.opts();
34964
34968
  const db = getDatabase();
34965
34969
  const filters = {};
34966
- if (opts.project)
34967
- filters.project_id = opts.project;
34970
+ const projectInput = opts.project || globalOpts.project;
34971
+ if (projectInput) {
34972
+ const pid = autoProject({ project: projectInput }) || resolvePartialId(db, "projects", projectInput) || db.query("SELECT id FROM projects WHERE path = ? OR name = ? OR task_list_id = ?").get(projectInput, projectInput, projectInput)?.id;
34973
+ if (pid)
34974
+ filters.project_id = pid;
34975
+ }
34968
34976
  const task = getNextTask(opts.agent, Object.keys(filters).length ? filters : undefined, db);
34969
34977
  if (!task) {
34970
34978
  console.log(chalk3.dim("No tasks available."));
@@ -35530,7 +35538,7 @@ program2.command("report").description("Analytics report: task activity, complet
35530
35538
  `);
35531
35539
  lines.push(`| Metric | Value |`);
35532
35540
  lines.push(`|--------|-------|`);
35533
- lines.push(`| Active tasks | ${all.length} total (${stats.pending} pending, ${stats.in_progress} active) |`);
35541
+ lines.push(`| Active tasks | ${all.length} total (${stats.by_status?.pending ?? 0} pending, ${stats.by_status?.in_progress ?? 0} active) |`);
35534
35542
  lines.push(`| Changed (${days}d) | ${changed.length} tasks |`);
35535
35543
  lines.push(`| Completed (${days}d) | ${completed.length} (${completionRate}% rate) |`);
35536
35544
  lines.push(`| Failed (${days}d) | ${failed.length} |`);
@@ -35539,7 +35547,7 @@ program2.command("report").description("Analytics report: task activity, complet
35539
35547
  } else {
35540
35548
  lines.push(chalk3.bold(`todos report \u2014 last ${days} day${days !== 1 ? "s" : ""}`));
35541
35549
  lines.push("");
35542
- lines.push(` Total: ${chalk3.bold(String(all.length))} tasks (${chalk3.yellow(String(stats.pending))} pending, ${chalk3.blue(String(stats.in_progress))} active)`);
35550
+ lines.push(` Total: ${chalk3.bold(String(all.length))} tasks (${chalk3.yellow(String(stats.by_status?.pending ?? 0))} pending, ${chalk3.blue(String(stats.by_status?.in_progress ?? 0))} active)`);
35543
35551
  lines.push(` Changed: ${chalk3.bold(String(changed.length))} in period`);
35544
35552
  lines.push(` Completed: ${chalk3.green(String(completed.length))} (${completionRate}% rate)`);
35545
35553
  if (failed.length > 0)
@@ -35549,7 +35557,7 @@ program2.command("report").description("Analytics report: task activity, complet
35549
35557
  if (Object.keys(byAgent).length > 0) {
35550
35558
  lines.push(` By agent: ${Object.entries(byAgent).map(([a, n]) => `${a}=${n}`).join(" ")}`);
35551
35559
  }
35552
- if (stats.in_progress > 0)
35560
+ if ((stats.by_status?.in_progress ?? 0) > 0)
35553
35561
  lines.push(` Stale risk: check \`todos stale\` for stuck tasks`);
35554
35562
  }
35555
35563
  console.log(lines.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.11.22",
3
+ "version": "0.11.23",
4
4
  "description": "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",