@koda-sl/baker-cli 0.211.0 → 0.212.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/cli.js CHANGED
@@ -849,6 +849,15 @@ function advisoryHint(name, description) {
849
849
  const executable = looksExecutable(name, description);
850
850
  return executable ? { kind: "executable", ...executable } : null;
851
851
  }
852
+ var ACTIONS_LIST_DEFAULT_LIMIT = 500;
853
+ function buildListHints({ returned, limit }) {
854
+ if (returned < limit) {
855
+ return [];
856
+ }
857
+ return [
858
+ `This list is capped at ${limit} Tasks and came back full, so older Tasks exist that are NOT shown. Do not treat it as the whole backlog \u2014 re-run with --limit ${limit * 2} (or narrow with --status / --q).`
859
+ ];
860
+ }
852
861
 
853
862
  // src/commands/actions/skillCatalog.ts
854
863
  import { existsSync, readdirSync, readFileSync } from "fs";
@@ -1178,7 +1187,13 @@ var actionsListRequestSchema = z.object({
1178
1187
  status: actionStatusSchema.optional(),
1179
1188
  bucketed: z.boolean().optional(),
1180
1189
  q: z.string().optional(),
1181
- sort: z.enum(["recent", "priority"]).optional()
1190
+ sort: z.enum(["recent", "priority"]).optional(),
1191
+ /**
1192
+ * How many rows the flat (`bucketed: false`) list may read, newest first.
1193
+ * Omitted means the server default; raise it to walk further back. The
1194
+ * bucketed view ignores it because it reads the open backlog whole.
1195
+ */
1196
+ limit: z.number().int().positive().optional()
1182
1197
  });
1183
1198
  var actionsListResponseSchema = okResponse(z.union([actionBucketsSchema, z.array(actionWithMetaSchema)]));
1184
1199
  var actionsStatusRequestSchema = z.object({
@@ -6468,7 +6483,7 @@ var linkCommand = defineCommand7({
6468
6483
  import { defineCommand as defineCommand8 } from "citty";
6469
6484
  registerSchema({
6470
6485
  command: "actions.list",
6471
- description: "List actions for the current company. Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded), each bucket ordered do-first (blockers before blocked, then highest-leverage). Set --bucketed=false for a flat list filterable by --status and orderable by --sort.",
6486
+ description: "List actions for the current company. Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded), each bucket ordered do-first (blockers before blocked, then highest-leverage). The bucketed view reads the whole open backlog, so nothing pending is ever hidden from it. Set --bucketed=false for a flat list filterable by --status, orderable by --sort, and windowed by --limit.",
6472
6487
  args: {
6473
6488
  bucketed: {
6474
6489
  type: "boolean",
@@ -6485,6 +6500,11 @@ registerSchema({
6485
6500
  type: "string",
6486
6501
  description: "Order a flat list (only with --bucketed=false): priority (do-first: blockers before blocked, then highest-leverage) | recent. Default: priority.",
6487
6502
  required: false
6503
+ },
6504
+ limit: {
6505
+ type: "string",
6506
+ description: `How many Tasks a flat list reads, newest first (only with --bucketed=false). Default: ${ACTIONS_LIST_DEFAULT_LIMIT}. When the read comes back full, hints[] says so \u2014 raise --limit to reach older Tasks.`,
6507
+ required: false
6488
6508
  }
6489
6509
  }
6490
6510
  });
@@ -6496,7 +6516,8 @@ var listCommand2 = defineCommand8({
6496
6516
  args: {
6497
6517
  bucketed: { type: "boolean", description: "Pre-bucket by chat", required: false, default: true },
6498
6518
  status: { type: "string", description: "Status filter (raw mode)", required: false },
6499
- sort: { type: "string", description: "Order (raw mode): priority|recent", required: false }
6519
+ sort: { type: "string", description: "Order (raw mode): priority|recent", required: false },
6520
+ limit: { type: "string", description: "How many Tasks to read (raw mode)", required: false }
6500
6521
  },
6501
6522
  run: async ({ args }) => {
6502
6523
  try {
@@ -6506,14 +6527,18 @@ var listCommand2 = defineCommand8({
6506
6527
  if (bucketed && env.BAKER_CHAT_ID) {
6507
6528
  body.chatId = env.BAKER_CHAT_ID;
6508
6529
  }
6530
+ const parsedLimit = args.limit === void 0 ? Number.NaN : Number.parseInt(String(args.limit), 10);
6531
+ const limit = Number.isFinite(parsedLimit) && parsedLimit > 0 ? parsedLimit : ACTIONS_LIST_DEFAULT_LIMIT;
6509
6532
  if (!bucketed) {
6510
6533
  if (args.status) {
6511
6534
  body.status = args.status;
6512
6535
  }
6513
6536
  body.sort = args.sort === "recent" ? "recent" : "priority";
6537
+ body.limit = limit;
6514
6538
  }
6515
6539
  const response = await apiPost("/api/actions/list", body);
6516
- writeJson(response);
6540
+ const hints = !bucketed && response.ok && Array.isArray(response.data) ? buildListHints({ returned: response.data.length, limit }) : [];
6541
+ writeJson(hints.length > 0 ? { ...response, hints } : response);
6517
6542
  } catch (err) {
6518
6543
  failApi(err);
6519
6544
  }