aitasks 1.3.5 → 1.3.6

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 +55 -37
  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.3.5",
1893
+ version: "1.3.6",
1894
1894
  description: "CLI task management tool built for AI agents",
1895
1895
  type: "module",
1896
1896
  bin: {
@@ -29428,23 +29428,20 @@ ${reviewRequired ? `3. Submit for review \u2014 you CANNOT mark done directly:
29428
29428
  \`\`\`
29429
29429
  **Do not run \`aitasks done\` yourself.** The system will block self-approval.
29430
29430
 
29431
- 4. **IN THIS SAME SESSION, immediately spawn a review sub-agent** with a DIFFERENT agent ID.
29431
+ 4. **IN THIS SAME SESSION**, immediately spawn a review sub-agent with a DIFFERENT agent ID.
29432
29432
  Do this NOW \u2014 before writing any summary, before moving to any other task, before anything else.
29433
- The review sub-agent must register first, then inspect and approve or reject:
29434
29433
  \`\`\`bash
29435
- # Review sub-agent registers itself (BEFORE the review was submitted \u2014 or it will be blocked)
29436
- aitasks heartbeat --agent <review-agent-id>
29434
+ # Review sub-agent registers itself
29435
+ aitasks heartbeat --agent review-task-001
29437
29436
 
29438
29437
  # Approve (moves task to done):
29439
- aitasks done TASK-001 --agent <review-agent-id>
29438
+ aitasks done TASK-001 --agent review-task-001
29440
29439
 
29441
29440
  # OR reject (sends task back to in_progress with feedback):
29442
- aitasks reject TASK-001 --reason "<specific feedback>" --agent <review-agent-id>
29441
+ aitasks reject TASK-001 --reason "<specific feedback>" --agent review-task-001
29443
29442
  \`\`\`
29444
29443
  **Your session is NOT complete after submitting for review. You must remain active and drive the
29445
29444
  review to completion. The task is still incomplete until \`aitasks done\` succeeds.**
29446
- The system will block approval from any agent that registered after the review was submitted
29447
- or that submitted the review itself.
29448
29445
 
29449
29446
  5. If rejected: address the feedback, re-check criteria, and repeat from step 3.
29450
29447
 
@@ -29494,7 +29491,7 @@ aitasks unclaim TASK-001 --agent $AITASKS_AGENT_ID --reason "Blocked on missing
29494
29491
  6. If a task needs splitting, create subtasks BEFORE marking parent done.
29495
29492
  7. Your evidence strings must be concrete and verifiable \u2014 not vague affirmations.
29496
29493
  8. Always provide --desc, at least one --ac, and --agent when creating a task. All three are required.${reviewRequired ? `
29497
- 9. NEVER move a task to done directly. Always submit for review first with \`aitasks review\`, then IMMEDIATELY spawn a review sub-agent with a DIFFERENT agent ID in the SAME session. Do NOT call \`aitasks done\` yourself after submitting for review \u2014 the system blocks self-approval.
29494
+ 9. NEVER move a task to done directly. Always submit for review first with \`aitasks review\`, then IMMEDIATELY spawn a review sub-agent with a DIFFERENT agent ID in the SAME session. Do NOT call \`aitasks done\` yourself \u2014 the system blocks the implementing agent and the agent that submitted the review from self-approving.
29498
29495
  10. **Do not end your session or write a final summary until every task you worked on is in \`done\` status.** If any task is in \`review\`, you must spawn the review sub-agent NOW in this session. Submitting for review and stopping is an incomplete session.` : ""}
29499
29496
 
29500
29497
  ${reviewRequired ? `---
@@ -30510,19 +30507,6 @@ function completeTask(taskId, agentId) {
30510
30507
  ` + ` A separate review sub-agent must run: aitasks done ${taskId} --agent <review-agent-id>`
30511
30508
  };
30512
30509
  }
30513
- if (agentId) {
30514
- const reviewerRow = db.query(`SELECT first_seen FROM agents WHERE id = ?`).get(agentId);
30515
- const reviewSubmittedAt = reviewEvent?.created_at ?? 0;
30516
- if (!reviewerRow || reviewerRow.first_seen > reviewSubmittedAt) {
30517
- return {
30518
- task: null,
30519
- error: `Review agent '${agentId}' was not active before this review was submitted.
30520
- ` + ` A real review sub-agent must be independently spawned \u2014 it cannot be registered
30521
- ` + ` moments before approving. The reviewer must have prior activity in the system
30522
- ` + ` before the review was submitted.`
30523
- };
30524
- }
30525
- }
30526
30510
  }
30527
30511
  const updated = updateTask(taskId, { status: "done", completed_at: Date.now() });
30528
30512
  logEvent({ task_id: taskId, agent_id: agentId, event_type: "completed", payload: {} });
