aitasks 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +52 -22
  2. 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.0.0",
1893
+ version: "1.0.2",
1894
1894
  description: "CLI task management tool built for AI agents",
1895
1895
  type: "module",
1896
1896
  bin: {
@@ -15285,7 +15285,7 @@ Always note:
15285
15285
 
15286
15286
  Creating subtasks:
15287
15287
  \`\`\`bash
15288
- aitasks create --title "Write unit tests for auth" --parent TASK-001 --priority high --type chore
15288
+ aitasks create --title "Write unit tests for auth" --desc "Add unit tests covering all auth edge cases" --ac "All tests pass" --ac "Coverage \u2265 90%" --parent TASK-001 --priority high --type chore
15289
15289
  \`\`\`
15290
15290
 
15291
15291
  If you discover your task is blocked by something:
@@ -15340,6 +15340,7 @@ aitasks unclaim TASK-001 --agent $AITASKS_AGENT_ID --reason "Blocked on missing
15340
15340
  4. Add implementation notes continuously, not just at the end.
15341
15341
  5. If a task needs splitting, create subtasks BEFORE marking parent done.
15342
15342
  6. Your evidence strings must be concrete and verifiable \u2014 not vague affirmations.
15343
+ 7. Always provide --desc and at least one --ac when creating a task. Both are required.
15343
15344
 
15344
15345
  ---
15345
15346
 
@@ -15349,7 +15350,7 @@ aitasks unclaim TASK-001 --agent $AITASKS_AGENT_ID --reason "Blocked on missing
15349
15350
  aitasks next Find best task to work on
15350
15351
  aitasks list [--status <s>] [--json] List tasks
15351
15352
  aitasks show <id> Full task detail
15352
- aitasks create [flags] Create a task (interactive if no flags)
15353
+ aitasks create --title <t> --desc <d> --ac <c> [--ac <c> ...] Create a task
15353
15354
  aitasks claim <id> --agent <id> Claim a task
15354
15355
  aitasks start <id> --agent <id> Begin work
15355
15356
  aitasks note <id> <text> --agent <id> Add implementation note
@@ -16450,6 +16451,18 @@ var createCommand2 = new Command("create").description("Create a new task").opti
16450
16451
  requireInitialized();
16451
16452
  const json = isJsonMode(opts.json);
16452
16453
  if (opts.title) {
16454
+ if (!opts.desc || !opts.desc.trim()) {
16455
+ if (json)
16456
+ return jsonOut(false, undefined, "Missing required field: --desc <description>");
16457
+ console.error(source_default.red(" Missing required field: --desc <description>"));
16458
+ process.exit(1);
16459
+ }
16460
+ if (opts.ac.length === 0) {
16461
+ if (json)
16462
+ return jsonOut(false, undefined, "Missing required field: --ac <criterion> (at least one required)");
16463
+ console.error(source_default.red(" Missing required field: --ac <criterion> (at least one required)"));
16464
+ process.exit(1);
16465
+ }
16453
16466
  if (opts.parent) {
16454
16467
  const parent = getTask(opts.parent);
16455
16468
  if (!parent) {
@@ -16486,8 +16499,9 @@ var createCommand2 = new Command("create").description("Create a new task").opti
16486
16499
  validate: (v2) => !v2.trim() ? "Title is required" : undefined
16487
16500
  }),
16488
16501
  description: () => ue({
16489
- message: "Description (optional)",
16490
- placeholder: "What needs to be done and why"
16502
+ message: "Description",
16503
+ placeholder: "What needs to be done and why",
16504
+ validate: (v2) => !v2.trim() ? "Description is required" : undefined
16491
16505
  }),
16492
16506
  priority: () => de({
16493
16507
  message: "Priority",
@@ -16510,9 +16524,10 @@ var createCommand2 = new Command("create").description("Create a new task").opti
16510
16524
  ]
16511
16525
  }),
16512
16526
  criteria: () => ue({
16513
- message: "Acceptance criteria (one per line, empty to skip)",
16527
+ message: "Acceptance criteria (one per line)",
16514
16528
  placeholder: `API returns 404 for unknown user
16515
- Unit tests pass`
16529
+ Unit tests pass`,
16530
+ validate: (v2) => !v2.trim() ? "At least one acceptance criterion is required" : undefined
16516
16531
  }),
