@hasna/todos 0.2.0 → 0.2.2

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 +72 -18
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -7602,6 +7602,29 @@ function TaskDetail({ task }) {
7602
7602
  }, undefined, false, undefined, this)
7603
7603
  ]
7604
7604
  }, undefined, true, undefined, this),
7605
+ task.agent_id && /* @__PURE__ */ jsxDEV3(Box3, {
7606
+ children: [
7607
+ /* @__PURE__ */ jsxDEV3(Text3, {
7608
+ dimColor: true,
7609
+ children: "Agent: "
7610
+ }, undefined, false, undefined, this),
7611
+ /* @__PURE__ */ jsxDEV3(Text3, {
7612
+ color: "cyan",
7613
+ children: task.agent_id
7614
+ }, undefined, false, undefined, this)
7615
+ ]
7616
+ }, undefined, true, undefined, this),
7617
+ task.session_id && /* @__PURE__ */ jsxDEV3(Box3, {
7618
+ children: [
7619
+ /* @__PURE__ */ jsxDEV3(Text3, {
7620
+ dimColor: true,
7621
+ children: "Session: "
7622
+ }, undefined, false, undefined, this),
7623
+ /* @__PURE__ */ jsxDEV3(Text3, {
7624
+ children: task.session_id
7625
+ }, undefined, false, undefined, this)
7626
+ ]
7627
+ }, undefined, true, undefined, this),
7605
7628
  task.assigned_to && /* @__PURE__ */ jsxDEV3(Box3, {
7606
7629
  children: [
7607
7630
  /* @__PURE__ */ jsxDEV3(Text3, {
@@ -7614,6 +7637,28 @@ function TaskDetail({ task }) {
7614
7637
  }, undefined, false, undefined, this)
7615
7638
  ]
7616
7639
  }, undefined, true, undefined, this),
7640
+ task.project_id && /* @__PURE__ */ jsxDEV3(Box3, {
7641
+ children: [
7642
+ /* @__PURE__ */ jsxDEV3(Text3, {
7643
+ dimColor: true,
7644
+ children: "Project: "
7645
+ }, undefined, false, undefined, this),
7646
+ /* @__PURE__ */ jsxDEV3(Text3, {
7647
+ children: task.project_id
7648
+ }, undefined, false, undefined, this)
7649
+ ]
7650
+ }, undefined, true, undefined, this),
7651
+ task.working_dir && /* @__PURE__ */ jsxDEV3(Box3, {
7652
+ children: [
7653
+ /* @__PURE__ */ jsxDEV3(Text3, {
7654
+ dimColor: true,
7655
+ children: "Work Dir: "
7656
+ }, undefined, false, undefined, this),
7657
+ /* @__PURE__ */ jsxDEV3(Text3, {
7658
+ children: task.working_dir
7659
+ }, undefined, false, undefined, this)
7660
+ ]
7661
+ }, undefined, true, undefined, this),
7617
7662
  task.locked_by && /* @__PURE__ */ jsxDEV3(Box3, {
7618
7663
  children: [
7619
7664
  /* @__PURE__ */ jsxDEV3(Text3, {
@@ -8540,10 +8585,14 @@ program2.command("show <id>").description("Show full task details").action((id)
8540
8585
  console.log(` ${chalk.dim("Assigned:")} ${task.assigned_to}`);
8541
8586
  if (task.agent_id)
8542
8587
  console.log(` ${chalk.dim("Agent:")} ${task.agent_id}`);
8588
+ if (task.session_id)
8589
+ console.log(` ${chalk.dim("Session:")} ${task.session_id}`);
8543
8590
  if (task.locked_by)
8544
8591
  console.log(` ${chalk.dim("Locked:")} ${task.locked_by} (at ${task.locked_at})`);
8545
8592
  if (task.project_id)
8546
8593
  console.log(` ${chalk.dim("Project:")} ${task.project_id}`);
8594
+ if (task.working_dir)
8595
+ console.log(` ${chalk.dim("WorkDir:")} ${task.working_dir}`);
8547
8596
  if (task.parent)
8548
8597
  console.log(` ${chalk.dim("Parent:")} ${task.parent.id.slice(0, 8)} | ${task.parent.title}`);
8549
8598
  if (task.tags.length > 0)
@@ -8860,13 +8909,13 @@ program2.command("export").description("Export tasks").option("-f, --format <for
8860
8909
  console.log(JSON.stringify(tasks, null, 2));
8861
8910
  }
8862
8911
  });
8863
- program2.command("mcp").description("Start MCP server (stdio)").option("--register <agent>", "Register MCP server with an agent (claude, codex, gemini, all)").option("--unregister <agent>", "Unregister MCP server from an agent (claude, codex, gemini, all)").action(async (opts) => {
8912
+ program2.command("mcp").description("Start MCP server (stdio)").option("--register <agent>", "Register MCP server with an agent (claude, codex, gemini, all)").option("--unregister <agent>", "Unregister MCP server from an agent (claude, codex, gemini, all)").option("-g, --global", "Register/unregister globally (user-level) instead of project-level").action(async (opts) => {
8864
8913
  if (opts.register) {
8865
- registerMcp(opts.register);
8914
+ registerMcp(opts.register, opts.global);
8866
8915
  return;
8867
8916
  }
8868
8917
  if (opts.unregister) {
8869
- unregisterMcp(opts.unregister);
8918
+ unregisterMcp(opts.unregister, opts.global);
8870
8919
  return;
8871
8920
  }
8872
8921
  await Promise.resolve().then(() => (init_mcp(), exports_mcp));
@@ -8910,28 +8959,33 @@ function writeTomlFile(path, content) {
8910
8959
  mkdirSync2(dir, { recursive: true });
8911
8960
  writeFileSync(path, content);
8912
8961
  }
8913
- function registerClaude(binPath) {
8914
- const cwd = process.cwd();
8915
- const configPath = join3(cwd, ".mcp.json");
8962
+ function registerClaude(binPath, global) {
8963
+ const configPath = global ? join3(HOME, ".claude", ".mcp.json") : join3(process.cwd(), ".mcp.json");
8916
8964
  const config = readJsonFile(configPath);
8917
- config["todos"] = {
8965
+ if (!config["mcpServers"]) {
8966
+ config["mcpServers"] = {};
8967
+ }
8968
+ const servers = config["mcpServers"];
8969
+ servers["todos"] = {
8918
8970
  command: binPath,
8919
8971
  args: []
8920
8972
  };
8921
8973
  writeJsonFile(configPath, config);
8922
- console.log(chalk.green(`Claude Code: registered in ${configPath}`));
8974
+ const scope = global ? "global" : "project";
8975
+ console.log(chalk.green(`Claude Code (${scope}): registered in ${configPath}`));
8923
8976
  }
8924
- function unregisterClaude() {
8925
- const cwd = process.cwd();
8926
- const configPath = join3(cwd, ".mcp.json");
8977
+ function unregisterClaude(global) {
8978
+ const configPath = global ? join3(HOME, ".claude", ".mcp.json") : join3(process.cwd(), ".mcp.json");
8927
8979
  const config = readJsonFile(configPath);
8928
- if (!("todos" in config)) {
8980
+ const servers = config["mcpServers"];
8981
+ if (!servers || !("todos" in servers)) {
8929
8982
  console.log(chalk.dim(`Claude Code: todos not found in ${configPath}`));
8930
8983
  return;
8931
8984
  }
8932
- delete config["todos"];
8985
+ delete servers["todos"];
8933
8986
  writeJsonFile(configPath, config);
8934
- console.log(chalk.green(`Claude Code: unregistered from ${configPath}`));
8987
+ const scope = global ? "global" : "project";
8988
+ console.log(chalk.green(`Claude Code (${scope}): unregistered from ${configPath}`));
8935
8989
  }
8936
8990
  function registerCodex(binPath) {
8937
8991
  const configPath = join3(HOME, ".codex", "config.toml");
@@ -9006,13 +9060,13 @@ function unregisterGemini() {
9006
9060
  writeJsonFile(configPath, config);
9007
9061
  console.log(chalk.green(`Gemini CLI: unregistered from ${configPath}`));
9008
9062
  }
9009
- function registerMcp(agent) {
9063
+ function registerMcp(agent, global) {
9010
9064
  const agents = agent === "all" ? ["claude", "codex", "gemini"] : [agent];
9011
9065
  const binPath = getMcpBinaryPath();
9012
9066
  for (const a of agents) {
9013
9067
  switch (a) {
9014
9068
  case "claude":
9015
- registerClaude(binPath);
9069
+ registerClaude(binPath, global);
9016
9070
  break;
9017
9071
  case "codex":
9018
9072
  registerCodex(binPath);
@@ -9025,12 +9079,12 @@ function registerMcp(agent) {
9025
9079
  }
9026
9080
  }
9027
9081
  }
9028
- function unregisterMcp(agent) {
9082
+ function unregisterMcp(agent, global) {
9029
9083
  const agents = agent === "all" ? ["claude", "codex", "gemini"] : [agent];
9030
9084
  for (const a of agents) {
9031
9085
  switch (a) {
9032
9086
  case "claude":
9033
- unregisterClaude();
9087
+ unregisterClaude(global);
9034
9088
  break;
9035
9089
  case "codex":
9036
9090
  unregisterCodex();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
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",