@hasna/todos 0.10.15 → 0.10.17
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 +52 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -16894,6 +16894,19 @@ program2.command("delete <id>").description("Delete a task").action((id) => {
|
|
|
16894
16894
|
process.exit(1);
|
|
16895
16895
|
}
|
|
16896
16896
|
});
|
|
16897
|
+
program2.command("remove <id>").description("Remove/delete a task (alias for delete)").action((id) => {
|
|
16898
|
+
const globalOpts = program2.opts();
|
|
16899
|
+
const resolvedId = resolveTaskId(id);
|
|
16900
|
+
const deleted = deleteTask(resolvedId);
|
|
16901
|
+
if (globalOpts.json) {
|
|
16902
|
+
output({ deleted }, true);
|
|
16903
|
+
} else if (deleted) {
|
|
16904
|
+
console.log(chalk.green("Task removed."));
|
|
16905
|
+
} else {
|
|
16906
|
+
console.error(chalk.red("Task not found."));
|
|
16907
|
+
process.exit(1);
|
|
16908
|
+
}
|
|
16909
|
+
});
|
|
16897
16910
|
program2.command("bulk <action> <ids...>").description("Bulk operation on multiple tasks (done, start, delete)").action((action, ids) => {
|
|
16898
16911
|
const globalOpts = program2.opts();
|
|
16899
16912
|
const results = [];
|
|
@@ -17576,6 +17589,45 @@ Use ${chalk.cyan(`--agent ${result.id}`)} on future commands.`);
|
|
|
17576
17589
|
handleError(e);
|
|
17577
17590
|
}
|
|
17578
17591
|
});
|
|
17592
|
+
program2.command("heartbeat [agent]").description("Update last_seen_at to signal you're still active").action((agent) => {
|
|
17593
|
+
const globalOpts = program2.opts();
|
|
17594
|
+
const agentId = agent || globalOpts.agent;
|
|
17595
|
+
if (!agentId) {
|
|
17596
|
+
console.error(chalk.red("Agent ID required. Use --agent or pass as argument."));
|
|
17597
|
+
process.exit(1);
|
|
17598
|
+
}
|
|
17599
|
+
const { updateAgentActivity: updateAgentActivity2, getAgent: getAgent2 } = (init_agents(), __toCommonJS(exports_agents));
|
|
17600
|
+
const a = getAgent2(agentId) || (init_agents(), __toCommonJS(exports_agents)).getAgentByName(agentId);
|
|
17601
|
+
if (!a) {
|
|
17602
|
+
console.error(chalk.red(`Agent not found: ${agentId}`));
|
|
17603
|
+
process.exit(1);
|
|
17604
|
+
}
|
|
17605
|
+
updateAgentActivity2(a.id);
|
|
17606
|
+
if (globalOpts.json) {
|
|
17607
|
+
console.log(JSON.stringify({ agent_id: a.id, name: a.name, last_seen_at: new Date().toISOString() }));
|
|
17608
|
+
} else {
|
|
17609
|
+
console.log(chalk.green(`\u2665 ${a.name} (${a.id.slice(0, 8)}) \u2014 heartbeat sent`));
|
|
17610
|
+
}
|
|
17611
|
+
});
|
|
17612
|
+
program2.command("focus [project]").description("Focus on a project (or clear focus if no project given)").action((project) => {
|
|
17613
|
+
const globalOpts = program2.opts();
|
|
17614
|
+
const agentId = globalOpts.agent;
|
|
17615
|
+
if (!agentId) {
|
|
17616
|
+
console.error(chalk.red("Agent ID required. Use --agent."));
|
|
17617
|
+
process.exit(1);
|
|
17618
|
+
}
|
|
17619
|
+
const db = getDatabase();
|
|
17620
|
+
if (project) {
|
|
17621
|
+
const { getProjectByPath: getProjectByPath2, getProjectByName } = (init_projects(), __toCommonJS(exports_projects));
|
|
17622
|
+
const p = getProjectByPath2(process.cwd(), db) || getProjectByName(project, db);
|
|
17623
|
+
const projectId = p?.id || project;
|
|
17624
|
+
db.run("UPDATE agents SET active_project_id = ? WHERE id = ? OR name = ?", [projectId, agentId, agentId]);
|
|
17625
|
+
console.log(chalk.green(`Focused on: ${p?.name || projectId}`));
|
|
17626
|
+
} else {
|
|
17627
|
+
db.run("UPDATE agents SET active_project_id = NULL WHERE id = ? OR name = ?", [agentId, agentId]);
|
|
17628
|
+
console.log(chalk.dim("Focus cleared."));
|
|
17629
|
+
}
|
|
17630
|
+
});
|
|
17579
17631
|
program2.command("agents").description("List registered agents").action(() => {
|
|
17580
17632
|
const globalOpts = program2.opts();
|
|
17581
17633
|
try {
|