@hasna/todos 0.9.50 → 0.9.52

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
@@ -11653,7 +11653,10 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
11653
11653
  }
11654
11654
  }
11655
11655
  if (path === "/api/projects" && method === "GET") {
11656
- return json(listProjects(), 200, port);
11656
+ const pFieldsParam = url.searchParams.get("fields");
11657
+ const pFields = pFieldsParam ? pFieldsParam.split(",").map((f) => f.trim()).filter(Boolean) : undefined;
11658
+ const projects = listProjects();
11659
+ return json(pFields ? projects.map((p) => Object.fromEntries(pFields.map((f) => [f, p[f] ?? null]))) : projects, 200, port);
11657
11660
  }
11658
11661
  if (path === "/api/agents/me" && method === "GET") {
11659
11662
  const name = url.searchParams.get("name");
@@ -11741,7 +11744,10 @@ data: ${JSON.stringify({ type: "connected", agent_id: agentId, timestamp: new Da
11741
11744
  return json(getDirectReports2(agentId), 200, port);
11742
11745
  }
11743
11746
  if (path === "/api/agents" && method === "GET") {
11744
- return json(listAgents(), 200, port);
11747
+ const aFieldsParam = url.searchParams.get("fields");
11748
+ const aFields = aFieldsParam ? aFieldsParam.split(",").map((f) => f.trim()).filter(Boolean) : undefined;
11749
+ const agents = listAgents();
11750
+ return json(aFields ? agents.map((a) => Object.fromEntries(aFields.map((f) => [f, a[f] ?? null]))) : agents, 200, port);
11745
11751
  }
11746
11752
  if (path === "/api/projects" && method === "POST") {
11747
11753
  try {
@@ -14113,32 +14119,26 @@ function writeTomlFile(path, content) {
14113
14119
  writeFileSync3(path, content);
14114
14120
  }
14115
14121
  function registerClaude(binPath, global) {
14116
- const configPath = global ? join7(HOME2, ".claude", ".mcp.json") : join7(process.cwd(), ".mcp.json");
14117
- const config = readJsonFile2(configPath);
14118
- if (!config["mcpServers"]) {
14119
- config["mcpServers"] = {};
14122
+ const scope = global ? "user" : "project";
14123
+ const cmd = `claude mcp add --transport stdio --scope ${scope} todos -- ${binPath}`;
14124
+ try {
14125
+ const { execSync: execSync2 } = __require("child_process");
14126
+ execSync2(cmd, { stdio: "pipe" });
14127
+ console.log(chalk.green(`Claude Code (${scope}): registered via 'claude mcp add'`));
14128
+ } catch {
14129
+ console.log(chalk.yellow(`Claude Code: could not auto-register. Run this command manually:`));
14130
+ console.log(chalk.cyan(` ${cmd}`));
14120
14131
  }
14121
- const servers = config["mcpServers"];
14122
- servers["todos"] = {
14123
- command: binPath,
14124
- args: []
14125
- };
14126
- writeJsonFile2(configPath, config);
14127
- const scope = global ? "global" : "project";
14128
- console.log(chalk.green(`Claude Code (${scope}): registered in ${configPath}`));
14129
14132
  }
14130
- function unregisterClaude(global) {
14131
- const configPath = global ? join7(HOME2, ".claude", ".mcp.json") : join7(process.cwd(), ".mcp.json");
14132
- const config = readJsonFile2(configPath);
14133
- const servers = config["mcpServers"];
14134
- if (!servers || !("todos" in servers)) {
14135
- console.log(chalk.dim(`Claude Code: todos not found in ${configPath}`));
14136
- return;
14133
+ function unregisterClaude(_global) {
14134
+ try {
14135
+ const { execSync: execSync2 } = __require("child_process");
14136
+ execSync2("claude mcp remove todos", { stdio: "pipe" });
14137
+ console.log(chalk.green(`Claude Code: removed todos MCP server`));
14138
+ } catch {
14139
+ console.log(chalk.yellow(`Claude Code: could not auto-remove. Run manually:`));
14140
+ console.log(chalk.cyan(" claude mcp remove todos"));
14137
14141
  }
14138
- delete servers["todos"];
14139
- writeJsonFile2(configPath, config);
14140
- const scope = global ? "global" : "project";
14141
- console.log(chalk.green(`Claude Code (${scope}): unregistered from ${configPath}`));
14142
14142
  }
14143
14143
  function registerCodex(binPath) {
14144
14144
  const configPath = join7(HOME2, ".codex", "config.toml");
@@ -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.50",
3
+ "version": "0.9.52",
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",