aitasks 1.1.1 → 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/dist/index.js +214 -10
- package/package.json +1 -1
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: {
|
|
@@ -41663,6 +41663,70 @@ var RightPane = ({ task, width, height, scrollOffset }) => {
|
|
|
41663
41663
|
}, i, true, undefined, this))
|
|
41664
41664
|
}, undefined, false, undefined, this);
|
|
41665
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);
|
|
41666
41730
|
function wrapText2(text, maxW) {
|
|
41667
41731
|
const words2 = text.split(/\s+/);
|
|
41668
41732
|
const result2 = [];
|
|
@@ -41685,6 +41749,8 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41685
41749
|
const [selectedIdx, setSelectedIdx] = import_react29.useState(0);
|
|
41686
41750
|
const [scrollOffset, setScrollOffset] = import_react29.useState(0);
|
|
41687
41751
|
const [leftScrollOffset, setLeftScrollOffset] = import_react29.useState(0);
|
|
41752
|
+
const [mode, setMode] = import_react29.useState("normal");
|
|
41753
|
+
const [searchQuery, setSearchQuery] = import_react29.useState("");
|
|
41688
41754
|
const { exit } = use_app_default();
|
|
41689
41755
|
const { stdout } = use_stdout_default();
|
|
41690
41756
|
import_react29.useEffect(() => {
|
|
@@ -41693,8 +41759,17 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41693
41759
|
}, 1500);
|
|
41694
41760
|
return () => clearInterval(id);
|
|
41695
41761
|
}, [getTasks]);
|
|
41696
|
-
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]);
|
|
41697
41769
|
const clampIdx = Math.min(selectedIdx, Math.max(0, items.length - 1));
|
|
41770
|
+
import_react29.useEffect(() => {
|
|
41771
|
+
setSelectedIdx(0);
|
|
41772
|
+
}, [searchQuery]);
|
|
41698
41773
|
const leftRows = import_react29.useMemo(() => {
|
|
41699
41774
|
const ipCnt = items.filter((i) => i.section === "in_progress").length;
|
|
41700
41775
|
const ipTotal = items.filter((i) => i.section === "in_progress" || i.section === "middle").length;
|
|
@@ -41734,20 +41809,77 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41734
41809
|
return o;
|
|
41735
41810
|
});
|
|
41736
41811
|
}, [selectedRowIdx, stdout]);
|
|
41812
|
+
const selectedTask = items[clampIdx]?.task;
|
|
41737
41813
|
use_input_default((input, key) => {
|
|
41738
|
-
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")
|
|
41739
41864
|
exit();
|
|
41865
|
+
if (key.escape) {
|
|
41866
|
+
searchQuery ? setSearchQuery("") : exit();
|
|
41867
|
+
return;
|
|
41868
|
+
}
|
|
41740
41869
|
if (key.upArrow)
|
|
41741
41870
|
setSelectedIdx((i) => Math.max(0, i - 1));
|
|
41742
41871
|
if (key.downArrow)
|
|
41743
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");
|
|
41744
41877
|
});
|
|
41745
41878
|
const cols = stdout.columns ?? 120;
|
|
41746
41879
|
const rows = stdout.rows ?? 30;
|
|
41747
41880
|
const leftWidth = Math.max(44, Math.floor(cols * 0.37));
|
|
41748
41881
|
const rightWidth = cols - leftWidth - 2;
|
|
41749
41882
|
const rightHeight = rows - 2;
|
|
41750
|
-
const selectedTask = items[clampIdx]?.task;
|
|
41751
41883
|
const itemsLenRef = import_react29.useRef(items.length);
|
|
41752
41884
|
itemsLenRef.current = items.length;
|
|
41753
41885
|
const leftWidthRef = import_react29.useRef(leftWidth);
|
|
@@ -41819,6 +41951,8 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41819
41951
|
}
|
|
41820
41952
|
return bar;
|
|
41821
41953
|
})();
|
|
41954
|
+
const taskCountLabel = searchQuery ? `${filteredTasks.length} of ${tasks.length}` : `${tasks.length}`;
|
|
41955
|
+
const searchMode = mode === "search";
|
|
41822
41956
|
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
41823
41957
|
flexDirection: "column",
|
|
41824
41958
|
width: cols,
|
|
@@ -41845,17 +41979,85 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41845
41979
|
color: "#AAAAAA",
|
|
41846
41980
|
children: [
|
|
41847
41981
|
"(",
|
|
41848
|
-
|
|
41982
|
+
taskCountLabel,
|
|
41849
41983
|
")"
|
|
41850
41984
|
]
|
|
41851
41985
|
}, undefined, true, undefined, this),
|
|
41852
41986
|
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
41853
41987
|
dimColor: true,
|
|
41854
|
-
children: "
|
|
41855
|
-
}, 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)
|
|
41856
42041
|
]
|
|
41857
42042
|
}, undefined, true, undefined, this),
|
|
41858
|
-
/* @__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, {
|
|
41859
42061
|
dimColor: true,
|
|
41860
42062
|
children: "\u2500".repeat(leftInner)
|
|
41861
42063
|
}, undefined, false, undefined, this),
|
|
@@ -41930,7 +42132,9 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41930
42132
|
flexDirection: "column",
|
|
41931
42133
|
borderStyle: "round",
|
|
41932
42134
|
borderColor: "gray",
|
|
41933
|
-
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, {
|
|
41934
42138
|
task: selectedTask,
|
|
41935
42139
|
width: rightInner,
|
|
41936
42140
|
height: rightHeight,
|
|
@@ -42780,4 +42984,4 @@ program2.parseAsync(process.argv).catch((err) => {
|
|
|
42780
42984
|
process.exit(1);
|
|
42781
42985
|
});
|
|
42782
42986
|
|
|
42783
|
-
//# debugId=
|
|
42987
|
+
//# debugId=471CEF4A0A35378464756E2164756E21
|