16517
16532
  parent: () => ue({
16518
16533
  message: "Parent task ID (optional, for subtasks)",
@@ -27092,7 +27107,7 @@ var TreeRow = ({ item, isSelected, paneWidth }) => {
27092
27107
  const priChar = task.priority[0].toUpperCase();
27093
27108
  const treeStr = indent === 0 ? "" : isLastSibling ? " \u2514\u2500 " : " \u251C\u2500 ";
27094
27109
  const fixedW = 2 + treeStr.length + 9 + 1 + 1 + 1 + 1 + 1;
27095
- const titleWidth = Math.max(4, paneWidth - fixedW);
27110
+ const titleWidth = Math.max(4, paneWidth - fixedW - 1);
27096
27111
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
27097
27112
  children: [
27098
27113
  isSelected ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
@@ -27144,9 +27159,10 @@ var TreeRow = ({ item, isSelected, paneWidth }) => {
27144
27159
  ]
27145
27160
  }, undefined, true, undefined, this);
27146
27161
  };
27147
- var SectionDivider = ({ section, count, isFirst }) => {
27162
+ var SectionDivider = ({ section, count, total, isFirst }) => {
27148
27163
  const color = section === "in_progress" ? "yellow" : "green";
27149
27164
  const label = section === "in_progress" ? "IN PROGRESS" : "DONE";
27165
+ const countLabel = total !== undefined && total !== count ? `${count} of ${total}` : `${count}`;
27150
27166
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
27151
27167
  marginTop: isFirst ? 0 : 1,
27152
27168
  paddingLeft: 1,
@@ -27160,7 +27176,7 @@ var SectionDivider = ({ section, count, isFirst }) => {
27160
27176
  color: "#AAAAAA",
27161
27177
  children: [
27162
27178
  " (",
27163
- count,
27179
+ countLabel,
27164
27180
  ")"
27165
27181
  ]
27166
27182
  }, undefined, true, undefined, this)
@@ -27271,16 +27287,6 @@ var RightPane = ({ task, width, height, scrollOffset }) => {
27271
27287
  }
27272
27288
  return { lines: lines2, contentW: cw };
27273
27289
  }, [task, width]);
27274
- if (!task) {
27275
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
27276
- paddingLeft: 2,
27277
- paddingTop: 2,
27278
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
27279
- dimColor: true,
27280
- children: "Select a task with \u2191\u2193"
27281
- }, undefined, false, undefined, this)
27282
- }, undefined, false, undefined, this);
27283
- }
27284
27290
  const totalLines = lines.length;
27285
27291
  const visibleH = Math.max(3, height - 2);
27286
27292
  const maxOffset = Math.max(0, totalLines - visibleH);
@@ -27298,6 +27304,16 @@ var RightPane = ({ task, width, height, scrollOffset }) => {
27298
27304
  }
27299
27305
  return bar;
27300
27306
  }, [totalLines, visibleH, offset, maxOffset]);
27307
+ if (!task) {
27308
+ return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
27309
+ paddingLeft: 2,
27310
+ paddingTop: 2,
27311
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
27312
+ dimColor: true,
27313
+ children: "Select a task with \u2191\u2193"
27314
+ }, undefined, false, undefined, this)
27315
+ }, undefined, false, undefined, this);
27316
+ }
27301
27317
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
27302
27318
  flexDirection: "column",
27303
27319
  paddingTop: 1,
@@ -27425,6 +27441,7 @@ var TreeBoardComponent = ({ getTasks }) => {
27425
27441
  };
27426
27442
  }, []);
27427
27443
  const ipCount = items.filter((i) => i.section === "in_progress").length;
27444
+ const ipTotalCount = items.filter((i) => i.section === "in_progress" || i.section === "middle").length;
27428
27445
  const doneCount = items.filter((i) => i.section === "done").length;
27429
27446
  const leftInner = leftWidth - 2;
27430
27447
  const rightInner = rightWidth - 2;
@@ -27472,6 +27489,7 @@ var TreeBoardComponent = ({ getTasks }) => {
27472
27489
  item.showSectionHeader && item.section !== "middle" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(SectionDivider, {
27473
27490
  section: item.section,
27474
27491
  count: item.section === "in_progress" ? ipCount : doneCount,
27492
+ total: item.section === "in_progress" ? ipTotalCount : undefined,
27475
27493
  isFirst: idx === 0
27476
27494
  }, undefined, false, undefined, this),
27477
27495
  /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TreeRow, {
@@ -27871,14 +27889,26 @@ function formatBytes(bytes) {
27871
27889
  }
27872
27890
 
27873
27891
  // src/index.ts
27892
+ var pkg = require_package();
27874
27893
  var program2 = new Command;
27875
- program2.name("aitasks").description("CLI task management for AI agents").version("1.0.0").addHelpText("after", `
27894
+ program2.name("aitasks").description("CLI task management for AI agents").version(pkg.version).option("-C, --dir <path>", "run as if started in this directory").hook("preAction", () => {
27895
+ const dir = program2.opts().dir;
27896
+ if (dir) {
27897
+ try {
27898
+ process.chdir(dir);
27899
+ } catch {
27900
+ console.error(`Error: cannot change to directory: ${dir}`);
27901
+ process.exit(1);
27902
+ }
27903
+ }
27904
+ }).addHelpText("after", `
27876
27905
  Environment variables:
27877
27906
  AITASKS_AGENT_ID Default agent ID for commands that require --agent
27878
27907
  AITASKS_JSON Set to "true" to force JSON output globally
27879
27908
 
27880
27909
  Examples:
27881
27910
  aitasks init
27911
+ aitasks -C /path/to/project board
27882
27912
  aitasks create --title "Add auth" --priority high --ac "JWT issued on login"
27883
27913
  aitasks next --agent claude-sonnet
27884
27914
  aitasks claim TASK-001 --agent claude-sonnet
@@ -27915,4 +27945,4 @@ program2.parseAsync(process.argv).catch((err) => {
27915
27945
  process.exit(1);
27916
27946
  });
27917
27947
 
27918
- //# debugId=8C3602BE491FB9F364756E2164756E21
27948
+ //# debugId=7BF15E0EE4CC68E364756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aitasks",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "CLI task management tool built for AI agents",
5
5
  "type": "module",
6
6
  "bin": {