@@ -41417,7 +41401,7 @@ var reviewCommand = new Command("review").description("Request human review for
41417
41401
  console.log(source_default.dim(` 3. Sub-agent examines implementation and verifies all acceptance criteria`));
41418
41402
  console.log(source_default.dim(` 4. Approve: aitasks done ${task.id} --agent review-${task.id.toLowerCase()}`));
41419
41403
  console.log(source_default.dim(` Reject: aitasks reject ${task.id} --reason "<feedback>" --agent review-${task.id.toLowerCase()}`));
41420
- console.log(source_default.dim(` The system will reject approval from unregistered or self-approving agents.`));
41404
+ console.log(source_default.dim(` The system will reject approval from the implementing agent or the agent that submitted the review.`));
41421
41405
  } else {
41422
41406
  console.log(source_default.dim(` Approve: aitasks done ${task.id} --agent <review-agent-id>`));
41423
41407
  console.log(source_default.dim(` Reject: aitasks reject ${task.id} --reason "<feedback>"`));
@@ -41979,6 +41963,7 @@ var TreeBoardComponent = ({ getTasks }) => {
41979
41963
  const [scrollOffset, setScrollOffset] = import_react29.useState(0);
41980
41964
  const [leftScrollOffset, setLeftScrollOffset] = import_react29.useState(0);
41981
41965
  const [mode, setMode] = import_react29.useState("normal");
41966
+ const [moveError, setMoveError] = import_react29.useState(null);
41982
41967
  const [searchQuery, setSearchQuery] = import_react29.useState("");
41983
41968
  const { exit } = use_app_default();
41984
41969
  const { stdout } = use_stdout_default();
@@ -42099,9 +42084,23 @@ var TreeBoardComponent = ({ getTasks }) => {
42099
42084
  };
42100
42085
  const newStatus = statusMap[input];
42101
42086
  if (newStatus && selectedTask) {
42102
- updateTask(selectedTask.id, { status: newStatus });
42103
- setTasks(getTasks());
42104
- setMode("normal");
42087
+ if (newStatus === "done") {
42088
+ const { error } = completeTask(selectedTask.id);
42089
+ if (error) {
42090
+ setMoveError(error.split(`
42091
+ `)[0] ?? error);
42092
+ setMode("normal");
42093
+ } else {
42094
+ setMoveError(null);
42095
+ setTasks(getTasks());
42096
+ setMode("normal");
42097
+ }
42098
+ } else {
42099
+ setMoveError(null);
42100
+ updateTask(selectedTask.id, { status: newStatus });
42101
+ setTasks(getTasks());
42102
+ setMode("normal");
42103
+ }
42105
42104
  }
42106
42105
  return;
42107
42106
  }
@@ -42111,10 +42110,14 @@ var TreeBoardComponent = ({ getTasks }) => {
42111
42110
  searchQuery ? setSearchQuery("") : exit();
42112
42111
  return;
42113
42112
  }
42114
- if (key.upArrow)
42113
+ if (key.upArrow) {
42114
+ setMoveError(null);
42115
42115
  setSelectedIdx((i) => Math.max(0, i - 1));
42116
- if (key.downArrow)
42116
+ }
42117
+ if (key.downArrow) {
42118
+ setMoveError(null);
42117
42119
  setSelectedIdx((i) => Math.min(items.length - 1, i + 1));
42120
+ }
42118
42121
  if (input === "s")
42119
42122
  setMode("search");
42120
42123
  if (input === "m" && selectedTask)
@@ -42468,13 +42471,28 @@ var TreeBoardComponent = ({ getTasks }) => {
42468
42471
  borderColor: "gray",
42469
42472
  children: mode === "move" && selectedTask ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(StatusPicker, {
42470
42473
  task: selectedTask
42471
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RightPane, {
42472
- task: selectedTask,
42473
- width: rightInner,
42474
- height: rightHeight,
42475
- scrollOffset,
42476
- metricsRef: rightMetricsRef
42477
- }, undefined, false, undefined, this)
42474
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(jsx_dev_runtime3.Fragment, {
42475
+ children: [
42476
+ moveError && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
42477
+ paddingX: 1,
42478
+ paddingTop: 1,
42479
+ children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Text, {
42480
+ color: "red",
42481
+ children: [
42482
+ "\u2717 ",
42483
+ moveError
42484
+ ]
42485
+ }, undefined, true, undefined, this)
42486
+ }, undefined, false, undefined, this),
42487
+ /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(RightPane, {
42488
+ task: selectedTask,
42489
+ width: rightInner,
42490
+ height: rightHeight,
42491
+ scrollOffset,
42492
+ metricsRef: rightMetricsRef
42493
+ }, undefined, false, undefined, this)
42494
+ ]
42495
+ }, undefined, true, undefined, this)
42478
42496
  }, undefined, false, undefined, this)
42479
42497
  ]
42480
42498
  }, undefined, true, undefined, this)
@@ -43354,4 +43372,4 @@ program2.parseAsync(process.argv).catch((err) => {
43354
43372
  process.exit(1);
43355
43373
  });
43356
43374
 
43357
- //# debugId=1AD83EE12EE8B53364756E2164756E21
43375
+ //# debugId=5791C0490824449C64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aitasks",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "CLI task management tool built for AI agents",
5
5
  "type": "module",
6
6
  "bin": {