@hasna/todos 0.9.62 → 0.9.63

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 CHANGED
@@ -11609,6 +11609,32 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
11609
11609
  return json({ error: e instanceof Error ? e.message : "Failed" }, 500, port);
11610
11610
  }
11611
11611
  }
11612
+ if (path === "/api/tasks/context" && method === "GET") {
11613
+ const agentId = url.searchParams.get("agent_id") || undefined;
11614
+ const projectId = url.searchParams.get("project_id") || undefined;
11615
+ const format = url.searchParams.get("format") || "text";
11616
+ const { getStatus: getStatus2, getNextTask: getNextTask2 } = await Promise.resolve().then(() => (init_tasks(), exports_tasks));
11617
+ const filters = projectId ? { project_id: projectId } : undefined;
11618
+ const status = getStatus2(filters, agentId);
11619
+ const next = getNextTask2(agentId, filters);
11620
+ if (format === "json") {
11621
+ return json({ status, next_task: next ? taskToSummary(next) : null }, 200, port);
11622
+ }
11623
+ const lines = [];
11624
+ lines.push(`Tasks: ${status.pending} pending | ${status.in_progress} active | ${status.completed} done`);
11625
+ if (status.stale_count > 0)
11626
+ lines.push(`\u26A0 ${status.stale_count} stale tasks stuck in-progress`);
11627
+ if (status.overdue_recurring > 0)
11628
+ lines.push(`\uD83D\uDD01 ${status.overdue_recurring} overdue recurring tasks`);
11629
+ if (status.active_work.length > 0) {
11630
+ lines.push(`Active: ${status.active_work.slice(0, 3).map((w) => `${w.short_id || w.id.slice(0, 8)} (${w.assigned_to || "?"})`).join(", ")}`);
11631
+ }
11632
+ if (next)
11633
+ lines.push(`Next up: ${next.short_id || next.id.slice(0, 8)} [${next.priority}] ${next.title}`);
11634
+ const text = lines.join(`
11635
+ `);
11636
+ return new Response(text, { headers: { "Content-Type": "text/plain", "Access-Control-Allow-Origin": "*" } });
11637
+ }
11612
11638
  const attachmentsMatch = path.match(/^\/api\/tasks\/([^/]+)\/attachments$/);
11613
11639
  if (attachmentsMatch && method === "GET") {
11614
11640
  const id = attachmentsMatch[1];
@@ -2795,6 +2795,32 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
2795
2795
  return json({ error: e instanceof Error ? e.message : "Failed" }, 500, port);
2796
2796
  }
2797
2797
  }
2798
+ if (path === "/api/tasks/context" && method === "GET") {
2799
+ const agentId = url.searchParams.get("agent_id") || undefined;
2800
+ const projectId = url.searchParams.get("project_id") || undefined;
2801
+ const format = url.searchParams.get("format") || "text";
2802
+ const { getStatus: getStatus2, getNextTask: getNextTask2 } = await Promise.resolve().then(() => (init_tasks(), exports_tasks));
2803
+ const filters = projectId ? { project_id: projectId } : undefined;
2804
+ const status = getStatus2(filters, agentId);
2805
+ const next = getNextTask2(agentId, filters);
2806
+ if (format === "json") {
2807
+ return json({ status, next_task: next ? taskToSummary(next) : null }, 200, port);
2808
+ }
2809
+ const lines = [];
2810
+ lines.push(`Tasks: ${status.pending} pending | ${status.in_progress} active | ${status.completed} done`);
2811
+ if (status.stale_count > 0)
2812
+ lines.push(`\u26A0 ${status.stale_count} stale tasks stuck in-progress`);
2813
+ if (status.overdue_recurring > 0)
2814
+ lines.push(`\uD83D\uDD01 ${status.overdue_recurring} overdue recurring tasks`);
2815
+ if (status.active_work.length > 0) {
2816
+ lines.push(`Active: ${status.active_work.slice(0, 3).map((w) => `${w.short_id || w.id.slice(0, 8)} (${w.assigned_to || "?"})`).join(", ")}`);
2817
+ }
2818
+ if (next)
2819
+ lines.push(`Next up: ${next.short_id || next.id.slice(0, 8)} [${next.priority}] ${next.title}`);
2820
+ const text = lines.join(`
2821
+ `);
2822
+ return new Response(text, { headers: { "Content-Type": "text/plain", "Access-Control-Allow-Origin": "*" } });
2823
+ }
2798
2824
  const attachmentsMatch = path.match(/^\/api\/tasks\/([^/]+)\/attachments$/);
2799
2825
  if (attachmentsMatch && method === "GET") {
2800
2826
  const id = attachmentsMatch[1];
@@ -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,CAizB1G"}
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,CA00B1G"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.9.62",
3
+ "version": "0.9.63",
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",