aitasks 1.2.0 → 1.2.2
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 +96 -7
- 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.2.
|
|
1893
|
+
version: "1.2.2",
|
|
1894
1894
|
description: "CLI task management tool built for AI agents",
|
|
1895
1895
|
type: "module",
|
|
1896
1896
|
bin: {
|
|
@@ -41438,8 +41438,9 @@ function buildTree(tasks) {
|
|
|
41438
41438
|
push(sub, 1, i === subs.length - 1, "middle", false);
|
|
41439
41439
|
});
|
|
41440
41440
|
}
|
|
41441
|
+
const doneSorted = sorted.filter((t) => t.status === "done").sort((a2, b2) => (b2.completed_at ?? b2.created_at) - (a2.completed_at ?? a2.created_at));
|
|
41441
41442
|
let firstDone = true;
|
|
41442
|
-
for (const task of
|
|
41443
|
+
for (const task of doneSorted) {
|
|
41443
41444
|
if (shownIds.has(task.id))
|
|
41444
41445
|
continue;
|
|
41445
41446
|
push(task, 0, false, "done", firstDone);
|
|
@@ -41727,6 +41728,15 @@ var StatusPicker = ({ task }) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_def
|
|
|
41727
41728
|
}, undefined, false, undefined, this)
|
|
41728
41729
|
]
|
|
41729
41730
|
}, undefined, true, undefined, this);
|
|
41731
|
+
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
41732
|
+
function getDateKey(ts) {
|
|
41733
|
+
const d2 = new Date(ts);
|
|
41734
|
+
return `${d2.getFullYear()}-${d2.getMonth()}-${d2.getDate()}`;
|
|
41735
|
+
}
|
|
41736
|
+
function formatDateLabel(ts) {
|
|
41737
|
+
const d2 = new Date(ts);
|
|
41738
|
+
return `${MONTHS[d2.getMonth()]} ${d2.getDate()}`;
|
|
41739
|
+
}
|
|
41730
41740
|
function wrapText2(text, maxW) {
|
|
41731
41741
|
const words2 = text.split(/\s+/);
|
|
41732
41742
|
const result2 = [];
|
|
@@ -41776,6 +41786,8 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41776
41786
|
const doneCnt = items.filter((i) => i.section === "done").length;
|
|
41777
41787
|
const result2 = [];
|
|
41778
41788
|
let firstSection = true;
|
|
41789
|
+
let prevDateKey = null;
|
|
41790
|
+
let prevSection = null;
|
|
41779
41791
|
for (let idx = 0;idx < items.length; idx++) {
|
|
41780
41792
|
const item = items[idx];
|
|
41781
41793
|
if (item.showSectionHeader && item.section !== "middle") {
|
|
@@ -41788,7 +41800,19 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41788
41800
|
total: item.section === "in_progress" ? ipTotal : undefined
|
|
41789
41801
|
});
|
|
41790
41802
|
firstSection = false;
|
|
41803
|
+
prevDateKey = null;
|
|
41804
|
+
} else if (item.section !== prevSection) {
|
|
41805
|
+
prevDateKey = null;
|
|
41806
|
+
}
|
|
41807
|
+
if (item.indent === 0) {
|
|
41808
|
+
const ts = item.section === "done" ? item.task.completed_at ?? item.task.created_at : item.task.created_at;
|
|
41809
|
+
const dateKey = getDateKey(ts);
|
|
41810
|
+
if (prevDateKey !== null && prevDateKey !== dateKey) {
|
|
41811
|
+
result2.push({ kind: "date-sep", label: formatDateLabel(ts) });
|
|
41812
|
+
}
|
|
41813
|
+
prevDateKey = dateKey;
|
|
41791
41814
|
}
|
|
41815
|
+
prevSection = item.section;
|
|
41792
41816
|
result2.push({ kind: "item", item, itemIdx: idx });
|
|
41793
41817
|
}
|
|
41794
41818
|
return result2;
|
|
@@ -41939,7 +41963,8 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
41939
41963
|
const leftTotalRows = leftRows.length;
|
|
41940
41964
|
const leftMaxOffset = Math.max(0, leftTotalRows - leftVisibleH);
|
|
41941
41965
|
const leftOffset = Math.min(leftScrollOffset, leftMaxOffset);
|
|
41942
|
-
const
|
|
41966
|
+
const rawLeftRows = leftRows.slice(leftOffset, leftOffset + leftVisibleH);
|
|
41967
|
+
const visibleLeftRows = rawLeftRows[0]?.kind === "date-sep" ? rawLeftRows.slice(1) : rawLeftRows;
|
|
41943
41968
|
const leftScrollbar = (() => {
|
|
41944
41969
|
const bar = Array(leftVisibleH).fill(" ");
|
|
41945
41970
|
if (leftTotalRows > leftVisibleH) {
|
|
@@ -42082,6 +42107,37 @@ var TreeBoardComponent = ({ getTasks }) => {
|
|
|
42082
42107
|
]
|
|
42083
42108
|
}, `sp-${leftOffset + i}`, true, undefined, this);
|
|
42084
42109
|
}
|
|
42110
|
+
if (row.kind === "date-sep") {
|
|
42111
|
+
const dashW = Math.max(0, Math.floor((leftInner - 2 - row.label.length - 2) / 2));
|
|
42112
|
+
const dashes = "\u254C".repeat(dashW);
|
|
42113
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
42114
|
+
children: [
|
|
42115
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
42116
|
+
flexGrow: 1,
|
|
42117
|
+
paddingLeft: 1,
|
|
42118
|
+
children: [
|
|
42119
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42120
|
+
dimColor: true,
|
|
42121
|
+
children: dashes
|
|
42122
|
+
}, undefined, false, undefined, this),
|
|
42123
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42124
|
+
dimColor: true,
|
|
42125
|
+
children: [
|
|
42126
|
+
" ",
|
|
42127
|
+
row.label,
|
|
42128
|
+
" "
|
|
42129
|
+
]
|
|
42130
|
+
}, undefined, true, undefined, this),
|
|
42131
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42132
|
+
dimColor: true,
|
|
42133
|
+
children: dashes
|
|
42134
|
+
}, undefined, false, undefined, this)
|
|
42135
|
+
]
|
|
42136
|
+
}, undefined, true, undefined, this),
|
|
42137
|
+
sb
|
|
42138
|
+
]
|
|
42139
|
+
}, `ds-${leftOffset + i}`, true, undefined, this);
|
|
42140
|
+
}
|
|
42085
42141
|
if (row.kind === "section") {
|
|
42086
42142
|
const color = row.section === "in_progress" ? "yellow" : "green";
|
|
42087
42143
|
const label = row.section === "in_progress" ? "IN PROGRESS" : "DONE";
|
|
@@ -42214,6 +42270,7 @@ var StaticCard = ({ task }) => {
|
|
|
42214
42270
|
};
|
|
42215
42271
|
var StaticSection = ({ status, tasks }) => {
|
|
42216
42272
|
const color = STATUS_COLORS3[status];
|
|
42273
|
+
const getTaskDateKey = (t) => getDateKey(status === "done" ? t.completed_at ?? t.created_at : t.created_at);
|
|
42217
42274
|
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
42218
42275
|
flexDirection: "column",
|
|
42219
42276
|
borderStyle: "round",
|
|
@@ -42248,9 +42305,41 @@ var StaticSection = ({ status, tasks }) => {
|
|
|
42248
42305
|
dimColor: true,
|
|
42249
42306
|
children: "empty"
|
|
42250
42307
|
}, undefined, false, undefined, this)
|
|
42251
|
-
}, undefined, false, undefined, this) : tasks.map((t) =>
|
|
42252
|
-
|
|
42253
|
-
|
|
42308
|
+
}, undefined, false, undefined, this) : tasks.map((t, i) => {
|
|
42309
|
+
const prev = tasks[i - 1];
|
|
42310
|
+
const showSep = prev != null && getTaskDateKey(prev) !== getTaskDateKey(t);
|
|
42311
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(import_react29.default.Fragment, {
|
|
42312
|
+
children: [
|
|
42313
|
+
showSep && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
|
|
42314
|
+
paddingLeft: 2,
|
|
42315
|
+
paddingRight: 1,
|
|
42316
|
+
children: [
|
|
42317
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42318
|
+
dimColor: true,
|
|
42319
|
+
children: [
|
|
42320
|
+
"\u254C".repeat(4),
|
|
42321
|
+
" "
|
|
42322
|
+
]
|
|
42323
|
+
}, undefined, true, undefined, this),
|
|
42324
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42325
|
+
dimColor: true,
|
|
42326
|
+
children: [
|
|
42327
|
+
formatDateLabel(status === "done" ? t.completed_at ?? t.created_at : t.created_at),
|
|
42328
|
+
" "
|
|
42329
|
+
]
|
|
42330
|
+
}, undefined, true, undefined, this),
|
|
42331
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
|
|
42332
|
+
dimColor: true,
|
|
42333
|
+
children: "\u254C".repeat(4)
|
|
42334
|
+
}, undefined, false, undefined, this)
|
|
42335
|
+
]
|
|
42336
|
+
}, undefined, true, undefined, this),
|
|
42337
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV(StaticCard, {
|
|
42338
|
+
task: t
|
|
42339
|
+
}, undefined, false, undefined, this)
|
|
42340
|
+
]
|
|
42341
|
+
}, t.id, true, undefined, this);
|
|
42342
|
+
})
|
|
42254
42343
|
]
|
|
42255
42344
|
}, undefined, true, undefined, this);
|
|
42256
42345
|
};
|
|
@@ -42984,4 +43073,4 @@ program2.parseAsync(process.argv).catch((err) => {
|
|
|
42984
43073
|
process.exit(1);
|
|
42985
43074
|
});
|
|
42986
43075
|
|
|
42987
|
-
//# debugId=
|
|
43076
|
+
//# debugId=605E90B62461DFBE64756E2164756E21
|