@koda-sl/baker-cli 0.366.0-dev.daafff067 → 0.366.0-dev.efa067f23

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/README.md CHANGED
@@ -3456,8 +3456,8 @@ baker actions list # default: bucketed (claimable, myCla
3456
3456
  # then most recent. The `blocked` bucket is ordered closest-to-ready first.
3457
3457
  baker actions list --bucketed=false --status pending
3458
3458
  baker actions list --bucketed=false --sort priority # flat list, do-first order (default); use --sort recent for newest-first
3459
- baker actions list --output md # id-first Markdown; works for both the bucketed and flat shapes (flat rows add a one-line summary)
3460
- baker actions list --full # whole descriptions and full records (large on a real backlog)
3459
+ baker actions list --output md # id-first Markdown, a one-line summary per Task; works for both the bucketed and flat shapes
3460
+ baker actions list --full # whole descriptions instead of the one-line summary (large on a real backlog)
3461
3461
  baker actions list --search "conversion goal" --output md # find Tasks by words in name/description/tags (flat, best match first)
3462
3462
  # With BAKER_CHAT_ID, the bucketed list folds in THIS chat's draft: staged creates appear in
3463
3463
  # `draftCreates`; published actions being completed/discarded/updated carry a `draftStatus` marker.
package/dist/cli.js CHANGED
@@ -9222,10 +9222,9 @@ var linkCommand = defineCommand7({
9222
9222
 
9223
9223
  // src/commands/actions/list.ts
9224
9224
  import { defineCommand as defineCommand8 } from "citty";
9225
- import { Lexer } from "marked";
9226
9225
  registerSchema({
9227
9226
  command: "actions.list",
9228
- description: 'List actions for the current company. Compact by default: a bucketed Task is its id and name (plus its blockers, holder or staged change); a flat row (--search, --bucketed=false) adds status, priority, tags and a one-line `summary` of its description. Checking whether a Task already exists? --search "<words>" returns the matches with their summaries. --full prints whole descriptions (or `baker actions get <id>` for one Task). 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. Looking for one Task by name? --search "conversion goal" --output md returns only the matching Tasks instead of the whole backlog.',
9227
+ description: 'List actions for the current company. Compact by default: each Task is its id, name, status, hint and a one-line `summary` of its description; add --full for whole descriptions (or `baker actions get <id>` for one Task). 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. Looking for one Task by name? --search "conversion goal" --output md returns only the matching Tasks instead of the whole backlog.',
9229
9228
  args: {
9230
9229
  search: {
9231
9230
  type: "string",
@@ -9255,7 +9254,7 @@ registerSchema({
9255
9254
  },
9256
9255
  full: {
9257
9256
  type: "boolean",
9258
- description: "Print every Task's whole description and full record instead of the compact row. Large on a real backlog \u2014 prefer --search, or `baker actions get <id>` for one Task.",
9257
+ description: "Print every Task's whole description (and the flat list's full record) instead of a one-line summary. Large on a real backlog \u2014 prefer --search, or `baker actions get <id>` for one Task.",
9259
9258
  required: false,
9260
9259
  default: false
9261
9260
  },
@@ -9265,7 +9264,7 @@ registerSchema({
9265
9264
  var listCommand2 = defineCommand8({
9266
9265
  meta: {
9267
9266
  name: "list",
9268
- description: "List actions, one short row per Task (id and name; --search rows add a one-line summary). Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status, --search <text> to find Tasks by name, --full for whole descriptions."
9267
+ description: "List actions, one short row per Task (id, name, status, one-line summary). Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status, --search <text> to find Tasks by name, --full for whole descriptions."
9269
9268
  },
9270
9269
  args: {
9271
9270
  search: { type: "string", description: "Find Tasks by words in name/description/tags", required: false },
@@ -9275,7 +9274,7 @@ var listCommand2 = defineCommand8({
9275
9274
  limit: { type: "string", description: "How many Tasks to read (raw mode)", required: false },
9276
9275
  full: {
9277
9276
  type: "boolean",
9278
- description: "Whole descriptions and full records",
9277
+ description: "Whole descriptions instead of a summary line",
9279
9278
  required: false,
9280
9279
  default: false
9281
9280
  },
@@ -9286,18 +9285,12 @@ var listCommand2 = defineCommand8({
9286
9285
  const body = buildListRequest(args5, getEnv().BAKER_CHAT_ID);
9287
9286
  const response = await apiPost("/api/actions/list", body);
9288
9287
  const hints2 = body.bucketed === false && body.limit !== void 0 && response.ok && Array.isArray(response.data) ? buildListHints({ returned: response.data.length, limit: body.limit }) : [];
9289
- const compact3 = !args5.full && response.ok;
9290
- const shaped = compact3 ? { ...response, data: compactListData(response.data) } : response;
9288
+ const shaped = args5.full || !response.ok ? response : { ...response, data: compactListData(response.data) };
9291
9289
  const envelope = hints2.length > 0 ? { ...shaped, hints: hints2 } : shaped;
9292
9290
  if (args5.output === "md" && envelope.ok) {
9293
9291
  process.stdout.write(renderMarkdown(envelope.data, hints2));
9294
9292
  return;
9295
9293
  }
9296
- if (compact3) {
9297
- process.stdout.write(`${JSON.stringify(envelope)}
9298
- `);
9299
- return;
9300
- }
9301
9294
  writeJson(envelope);
9302
9295
  } catch (err) {
9303
9296
  failApi(err);
@@ -9326,39 +9319,10 @@ function buildListRequest(args5, chatId) {
9326
9319
  return body;
9327
9320
  }
9328
9321
  var SUMMARY_MAX_CHARS = 100;
9329
- function plainText(tokens) {
9330
- return tokens.map((token) => {
9331
- if (token.type === "image" || token.type === "html") {
9332
- return "";
9333
- }
9334
- if (token.type === "br") {
9335
- return " ";
9336
- }
9337
- if ("tokens" in token && Array.isArray(token.tokens)) {
9338
- return plainText(token.tokens);
9339
- }
9340
- return "text" in token && typeof token.text === "string" ? token.text : "";
9341
- }).join("");
9342
- }
9343
- function firstProse(tokens) {
9344
- for (const token of tokens) {
9345
- let text2 = "";
9346
- if (token.type === "paragraph" || token.type === "text") {
9347
- text2 = plainText(Array.isArray(token.tokens) ? token.tokens : [token]);
9348
- } else if (token.type === "list") {
9349
- text2 = firstProse(token.items.flatMap((item) => item.tokens));
9350
- } else if (token.type === "blockquote") {
9351
- text2 = firstProse(token.tokens ?? []);
9352
- }
9353
- const line = text2.replace(/\s+/g, " ").trim();
9354
- if (line) {
9355
- return line;
9356
- }
9357
- }
9358
- return "";
9359
- }
9360
9322
  function summarizeDescription(description) {
9361
- const line = firstProse(Lexer.lex(description));
9323
+ const line = description.split("\n").filter((raw) => !/^\s*#{1,6}\s/.test(raw)).map(
9324
+ (raw) => raw.replace(/^\s*(?:[-*+>]|\d+[.)])\s+/, "").replace(/[*_`]/g, "").replace(/\s+/g, " ").trim()
9325
+ ).find((text2) => text2.length > 0) ?? "";
9362
9326
  if (line.length <= SUMMARY_MAX_CHARS) {
9363
9327
  return line;
9364
9328
  }
@@ -9367,8 +9331,8 @@ function summarizeDescription(description) {
9367
9331
  return `${(lastSpace > SUMMARY_MAX_CHARS / 2 ? cut.slice(0, lastSpace) : cut).trimEnd()}\u2026`;
9368
9332
  }
9369
9333
  function compactBucketEntry(entry) {
9370
- const { description: _description, status: _status, hint: _hint, ...rest } = entry;
9371
- return rest;
9334
+ const { description, ...rest } = entry;
9335
+ return { ...rest, summary: summarizeDescription(typeof description === "string" ? description : "") };
9372
9336
  }
9373
9337
  function compactFlatRow(entry) {
9374
9338
  const nested = entry.action;