@braingrid/cli 0.2.18 → 0.2.19

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/CHANGELOG.md CHANGED
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.19] - 2025-12-17
11
+
12
+ ### Added
13
+
14
+ - **Pagination options for task commands**
15
+ - Added `--page` and `--limit` options to `task list` and `task summary` commands
16
+ - Consistent with existing pagination options on `requirement list`
17
+
18
+ ### Changed
19
+
20
+ - **has_more pagination warnings**
21
+ - Task and requirement list commands now show a warning when more items exist beyond current page
22
+ - Warning message: "⚠️ More tasks/requirements exist. Use --limit to see more."
23
+ - `getCurrentTask` auto-detection warns if results may be incomplete due to pagination
24
+
25
+ - **Status line uses higher limit**
26
+ - Claude Code status line script now fetches up to 100 tasks for accurate counts
27
+ - Ensures task progress display `[completed/total]` is accurate for larger requirements
28
+
10
29
  ## [0.2.18] - 2025-12-17
11
30
 
12
31
  ### Added
package/dist/cli.js CHANGED
@@ -422,7 +422,7 @@ import axios3, { AxiosError as AxiosError2 } from "axios";
422
422
 
423
423
  // src/build-config.ts
424
424
  var BUILD_ENV = true ? "production" : process.env.NODE_ENV === "test" ? "development" : "production";
425
- var CLI_VERSION = true ? "0.2.18" : "0.0.0-test";
425
+ var CLI_VERSION = true ? "0.2.19" : "0.0.0-test";
426
426
  var PRODUCTION_CONFIG = {
427
427
  apiUrl: "https://app.braingrid.ai",
428
428
  workosAuthUrl: "https://auth.braingrid.ai",
@@ -3914,6 +3914,9 @@ async function handleRequirementList(opts) {
3914
3914
  break;
3915
3915
  }
3916
3916
  }
