@hasna/todos 0.9.51 → 0.9.53

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
@@ -10331,8 +10331,15 @@ Retry task created: ${formatTask(result.retryTask)}`;
10331
10331
  }, async ({ agent_name }) => {
10332
10332
  try {
10333
10333
  const agent = registerAgent({ name: agent_name });
10334
- const tasks = listTasks({});
10335
- const myTasks = tasks.filter((t) => t.assigned_to === agent_name || t.assigned_to === agent.id || t.agent_id === agent.id || t.agent_id === agent_name);
10334
+ const byName = listTasks({ assigned_to: agent_name });
10335
+ const byId = listTasks({ agent_id: agent.id });
10336
+ const seen = new Set;
10337
+ const myTasks = [...byName, ...byId].filter((t) => {
10338
+ if (seen.has(t.id))
10339
+ return false;
10340
+ seen.add(t.id);
10341
+ return true;
10342
+ });
10336
10343
  const pending = myTasks.filter((t) => t.status === "pending");
10337
10344
  const inProgress = myTasks.filter((t) => t.status === "in_progress");
10338
10345
  const completed = myTasks.filter((t) => t.status === "completed");
@@ -11653,7 +11660,10 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
11653
11660
  }
11654
11661
  }
11655
11662
  if (path === "/api/projects" && method === "GET") {
11656
- return json(listProjects(), 200, port);
11663
+ const pFieldsParam = url.searchParams.get("fields");
11664
+ const pFields = pFieldsParam ? pFieldsParam.split(",").map((f) => f.trim()).filter(Boolean) : undefined;
11665
+ const projects = listProjects();
11666
+ return json(pFields ? projects.map((p) => Object.fromEntries(pFields.map((f) => [f, p[f] ?? null]))) : projects, 200, port);
11657
11667
  }
11658
11668
  if (path === "/api/agents/me" && method === "GET") {
11659
11669
  const name = url.searchParams.get("name");
@@ -11741,7 +11751,10 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
11741
11751
  return json(getDirectReports2(agentId), 200, port);
11742
11752
  }
11743
11753
  if (path === "/api/agents" && method === "GET") {
11744
- return json(listAgents(), 200, port);
11754
+ const aFieldsParam = url.searchParams.get("fields");
11755
+ const aFields = aFieldsParam ? aFieldsParam.split(",").map((f) => f.trim()).filter(Boolean) : undefined;
11756
+ const agents = listAgents();
11757
+ return json(aFields ? agents.map((a) => Object.fromEntries(aFields.map((f) => [f, a[f] ?? null]))) : agents, 200, port);
11745
11758
  }
11746
11759
  if (path === "/api/projects" && method === "POST") {
11747
11760
  try {
package/dist/mcp/index.js CHANGED
@@ -8105,8 +8105,15 @@ if (shouldRegisterTool("get_my_tasks")) {
8105
8105
  }, async ({ agent_name }) => {
8106
8106
  try {
8107
8107
  const agent = registerAgent({ name: agent_name });
8108
- const tasks = listTasks({});
8109
- const myTasks = tasks.filter((t) => t.assigned_to === agent_name || t.assigned_to === agent.id || t.agent_id === agent.id || t.agent_id === agent_name);
8108
+ const byName = listTasks({ assigned_to: agent_name });
8109
+ const byId = listTasks({ agent_id: agent.id });
8110
+ const seen = new Set;
8111
+ const myTasks = [...byName, ...byId].filter((t) => {
8112
+ if (seen.has(t.id))
8113
+ return false;
8114
+ seen.add(t.id);
8115
+ return true;
8116
+ });
8110
8117
  const pending = myTasks.filter((t) => t.status === "pending");
8111
8118
  const inProgress = myTasks.filter((t) => t.status === "in_progress");
8112
8119
  const completed = myTasks.filter((t) => t.status === "completed");
@@ -2867,7 +2867,10 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
2867
2867
  }
2868
2868
  }
2869
2869
  if (path === "/api/projects" && method === "GET") {
2870
- return json(listProjects(), 200, port);
2870
+ const pFieldsParam = url.searchParams.get("fields");
2871
+ const pFields = pFieldsParam ? pFieldsParam.split(",").map((f) => f.trim()).filter(Boolean) : undefined;
2872
+ const projects = listProjects();
2873
+ return json(pFields ? projects.map((p) => Object.fromEntries(pFields.map((f) => [f, p[f] ?? null]))) : projects, 200, port);
2871
2874
  }
2872
2875
  if (path === "/api/agents/me" && method === "GET") {
2873
2876
  const name = url.searchParams.get("name");
@@ -2955,7 +2958,10 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
2955
2958
  return json(getDirectReports2(agentId), 200, port);
2956
2959
  }
2957
2960
  if (path === "/api/agents" && method === "GET") {
2958
- return json(listAgents(), 200, port);
2961
+ const aFieldsParam = url.searchParams.get("fields");
2962
+ const aFields = aFieldsParam ? aFieldsParam.split(",").map((f) => f.trim()).filter(Boolean) : undefined;
2963
+ const agents = listAgents();
2964
+ return json(aFields ? agents.map((a) => Object.fromEntries(aFields.map((f) => [f, a[f] ?? null]))) : agents, 200, port);
2959
2965
  }
2960
2966
  if (path === "/api/projects" && method === "POST") {
2961
2967
  try {
@@ -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,CAuvB1G"}
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,CA6vB1G"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.9.51",
3
+ "version": "0.9.53",
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",