@koda-sl/baker-cli 0.366.0-dev.daafff067 → 0.366.0-dev.eac0b5d73
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 +1 -2
- package/dist/cli.js +5 -108
- package/dist/cli.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -3456,8 +3456,7 @@ 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
|
|
3460
|
-
baker actions list --full # whole descriptions and full records (large on a real backlog)
|
|
3459
|
+
baker actions list --output md # id-first Markdown; works for both the bucketed and flat shapes
|
|
3461
3460
|
baker actions list --search "conversion goal" --output md # find Tasks by words in name/description/tags (flat, best match first)
|
|
3462
3461
|
# With BAKER_CHAT_ID, the bucketed list folds in THIS chat's draft: staged creates appear in
|
|
3463
3462
|
# `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.
|
|
9227
|
+
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. 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",
|
|
@@ -9253,19 +9252,13 @@ registerSchema({
|
|
|
9253
9252
|
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.`,
|
|
9254
9253
|
required: false
|
|
9255
9254
|
},
|
|
9256
|
-
full: {
|
|
9257
|
-
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.",
|
|
9259
|
-
required: false,
|
|
9260
|
-
default: false
|
|
9261
|
-
},
|
|
9262
9255
|
output: { type: "string", description: "Output format: json|md. Default: json", required: false }
|
|
9263
9256
|
}
|
|
9264
9257
|
});
|
|
9265
9258
|
var listCommand2 = defineCommand8({
|
|
9266
9259
|
meta: {
|
|
9267
9260
|
name: "list",
|
|
9268
|
-
description: "List actions
|
|
9261
|
+
description: "List actions. Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status, or --search <text> to find Tasks by name."
|
|
9269
9262
|
},
|
|
9270
9263
|
args: {
|
|
9271
9264
|
search: { type: "string", description: "Find Tasks by words in name/description/tags", required: false },
|
|
@@ -9273,12 +9266,6 @@ var listCommand2 = defineCommand8({
|
|
|
9273
9266
|
status: { type: "string", description: "Status filter (raw mode)", required: false },
|
|
9274
9267
|
sort: { type: "string", description: "Order (raw mode): priority|recent", required: false },
|
|
9275
9268
|
limit: { type: "string", description: "How many Tasks to read (raw mode)", required: false },
|
|
9276
|
-
full: {
|
|
9277
|
-
type: "boolean",
|
|
9278
|
-
description: "Whole descriptions and full records",
|
|
9279
|
-
required: false,
|
|
9280
|
-
default: false
|
|
9281
|
-
},
|
|
9282
9269
|
output: { type: "string", description: "Output format: json|md", required: false }
|
|
9283
9270
|
},
|
|
9284
9271
|
run: async ({ args: args5 }) => {
|
|
@@ -9286,18 +9273,11 @@ var listCommand2 = defineCommand8({
|
|
|
9286
9273
|
const body = buildListRequest(args5, getEnv().BAKER_CHAT_ID);
|
|
9287
9274
|
const response = await apiPost("/api/actions/list", body);
|
|
9288
9275
|
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
|
|
9290
|
-
const shaped = compact3 ? { ...response, data: compactListData(response.data) } : response;
|
|
9291
|
-
const envelope = hints2.length > 0 ? { ...shaped, hints: hints2 } : shaped;
|
|
9276
|
+
const envelope = hints2.length > 0 ? { ...response, hints: hints2 } : response;
|
|
9292
9277
|
if (args5.output === "md" && envelope.ok) {
|
|
9293
9278
|
process.stdout.write(renderMarkdown(envelope.data, hints2));
|
|
9294
9279
|
return;
|
|
9295
9280
|
}
|
|
9296
|
-
if (compact3) {
|
|
9297
|
-
process.stdout.write(`${JSON.stringify(envelope)}
|
|
9298
|
-
`);
|
|
9299
|
-
return;
|
|
9300
|
-
}
|
|
9301
9281
|
writeJson(envelope);
|
|
9302
9282
|
} catch (err) {
|
|
9303
9283
|
failApi(err);
|
|
@@ -9325,81 +9305,6 @@ function buildListRequest(args5, chatId) {
|
|
|
9325
9305
|
}
|
|
9326
9306
|
return body;
|
|
9327
9307
|
}
|
|
9328
|
-
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
|
-
function summarizeDescription(description) {
|
|
9361
|
-
const line = firstProse(Lexer.lex(description));
|
|
9362
|
-
if (line.length <= SUMMARY_MAX_CHARS) {
|
|
9363
|
-
return line;
|
|
9364
|
-
}
|
|
9365
|
-
const cut = line.slice(0, SUMMARY_MAX_CHARS - 1);
|
|
9366
|
-
const lastSpace = cut.lastIndexOf(" ");
|
|
9367
|
-
return `${(lastSpace > SUMMARY_MAX_CHARS / 2 ? cut.slice(0, lastSpace) : cut).trimEnd()}\u2026`;
|
|
9368
|
-
}
|
|
9369
|
-
function compactBucketEntry(entry) {
|
|
9370
|
-
const { description: _description, status: _status, hint: _hint, ...rest } = entry;
|
|
9371
|
-
return rest;
|
|
9372
|
-
}
|
|
9373
|
-
function compactFlatRow(entry) {
|
|
9374
|
-
const nested = entry.action;
|
|
9375
|
-
const doc = nested && typeof nested === "object" ? nested : entry;
|
|
9376
|
-
const { id, name, status, hint } = toRow(entry);
|
|
9377
|
-
const assignee = entry.assignee && typeof entry.assignee === "object" ? entry.assignee : null;
|
|
9378
|
-
return {
|
|
9379
|
-
id,
|
|
9380
|
-
name,
|
|
9381
|
-
status,
|
|
9382
|
-
...typeof doc.priority === "string" ? { priority: doc.priority } : {},
|
|
9383
|
-
...Array.isArray(doc.tags) && doc.tags.length > 0 ? { tags: doc.tags } : {},
|
|
9384
|
-
summary: summarizeDescription(typeof doc.description === "string" ? doc.description : ""),
|
|
9385
|
-
...hint ? { hint } : {},
|
|
9386
|
-
...typeof assignee?.name === "string" ? { assignee: assignee.name } : {}
|
|
9387
|
-
};
|
|
9388
|
-
}
|
|
9389
|
-
function compactListData(data) {
|
|
9390
|
-
if (Array.isArray(data)) {
|
|
9391
|
-
return data.map((entry) => compactFlatRow(entry));
|
|
9392
|
-
}
|
|
9393
|
-
if (!data || typeof data !== "object") {
|
|
9394
|
-
return data;
|
|
9395
|
-
}
|
|
9396
|
-
return Object.fromEntries(
|
|
9397
|
-
Object.entries(data).map(([bucket, entries]) => [
|
|
9398
|
-
bucket,
|
|
9399
|
-
Array.isArray(entries) ? entries.map((entry) => compactBucketEntry(entry)) : entries
|
|
9400
|
-
])
|
|
9401
|
-
);
|
|
9402
|
-
}
|
|
9403
9308
|
function toRow(entry) {
|
|
9404
9309
|
const nested = entry.action;
|
|
9405
9310
|
const doc = nested && typeof nested === "object" ? nested : entry;
|
|
@@ -9421,14 +9326,6 @@ function renderEntry(entry) {
|
|
|
9421
9326
|
const row = toRow(entry);
|
|
9422
9327
|
const suffix = row.status ? ` [${row.status}]` : "";
|
|
9423
9328
|
const lines = [`- \`${row.id}\` ${row.name}${suffix}`];
|
|
9424
|
-
const nested = entry.action;
|
|
9425
|
-
const doc = nested && typeof nested === "object" ? nested : entry;
|
|
9426
|
-
const text2 = typeof entry.summary === "string" ? entry.summary : doc.description;
|
|
9427
|
-
if (typeof text2 === "string" && text2.trim()) {
|
|
9428
|
-
lines.push(
|
|
9429
|
-
...text2.trim().split("\n").map((line) => line ? ` ${line}` : "")
|
|
9430
|
-
);
|
|
9431
|
-
}
|
|
9432
9329
|
if (row.hint) {
|
|
9433
9330
|
lines.push(` ${row.hint}`);
|
|
9434
9331
|
}
|
|
@@ -14844,8 +14741,8 @@ var SEND_PLATFORM_SPECS = {
|
|
|
14844
14741
|
title: "Meta",
|
|
14845
14742
|
eventMeans: "A Meta event name \u2014 Lead, Purchase, Schedule, or one of your own",
|
|
14846
14743
|
eventKind: "name",
|
|
14847
|
-
credentialFields: ["accessToken"
|
|
14848
|
-
setupHint: "Add the Conversions API access token
|
|
14744
|
+
credentialFields: ["accessToken"],
|
|
14745
|
+
setupHint: "Add the Conversions API access token to the Meta pixel in Tracking"
|
|
14849
14746
|
},
|
|
14850
14747
|
googleAds: {
|
|
14851
14748
|
title: "Google Ads",
|