@hasna/todos 0.11.24 → 0.11.25
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 +28 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -32729,6 +32729,29 @@ function autoDetectProject(opts) {
|
|
|
32729
32729
|
function autoProject(opts) {
|
|
32730
32730
|
return autoDetectProject(opts)?.id;
|
|
32731
32731
|
}
|
|
32732
|
+
function normalizeStatus(s) {
|
|
32733
|
+
switch (s.toLowerCase().trim()) {
|
|
32734
|
+
case "done":
|
|
32735
|
+
return "completed";
|
|
32736
|
+
case "complete":
|
|
32737
|
+
return "completed";
|
|
32738
|
+
case "active":
|
|
32739
|
+
return "in_progress";
|
|
32740
|
+
case "wip":
|
|
32741
|
+
return "in_progress";
|
|
32742
|
+
case "cancelled":
|
|
32743
|
+
return "cancelled";
|
|
32744
|
+
case "canceled":
|
|
32745
|
+
return "cancelled";
|
|
32746
|
+
default:
|
|
32747
|
+
return s;
|
|
32748
|
+
}
|
|
32749
|
+
}
|
|
32750
|
+
function normalizeStatusList(statuses) {
|
|
32751
|
+
if (Array.isArray(statuses))
|
|
32752
|
+
return statuses.map(normalizeStatus);
|
|
32753
|
+
return normalizeStatus(statuses);
|
|
32754
|
+
}
|
|
32732
32755
|
function output(data, jsonMode) {
|
|
32733
32756
|
if (jsonMode) {
|
|
32734
32757
|
console.log(JSON.stringify(data, null, 2));
|
|
@@ -32787,7 +32810,7 @@ program2.command("add <title>").description("Create a new task").option("-d, --d
|
|
|
32787
32810
|
return id;
|
|
32788
32811
|
})() : undefined,
|
|
32789
32812
|
assigned_to: opts.assign,
|
|
32790
|
-
status: opts.status,
|
|
32813
|
+
status: opts.status ? normalizeStatus(opts.status) : undefined,
|
|
32791
32814
|
task_list_id: taskListId,
|
|
32792
32815
|
agent_id: globalOpts.agent,
|
|
32793
32816
|
session_id: globalOpts.session,
|
|
@@ -32824,7 +32847,7 @@ program2.command("list").description("List tasks").option("-s, --status <status>
|
|
|
32824
32847
|
filter["task_list_id"] = listId;
|
|
32825
32848
|
}
|
|
32826
32849
|
if (opts.status) {
|
|
32827
|
-
filter["status"] = opts.status.includes(",") ? opts.status.split(",").map((s) => s.trim()) : opts.status;
|
|
32850
|
+
filter["status"] = opts.status.includes(",") ? opts.status.split(",").map((s) => normalizeStatus(s.trim())) : normalizeStatus(opts.status);
|
|
32828
32851
|
} else if (!opts.all) {
|
|
32829
32852
|
filter["status"] = ["pending", "in_progress"];
|
|
32830
32853
|
}
|
|
@@ -33201,7 +33224,7 @@ program2.command("update <id>").description("Update a task").option("--title <te
|
|
|
33201
33224
|
version: current.version,
|
|
33202
33225
|
title: opts.title,
|
|
33203
33226
|
description: opts.description,
|
|
33204
|
-
status: opts.status,
|
|
33227
|
+
status: opts.status ? normalizeStatus(opts.status) : undefined,
|
|
33205
33228
|
priority: opts.priority,
|
|
33206
33229
|
assigned_to: opts.assign,
|
|
33207
33230
|
tags: opts.tags ? opts.tags.split(",").map((t) => t.trim()) : undefined,
|
|
@@ -33730,7 +33753,7 @@ program2.command("search <query>").description("Search tasks").option("--status
|
|
|
33730
33753
|
const projectId = autoProject(globalOpts);
|
|
33731
33754
|
const searchOpts = { query, project_id: projectId };
|
|
33732
33755
|
if (opts.status)
|
|
33733
|
-
searchOpts.status = opts.status;
|
|
33756
|
+
searchOpts.status = normalizeStatusList(opts.status);
|
|
33734
33757
|
if (opts.priority)
|
|
33735
33758
|
searchOpts.priority = opts.priority;
|
|
33736
33759
|
if (opts.assigned)
|
|
@@ -34835,7 +34858,7 @@ program2.command("watch").description("Live-updating task list (refreshes every
|
|
|
34835
34858
|
const globalOpts = program2.opts();
|
|
34836
34859
|
const projectId = autoProject(globalOpts);
|
|
34837
34860
|
const interval = parseInt(opts.interval, 10) * 1000;
|
|
34838
|
-
const statusFilter = opts.status ? opts.status.split(",").map((s) => s.trim()) : ["pending", "in_progress"];
|
|
34861
|
+
const statusFilter = opts.status ? opts.status.split(",").map((s) => normalizeStatus(s.trim())) : ["pending", "in_progress"];
|
|
34839
34862
|
function render2() {
|
|
34840
34863
|
const tasks = listTasks({ project_id: projectId, status: statusFilter });
|
|
34841
34864
|
const all = listTasks({ project_id: projectId });
|