@koda-sl/baker-cli 0.211.0 → 0.213.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 +40 -8
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
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({
|
|
@@ -1426,7 +1441,7 @@ var resolvePreviewSchema = z2.object({
|
|
|
1426
1441
|
website: z2.string().nullable(),
|
|
1427
1442
|
followers: z2.number().nullable()
|
|
1428
1443
|
});
|
|
1429
|
-
var followedStatusSchema = z2.enum(["discovering", "ready"]);
|
|
1444
|
+
var followedStatusSchema = z2.enum(["discovering", "ingesting", "ready"]);
|
|
1430
1445
|
var followedAdvertiserSchema = z2.object({
|
|
1431
1446
|
// Baker subscription row id (used to unfollow).
|
|
1432
1447
|
followed_id: z2.string(),
|
|
@@ -1438,9 +1453,15 @@ var followedAdvertiserSchema = z2.object({
|
|
|
1438
1453
|
active_ad_count: z2.number().nullable(),
|
|
1439
1454
|
total_ad_count: z2.number().nullable(),
|
|
1440
1455
|
family_count: z2.number().nullable(),
|
|
1441
|
-
// Progress while status
|
|
1456
|
+
// Progress while status is "discovering" or "ingesting". `adding_ingested`
|
|
1457
|
+
// and `adding_enqueued` are both counts for the CURRENT run, so they read as
|
|
1458
|
+
// a fraction; `total_ad_count` is the brand's whole corpus and is not.
|
|
1442
1459
|
adding_discovered: z2.number().nullable(),
|
|
1443
|
-
adding_enqueued: z2.number().nullable()
|
|
1460
|
+
adding_enqueued: z2.number().nullable(),
|
|
1461
|
+
adding_ingested: z2.number().nullable(),
|
|
1462
|
+
// A discovery job ended in failure, so this brand's ads are under-counted.
|
|
1463
|
+
// Distinguishes "we couldn't finish looking" from "this brand runs no ads".
|
|
1464
|
+
discovery_failed: z2.boolean().nullable()
|
|
1444
1465
|
});
|
|
1445
1466
|
var followingListResponseSchema = z2.object({
|
|
1446
1467
|
following: z2.array(followedAdvertiserSchema)
|
|
@@ -6468,7 +6489,7 @@ var linkCommand = defineCommand7({
|
|
|
6468
6489
|
import { defineCommand as defineCommand8 } from "citty";
|
|
6469
6490
|
registerSchema({
|
|
6470
6491
|
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
|
|
6492
|
+
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
6493
|
args: {
|
|
6473
6494
|
bucketed: {
|
|
6474
6495
|
type: "boolean",
|
|
@@ -6485,6 +6506,11 @@ registerSchema({
|
|
|
6485
6506
|
type: "string",
|
|
6486
6507
|
description: "Order a flat list (only with --bucketed=false): priority (do-first: blockers before blocked, then highest-leverage) | recent. Default: priority.",
|
|
6487
6508
|
required: false
|
|
6509
|
+
},
|
|
6510
|
+
limit: {
|
|
6511
|
+
type: "string",
|
|
6512
|
+
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.`,
|
|
6513
|
+
required: false
|
|
6488
6514
|
}
|
|
6489
6515
|
}
|
|
6490
6516
|
});
|
|
@@ -6496,7 +6522,8 @@ var listCommand2 = defineCommand8({
|
|
|
6496
6522
|
args: {
|
|
6497
6523
|
bucketed: { type: "boolean", description: "Pre-bucket by chat", required: false, default: true },
|
|
6498
6524
|
status: { type: "string", description: "Status filter (raw mode)", required: false },
|
|
6499
|
-
sort: { type: "string", description: "Order (raw mode): priority|recent", required: false }
|
|
6525
|
+
sort: { type: "string", description: "Order (raw mode): priority|recent", required: false },
|
|
6526
|
+
limit: { type: "string", description: "How many Tasks to read (raw mode)", required: false }
|
|
6500
6527
|
},
|
|
6501
6528
|
run: async ({ args }) => {
|
|
6502
6529
|
try {
|
|
@@ -6506,14 +6533,18 @@ var listCommand2 = defineCommand8({
|
|
|
6506
6533
|
if (bucketed && env.BAKER_CHAT_ID) {
|
|
6507
6534
|
body.chatId = env.BAKER_CHAT_ID;
|
|
6508
6535
|
}
|
|
6536
|
+
const parsedLimit = args.limit === void 0 ? Number.NaN : Number.parseInt(String(args.limit), 10);
|
|
6537
|
+
const limit = Number.isFinite(parsedLimit) && parsedLimit > 0 ? parsedLimit : ACTIONS_LIST_DEFAULT_LIMIT;
|
|
6509
6538
|
if (!bucketed) {
|
|
6510
6539
|
if (args.status) {
|
|
6511
6540
|
body.status = args.status;
|
|
6512
6541
|
}
|
|
6513
6542
|
body.sort = args.sort === "recent" ? "recent" : "priority";
|
|
6543
|
+
body.limit = limit;
|
|
6514
6544
|
}
|
|
6515
6545
|
const response = await apiPost("/api/actions/list", body);
|
|
6516
|
-
|
|
6546
|
+
const hints = !bucketed && response.ok && Array.isArray(response.data) ? buildListHints({ returned: response.data.length, limit }) : [];
|
|
6547
|
+
writeJson(hints.length > 0 ? { ...response, hints } : response);
|
|
6517
6548
|
} catch (err) {
|
|
6518
6549
|
failApi(err);
|
|
6519
6550
|
}
|
|
@@ -44198,7 +44229,8 @@ function compactFollowed(record) {
|
|
|
44198
44229
|
total_ad_count: record.total_ad_count ?? null,
|
|
44199
44230
|
family_count: record.family_count ?? null,
|
|
44200
44231
|
adding_discovered: record.adding_discovered ?? null,
|
|
44201
|
-
adding_enqueued: record.adding_enqueued ?? null
|
|
44232
|
+
adding_enqueued: record.adding_enqueued ?? null,
|
|
44233
|
+
adding_ingested: record.adding_ingested ?? null
|
|
44202
44234
|
};
|
|
44203
44235
|
}
|
|
44204
44236
|
function followingNormalizer(record, full) {
|