@hasna/todos 0.10.10 → 0.10.11

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
@@ -10836,8 +10836,6 @@ var init_mcp = __esm(() => {
10836
10836
  "heartbeat"
10837
10837
  ]);
10838
10838
  STANDARD_EXCLUDED = new Set([
10839
- "get_org_chart",
10840
- "set_reports_to",
10841
10839
  "rename_agent",
10842
10840
  "delete_agent",
10843
10841
  "unarchive_agent",
@@ -12282,14 +12280,32 @@ In Progress:`);
12282
12280
  });
12283
12281
  }
12284
12282
  if (shouldRegisterTool("get_org_chart")) {
12285
- server.tool("get_org_chart", "Get agent org chart showing reporting hierarchy.", {}, async () => {
12283
+ server.tool("get_org_chart", "Get agent org chart showing reporting hierarchy with roles, titles, capabilities, and activity status.", {
12284
+ format: exports_external.enum(["text", "json"]).optional().describe("Output format (default: text)"),
12285
+ role: exports_external.string().optional().describe("Filter by agent role (e.g. 'lead', 'developer')"),
12286
+ active_only: exports_external.coerce.boolean().optional().describe("Only show agents active in last 30 min")
12287
+ }, async ({ format, role, active_only }) => {
12286
12288
  try {
12287
- let render = function(nodes, indent = 0) {
12289
+ let filterTree = function(nodes) {
12290
+ return nodes.map((n) => ({ ...n, reports: filterTree(n.reports) })).filter((n) => {
12291
+ if (role && n.agent.role !== role)
12292
+ return false;
12293
+ if (active_only) {
12294
+ const lastSeen = new Date(n.agent.last_seen_at).getTime();
12295
+ if (now2 - lastSeen > ACTIVE_MS)
12296
+ return false;
12297
+ }
12298
+ return true;
12299
+ });
12300
+ }, render = function(nodes, indent = 0) {
12288
12301
  return nodes.map((n) => {
12289
12302
  const prefix = " ".repeat(indent);
12290
12303
  const title = n.agent.title ? ` \u2014 ${n.agent.title}` : "";
12291
- const level = n.agent.level ? ` (${n.agent.level})` : "";
12292
- const line = `${prefix}${n.agent.name}${title}${level}`;
12304
+ const level = n.agent.level ? ` [${n.agent.level}]` : "";
12305
+ const caps = n.agent.capabilities?.length > 0 ? ` {${n.agent.capabilities.join(", ")}}` : "";
12306
+ const lastSeen = new Date(n.agent.last_seen_at).getTime();
12307
+ const active = now2 - lastSeen < ACTIVE_MS ? " \u25CF" : " \u25CB";
12308
+ const line = `${prefix}${active} ${n.agent.name}${title}${level}${caps}`;
12293
12309
  const children = n.reports.length > 0 ? `
12294
12310
  ` + render(n.reports, indent + 1) : "";
12295
12311
  return line + children;
@@ -12297,7 +12313,14 @@ In Progress:`);
12297
12313
  `);
12298
12314
  };
12299
12315
  const { getOrgChart: getOrgChart2 } = await Promise.resolve().then(() => (init_agents(), exports_agents));
12300
- const tree = getOrgChart2();
12316
+ let tree = getOrgChart2();
12317
+ const now2 = Date.now();
12318
+ const ACTIVE_MS = 1800000;
12319
+ if (role || active_only)
12320
+ tree = filterTree(tree);
12321
+ if (format === "json") {
12322
+ return { content: [{ type: "text", text: JSON.stringify(tree, null, 2) }] };
12323
+ }
12301
12324
  const text = tree.length > 0 ? render(tree) : "No agents registered.";
12302
12325
  return { content: [{ type: "text", text }] };
12303
12326
  } catch (e) {
package/dist/mcp/index.js CHANGED
@@ -8441,8 +8441,6 @@ var MINIMAL_TOOLS = new Set([
8441
8441
  "heartbeat"
8442
8442
  ]);
8443
8443
  var STANDARD_EXCLUDED = new Set([
8444
- "get_org_chart",
8445
- "set_reports_to",
8446
8444
  "rename_agent",
8447
8445
  "delete_agent",
8448
8446
  "unarchive_agent",
@@ -10010,14 +10008,32 @@ In Progress:`);
10010
10008
  });
10011
10009
  }
10012
10010
  if (shouldRegisterTool("get_org_chart")) {
10013
- server.tool("get_org_chart", "Get agent org chart showing reporting hierarchy.", {}, async () => {
10011
+ server.tool("get_org_chart", "Get agent org chart showing reporting hierarchy with roles, titles, capabilities, and activity status.", {
10012
+ format: exports_external.enum(["text", "json"]).optional().describe("Output format (default: text)"),
10013
+ role: exports_external.string().optional().describe("Filter by agent role (e.g. 'lead', 'developer')"),
10014
+ active_only: exports_external.coerce.boolean().optional().describe("Only show agents active in last 30 min")
10015
+ }, async ({ format, role, active_only }) => {
10014
10016
  try {
10015
- let render = function(nodes, indent = 0) {
10017
+ let filterTree = function(nodes) {
10018
+ return nodes.map((n) => ({ ...n, reports: filterTree(n.reports) })).filter((n) => {
10019
+ if (role && n.agent.role !== role)
10020
+ return false;
10021
+ if (active_only) {
10022
+ const lastSeen = new Date(n.agent.last_seen_at).getTime();
10023
+ if (now2 - lastSeen > ACTIVE_MS)
10024
+ return false;
10025
+ }
10026
+ return true;
10027
+ });
10028
+ }, render = function(nodes, indent = 0) {
10016
10029
  return nodes.map((n) => {
10017
10030
  const prefix = " ".repeat(indent);
10018
10031
  const title = n.agent.title ? ` \u2014 ${n.agent.title}` : "";
10019
- const level = n.agent.level ? ` (${n.agent.level})` : "";
10020
- const line = `${prefix}${n.agent.name}${title}${level}`;
10032
+ const level = n.agent.level ? ` [${n.agent.level}]` : "";
10033
+ const caps = n.agent.capabilities?.length > 0 ? ` {${n.agent.capabilities.join(", ")}}` : "";
10034
+ const lastSeen = new Date(n.agent.last_seen_at).getTime();
10035
+ const active = now2 - lastSeen < ACTIVE_MS ? " \u25CF" : " \u25CB";
10036
+ const line = `${prefix}${active} ${n.agent.name}${title}${level}${caps}`;
10021
10037
  const children = n.reports.length > 0 ? `
10022
10038
  ` + render(n.reports, indent + 1) : "";
10023
10039
  return line + children;
@@ -10025,7 +10041,14 @@ if (shouldRegisterTool("get_org_chart")) {
10025
10041
  `);
10026
10042
  };
10027
10043
  const { getOrgChart: getOrgChart2 } = await Promise.resolve().then(() => (init_agents(), exports_agents));
10028
- const tree = getOrgChart2();
10044
+ let tree = getOrgChart2();
10045
+ const now2 = Date.now();
10046
+ const ACTIVE_MS = 1800000;
10047
+ if (role || active_only)
10048
+ tree = filterTree(tree);
10049
+ if (format === "json") {
10050
+ return { content: [{ type: "text", text: JSON.stringify(tree, null, 2) }] };
10051
+ }
10029
10052
  const text = tree.length > 0 ? render(tree) : "No agents registered.";
10030
10053
  return { content: [{ type: "text", text }] };
10031
10054
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.10.10",
3
+ "version": "0.10.11",
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",