3917
+ if (response.pagination?.has_more) {
3918
+ output += "\n" + chalk7.yellow("\u26A0\uFE0F More requirements exist. Use --limit to see more.");
3919
+ }
3917
3920
  return {
3918
3921
  success: true,
3919
3922
  message: output,
@@ -4522,11 +4525,19 @@ async function getCurrentTask(taskService, projectId, requirementId) {
4522
4525
  const response = await taskService.listTasks(projectId, requirementId);
4523
4526
  const inProgress = response.tasks.find((t) => t.status === "IN_PROGRESS");
4524
4527
  if (inProgress) {
4525
- return { success: true, taskId: inProgress.number };
4528
+ const warning = response.pagination?.has_more ? "Note: More tasks exist beyond current page." : void 0;
4529
+ return { success: true, taskId: inProgress.number, warning };
4526
4530
  }
4527
4531
  const planned = response.tasks.find((t) => t.status === "PLANNED");
4528
4532
  if (planned) {
4529
- return { success: true, taskId: planned.number };
4533
+ const warning = response.pagination?.has_more ? "Note: More tasks exist beyond current page." : void 0;
4534
+ return { success: true, taskId: planned.number, warning };
4535
+ }
4536
+ if (response.pagination?.has_more) {
4537
+ return {
4538
+ success: false,
4539
+ error: "No active task found in current page. More tasks exist - use --limit to fetch more."
4540
+ };
4530
4541
  }
4531
4542
  return {
4532
4543
  success: false,
@@ -4561,7 +4572,10 @@ async function handleTaskList(opts) {
4561
4572
  }
4562
4573
  const requirementId = requirementResult.requirementId;
4563
4574
  stopSpinner = showSpinner("Loading tasks", chalk8.gray);
4564
- const response = await taskService.listTasks(projectId, requirementId);
4575
+ const response = await taskService.listTasks(projectId, requirementId, {
4576
+ page: opts.page ? parseInt(opts.page, 10) : 1,
4577
+ limit: opts.limit ? parseInt(opts.limit, 10) : 20
4578
+ });
4565
4579
  stopSpinner();
4566
4580
  stopSpinner = null;
4567
4581
  if (response.tasks.length === 0) {
@@ -4575,12 +4589,15 @@ async function handleTaskList(opts) {
4575
4589
  const requirementShortId = opts.requirement || requirementId;
4576
4590
  const format = opts.format || "markdown";
4577
4591
  const config = getConfig();
4578
- const output = formatTasksListOutput(response.tasks, format, true, {
4592
+ let output = formatTasksListOutput(response.tasks, format, true, {
4579
4593
  requirementId,
4580
4594
  projectShortId,
4581
4595
  requirementShortId,
4582
4596
  apiUrl: config.apiUrl
4583
4597
  });
4598
+ if (response.pagination?.has_more) {
4599
+ output += "\n" + chalk8.yellow("\u26A0\uFE0F More tasks exist. Use --limit to see more.");
4600
+ }
4584
4601
  return {
4585
4602
  success: true,
4586
4603
  message: output,
@@ -4624,7 +4641,10 @@ async function handleTaskSummary(opts) {
4624
4641
  }
4625
4642
  const requirementId = requirementResult.requirementId;
4626
4643
  stopSpinner = showSpinner("Loading tasks", chalk8.gray);
4627
- const response = await taskService.listTasks(projectId, requirementId);
4644
+ const response = await taskService.listTasks(projectId, requirementId, {
4645
+ page: opts.page ? parseInt(opts.page, 10) : 1,
4646
+ limit: opts.limit ? parseInt(opts.limit, 10) : 20
4647
+ });
4628
4648
  stopSpinner();
4629
4649
  stopSpinner = null;
4630
4650
  if (response.tasks.length === 0) {
@@ -4637,12 +4657,15 @@ async function handleTaskSummary(opts) {
4637
4657
  const projectShortId = projectId;
4638
4658
  const requirementShortId = opts.requirement || requirementId;
4639
4659
  const config = getConfig();
4640
- const output = formatTasksListOutput(response.tasks, "table", false, {
4660
+ let output = formatTasksListOutput(response.tasks, "table", false, {
4641
4661
  requirementId,
4642
4662
  projectShortId,
4643
4663
  requirementShortId,
4644
4664
  apiUrl: config.apiUrl
4645
4665
  });
4666
+ if (response.pagination?.has_more) {
4667
+ output += "\n" + chalk8.yellow("\u26A0\uFE0F More tasks exist. Use --limit to see more.");
4668
+ }
4646
4669
  return {
4647
4670
  success: true,
4648
4671
  message: output,
@@ -4695,6 +4718,7 @@ async function handleTaskShow(id, opts) {
4695
4718
  }
4696
4719
  const requirementId = requirementResult.requirementId;
4697
4720
  let taskId;
4721
+ let taskWarning;
4698
4722
  if (id) {
4699
4723
  taskId = normalizeTaskId(id);
4700
4724
  } else {
@@ -4706,6 +4730,7 @@ async function handleTaskShow(id, opts) {
4706
4730
  };
4707
4731
  }
4708
4732
  taskId = currentTask.taskId;
4733
+ taskWarning = currentTask.warning;
4709
4734
  }
4710
4735
  const config = getConfig();
4711
4736
  stopSpinner = showSpinner("Loading task", chalk8.gray);
@@ -4740,6 +4765,9 @@ async function handleTaskShow(id, opts) {
4740
4765
  break;
4741
4766
  }
4742
4767
  }
4768
+ if (taskWarning) {
4769
+ output += "\n" + chalk8.yellow(`\u26A0\uFE0F ${taskWarning}`);
4770
+ }
4743
4771
  return {
4744
4772
  success: true,
4745
4773
  message: output,
@@ -4849,6 +4877,7 @@ async function handleTaskUpdate(id, opts) {
4849
4877
  }
4850
4878
  const requirementId = requirementResult.requirementId;
4851
4879
  let taskId;
4880
+ let taskWarning;
4852
4881
  if (id) {
4853
4882
  taskId = normalizeTaskId(id);
4854
4883
  } else {
@@ -4860,6 +4889,7 @@ async function handleTaskUpdate(id, opts) {
4860
4889
  };
4861
4890
  }
4862
4891
  taskId = currentTask.taskId;
4892
+ taskWarning = currentTask.warning;
4863
4893
  }
4864
4894
  const config = getConfig();
4865
4895
  stopSpinner = showSpinner("Updating task", chalk8.gray);
@@ -4869,7 +4899,7 @@ async function handleTaskUpdate(id, opts) {
4869
4899
  });
4870
4900
  stopSpinner();
4871
4901
  stopSpinner = null;
4872
- const output = formatTaskOutput(task2, {
4902
+ let output = formatTaskOutput(task2, {
4873
4903
  showContent: true,
4874
4904
  successMessage: `Updated task ${task2.number}`,
4875
4905
  apiUrl: config.apiUrl,
@@ -4877,6 +4907,9 @@ async function handleTaskUpdate(id, opts) {
4877
4907
  requirementShortId: opts?.requirement || requirementId,
4878
4908
  requirementId
4879
4909
  });
4910
+ if (taskWarning) {
4911
+ output += "\n" + chalk8.yellow(`\u26A0\uFE0F ${taskWarning}`);
4912
+ }
4880
4913
  return {
4881
4914
  success: true,
4882
4915
  message: output,
@@ -7207,14 +7240,14 @@ requirement.command("build [id]").description(
7207
7240
  }
7208
7241
  });
7209
7242
  var task = program.command("task").description("Manage tasks");
7210
- task.command("list").description("List tasks for a requirement").option("-r, --requirement <id>", "requirement ID (REQ-456, auto-detects project if initialized)").option("-p, --project <id>", "project ID (PROJ-123, optional if project is initialized)").option("--format <format>", "output format (table, json, xml, markdown)", "markdown").action(async (opts) => {
7243
+ task.command("list").description("List tasks for a requirement").option("-r, --requirement <id>", "requirement ID (REQ-456, auto-detects project if initialized)").option("-p, --project <id>", "project ID (PROJ-123, optional if project is initialized)").option("--format <format>", "output format (table, json, xml, markdown)", "markdown").option("--page <page>", "page number for pagination", "1").option("--limit <limit>", "number of tasks per page", "20").action(async (opts) => {
7211
7244
  const result = await handleTaskList(opts);
7212
7245
  console.log(result.message);
7213
7246
  if (!result.success) {
7214
7247
  process.exit(1);
7215
7248
  }
7216
7249
  });
7217
- task.command("summary").description("Show task summary table (quick overview without content)").option("-r, --requirement <id>", "requirement ID (REQ-456, auto-detects project if initialized)").option("-p, --project <id>", "project ID (PROJ-123, optional if project is initialized)").action(async (opts) => {
7250
+ task.command("summary").description("Show task summary table (quick overview without content)").option("-r, --requirement <id>", "requirement ID (REQ-456, auto-detects project if initialized)").option("-p, --project <id>", "project ID (PROJ-123, optional if project is initialized)").option("--page <page>", "page number for pagination", "1").option("--limit <limit>", "number of tasks per page", "20").action(async (opts) => {
7218
7251
  const result = await handleTaskSummary(opts);
7219
7252
  console.log(result.message);
7220
7253
  if (!result.success) {