aitasks 1.1.0 → 1.2.0
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/README.md +2 -0
- package/dist/index.js +317 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ aitasks done TASK-001 --agent claude-sonnet
|
|
|
47
47
|
- Pattern matching: `aitasks claim TASK-0* --agent <id>` claims all TASK-00x tasks
|
|
48
48
|
- Search: `aitasks search "auth"` finds tasks mentioning authentication
|
|
49
49
|
- Undo mistakes: `aitasks undo TASK-001`
|
|
50
|
+
- Delete tasks: `aitasks delete TASK-001` (no need to claim first)
|
|
50
51
|
|
|
51
52
|
---
|
|
52
53
|
|
|
@@ -100,6 +101,7 @@ export AITASKS_JSON=true
|
|
|
100
101
|
| `aitasks reject <id> --reason <text>` | Reject and send back to in_progress |
|
|
101
102
|
| `aitasks unclaim <id> --agent <id>` | Release a task back to the pool |
|
|
102
103
|
| `aitasks undo <id>` | Undo the last action on a task |
|
|
104
|
+
| `aitasks delete <id...>` | Delete task(s) - does not require claiming first |
|
|
103
105
|
|
|
104
106
|
**Note:** Commands marked with `<id...>` support multiple task IDs and pattern matching (e.g., `TASK-0*`).
|
|
105
107
|
|
package/dist/index.js
CHANGED
|
@@ -1890,7 +1890,7 @@ var require_commander = __commonJS((exports) => {
|
|
|
1890
1890
|
var require_package = __commonJS((exports, module) => {
|
|
1891
1891
|
module.exports = {
|
|
1892
1892
|
name: "aitasks",
|
|
1893
|
-
version: "1.
|
|
1893
|
+
version: "1.2.0",
|
|
1894
1894
|
description: "CLI task management tool built for AI agents",
|
|
1895
1895
|
type: "module",
|
|
1896
1896
|
bin: {
|
|
@@ -29296,6 +29296,7 @@ aitasks next --claim --agent <id> # Auto-claim and start the best task (one-
|
|
|
29296
29296
|
aitasks show TASK-001 # Full detail on a specific task
|
|
29297
29297
|
aitasks search <query> # Full-text search across titles, descriptions, notes
|
|
29298
29298
|
aitasks deps TASK-001 # Show dependency tree (what blocks what)
|
|
29299
|
+
aitasks delete TASK-001 # Delete a task (no need to claim first)
|
|
29299
29300
|
\`\`\`
|
|
29300
29301
|
|
|
29301
29302
|
---
|
|
@@ -29392,8 +29393,6 @@ You MUST verify every acceptance criterion before marking done.
|
|
|
29392
29393
|
aitasks done TASK-001 --agent $AITASKS_AGENT_ID
|
|
29393
29394
|
\`\`\`
|
|
29394
29395
|
|
|
29395
|
-
**Note:** When you complete a subtask, if ALL sibling subtasks are also done, the parent task will be automatically marked as done.
|
|
29396
|
-
|
|
29397
29396
|
If human review is needed instead:
|
|
29398
29397
|
\`\`\`bash
|
|
29399
29398
|
aitasks review TASK-001 --agent $AITASKS_AGENT_ID
|
|
@@ -29436,7 +29435,6 @@ aitasks unclaim TASK-001 --agent $AITASKS_AGENT_ID --reason "Blocked on missing
|
|
|
29436
29435
|
5. If a task needs splitting, create subtasks BEFORE marking parent done.
|
|
29437
29436
|
6. Your evidence strings must be concrete and verifiable \u2014 not vague affirmations.
|
|
29438
29437
|
7. Always provide --desc and at least one --ac when creating a task. Both are required.
|
|
29439
|
-
8. When completing a subtask, the parent auto-completes if ALL subtasks are done.
|
|
29440
29438
|
|
|
29441
29439
|
---
|
|
29442
29440
|
|
|
@@ -29459,6 +29457,7 @@ aitasks block <id> --on <id,...> Mark as blocked
|
|
|
29459
29457
|
aitasks unblock <id> --from <id> Remove a blocker
|
|
29460
29458
|
aitasks unclaim <id> --agent <id> Release task
|
|
29461
29459
|
aitasks undo <id> Undo last action on task
|
|
29460
|
+
aitasks delete <id...> Delete task(s) - no claim required
|
|
29462
29461
|
aitasks log <id> Full event history
|
|
29463
29462
|
aitasks agents List active agents
|
|
29464
29463
|
aitasks export --format json Export all tasks
|
|
@@ -30360,9 +30359,6 @@ function completeTask(taskId, agentId) {
|
|
|
30360
30359
|
}
|
|
30361
30360
|
const updated = updateTask(taskId, { status: "done", completed_at: Date.now() });
|
|
30362
30361
|
logEvent({ task_id: taskId, agent_id: agentId, event_type: "completed", payload: {} });
|
|
30363
|
-
if (task.parent_id) {
|
|
30364
|
-
autoCompleteParentIfReady(task.parent_id, taskId);
|
|
30365
|
-
}
|
|
30366
30362
|
const pendingRows = db.query(`SELECT id, blocked_by FROM tasks WHERE status != 'done'`).all();
|
|
30367
30363
|
for (const row of pendingRows) {
|
|
30368
30364
|
const blockedBy = JSON.parse(row.blocked_by);
|
|
@@ -30382,28 +30378,6 @@ function completeTask(taskId, agentId) {
|
|
|
30382
30378
|
db.run(`UPDATE agents SET current_task = NULL WHERE id = ?`, [agentId]);
|
|
30383
30379
|
return { task: updated };
|
|
30384
30380
|
}
|
|
30385
|
-
function autoCompleteParentIfReady(parentId, completedSubtaskId) {
|
|
30386
|
-
const db = getDb();
|
|
30387
|
-
const parent = getTask(parentId);
|
|
30388
|
-
if (!parent || parent.status === "done")
|
|
30389
|
-
return;
|
|
30390
|
-
const allSubtasks = listTasks({ parent_id: parentId });
|
|
30391
|
-
if (allSubtasks.length === 0)
|
|
30392
|
-
return;
|
|
30393
|
-
const allDone = allSubtasks.every((t) => t.status === "done");
|
|
30394
|
-
if (!allDone)
|
|
30395
|
-
return;
|
|
30396
|
-
db.run(`UPDATE tasks SET status = 'done', completed_at = ? WHERE id = ?`, [Date.now(), parentId]);
|
|
30397
|
-
logEvent({
|
|
30398
|
-
task_id: parentId,
|
|
30399
|
-
event_type: "auto_completed",
|
|
30400
|
-
payload: {
|
|
30401
|
-
reason: "all_subtasks_done",
|
|
30402
|
-
completed_by: completedSubtaskId,
|
|
30403
|
-
subtask_count: allSubtasks.length
|
|
30404
|
-
}
|
|
30405
|
-
});
|
|
30406
|
-
}
|
|
30407
30381
|
function blockTask(taskId, blockerIds, agentId) {
|
|
30408
30382
|
const task = getTask(taskId);
|
|
30409
30383
|
if (!task)
|
|
@@ -30543,6 +30517,46 @@ function getStats() {
|
|
|
30543
30517
|
total
|
|
30544
30518
|
};
|
|
30545
30519
|
}
|
|
30520
|
+
function deleteTask(taskId, agentId) {
|
|
30521
|
+
const db = getDb();
|
|
30522
|
+
const task = getTask(taskId);
|
|
30523
|
+
if (!task) {
|
|
30524
|
+
return { success: false, error: "Task not found" };
|
|
30525
|
+
}
|
|
30526
|
+
const subtasks = listTasks({ parent_id: taskId });
|
|
30527
|
+
if (subtasks.length > 0) {
|
|
30528
|
+
return {
|
|
30529
|
+
success: false,
|
|
30530
|
+
error: `Cannot delete ${taskId} - it has ${subtasks.length} subtask(s). Delete subtasks first.`
|
|
30531
|
+
};
|
|
30532
|
+
}
|
|
30533
|
+
logEvent({
|
|
30534
|
+
task_id: taskId,
|
|
30535
|
+
agent_id: agentId,
|
|
30536
|
+
event_type: "deleted",
|
|
30537
|
+
payload: {}
|
|
30538
|
+
});
|
|
30539
|
+
const allTasks = listTasks();
|
|
30540
|
+
for (const t of allTasks) {
|
|
30541
|
+
if (t.blocks.includes(taskId)) {
|
|
30542
|
+
updateTask(t.id, { blocks: t.blocks.filter((id) => id !== taskId) });
|
|
30543
|
+
}
|
|
30544
|
+
if (t.blocked_by.includes(taskId)) {
|
|
30545
|
+
const remaining = t.blocked_by.filter((id) => id !== taskId);
|
|
30546
|
+
updateTask(t.id, {
|
|
30547
|
+
blocked_by: remaining,
|
|
30548
|
+
status: remaining.length === 0 ? "ready" : "blocked"
|
|
30549
|
+
});
|
|
30550
|
+
}
|
|
30551
|
+
if (t.parent_id === taskId) {
|
|
30552
|
+
updateTask(t.id, { parent_id: null });
|
|
30553
|
+
}
|
|
30554
|
+
}
|
|
30555
|
+
db.run("DELETE FROM events WHERE task_id = ?", [taskId]);
|
|
30556
|
+
db.run("UPDATE agents SET current_task = NULL WHERE current_task = ?", [taskId]);
|
|
30557
|
+
db.run("DELETE FROM tasks WHERE id = ?", [taskId]);
|
|
30558
|
+
return { success: true };
|
|
30559
|
+
}
|
|
30546
30560
|
|
|
30547
30561
|
// src/commands/shared.ts
|
|
30548
30562
|
function jsonOut(success, data, errorMsg) {
|
|
@@ -41649,6 +41663,70 @@ var RightPane = ({ task, width, height, scrollOffset }) => {
|
|
|
41649
41663
|
}, i, true, undefined, this))
|
|
41650
41664
|
}, undefined, false, undefined, this);
|
|
41651
41665
|
};
|
|
41666
|
+
var PICKER_STATUSES = ["backlog", "ready", "in_progress", "blocked", "needs_review", "done"];
|
|
41667
|
+
var StatusPicker = ({ task }) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
41668
|
+
flexDirection: "column",
|
|
41669
|
+
paddingLeft: 2,
|
|
41670
|
+
paddingTop: 1,
|
|
41671
|
+
children: [
|
|
41672
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41673
|
+
children: [
|
|
41674
|
+
"Change status for ",
|
|
41675
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41676
|
+
bold: true,
|
|
41677
|
+
color: "cyan",
|
|
41678
|
+
children: task.id
|
|
41679
|
+
}, undefined, false, undefined, this)
|
|
41680
|
+
]
|
|
41681
|
+
}, undefined, true, undefined, this),
|
|
41682
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41683
|
+
dimColor: true,
|
|
41684
|
+
children: "\u2500".repeat(36)
|
|
41685
|
+
}, undefined, false, undefined, this),
|
|
41686
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
41687
|
+
marginTop: 1,
|
|
41688
|
+
flexDirection: "column",
|
|
41689
|
+
children: PICKER_STATUSES.map((status, i) => {
|
|
41690
|
+
const isCurrent = task.status === status;
|
|
41691
|
+
const sc = STATUS_COLORS3[status];
|
|
41692
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
41693
|
+
children: [
|
|
41694
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41695
|
+
color: isCurrent ? "cyan" : "gray",
|
|
41696
|
+
children: [
|
|
41697
|
+
i + 1,
|
|
41698
|
+
" "
|
|
41699
|
+
]
|
|
41700
|
+
}, undefined, true, undefined, this),
|
|
41701
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41702
|
+
color: sc,
|
|
41703
|
+
children: [
|
|
41704
|
+
STATUS_ICON[status],
|
|
41705
|
+
" "
|
|
41706
|
+
]
|
|
41707
|
+
}, undefined, true, undefined, this),
|
|
41708
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41709
|
+
color: isCurrent ? "cyan" : undefined,
|
|
41710
|
+
bold: isCurrent,
|
|
41711
|
+
children: status
|
|
41712
|
+
}, undefined, false, undefined, this),
|
|
41713
|
+
isCurrent && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41714
|
+
dimColor: true,
|
|
41715
|
+
children: " \u2190 current"
|
|
41716
|
+
}, undefined, false, undefined, this)
|
|
41717
|
+
]
|
|
41718
|
+
}, status, true, undefined, this);
|
|
41719
|
+
})
|
|
41720
|
+
}, undefined, false, undefined, this),
|
|
41721
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
41722
|
+
marginTop: 1,
|
|
41723
|
+
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41724
|
+
dimColor: true,
|
|
41725
|
+
children: "1\u20136 select \xB7 Esc cancel"
|
|
41726
|
+
}, undefined, false, undefined, this)
|
|
41727
|
+
}, undefined, false, undefined, this)
|
|
41728
|
+
]
|
|
41729
|
+
}, undefined, true, undefined, this);
|
|
41652
41730
|
function wrapText2(text, maxW) {
|
|
41653
41731
|
const words2 = text.split(/\s+/);
|
|
41654
41732
|
const result2 = [];
|
|
@@ -41671,6 +41749,8 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41671
41749
|
const [selectedIdx, setSelectedIdx] = import_react29.useState(0);
|
|
41672
41750
|
const [scrollOffset, setScrollOffset] = import_react29.useState(0);
|
|
41673
41751
|
const [leftScrollOffset, setLeftScrollOffset] = import_react29.useState(0);
|
|
41752
|
+
const [mode, setMode] = import_react29.useState("normal");
|
|
41753
|
+
const [searchQuery, setSearchQuery] = import_react29.useState("");
|
|
41674
41754
|
const { exit } = use_app_default();
|
|
41675
41755
|
const { stdout } = use_stdout_default();
|
|
41676
41756
|
import_react29.useEffect(() => {
|
|
@@ -41679,8 +41759,17 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41679
41759
|
}, 1500);
|
|
41680
41760
|
return () => clearInterval(id);
|
|
41681
41761
|
}, [getTasks]);
|
|
41682
|
-
const
|
|
41762
|
+
const filteredTasks = import_react29.useMemo(() => {
|
|
41763
|
+
if (!searchQuery.trim())
|
|
41764
|
+
return tasks;
|
|
41765
|
+
const q2 = searchQuery.toLowerCase();
|
|
41766
|
+
return tasks.filter((t) => t.id.toLowerCase().includes(q2) || t.title.toLowerCase().includes(q2) || t.description.toLowerCase().includes(q2) || t.acceptance_criteria.some((ac) => ac.toLowerCase().includes(q2)) || t.implementation_notes.some((n) => n.note.toLowerCase().includes(q2)));
|
|
41767
|
+
}, [tasks, searchQuery]);
|
|
41768
|
+
const items = import_react29.useMemo(() => buildTree(filteredTasks), [filteredTasks]);
|
|
41683
41769
|
const clampIdx = Math.min(selectedIdx, Math.max(0, items.length - 1));
|
|
41770
|
+
import_react29.useEffect(() => {
|
|
41771
|
+
setSelectedIdx(0);
|
|
41772
|
+
}, [searchQuery]);
|
|
41684
41773
|
const leftRows = import_react29.useMemo(() => {
|
|
41685
41774
|
const ipCnt = items.filter((i) => i.section === "in_progress").length;
|
|
41686
41775
|
const ipTotal = items.filter((i) => i.section === "in_progress" || i.section === "middle").length;
|
|
@@ -41720,20 +41809,77 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41720
41809
|
return o;
|
|
41721
41810
|
});
|
|
41722
41811
|
}, [selectedRowIdx, stdout]);
|
|
41812
|
+
const selectedTask = items[clampIdx]?.task;
|
|
41723
41813
|
use_input_default((input, key) => {
|
|
41724
|
-
if (
|
|
41814
|
+
if (mode === "search") {
|
|
41815
|
+
if (key.escape) {
|
|
41816
|
+
setSearchQuery("");
|
|
41817
|
+
setMode("normal");
|
|
41818
|
+
return;
|
|
41819
|
+
}
|
|
41820
|
+
if (key.return) {
|
|
41821
|
+
setMode("normal");
|
|
41822
|
+
return;
|
|
41823
|
+
}
|
|
41824
|
+
if (key.upArrow) {
|
|
41825
|
+
setSelectedIdx((i) => Math.max(0, i - 1));
|
|
41826
|
+
return;
|
|
41827
|
+
}
|
|
41828
|
+
if (key.downArrow) {
|
|
41829
|
+
setSelectedIdx((i) => Math.min(items.length - 1, i + 1));
|
|
41830
|
+
return;
|
|
41831
|
+
}
|
|
41832
|
+
if (key.backspace || key.delete) {
|
|
41833
|
+
setSearchQuery((q2) => q2.slice(0, -1));
|
|
41834
|
+
return;
|
|
41835
|
+
}
|
|
41836
|
+
if (input && !key.ctrl && !key.meta) {
|
|
41837
|
+
setSearchQuery((q2) => q2 + input);
|
|
41838
|
+
return;
|
|
41839
|
+
}
|
|
41840
|
+
return;
|
|
41841
|
+
}
|
|
41842
|
+
if (mode === "move") {
|
|
41843
|
+
if (key.escape || input === "q") {
|
|
41844
|
+
setMode("normal");
|
|
41845
|
+
return;
|
|
41846
|
+
}
|
|
41847
|
+
const statusMap = {
|
|
41848
|
+
"1": "backlog",
|
|
41849
|
+
"2": "ready",
|
|
41850
|
+
"3": "in_progress",
|
|
41851
|
+
"4": "blocked",
|
|
41852
|
+
"5": "needs_review",
|
|
41853
|
+
"6": "done"
|
|
41854
|
+
};
|
|
41855
|
+
const newStatus = statusMap[input];
|
|
41856
|
+
if (newStatus && selectedTask) {
|
|
41857
|
+
updateTask(selectedTask.id, { status: newStatus });
|
|
41858
|
+
setTasks(getTasks());
|
|
41859
|
+
setMode("normal");
|
|
41860
|
+
}
|
|
41861
|
+
return;
|
|
41862
|
+
}
|
|
41863
|
+
if (input === "q")
|
|
41725
41864
|
exit();
|
|
41865
|
+
if (key.escape) {
|
|
41866
|
+
searchQuery ? setSearchQuery("") : exit();
|
|
41867
|
+
return;
|
|
41868
|
+
}
|
|
41726
41869
|
if (key.upArrow)
|
|
41727
41870
|
setSelectedIdx((i) => Math.max(0, i - 1));
|
|
41728
41871
|
if (key.downArrow)
|
|
41729
41872
|
setSelectedIdx((i) => Math.min(items.length - 1, i + 1));
|
|
41873
|
+
if (input === "s")
|
|
41874
|
+
setMode("search");
|
|
41875
|
+
if (input === "m" && selectedTask)
|
|
41876
|
+
setMode("move");
|
|
41730
41877
|
});
|
|
41731
41878
|
const cols = stdout.columns ?? 120;
|
|
41732
41879
|
const rows = stdout.rows ?? 30;
|
|
41733
41880
|
const leftWidth = Math.max(44, Math.floor(cols * 0.37));
|
|
41734
41881
|
const rightWidth = cols - leftWidth - 2;
|
|
41735
41882
|
const rightHeight = rows - 2;
|
|
41736
|
-
const selectedTask = items[clampIdx]?.task;
|
|
41737
41883
|
const itemsLenRef = import_react29.useRef(items.length);
|
|
41738
41884
|
itemsLenRef.current = items.length;
|
|
41739
41885
|
const leftWidthRef = import_react29.useRef(leftWidth);
|
|
@@ -41805,6 +41951,8 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41805
41951
|
}
|
|
41806
41952
|
return bar;
|
|
41807
41953
|
})();
|
|
41954
|
+
const taskCountLabel = searchQuery ? `${filteredTasks.length} of ${tasks.length}` : `${tasks.length}`;
|
|
41955
|
+
const searchMode = mode === "search";
|
|
41808
41956
|
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
41809
41957
|
flexDirection: "column",
|
|
41810
41958
|
width: cols,
|
|
@@ -41831,17 +41979,85 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41831
41979
|
color: "#AAAAAA",
|
|
41832
41980
|
children: [
|
|
41833
41981
|
"(",
|
|
41834
|
-
|
|
41982
|
+
taskCountLabel,
|
|
41835
41983
|
")"
|
|
41836
41984
|
]
|
|
41837
41985
|
}, undefined, true, undefined, this),
|
|
41838
41986
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41839
41987
|
dimColor: true,
|
|
41840
|
-
children: "
|
|
41841
|
-
}, undefined, false, undefined, this)
|
|
41988
|
+
children: " "
|
|
41989
|
+
}, undefined, false, undefined, this),
|
|
41990
|
+
searchMode ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
|
|
41991
|
+
children: [
|
|
41992
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41993
|
+
dimColor: true,
|
|
41994
|
+
children: "type to filter \xB7 "
|
|
41995
|
+
}, undefined, false, undefined, this),
|
|
41996
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41997
|
+
color: "cyan",
|
|
41998
|
+
children: "Enter"
|
|
41999
|
+
}, undefined, false, undefined, this),
|
|
42000
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42001
|
+
dimColor: true,
|
|
42002
|
+
children: " done \xB7 "
|
|
42003
|
+
}, undefined, false, undefined, this),
|
|
42004
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42005
|
+
color: "cyan",
|
|
42006
|
+
children: "Esc"
|
|
42007
|
+
}, undefined, false, undefined, this),
|
|
42008
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42009
|
+
dimColor: true,
|
|
42010
|
+
children: " clear"
|
|
42011
|
+
}, undefined, false, undefined, this)
|
|
42012
|
+
]
|
|
42013
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
|
|
42014
|
+
children: [
|
|
42015
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42016
|
+
color: "cyan",
|
|
42017
|
+
children: "s"
|
|
42018
|
+
}, undefined, false, undefined, this),
|
|
42019
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42020
|
+
dimColor: true,
|
|
42021
|
+
children: " search \xB7 "
|
|
42022
|
+
}, undefined, false, undefined, this),
|
|
42023
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42024
|
+
color: "cyan",
|
|
42025
|
+
children: "m"
|
|
42026
|
+
}, undefined, false, undefined, this),
|
|
42027
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42028
|
+
dimColor: true,
|
|
42029
|
+
children: " status \xB7 "
|
|
42030
|
+
}, undefined, false, undefined, this),
|
|
42031
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42032
|
+
color: "cyan",
|
|
42033
|
+
children: "q"
|
|
42034
|
+
}, undefined, false, undefined, this),
|
|
42035
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42036
|
+
dimColor: true,
|
|
42037
|
+
children: " quit"
|
|
42038
|
+
}, undefined, false, undefined, this)
|
|
42039
|
+
]
|
|
42040
|
+
}, undefined, true, undefined, this)
|
|
41842
42041
|
]
|
|
41843
42042
|
}, undefined, true, undefined, this),
|
|
41844
|
-
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(
|
|
42043
|
+
mode === "search" || searchQuery ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
42044
|
+
paddingLeft: 1,
|
|
42045
|
+
children: [
|
|
42046
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42047
|
+
color: "cyan",
|
|
42048
|
+
children: "/ "
|
|
42049
|
+
}, undefined, false, undefined, this),
|
|
42050
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42051
|
+
color: "white",
|
|
42052
|
+
children: searchQuery
|
|
42053
|
+
}, undefined, false, undefined, this),
|
|
42054
|
+
mode === "search" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42055
|
+
color: "cyan",
|
|
42056
|
+
bold: true,
|
|
42057
|
+
children: "\u2588"
|
|
42058
|
+
}, undefined, false, undefined, this)
|
|
42059
|
+
]
|
|
42060
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41845
42061
|
dimColor: true,
|
|
41846
42062
|
children: "\u2500".repeat(leftInner)
|
|
41847
42063
|
}, undefined, false, undefined, this),
|
|
@@ -41916,7 +42132,9 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41916
42132
|
flexDirection: "column",
|
|
41917
42133
|
borderStyle: "round",
|
|
41918
42134
|
borderColor: "gray",
|
|
41919
|
-
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(
|
|
42135
|
+
children: mode === "move" && selectedTask ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(StatusPicker, {
|
|
42136
|
+
task: selectedTask
|
|
42137
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RightPane, {
|
|
41920
42138
|
task: selectedTask,
|
|
41921
42139
|
width: rightInner,
|
|
41922
42140
|
height: rightHeight,
|
|
@@ -42640,6 +42858,65 @@ function undoNoteAdded(task, payload) {
|
|
|
42640
42858
|
};
|
|
42641
42859
|
}
|
|
42642
42860
|
|
|
42861
|
+
// src/commands/delete.ts
|
|
42862
|
+
var deleteCommand = new Command("delete").description("Delete task(s) - does not require claiming first").argument("<taskIds...>", "Task ID(s) to delete - supports patterns like TASK-0*").option("--agent <agentId>", "Agent ID for tracking (or set AITASKS_AGENT_ID)").option("--json", "Output as JSON").action((taskIds, opts) => {
|
|
42863
|
+
requireInitialized();
|
|
42864
|
+
const json = isJsonMode(opts.json);
|
|
42865
|
+
const agent = opts.agent || process.env.AITASKS_AGENT_ID;
|
|
42866
|
+
const allTaskIds = listTasks().map((t) => t.id);
|
|
42867
|
+
const resolvedIds = expandPatterns(taskIds.map((id) => id.toUpperCase()), allTaskIds);
|
|
42868
|
+
if (resolvedIds.length === 0) {
|
|
42869
|
+
exitError("No tasks match the provided IDs/patterns", json);
|
|
42870
|
+
}
|
|
42871
|
+
const results = [];
|
|
42872
|
+
let successCount = 0;
|
|
42873
|
+
for (const id of resolvedIds) {
|
|
42874
|
+
const { success, error } = deleteTask(id, agent);
|
|
42875
|
+
if (success) {
|
|
42876
|
+
successCount++;
|
|
42877
|
+
results.push({ id, success: true });
|
|
42878
|
+
} else {
|
|
42879
|
+
results.push({ id, success: false, error });
|
|
42880
|
+
}
|
|
42881
|
+
}
|
|
42882
|
+
if (json) {
|
|
42883
|
+
return jsonOut(successCount === resolvedIds.length, {
|
|
42884
|
+
deleted: results.filter((r2) => r2.success).map((r2) => r2.id),
|
|
42885
|
+
failed: results.filter((r2) => !r2.success),
|
|
42886
|
+
total: resolvedIds.length,
|
|
42887
|
+
deletedCount: successCount
|
|
42888
|
+
});
|
|
42889
|
+
}
|
|
42890
|
+
console.log("");
|
|
42891
|
+
for (const result2 of results) {
|
|
42892
|
+
if (result2.success) {
|
|
42893
|
+
console.log(source_default.green(" \u2713") + ` Deleted ${source_default.bold(result2.id)}`);
|
|
42894
|
+
} else {
|
|
42895
|
+
console.log(source_default.red(" \u2717") + ` Failed to delete ${source_default.bold(result2.id)}: ${result2.error}`);
|
|
42896
|
+
}
|
|
42897
|
+
}
|
|
42898
|
+
console.log("");
|
|
42899
|
+
console.log(source_default.dim(` ${successCount}/${resolvedIds.length} tasks deleted`));
|
|
42900
|
+
console.log("");
|
|
42901
|
+
if (successCount < resolvedIds.length) {
|
|
42902
|
+
process.exit(1);
|
|
42903
|
+
}
|
|
42904
|
+
});
|
|
42905
|
+
function expandPatterns(patterns, existingIds) {
|
|
42906
|
+
const resolved = new Set;
|
|
42907
|
+
for (const pattern of patterns) {
|
|
42908
|
+
if (pattern.includes("*")) {
|
|
42909
|
+
const matches2 = expandPattern(pattern, existingIds);
|
|
42910
|
+
matches2.forEach((id) => resolved.add(id));
|
|
42911
|
+
} else {
|
|
42912
|
+
if (existingIds.includes(pattern)) {
|
|
42913
|
+
resolved.add(pattern);
|
|
42914
|
+
}
|
|
42915
|
+
}
|
|
42916
|
+
}
|
|
42917
|
+
return Array.from(resolved);
|
|
42918
|
+
}
|
|
42919
|
+
|
|
42643
42920
|
// src/index.ts
|
|
42644
42921
|
var pkg = require_package();
|
|
42645
42922
|
var program2 = new Command;
|
|
@@ -42673,6 +42950,7 @@ Examples:
|
|
|
42673
42950
|
aitasks search "auth" # Full-text search
|
|
42674
42951
|
aitasks deps TASK-001 # Show dependencies
|
|
42675
42952
|
aitasks undo TASK-001 # Undo last action
|
|
42953
|
+
aitasks delete TASK-001 # Delete a task
|
|
42676
42954
|
`);
|
|
42677
42955
|
program2.addCommand(initCommand);
|
|
42678
42956
|
program2.addCommand(createCommand2);
|
|
@@ -42700,9 +42978,10 @@ program2.addCommand(dbCommand);
|
|
|
42700
42978
|
program2.addCommand(depsCommand);
|
|
42701
42979
|
program2.addCommand(searchCommand);
|
|
42702
42980
|
program2.addCommand(undoCommand);
|
|
42981
|
+
program2.addCommand(deleteCommand);
|
|
42703
42982
|
program2.parseAsync(process.argv).catch((err) => {
|
|
42704
42983
|
console.error(err.message);
|
|
42705
42984
|
process.exit(1);
|
|
42706
42985
|
});
|
|
42707
42986
|
|
|
42708
|
-
//# debugId=
|
|
42987
|
+
//# debugId=471CEF4A0A35378464756E2164756E21
|