@koda-sl/baker-cli 0.96.0 → 0.97.0-dev.e4727e68
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 +5 -3
- package/dist/{chunk-RCPMJKI7.js → chunk-7HSLFPZI.js} +4 -4
- package/dist/chunk-7HSLFPZI.js.map +1 -0
- package/dist/cli.js +350 -151
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-RCPMJKI7.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
defaultRegistry,
|
|
10
10
|
generateCatalog,
|
|
11
11
|
validateCanvasDeep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7HSLFPZI.js";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
|
-
import { defineCommand as
|
|
15
|
+
import { defineCommand as defineCommand150, runMain } from "citty";
|
|
16
16
|
|
|
17
17
|
// src/commands/actions/index.ts
|
|
18
18
|
import { defineCommand as defineCommand17 } from "citty";
|
|
@@ -483,6 +483,33 @@ var SCHEDULE_SIGNALS = [
|
|
|
483
483
|
/\bremind(?:er|s)?\b/i,
|
|
484
484
|
/\brun\s+at\b/i
|
|
485
485
|
];
|
|
486
|
+
var ACTION_PRIORITIES = ["urgent", "high", "medium", "low"];
|
|
487
|
+
function parsePriority(value, { allowClear }) {
|
|
488
|
+
if (value === void 0) {
|
|
489
|
+
return void 0;
|
|
490
|
+
}
|
|
491
|
+
if (typeof value !== "string") {
|
|
492
|
+
failValidation(
|
|
493
|
+
`--priority must be one of: ${ACTION_PRIORITIES.join(", ")}${allowClear ? ", or 'none' to clear" : ""}.`
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
const trimmed = value.trim().toLowerCase();
|
|
497
|
+
if (trimmed === "") {
|
|
498
|
+
if (allowClear) {
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
501
|
+
return void 0;
|
|
502
|
+
}
|
|
503
|
+
if (allowClear && (trimmed === "none" || trimmed === "clear")) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
if (ACTION_PRIORITIES.includes(trimmed)) {
|
|
507
|
+
return trimmed;
|
|
508
|
+
}
|
|
509
|
+
failValidation(
|
|
510
|
+
`Unknown --priority "${value}". Expected one of: ${ACTION_PRIORITIES.join(", ")}${allowClear ? ", or 'none' to clear" : ""}.`
|
|
511
|
+
);
|
|
512
|
+
}
|
|
486
513
|
function looksScheduled(name, description) {
|
|
487
514
|
const haystack = `${name}
|
|
488
515
|
${description}`;
|
|
@@ -570,7 +597,7 @@ var completeCommand = defineCommand2({
|
|
|
570
597
|
import { defineCommand as defineCommand3 } from "citty";
|
|
571
598
|
registerSchema({
|
|
572
599
|
command: "actions.create",
|
|
573
|
-
description: "Stage creation of a new action (applies when the chat is published). Returns a tempId you can use to link in the same draft.
|
|
600
|
+
description: "Stage creation of a new action (applies when the chat is published). Returns a tempId you can use to link in the same draft. Pass --tags (REQUIRED \u2014 run `baker actions tags list` for the taxonomy) and --priority (one of urgent|high|medium|low \u2014 drives the dependency-aware 'Do first' ordering). After creating, check if this action blocks or is blocked by other actions and wire dependencies with `baker actions link`.",
|
|
574
601
|
args: {
|
|
575
602
|
name: { type: "string", description: "Action name (short, action-verb, \u22646 words)", required: true },
|
|
576
603
|
description: {
|
|
@@ -583,6 +610,11 @@ registerSchema({
|
|
|
583
610
|
description: "Comma-separated tag slugs (e.g. google-ads,audit-finding). Must be known \u2014 see `baker actions tags list`.",
|
|
584
611
|
required: false
|
|
585
612
|
},
|
|
613
|
+
priority: {
|
|
614
|
+
type: "string",
|
|
615
|
+
description: `User priority for the do-first ordering. One of: ${ACTION_PRIORITIES.join(", ")}.`,
|
|
616
|
+
required: false
|
|
617
|
+
},
|
|
586
618
|
"temp-id": { type: "string", description: "Custom tempId (auto-generated if omitted)", required: false }
|
|
587
619
|
}
|
|
588
620
|
});
|
|
@@ -595,6 +627,7 @@ var createCommand = defineCommand3({
|
|
|
595
627
|
name: { type: "string", description: "Action name", required: false },
|
|
596
628
|
description: { type: "string", description: "Description", required: false, default: "" },
|
|
597
629
|
tags: { type: "string", description: "Comma-separated tag slugs (see `baker actions tags list`)", required: false },
|
|
630
|
+
priority: { type: "string", description: `User priority: ${ACTION_PRIORITIES.join("|")}`, required: false },
|
|
598
631
|
"temp-id": { type: "string", description: "Optional custom tempId", required: false }
|
|
599
632
|
},
|
|
600
633
|
run: async ({ args }) => {
|
|
@@ -606,12 +639,14 @@ var createCommand = defineCommand3({
|
|
|
606
639
|
const chatId = requireChatId();
|
|
607
640
|
const tempId = args["temp-id"] || generateTempId();
|
|
608
641
|
const tags = parseTagList(args.tags);
|
|
642
|
+
const priority = parsePriority(args.priority, { allowClear: false });
|
|
609
643
|
const response = await apiPost("/api/actions/create", {
|
|
610
644
|
chatId,
|
|
611
645
|
tempId,
|
|
612
646
|
name,
|
|
613
647
|
description: args.description ?? "",
|
|
614
|
-
...tags ? { tags } : {}
|
|
648
|
+
...tags ? { tags } : {},
|
|
649
|
+
...priority !== void 0 && priority !== null ? { priority } : {}
|
|
615
650
|
});
|
|
616
651
|
const hints = [];
|
|
617
652
|
if (looksScheduled(name, args.description ?? "")) {
|
|
@@ -625,7 +660,12 @@ var createCommand = defineCommand3({
|
|
|
625
660
|
}
|
|
626
661
|
if (!tags || tags.length === 0) {
|
|
627
662
|
hints.push(
|
|
628
|
-
"
|
|
663
|
+
"MISSING --tags. This action is invisible to the backlog's tag filter. Re-run with --tags <slug,...> (`baker actions tags list` for the taxonomy, `baker actions tags create --slug <slug>` to mint) \u2014 or `baker actions update <tempId> --tags <slug,...>`."
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
if (priority === void 0) {
|
|
667
|
+
hints.push(
|
|
668
|
+
`MISSING --priority. Without it this action ranks as 'normal' (medium) in the do-first ordering, so urgent/high client work won't surface first. Re-run with --priority ${ACTION_PRIORITIES.join("|")} \u2014 or \`baker actions update <tempId> --priority <level>\`.`
|
|
629
669
|
);
|
|
630
670
|
}
|
|
631
671
|
writeJson({ ...response, hints });
|
|
@@ -1161,7 +1201,7 @@ var unlinkCommand = defineCommand15({
|
|
|
1161
1201
|
import { defineCommand as defineCommand16 } from "citty";
|
|
1162
1202
|
registerSchema({
|
|
1163
1203
|
command: "actions.update",
|
|
1164
|
-
description: "Stage an update on a claimed action (name, description, and/or
|
|
1204
|
+
description: "Stage an update on a claimed action (name, description, tags, and/or priority). Applies on publish. --tags REPLACES the tag set; pass --tags '' to clear. --priority accepts urgent|high|medium|low or 'none' to clear back to unset (== normal).",
|
|
1165
1205
|
args: {
|
|
1166
1206
|
id: { type: "string", description: "Action ID (must be claimed by current chat)", required: true },
|
|
1167
1207
|
name: { type: "string", description: "New name", required: false },
|
|
@@ -1170,6 +1210,11 @@ registerSchema({
|
|
|
1170
1210
|
type: "string",
|
|
1171
1211
|
description: "Comma-separated tag slugs \u2014 REPLACES existing tags ('' clears)",
|
|
1172
1212
|
required: false
|
|
1213
|
+
},
|
|
1214
|
+
priority: {
|
|
1215
|
+
type: "string",
|
|
1216
|
+
description: `User priority: ${ACTION_PRIORITIES.join("|")}, or 'none' to clear.`,
|
|
1217
|
+
required: false
|
|
1173
1218
|
}
|
|
1174
1219
|
}
|
|
1175
1220
|
});
|
|
@@ -1183,7 +1228,8 @@ var updateCommand = defineCommand16({
|
|
|
1183
1228
|
"action-id": { type: "string", description: "Action ID", required: false },
|
|
1184
1229
|
name: { type: "string", description: "New name", required: false },
|
|
1185
1230
|
description: { type: "string", description: "New description", required: false },
|
|
1186
|
-
tags: { type: "string", description: "Comma-separated tag slugs \u2014 REPLACES existing ('' clears)", required: false }
|
|
1231
|
+
tags: { type: "string", description: "Comma-separated tag slugs \u2014 REPLACES existing ('' clears)", required: false },
|
|
1232
|
+
priority: { type: "string", description: `Priority: ${ACTION_PRIORITIES.join("|")}|none`, required: false }
|
|
1187
1233
|
},
|
|
1188
1234
|
run: async ({ args }) => {
|
|
1189
1235
|
try {
|
|
@@ -1193,8 +1239,9 @@ var updateCommand = defineCommand16({
|
|
|
1193
1239
|
}
|
|
1194
1240
|
validateConvexId(id);
|
|
1195
1241
|
const tags = parseTagList(args.tags);
|
|
1196
|
-
|
|
1197
|
-
|
|
1242
|
+
const priority = parsePriority(args.priority, { allowClear: true });
|
|
1243
|
+
if (args.name === void 0 && args.description === void 0 && tags === void 0 && priority === void 0) {
|
|
1244
|
+
failValidation("Provide at least one of --name, --description, --tags, --priority.");
|
|
1198
1245
|
}
|
|
1199
1246
|
const chatId = requireChatId();
|
|
1200
1247
|
await apiPost("/api/actions/update", {
|
|
@@ -1202,7 +1249,8 @@ var updateCommand = defineCommand16({
|
|
|
1202
1249
|
actionId: id,
|
|
1203
1250
|
name: args.name,
|
|
1204
1251
|
description: args.description,
|
|
1205
|
-
...tags !== void 0 ? { tags } : {}
|
|
1252
|
+
...tags !== void 0 ? { tags } : {},
|
|
1253
|
+
...priority !== void 0 ? { priority } : {}
|
|
1206
1254
|
});
|
|
1207
1255
|
writeOk();
|
|
1208
1256
|
} catch (err) {
|
|
@@ -11509,11 +11557,161 @@ Subcommands:
|
|
|
11509
11557
|
}
|
|
11510
11558
|
});
|
|
11511
11559
|
|
|
11560
|
+
// src/commands/creatives/index.ts
|
|
11561
|
+
import { defineCommand as defineCommand86 } from "citty";
|
|
11562
|
+
|
|
11563
|
+
// src/commands/creatives/publish.ts
|
|
11564
|
+
import { readFile as readFile7 } from "fs/promises";
|
|
11565
|
+
import { extname } from "path";
|
|
11566
|
+
import { defineCommand as defineCommand85 } from "citty";
|
|
11567
|
+
var creativeTag = "creative";
|
|
11568
|
+
var publishTimeoutMs = 18e4;
|
|
11569
|
+
var pollIntervalMs = 2e3;
|
|
11570
|
+
var mimeMap = {
|
|
11571
|
+
".png": "image/png",
|
|
11572
|
+
".jpg": "image/jpeg",
|
|
11573
|
+
".jpeg": "image/jpeg",
|
|
11574
|
+
".webp": "image/webp"
|
|
11575
|
+
};
|
|
11576
|
+
var defaultDeps = {
|
|
11577
|
+
readFile: readFile7,
|
|
11578
|
+
post: apiPost,
|
|
11579
|
+
get: apiGet,
|
|
11580
|
+
sleep: (ms) => new Promise((resolve5) => setTimeout(resolve5, ms))
|
|
11581
|
+
};
|
|
11582
|
+
registerSchema({
|
|
11583
|
+
command: "creatives.publish",
|
|
11584
|
+
description: "Publish a final static creative image to Baker Images, apply the official creative tag, and return an image reference.",
|
|
11585
|
+
args: {
|
|
11586
|
+
file: { type: "string", description: "Local PNG/JPG/WebP creative image path", required: true },
|
|
11587
|
+
title: { type: "string", description: "Human title for the creative output", required: true },
|
|
11588
|
+
context: { type: "string", description: "Optional describe context for the image row", required: false }
|
|
11589
|
+
}
|
|
11590
|
+
});
|
|
11591
|
+
function detectCreativeContentType(filePath) {
|
|
11592
|
+
const ext = extname(filePath).toLowerCase();
|
|
11593
|
+
const contentType = mimeMap[ext];
|
|
11594
|
+
if (!contentType) {
|
|
11595
|
+
throw new ApiError("VALIDATION_ERROR", `Unsupported creative image extension "${ext}". Use PNG, JPG, or WebP.`);
|
|
11596
|
+
}
|
|
11597
|
+
return contentType;
|
|
11598
|
+
}
|
|
11599
|
+
function imageToCreativeReference(image, title) {
|
|
11600
|
+
if (!image.imageUrl) {
|
|
11601
|
+
throw new ApiError("IMAGE_PROCESSING_ERROR", "Published image is missing imageUrl");
|
|
11602
|
+
}
|
|
11603
|
+
return {
|
|
11604
|
+
type: "image",
|
|
11605
|
+
slug: image._id,
|
|
11606
|
+
title,
|
|
11607
|
+
tags: image.tags?.includes(creativeTag) ? image.tags : [...image.tags ?? [], creativeTag],
|
|
11608
|
+
imageUrl: image.imageUrl,
|
|
11609
|
+
thumbnailUrl: image.thumbnailUrl ?? image.imageUrl,
|
|
11610
|
+
storageKey: image.storageKey,
|
|
11611
|
+
width: image.width,
|
|
11612
|
+
height: image.height,
|
|
11613
|
+
aspectRatio: image.aspectRatio,
|
|
11614
|
+
source: image.source
|
|
11615
|
+
};
|
|
11616
|
+
}
|
|
11617
|
+
async function waitForReadyImage(deps, imageId, timeoutMs = publishTimeoutMs) {
|
|
11618
|
+
const deadline = Date.now() + timeoutMs;
|
|
11619
|
+
let lastStatus = "unknown";
|
|
11620
|
+
while (Date.now() <= deadline) {
|
|
11621
|
+
const image = await deps.get("/api/images/get", { id: imageId });
|
|
11622
|
+
lastStatus = image.status ?? "unknown";
|
|
11623
|
+
if (image.status === "ready") {
|
|
11624
|
+
return image;
|
|
11625
|
+
}
|
|
11626
|
+
if (image.status === "error") {
|
|
11627
|
+
throw new ApiError("IMAGE_PROCESSING_ERROR", "Creative image processing failed");
|
|
11628
|
+
}
|
|
11629
|
+
await deps.sleep(pollIntervalMs);
|
|
11630
|
+
}
|
|
11631
|
+
throw new ApiError("TIMEOUT", `Creative image was not ready before timeout; last status: ${lastStatus}`);
|
|
11632
|
+
}
|
|
11633
|
+
async function publishCreative(args, deps = defaultDeps) {
|
|
11634
|
+
const title = args.title.trim();
|
|
11635
|
+
if (!title) {
|
|
11636
|
+
throw new ApiError("VALIDATION_ERROR", "--title is required");
|
|
11637
|
+
}
|
|
11638
|
+
const contentType = detectCreativeContentType(args.file);
|
|
11639
|
+
const fileBuffer = await deps.readFile(args.file);
|
|
11640
|
+
const uploadBody = {
|
|
11641
|
+
base64: fileBuffer.toString("base64"),
|
|
11642
|
+
contentType,
|
|
11643
|
+
source: "ai_generated",
|
|
11644
|
+
descriptionContext: args.context ?? `Static ad creative: ${title}`
|
|
11645
|
+
};
|
|
11646
|
+
const upload = await deps.post("/api/images/upload", uploadBody, {
|
|
11647
|
+
timeoutMs: publishTimeoutMs
|
|
11648
|
+
});
|
|
11649
|
+
const readyImage = await waitForReadyImage(deps, upload.imageId);
|
|
11650
|
+
await deps.post("/api/images/tag", {
|
|
11651
|
+
imageIds: [upload.imageId],
|
|
11652
|
+
addTags: [creativeTag],
|
|
11653
|
+
removeTags: [],
|
|
11654
|
+
title
|
|
11655
|
+
});
|
|
11656
|
+
const taggedImage = await deps.get("/api/images/get", { id: upload.imageId });
|
|
11657
|
+
return { imageId: upload.imageId, reference: imageToCreativeReference({ ...readyImage, ...taggedImage }, title) };
|
|
11658
|
+
}
|
|
11659
|
+
var publishCommand = defineCommand85({
|
|
11660
|
+
meta: {
|
|
11661
|
+
name: "publish",
|
|
11662
|
+
description: "Publish a final static creative image to Baker Images, deterministically tag it as creative, and print the image reference JSON."
|
|
11663
|
+
},
|
|
11664
|
+
args: {
|
|
11665
|
+
file: { type: "positional", description: "Local PNG/JPG/WebP creative image path", required: false },
|
|
11666
|
+
title: { type: "string", description: "Human title for the creative output", required: false },
|
|
11667
|
+
context: { type: "string", description: "Optional describe context for the image row", required: false }
|
|
11668
|
+
},
|
|
11669
|
+
run: async ({ args }) => {
|
|
11670
|
+
try {
|
|
11671
|
+
const file = args.file;
|
|
11672
|
+
const title = args.title;
|
|
11673
|
+
if (!file) {
|
|
11674
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Image path is required" } });
|
|
11675
|
+
process.exit(1);
|
|
11676
|
+
}
|
|
11677
|
+
if (!title) {
|
|
11678
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "--title is required" } });
|
|
11679
|
+
process.exit(1);
|
|
11680
|
+
}
|
|
11681
|
+
const data = await publishCreative({ file, title, context: args.context });
|
|
11682
|
+
writeJson({ ok: true, data });
|
|
11683
|
+
} catch (err) {
|
|
11684
|
+
if (err instanceof ApiError) {
|
|
11685
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
11686
|
+
process.exit(1);
|
|
11687
|
+
}
|
|
11688
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
11689
|
+
process.exit(1);
|
|
11690
|
+
}
|
|
11691
|
+
}
|
|
11692
|
+
});
|
|
11693
|
+
|
|
11694
|
+
// src/commands/creatives/index.ts
|
|
11695
|
+
var creativesCommand3 = defineCommand86({
|
|
11696
|
+
meta: {
|
|
11697
|
+
name: "creatives",
|
|
11698
|
+
description: `Publish static ad creatives as first-class Baker outputs.
|
|
11699
|
+
|
|
11700
|
+
Static creative handoff:
|
|
11701
|
+
baker creatives publish ./canvas/run/final.png --title "Spring Offer Static Ad"
|
|
11702
|
+
|
|
11703
|
+
Publishing uploads the image to the Company image library, applies the official creative tag, and returns an image reference for chat previews.`
|
|
11704
|
+
},
|
|
11705
|
+
subCommands: {
|
|
11706
|
+
publish: publishCommand
|
|
11707
|
+
}
|
|
11708
|
+
});
|
|
11709
|
+
|
|
11512
11710
|
// src/commands/ga4/index.ts
|
|
11513
|
-
import { defineCommand as
|
|
11711
|
+
import { defineCommand as defineCommand90 } from "citty";
|
|
11514
11712
|
|
|
11515
11713
|
// src/commands/ga4/audit.ts
|
|
11516
|
-
import { defineCommand as
|
|
11714
|
+
import { defineCommand as defineCommand87 } from "citty";
|
|
11517
11715
|
|
|
11518
11716
|
// src/commands/ga4/resolve.ts
|
|
11519
11717
|
async function fetchProperties(useCache = true) {
|
|
@@ -11576,7 +11774,7 @@ registerSchema({
|
|
|
11576
11774
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11577
11775
|
}
|
|
11578
11776
|
});
|
|
11579
|
-
var auditCommand2 =
|
|
11777
|
+
var auditCommand2 = defineCommand87({
|
|
11580
11778
|
meta: {
|
|
11581
11779
|
name: "audit",
|
|
11582
11780
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -11628,7 +11826,7 @@ Examples:
|
|
|
11628
11826
|
});
|
|
11629
11827
|
|
|
11630
11828
|
// src/commands/ga4/properties.ts
|
|
11631
|
-
import { defineCommand as
|
|
11829
|
+
import { defineCommand as defineCommand88 } from "citty";
|
|
11632
11830
|
registerSchema({
|
|
11633
11831
|
command: "ga4.properties",
|
|
11634
11832
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -11636,7 +11834,7 @@ registerSchema({
|
|
|
11636
11834
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11637
11835
|
}
|
|
11638
11836
|
});
|
|
11639
|
-
var propertiesCommand =
|
|
11837
|
+
var propertiesCommand = defineCommand88({
|
|
11640
11838
|
meta: {
|
|
11641
11839
|
name: "properties",
|
|
11642
11840
|
description: `List accessible GA4 properties.
|
|
@@ -11686,7 +11884,7 @@ Examples:
|
|
|
11686
11884
|
// src/commands/ga4/query.ts
|
|
11687
11885
|
import { appendFileSync as appendFileSync2, existsSync as existsSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
|
|
11688
11886
|
import { resolve as resolve2 } from "path";
|
|
11689
|
-
import { defineCommand as
|
|
11887
|
+
import { defineCommand as defineCommand89 } from "citty";
|
|
11690
11888
|
|
|
11691
11889
|
// src/commands/ga4/presets.ts
|
|
11692
11890
|
var GA4_PRESETS = [
|
|
@@ -11818,7 +12016,7 @@ function handleError(err) {
|
|
|
11818
12016
|
});
|
|
11819
12017
|
process.exit(1);
|
|
11820
12018
|
}
|
|
11821
|
-
var queryCommand2 =
|
|
12019
|
+
var queryCommand2 = defineCommand89({
|
|
11822
12020
|
meta: {
|
|
11823
12021
|
name: "query",
|
|
11824
12022
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -11889,7 +12087,7 @@ Free-form (escape hatch):
|
|
|
11889
12087
|
});
|
|
11890
12088
|
|
|
11891
12089
|
// src/commands/ga4/index.ts
|
|
11892
|
-
var ga4Command =
|
|
12090
|
+
var ga4Command = defineCommand90({
|
|
11893
12091
|
meta: {
|
|
11894
12092
|
name: "ga4",
|
|
11895
12093
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -11912,12 +12110,12 @@ Examples:
|
|
|
11912
12110
|
});
|
|
11913
12111
|
|
|
11914
12112
|
// src/commands/gsc/index.ts
|
|
11915
|
-
import { defineCommand as
|
|
12113
|
+
import { defineCommand as defineCommand94 } from "citty";
|
|
11916
12114
|
|
|
11917
12115
|
// src/commands/gsc/query.ts
|
|
11918
12116
|
import { appendFileSync as appendFileSync3, existsSync as existsSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
11919
12117
|
import { resolve as resolve3 } from "path";
|
|
11920
|
-
import { defineCommand as
|
|
12118
|
+
import { defineCommand as defineCommand91 } from "citty";
|
|
11921
12119
|
|
|
11922
12120
|
// src/commands/gsc/presets.ts
|
|
11923
12121
|
var GSC_PRESETS = [
|
|
@@ -12105,7 +12303,7 @@ function handleError2(err) {
|
|
|
12105
12303
|
});
|
|
12106
12304
|
process.exit(1);
|
|
12107
12305
|
}
|
|
12108
|
-
var queryCommand3 =
|
|
12306
|
+
var queryCommand3 = defineCommand91({
|
|
12109
12307
|
meta: {
|
|
12110
12308
|
name: "query",
|
|
12111
12309
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -12183,7 +12381,7 @@ Free-form (escape hatch):
|
|
|
12183
12381
|
});
|
|
12184
12382
|
|
|
12185
12383
|
// src/commands/gsc/sitemaps.ts
|
|
12186
|
-
import { defineCommand as
|
|
12384
|
+
import { defineCommand as defineCommand92 } from "citty";
|
|
12187
12385
|
registerSchema({
|
|
12188
12386
|
command: "gsc.sitemaps",
|
|
12189
12387
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -12192,7 +12390,7 @@ registerSchema({
|
|
|
12192
12390
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
12193
12391
|
}
|
|
12194
12392
|
});
|
|
12195
|
-
var sitemapsCommand =
|
|
12393
|
+
var sitemapsCommand = defineCommand92({
|
|
12196
12394
|
meta: {
|
|
12197
12395
|
name: "sitemaps",
|
|
12198
12396
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -12242,7 +12440,7 @@ Examples:
|
|
|
12242
12440
|
});
|
|
12243
12441
|
|
|
12244
12442
|
// src/commands/gsc/sites.ts
|
|
12245
|
-
import { defineCommand as
|
|
12443
|
+
import { defineCommand as defineCommand93 } from "citty";
|
|
12246
12444
|
registerSchema({
|
|
12247
12445
|
command: "gsc.sites",
|
|
12248
12446
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -12250,7 +12448,7 @@ registerSchema({
|
|
|
12250
12448
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
12251
12449
|
}
|
|
12252
12450
|
});
|
|
12253
|
-
var sitesCommand =
|
|
12451
|
+
var sitesCommand = defineCommand93({
|
|
12254
12452
|
meta: {
|
|
12255
12453
|
name: "sites",
|
|
12256
12454
|
description: `List verified Search Console sites.
|
|
@@ -12298,7 +12496,7 @@ Examples:
|
|
|
12298
12496
|
});
|
|
12299
12497
|
|
|
12300
12498
|
// src/commands/gsc/index.ts
|
|
12301
|
-
var gscCommand =
|
|
12499
|
+
var gscCommand = defineCommand94({
|
|
12302
12500
|
meta: {
|
|
12303
12501
|
name: "gsc",
|
|
12304
12502
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -12321,10 +12519,10 @@ Examples:
|
|
|
12321
12519
|
});
|
|
12322
12520
|
|
|
12323
12521
|
// src/commands/images/index.ts
|
|
12324
|
-
import { defineCommand as
|
|
12522
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
12325
12523
|
|
|
12326
12524
|
// src/commands/images/crop.ts
|
|
12327
|
-
import { defineCommand as
|
|
12525
|
+
import { defineCommand as defineCommand95 } from "citty";
|
|
12328
12526
|
|
|
12329
12527
|
// src/lib/image/crop-sprite.ts
|
|
12330
12528
|
import sharp from "sharp";
|
|
@@ -12339,8 +12537,8 @@ function cropSprite(input, region) {
|
|
|
12339
12537
|
|
|
12340
12538
|
// src/lib/image/io.ts
|
|
12341
12539
|
import { randomBytes } from "crypto";
|
|
12342
|
-
import { glob as fsGlob, readFile as
|
|
12343
|
-
import { dirname, extname, join as join3, resolve as resolve4 } from "path";
|
|
12540
|
+
import { glob as fsGlob, readFile as readFile8, rename, stat as stat2, writeFile as writeFile3 } from "fs/promises";
|
|
12541
|
+
import { dirname, extname as extname2, join as join3, resolve as resolve4 } from "path";
|
|
12344
12542
|
var REMOTE_RE = /^https?:\/\//i;
|
|
12345
12543
|
var GLOB_RE = /[*?[\]{}]/;
|
|
12346
12544
|
function isRemoteUrl(value) {
|
|
@@ -12375,7 +12573,7 @@ async function readImageBuffer(pathOrUrl) {
|
|
|
12375
12573
|
}
|
|
12376
12574
|
return Buffer.from(await response.arrayBuffer());
|
|
12377
12575
|
}
|
|
12378
|
-
return
|
|
12576
|
+
return readFile8(pathOrUrl);
|
|
12379
12577
|
}
|
|
12380
12578
|
async function isDirectory(path7) {
|
|
12381
12579
|
try {
|
|
@@ -12386,7 +12584,7 @@ async function isDirectory(path7) {
|
|
|
12386
12584
|
}
|
|
12387
12585
|
}
|
|
12388
12586
|
async function resolveOutputPath(inputPath, outputArg, options) {
|
|
12389
|
-
const base = options.newExtension ? inputPath.slice(0, -
|
|
12587
|
+
const base = options.newExtension ? inputPath.slice(0, -extname2(inputPath).length) + options.newExtension : inputPath;
|
|
12390
12588
|
if (!outputArg) return base;
|
|
12391
12589
|
if (options.multipleInputs || await isDirectory(outputArg)) {
|
|
12392
12590
|
const filename = base.split("/").pop() ?? "out.png";
|
|
@@ -12449,7 +12647,7 @@ function emitError2(err) {
|
|
|
12449
12647
|
}
|
|
12450
12648
|
process.exit(1);
|
|
12451
12649
|
}
|
|
12452
|
-
var cropCommand =
|
|
12650
|
+
var cropCommand = defineCommand95({
|
|
12453
12651
|
meta: {
|
|
12454
12652
|
name: "crop",
|
|
12455
12653
|
description: "Crop a rectangular region from an image.\n\nExample: baker images crop sprite.png --x 0 --y 0 --width 64 --height 64 --output icon.png"
|
|
@@ -12485,7 +12683,7 @@ var cropCommand = defineCommand93({
|
|
|
12485
12683
|
});
|
|
12486
12684
|
|
|
12487
12685
|
// src/commands/images/delete.ts
|
|
12488
|
-
import { defineCommand as
|
|
12686
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
12489
12687
|
registerSchema({
|
|
12490
12688
|
command: "images.delete",
|
|
12491
12689
|
description: "Delete an image by ID",
|
|
@@ -12499,7 +12697,7 @@ registerSchema({
|
|
|
12499
12697
|
}
|
|
12500
12698
|
}
|
|
12501
12699
|
});
|
|
12502
|
-
var deleteCommand =
|
|
12700
|
+
var deleteCommand = defineCommand96({
|
|
12503
12701
|
meta: {
|
|
12504
12702
|
name: "delete",
|
|
12505
12703
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -12540,7 +12738,7 @@ var deleteCommand = defineCommand94({
|
|
|
12540
12738
|
});
|
|
12541
12739
|
|
|
12542
12740
|
// src/commands/images/dimensions.ts
|
|
12543
|
-
import { defineCommand as
|
|
12741
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
12544
12742
|
|
|
12545
12743
|
// src/lib/image/dimensions.ts
|
|
12546
12744
|
import { imageSize } from "image-size";
|
|
@@ -12563,7 +12761,7 @@ registerSchema({
|
|
|
12563
12761
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
12564
12762
|
}
|
|
12565
12763
|
});
|
|
12566
|
-
var dimensionsCommand =
|
|
12764
|
+
var dimensionsCommand = defineCommand97({
|
|
12567
12765
|
meta: {
|
|
12568
12766
|
name: "dimensions",
|
|
12569
12767
|
description: "Read image dimensions without decoding the full file.\n\nExample: baker images dimensions ./logo.png\nExample: baker images dimensions https://acme.com/hero.png"
|
|
@@ -12607,7 +12805,7 @@ var dimensionsCommand = defineCommand95({
|
|
|
12607
12805
|
});
|
|
12608
12806
|
|
|
12609
12807
|
// src/commands/images/extract.ts
|
|
12610
|
-
import { defineCommand as
|
|
12808
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
12611
12809
|
registerSchema({
|
|
12612
12810
|
command: "images.extract",
|
|
12613
12811
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -12623,7 +12821,7 @@ registerSchema({
|
|
|
12623
12821
|
}
|
|
12624
12822
|
}
|
|
12625
12823
|
});
|
|
12626
|
-
var extractCommand =
|
|
12824
|
+
var extractCommand = defineCommand98({
|
|
12627
12825
|
meta: {
|
|
12628
12826
|
name: "extract",
|
|
12629
12827
|
description: "Pull every image from a single URL via Firecrawl. ~$0.001/scrape. Cap auto-ingest at 20.\n\nExample: baker images extract https://stripe.com --auto-ingest 5"
|
|
@@ -12661,7 +12859,7 @@ var extractCommand = defineCommand96({
|
|
|
12661
12859
|
});
|
|
12662
12860
|
|
|
12663
12861
|
// src/commands/images/find.ts
|
|
12664
|
-
import { defineCommand as
|
|
12862
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
12665
12863
|
registerSchema({
|
|
12666
12864
|
command: "images.find",
|
|
12667
12865
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -12693,7 +12891,7 @@ registerSchema({
|
|
|
12693
12891
|
}
|
|
12694
12892
|
}
|
|
12695
12893
|
});
|
|
12696
|
-
var findCommand =
|
|
12894
|
+
var findCommand = defineCommand99({
|
|
12697
12895
|
meta: {
|
|
12698
12896
|
name: "find",
|
|
12699
12897
|
description: "Library-first fanout image search. Opt in to providers with --sources. `--fallback` short-circuits to externals only when library is thin. With --auto-ingest, ingested external hits return Baker-owned URLs.\n\nExample: baker images find 'office' --sources library,magnific --limit 20"
|
|
@@ -12739,8 +12937,8 @@ var findCommand = defineCommand97({
|
|
|
12739
12937
|
});
|
|
12740
12938
|
|
|
12741
12939
|
// src/commands/images/generate.ts
|
|
12742
|
-
import { readFile as
|
|
12743
|
-
import { defineCommand as
|
|
12940
|
+
import { readFile as readFile9 } from "fs/promises";
|
|
12941
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
12744
12942
|
import sharp2 from "sharp";
|
|
12745
12943
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
12746
12944
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -12822,7 +13020,7 @@ async function resolveReferences(spec) {
|
|
|
12822
13020
|
}
|
|
12823
13021
|
let raw;
|
|
12824
13022
|
try {
|
|
12825
|
-
raw = await
|
|
13023
|
+
raw = await readFile9(entry);
|
|
12826
13024
|
} catch {
|
|
12827
13025
|
throw new ApiError("VALIDATION_ERROR", `Reference file not found: ${entry}`);
|
|
12828
13026
|
}
|
|
@@ -12836,7 +13034,7 @@ async function resolveReferences(spec) {
|
|
|
12836
13034
|
}
|
|
12837
13035
|
return out;
|
|
12838
13036
|
}
|
|
12839
|
-
var generateCommand =
|
|
13037
|
+
var generateCommand = defineCommand100({
|
|
12840
13038
|
meta: {
|
|
12841
13039
|
name: "generate",
|
|
12842
13040
|
description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: openai/gpt-5.4-image-2 (default \u2014 photoreal, cleanest text, best for ad/landing reproduction), google/gemini-3-pro-image-preview (Nano Banana Pro), google/gemini-3.5-flash & google/gemini-3.1-flash-image-preview (fast, extreme aspect ratios), recraft/recraft-v4.1-pro-vector (vector/SVG-style with palette control). The result is auto-ingested (describe + embed), so the next `baker images library` query finds it. Pass --reference with image URLs and/or local file paths (Pinterest, stock, brand assets, sandbox files) to ground generation in reality.\n\nExamples:\n baker images generate 'a friendly golden retriever sitting in a bright modern living room' --aspect-ratio 16:9\n baker images generate 'hero shot of a matte black water bottle on marble' --model google/gemini-3-pro-image-preview --image-size 2K\n baker images generate 'lifestyle photo matching this mood' --reference 'https://\u2026/ref1.jpg,https://\u2026/ref2.jpg'\n baker images generate 'put this product on a marble countertop, soft daylight' --reference './src/brand/logos/product.png,./refs/kitchen-mood.jpg'\n baker images generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
|
|
@@ -12888,7 +13086,7 @@ var generateCommand = defineCommand98({
|
|
|
12888
13086
|
});
|
|
12889
13087
|
|
|
12890
13088
|
// src/commands/images/get.ts
|
|
12891
|
-
import { defineCommand as
|
|
13089
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
12892
13090
|
registerSchema({
|
|
12893
13091
|
command: "images.get",
|
|
12894
13092
|
description: "Get a single image by ID",
|
|
@@ -12896,7 +13094,7 @@ registerSchema({
|
|
|
12896
13094
|
id: { type: "string", description: "Image ID", required: true }
|
|
12897
13095
|
}
|
|
12898
13096
|
});
|
|
12899
|
-
var getCommand2 =
|
|
13097
|
+
var getCommand2 = defineCommand101({
|
|
12900
13098
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
12901
13099
|
args: {
|
|
12902
13100
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -12932,7 +13130,7 @@ var getCommand2 = defineCommand99({
|
|
|
12932
13130
|
});
|
|
12933
13131
|
|
|
12934
13132
|
// src/commands/images/gif.ts
|
|
12935
|
-
import { defineCommand as
|
|
13133
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
12936
13134
|
registerSchema({
|
|
12937
13135
|
command: "images.gif",
|
|
12938
13136
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -12964,7 +13162,7 @@ registerSchema({
|
|
|
12964
13162
|
}
|
|
12965
13163
|
}
|
|
12966
13164
|
});
|
|
12967
|
-
var gifCommand =
|
|
13165
|
+
var gifCommand = defineCommand102({
|
|
12968
13166
|
meta: {
|
|
12969
13167
|
name: "gif",
|
|
12970
13168
|
description: "Search Giphy for GIFs / reaction memes \u2014 built for paid-social creative (Meta, TikTok, LinkedIn, X). Free API. Each hit carries WebP + GIF + MP4 URLs in providerMeta so you can pick the right format per platform.\n\nExample: baker images gif 'this is fine' --limit 10\nExample: baker images gif 'office reaction' --rating pg --auto-ingest 2\nExample: baker images gif --trending --limit 25"
|
|
@@ -13011,7 +13209,7 @@ var gifCommand = defineCommand100({
|
|
|
13011
13209
|
});
|
|
13012
13210
|
|
|
13013
13211
|
// src/commands/images/google.ts
|
|
13014
|
-
import { defineCommand as
|
|
13212
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
13015
13213
|
registerSchema({
|
|
13016
13214
|
command: "images.google",
|
|
13017
13215
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -13047,7 +13245,7 @@ registerSchema({
|
|
|
13047
13245
|
}
|
|
13048
13246
|
}
|
|
13049
13247
|
});
|
|
13050
|
-
var googleCommand2 =
|
|
13248
|
+
var googleCommand2 = defineCommand103({
|
|
13051
13249
|
meta: {
|
|
13052
13250
|
name: "google",
|
|
13053
13251
|
description: "Google Images via the official Custom Search JSON API ($0.005/query, free 100/day). \u26A0 Source unverified \u2014 watermarks, low-res, mislabeled results are common. Use as last resort. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExample: baker images google 'industrial workshop' --type photo --size large --limit 20"
|
|
@@ -13095,7 +13293,7 @@ var googleCommand2 = defineCommand101({
|
|
|
13095
13293
|
});
|
|
13096
13294
|
|
|
13097
13295
|
// src/commands/images/icon.ts
|
|
13098
|
-
import { defineCommand as
|
|
13296
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
13099
13297
|
registerSchema({
|
|
13100
13298
|
command: "images.icon",
|
|
13101
13299
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -13121,7 +13319,7 @@ registerSchema({
|
|
|
13121
13319
|
}
|
|
13122
13320
|
}
|
|
13123
13321
|
});
|
|
13124
|
-
var iconCommand =
|
|
13322
|
+
var iconCommand = defineCommand104({
|
|
13125
13323
|
meta: {
|
|
13126
13324
|
name: "icon",
|
|
13127
13325
|
description: "Icon via Iconify (simple-icons, logos, lucide, devicon, heroicons, tabler, phosphor, material-symbols, \u2026). Free CDN, no API key.\n\nExample: baker images icon react --set devicon\nExample: baker images icon lucide:check --color '#0a0a0a'"
|
|
@@ -13161,7 +13359,7 @@ var iconCommand = defineCommand102({
|
|
|
13161
13359
|
});
|
|
13162
13360
|
|
|
13163
13361
|
// src/commands/images/ingest.ts
|
|
13164
|
-
import { defineCommand as
|
|
13362
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
13165
13363
|
registerSchema({
|
|
13166
13364
|
command: "images.ingest",
|
|
13167
13365
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -13173,7 +13371,7 @@ registerSchema({
|
|
|
13173
13371
|
context: { type: "string", description: "Description context hint", required: false }
|
|
13174
13372
|
}
|
|
13175
13373
|
});
|
|
13176
|
-
var ingestCommand =
|
|
13374
|
+
var ingestCommand = defineCommand105({
|
|
13177
13375
|
meta: {
|
|
13178
13376
|
name: "ingest",
|
|
13179
13377
|
description: "Download a remote URL and store it in the library. Hash-deduped on bytes + externalId.\n\nExample: baker images ingest https://img.freepik.com/free-photo/xyz.jpg --source magnific --external-id 12345"
|
|
@@ -13215,7 +13413,7 @@ var ingestCommand = defineCommand103({
|
|
|
13215
13413
|
});
|
|
13216
13414
|
|
|
13217
13415
|
// src/commands/images/library.ts
|
|
13218
|
-
import { defineCommand as
|
|
13416
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
13219
13417
|
registerSchema({
|
|
13220
13418
|
command: "images.library",
|
|
13221
13419
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -13241,7 +13439,7 @@ registerSchema({
|
|
|
13241
13439
|
}
|
|
13242
13440
|
}
|
|
13243
13441
|
});
|
|
13244
|
-
var libraryCommand =
|
|
13442
|
+
var libraryCommand = defineCommand106({
|
|
13245
13443
|
meta: {
|
|
13246
13444
|
name: "library",
|
|
13247
13445
|
description: "Search the company image library (hybrid BM25 + vector + Cohere rerank). Use this BEFORE any external provider.\n\nExample: baker images library 'hero banner' --aspect-ratio 16:9 --source magnific"
|
|
@@ -13298,7 +13496,7 @@ var libraryCommand = defineCommand104({
|
|
|
13298
13496
|
});
|
|
13299
13497
|
|
|
13300
13498
|
// src/commands/images/logo.ts
|
|
13301
|
-
import { defineCommand as
|
|
13499
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
13302
13500
|
registerSchema({
|
|
13303
13501
|
command: "images.logo",
|
|
13304
13502
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -13323,7 +13521,7 @@ registerSchema({
|
|
|
13323
13521
|
}
|
|
13324
13522
|
}
|
|
13325
13523
|
});
|
|
13326
|
-
var logoCommand =
|
|
13524
|
+
var logoCommand = defineCommand107({
|
|
13327
13525
|
meta: {
|
|
13328
13526
|
name: "logo",
|
|
13329
13527
|
description: "Brand logo via Brandfetch CDN. Returns up to 5 variants (icon, light/dark logo, light/dark symbol). Auto-ingests the first variant.\n\nExample: baker images logo stripe.com --variant logo"
|
|
@@ -13361,7 +13559,7 @@ var logoCommand = defineCommand105({
|
|
|
13361
13559
|
});
|
|
13362
13560
|
|
|
13363
13561
|
// src/commands/images/normalize.ts
|
|
13364
|
-
import { defineCommand as
|
|
13562
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
13365
13563
|
|
|
13366
13564
|
// src/lib/image/color-changer.ts
|
|
13367
13565
|
import quantize from "quantize";
|
|
@@ -14093,7 +14291,7 @@ function coerceRawArgs(args) {
|
|
|
14093
14291
|
"dry-run": bool(args["dry-run"])
|
|
14094
14292
|
};
|
|
14095
14293
|
}
|
|
14096
|
-
var normalizeCommand =
|
|
14294
|
+
var normalizeCommand = defineCommand108({
|
|
14097
14295
|
meta: {
|
|
14098
14296
|
name: "normalize",
|
|
14099
14297
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -14148,7 +14346,7 @@ Examples:
|
|
|
14148
14346
|
});
|
|
14149
14347
|
|
|
14150
14348
|
// src/commands/images/pinterest.ts
|
|
14151
|
-
import { defineCommand as
|
|
14349
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
14152
14350
|
registerSchema({
|
|
14153
14351
|
command: "images.pinterest",
|
|
14154
14352
|
description: "Pinterest image search via ScrapeCreators. Reference-grade real-world photography, product styling, interiors, fashion, food, and aesthetic mood boards. Inspect before placing \u2014 Pinterest is unverified, trademark-bearing web content.",
|
|
@@ -14168,7 +14366,7 @@ registerSchema({
|
|
|
14168
14366
|
}
|
|
14169
14367
|
}
|
|
14170
14368
|
});
|
|
14171
|
-
var pinterestCommand =
|
|
14369
|
+
var pinterestCommand = defineCommand109({
|
|
14172
14370
|
meta: {
|
|
14173
14371
|
name: "pinterest",
|
|
14174
14372
|
description: "Pinterest image search via ScrapeCreators ($0.00188/request). Best for photo-realistic reference imagery \u2014 lifestyle, interiors, fashion, food, product styling, and mood boards to brief AI generation against. \u26A0 Unverified, trademark-bearing web content \u2014 inspect and respect rights before placing on a customer page. Browse first; auto-ingest only the pins you commit to.\n\nExamples:\n baker images pinterest 'scandinavian living room'\n baker images pinterest 'minimalist skincare product photography' --limit 20\n baker images pinterest 'cozy coffee shop interior' --auto-ingest 2 --context 'Mood reference for hero photography'"
|
|
@@ -14208,7 +14406,7 @@ var pinterestCommand = defineCommand107({
|
|
|
14208
14406
|
});
|
|
14209
14407
|
|
|
14210
14408
|
// src/commands/images/screenshot.ts
|
|
14211
|
-
import { defineCommand as
|
|
14409
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
14212
14410
|
registerSchema({
|
|
14213
14411
|
command: "images.screenshot",
|
|
14214
14412
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -14224,7 +14422,7 @@ registerSchema({
|
|
|
14224
14422
|
}
|
|
14225
14423
|
}
|
|
14226
14424
|
});
|
|
14227
|
-
var screenshotCommand =
|
|
14425
|
+
var screenshotCommand = defineCommand110({
|
|
14228
14426
|
meta: {
|
|
14229
14427
|
name: "screenshot",
|
|
14230
14428
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -14274,7 +14472,7 @@ var screenshotCommand = defineCommand108({
|
|
|
14274
14472
|
});
|
|
14275
14473
|
|
|
14276
14474
|
// src/commands/images/search.ts
|
|
14277
|
-
import { defineCommand as
|
|
14475
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
14278
14476
|
registerSchema({
|
|
14279
14477
|
command: "images.search",
|
|
14280
14478
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -14290,7 +14488,7 @@ registerSchema({
|
|
|
14290
14488
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
14291
14489
|
}
|
|
14292
14490
|
});
|
|
14293
|
-
var searchCommand =
|
|
14491
|
+
var searchCommand = defineCommand111({
|
|
14294
14492
|
meta: {
|
|
14295
14493
|
name: "search",
|
|
14296
14494
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -14350,7 +14548,7 @@ var searchCommand = defineCommand109({
|
|
|
14350
14548
|
});
|
|
14351
14549
|
|
|
14352
14550
|
// src/commands/images/sticker.ts
|
|
14353
|
-
import { defineCommand as
|
|
14551
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
14354
14552
|
registerSchema({
|
|
14355
14553
|
command: "images.sticker",
|
|
14356
14554
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -14382,7 +14580,7 @@ registerSchema({
|
|
|
14382
14580
|
}
|
|
14383
14581
|
}
|
|
14384
14582
|
});
|
|
14385
|
-
var stickerCommand =
|
|
14583
|
+
var stickerCommand = defineCommand112({
|
|
14386
14584
|
meta: {
|
|
14387
14585
|
name: "sticker",
|
|
14388
14586
|
description: "Search Giphy's sticker corpus \u2014 transparent-background WebPs / GIFs ideal for overlaying on ad creative (Meta, TikTok, Stories). Same Giphy free API as `baker images gif`; results carry WebP + GIF + MP4 URLs in providerMeta.\n\nExample: baker images sticker 'thumbs up' --limit 10\nExample: baker images sticker celebration --rating g --auto-ingest 3\nExample: baker images sticker --trending --limit 25"
|
|
@@ -14429,7 +14627,7 @@ var stickerCommand = defineCommand110({
|
|
|
14429
14627
|
});
|
|
14430
14628
|
|
|
14431
14629
|
// src/commands/images/stock.ts
|
|
14432
|
-
import { defineCommand as
|
|
14630
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
14433
14631
|
registerSchema({
|
|
14434
14632
|
command: "images.stock",
|
|
14435
14633
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -14487,7 +14685,7 @@ registerSchema({
|
|
|
14487
14685
|
}
|
|
14488
14686
|
}
|
|
14489
14687
|
});
|
|
14490
|
-
var stockCommand =
|
|
14688
|
+
var stockCommand = defineCommand113({
|
|
14491
14689
|
meta: {
|
|
14492
14690
|
name: "stock",
|
|
14493
14691
|
description: "Stock search via Magnific \u2014 Freepik's developer API (~250M assets: photos, vectors, illustrations, icons, PSDs). $0.002/req. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExamples:\n baker images stock 'minimalist office'\n baker images stock 'flat office workers' --type vector\n baker images stock 'hero photo of a kitchen' --type photo --orientation landscape --ai exclude\n baker images stock 'brand pattern' --color '#0a0a0a' --license freemium --auto-ingest 2"
|
|
@@ -14543,7 +14741,7 @@ var stockCommand = defineCommand111({
|
|
|
14543
14741
|
});
|
|
14544
14742
|
|
|
14545
14743
|
// src/lib/tags-command.ts
|
|
14546
|
-
import { defineCommand as
|
|
14744
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
14547
14745
|
function makeTagsCommand(command, label, endpoint) {
|
|
14548
14746
|
registerSchema({
|
|
14549
14747
|
command: `${command}.tags`,
|
|
@@ -14552,7 +14750,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
14552
14750
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
14553
14751
|
}
|
|
14554
14752
|
});
|
|
14555
|
-
return
|
|
14753
|
+
return defineCommand114({
|
|
14556
14754
|
meta: {
|
|
14557
14755
|
name: "tags",
|
|
14558
14756
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -14588,9 +14786,9 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
14588
14786
|
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
14589
14787
|
|
|
14590
14788
|
// src/commands/images/upload.ts
|
|
14591
|
-
import { readFile as
|
|
14592
|
-
import { extname as
|
|
14593
|
-
import { defineCommand as
|
|
14789
|
+
import { readFile as readFile10 } from "fs/promises";
|
|
14790
|
+
import { extname as extname3 } from "path";
|
|
14791
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
14594
14792
|
var MIME_MAP = {
|
|
14595
14793
|
".png": "image/png",
|
|
14596
14794
|
".jpg": "image/jpeg",
|
|
@@ -14638,14 +14836,14 @@ function isRemoteUrl2(value) {
|
|
|
14638
14836
|
return /^https?:\/\//i.test(value);
|
|
14639
14837
|
}
|
|
14640
14838
|
function detectContentType(filePath) {
|
|
14641
|
-
const ext =
|
|
14839
|
+
const ext = extname3(filePath).toLowerCase();
|
|
14642
14840
|
const mime = MIME_MAP[ext];
|
|
14643
14841
|
if (!mime) {
|
|
14644
14842
|
throw new ApiError("VALIDATION_ERROR", `Cannot detect content type for extension "${ext}". Use --content-type.`);
|
|
14645
14843
|
}
|
|
14646
14844
|
return mime;
|
|
14647
14845
|
}
|
|
14648
|
-
var uploadCommand =
|
|
14846
|
+
var uploadCommand = defineCommand115({
|
|
14649
14847
|
meta: {
|
|
14650
14848
|
name: "upload",
|
|
14651
14849
|
description: "Upload an image to the library \u2014 accepts a local file path OR a remote http(s) URL.\n\nLocal: reads bytes, sends to /api/images/upload, content-type auto-detected from extension.\nRemote: dispatches to /api/images/ingest with hash-dedup on bytes + externalId.\n\nExamples:\n baker images upload ./logo.png --source uploaded\n baker images upload ./cert.png --context 'ISO 27001 badge \u2014 enterprise tier'\n baker images upload https://acme.com/hero.png --source firecrawl --context 'Acme competitor pricing hero'"
|
|
@@ -14728,7 +14926,7 @@ async function uploadLocal(target, args) {
|
|
|
14728
14926
|
});
|
|
14729
14927
|
return;
|
|
14730
14928
|
}
|
|
14731
|
-
const fileBuffer = await
|
|
14929
|
+
const fileBuffer = await readFile10(target);
|
|
14732
14930
|
const base64 = fileBuffer.toString("base64");
|
|
14733
14931
|
const body = { base64, contentType };
|
|
14734
14932
|
if (args.source) body.source = args.source;
|
|
@@ -14738,7 +14936,7 @@ async function uploadLocal(target, args) {
|
|
|
14738
14936
|
}
|
|
14739
14937
|
|
|
14740
14938
|
// src/commands/images/upscale.ts
|
|
14741
|
-
import { defineCommand as
|
|
14939
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
14742
14940
|
registerSchema({
|
|
14743
14941
|
command: "images.upscale",
|
|
14744
14942
|
description: "Upscale a library image via the backend (Replicate, cost-tracked). Waits for completion by default. The image must be status 'ready' and raster (not SVG/AVIF).",
|
|
@@ -14753,7 +14951,7 @@ registerSchema({
|
|
|
14753
14951
|
}
|
|
14754
14952
|
});
|
|
14755
14953
|
var POLL_INTERVAL_MS3 = 1500;
|
|
14756
|
-
var upscaleCommand =
|
|
14954
|
+
var upscaleCommand = defineCommand116({
|
|
14757
14955
|
meta: {
|
|
14758
14956
|
name: "upscale",
|
|
14759
14957
|
description: "Upscale a library image via the Convex backend (Replicate, cost-tracked at $0.05/image). Waits for completion by default.\n\nExample: baker images upscale j571abc123def\nExample: baker images upscale j571abc123def --max-wait 0 # fire-and-forget"
|
|
@@ -14808,7 +15006,7 @@ var upscaleCommand = defineCommand114({
|
|
|
14808
15006
|
});
|
|
14809
15007
|
|
|
14810
15008
|
// src/commands/images/use.ts
|
|
14811
|
-
import { defineCommand as
|
|
15009
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
14812
15010
|
registerSchema({
|
|
14813
15011
|
command: "images.use",
|
|
14814
15012
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -14824,7 +15022,7 @@ registerSchema({
|
|
|
14824
15022
|
}
|
|
14825
15023
|
});
|
|
14826
15024
|
var POLL_INTERVAL_MS4 = 1500;
|
|
14827
|
-
var useCommand =
|
|
15025
|
+
var useCommand = defineCommand117({
|
|
14828
15026
|
meta: {
|
|
14829
15027
|
name: "use",
|
|
14830
15028
|
description: "Sugar over `ingest`: download \u2192 store \u2192 wait until describe + embed complete \u2192 return ready library record.\n\nExample: baker images use https://cdn.example.com/hero.png --source uploaded"
|
|
@@ -14870,7 +15068,7 @@ var useCommand = defineCommand115({
|
|
|
14870
15068
|
});
|
|
14871
15069
|
|
|
14872
15070
|
// src/commands/images/index.ts
|
|
14873
|
-
var imagesCommand =
|
|
15071
|
+
var imagesCommand = defineCommand118({
|
|
14874
15072
|
meta: {
|
|
14875
15073
|
name: "images",
|
|
14876
15074
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -14940,10 +15138,10 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
14940
15138
|
});
|
|
14941
15139
|
|
|
14942
15140
|
// src/commands/research/index.ts
|
|
14943
|
-
import { defineCommand as
|
|
15141
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
14944
15142
|
|
|
14945
15143
|
// src/commands/research/advertisers.ts
|
|
14946
|
-
import { defineCommand as
|
|
15144
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
14947
15145
|
|
|
14948
15146
|
// src/commands/research/output.ts
|
|
14949
15147
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -15056,7 +15254,7 @@ var FIELDS3 = {
|
|
|
15056
15254
|
etv: "Estimated traffic value (USD)",
|
|
15057
15255
|
visibility: "SERP visibility score (0-1)"
|
|
15058
15256
|
};
|
|
15059
|
-
var advertisersCommand =
|
|
15257
|
+
var advertisersCommand = defineCommand119({
|
|
15060
15258
|
meta: {
|
|
15061
15259
|
name: "advertisers",
|
|
15062
15260
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -15103,7 +15301,7 @@ Examples:
|
|
|
15103
15301
|
});
|
|
15104
15302
|
|
|
15105
15303
|
// src/commands/research/autocomplete.ts
|
|
15106
|
-
import { defineCommand as
|
|
15304
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
15107
15305
|
registerSchema({
|
|
15108
15306
|
command: "research.autocomplete",
|
|
15109
15307
|
description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -15126,7 +15324,7 @@ registerSchema({
|
|
|
15126
15324
|
var FIELDS4 = {
|
|
15127
15325
|
suggestion: "Autocomplete suggestion from Google"
|
|
15128
15326
|
};
|
|
15129
|
-
var autocompleteCommand =
|
|
15327
|
+
var autocompleteCommand = defineCommand120({
|
|
15130
15328
|
meta: {
|
|
15131
15329
|
name: "autocomplete",
|
|
15132
15330
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -15172,7 +15370,7 @@ Examples:
|
|
|
15172
15370
|
});
|
|
15173
15371
|
|
|
15174
15372
|
// src/commands/research/countries.ts
|
|
15175
|
-
import { defineCommand as
|
|
15373
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
15176
15374
|
registerSchema({
|
|
15177
15375
|
command: "research.countries",
|
|
15178
15376
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -15229,7 +15427,7 @@ var FIELDS5 = {
|
|
|
15229
15427
|
code: "Country code to pass as --location",
|
|
15230
15428
|
name: "Country name"
|
|
15231
15429
|
};
|
|
15232
|
-
var countriesCommand =
|
|
15430
|
+
var countriesCommand = defineCommand121({
|
|
15233
15431
|
meta: {
|
|
15234
15432
|
name: "countries",
|
|
15235
15433
|
description: "List all supported country codes for --location flag."
|
|
@@ -15240,7 +15438,7 @@ var countriesCommand = defineCommand119({
|
|
|
15240
15438
|
});
|
|
15241
15439
|
|
|
15242
15440
|
// src/commands/research/intent.ts
|
|
15243
|
-
import { defineCommand as
|
|
15441
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
15244
15442
|
registerSchema({
|
|
15245
15443
|
command: "research.intent",
|
|
15246
15444
|
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
|
|
@@ -15263,7 +15461,7 @@ var FIELDS6 = {
|
|
|
15263
15461
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
15264
15462
|
probability: "Confidence score 0.0-1.0"
|
|
15265
15463
|
};
|
|
15266
|
-
var intentCommand =
|
|
15464
|
+
var intentCommand = defineCommand122({
|
|
15267
15465
|
meta: {
|
|
15268
15466
|
name: "intent",
|
|
15269
15467
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -15311,7 +15509,7 @@ Examples:
|
|
|
15311
15509
|
});
|
|
15312
15510
|
|
|
15313
15511
|
// src/commands/research/keyword-gap.ts
|
|
15314
|
-
import { defineCommand as
|
|
15512
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
15315
15513
|
registerSchema({
|
|
15316
15514
|
command: "research.keyword-gap",
|
|
15317
15515
|
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -15340,7 +15538,7 @@ var FIELDS7 = {
|
|
|
15340
15538
|
cpc: "Cost per click USD",
|
|
15341
15539
|
their_position: "Competitor's ranking position"
|
|
15342
15540
|
};
|
|
15343
|
-
var keywordGapCommand =
|
|
15541
|
+
var keywordGapCommand = defineCommand123({
|
|
15344
15542
|
meta: {
|
|
15345
15543
|
name: "keyword-gap",
|
|
15346
15544
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -15414,7 +15612,7 @@ Examples:
|
|
|
15414
15612
|
});
|
|
15415
15613
|
|
|
15416
15614
|
// src/commands/research/keywords-for-site.ts
|
|
15417
|
-
import { defineCommand as
|
|
15615
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
15418
15616
|
registerSchema({
|
|
15419
15617
|
command: "research.keywords-for-site",
|
|
15420
15618
|
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -15447,7 +15645,7 @@ var FIELDS8 = {
|
|
|
15447
15645
|
competition: "LOW, MEDIUM, or HIGH",
|
|
15448
15646
|
competition_index: "Competition score 0-100"
|
|
15449
15647
|
};
|
|
15450
|
-
var keywordsForSiteCommand =
|
|
15648
|
+
var keywordsForSiteCommand = defineCommand124({
|
|
15451
15649
|
meta: {
|
|
15452
15650
|
name: "keywords-for-site",
|
|
15453
15651
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -15500,7 +15698,7 @@ Examples:
|
|
|
15500
15698
|
});
|
|
15501
15699
|
|
|
15502
15700
|
// src/commands/research/languages.ts
|
|
15503
|
-
import { defineCommand as
|
|
15701
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
15504
15702
|
registerSchema({
|
|
15505
15703
|
command: "research.languages",
|
|
15506
15704
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -15530,7 +15728,7 @@ var FIELDS9 = {
|
|
|
15530
15728
|
code: "Language code to pass as --language",
|
|
15531
15729
|
name: "Language name (also accepted by --language)"
|
|
15532
15730
|
};
|
|
15533
|
-
var languagesCommand2 =
|
|
15731
|
+
var languagesCommand2 = defineCommand125({
|
|
15534
15732
|
meta: {
|
|
15535
15733
|
name: "languages",
|
|
15536
15734
|
description: "List all supported language codes for --language flag."
|
|
@@ -15541,7 +15739,7 @@ var languagesCommand2 = defineCommand123({
|
|
|
15541
15739
|
});
|
|
15542
15740
|
|
|
15543
15741
|
// src/commands/research/lighthouse.ts
|
|
15544
|
-
import { defineCommand as
|
|
15742
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
15545
15743
|
registerSchema({
|
|
15546
15744
|
command: "research.lighthouse",
|
|
15547
15745
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -15560,7 +15758,7 @@ var FIELDS10 = {
|
|
|
15560
15758
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
15561
15759
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
15562
15760
|
};
|
|
15563
|
-
var lighthouseCommand =
|
|
15761
|
+
var lighthouseCommand = defineCommand126({
|
|
15564
15762
|
meta: {
|
|
15565
15763
|
name: "lighthouse",
|
|
15566
15764
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -15598,7 +15796,7 @@ Examples:
|
|
|
15598
15796
|
});
|
|
15599
15797
|
|
|
15600
15798
|
// src/commands/research/relevant-pages.ts
|
|
15601
|
-
import { defineCommand as
|
|
15799
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
15602
15800
|
registerSchema({
|
|
15603
15801
|
command: "research.relevant-pages",
|
|
15604
15802
|
description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -15624,7 +15822,7 @@ var FIELDS11 = {
|
|
|
15624
15822
|
keywords: "Total organic keywords the page ranks for",
|
|
15625
15823
|
top_10: "Keywords in positions 1-10"
|
|
15626
15824
|
};
|
|
15627
|
-
var relevantPagesCommand =
|
|
15825
|
+
var relevantPagesCommand = defineCommand127({
|
|
15628
15826
|
meta: {
|
|
15629
15827
|
name: "relevant-pages",
|
|
15630
15828
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -15670,7 +15868,7 @@ Examples:
|
|
|
15670
15868
|
});
|
|
15671
15869
|
|
|
15672
15870
|
// src/commands/research/web.ts
|
|
15673
|
-
import { defineCommand as
|
|
15871
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
15674
15872
|
registerSchema({
|
|
15675
15873
|
command: "research.web",
|
|
15676
15874
|
description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
|
|
@@ -15721,7 +15919,7 @@ async function runDeepResearch(question) {
|
|
|
15721
15919
|
}
|
|
15722
15920
|
throw new Error("Deep research timed out");
|
|
15723
15921
|
}
|
|
15724
|
-
var webCommand =
|
|
15922
|
+
var webCommand = defineCommand128({
|
|
15725
15923
|
meta: {
|
|
15726
15924
|
name: "web",
|
|
15727
15925
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -15781,7 +15979,7 @@ Examples:
|
|
|
15781
15979
|
});
|
|
15782
15980
|
|
|
15783
15981
|
// src/commands/research/index.ts
|
|
15784
|
-
var researchCommand =
|
|
15982
|
+
var researchCommand = defineCommand129({
|
|
15785
15983
|
meta: {
|
|
15786
15984
|
name: "research",
|
|
15787
15985
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -15821,10 +16019,10 @@ Examples:
|
|
|
15821
16019
|
});
|
|
15822
16020
|
|
|
15823
16021
|
// src/commands/scheduled-actions/index.ts
|
|
15824
|
-
import { defineCommand as
|
|
16022
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
15825
16023
|
|
|
15826
16024
|
// src/commands/scheduled-actions/create.ts
|
|
15827
|
-
import { defineCommand as
|
|
16025
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
15828
16026
|
|
|
15829
16027
|
// src/commands/scheduled-actions/shared.ts
|
|
15830
16028
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -15929,7 +16127,7 @@ registerSchema({
|
|
|
15929
16127
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
15930
16128
|
}
|
|
15931
16129
|
});
|
|
15932
|
-
var createCommand2 =
|
|
16130
|
+
var createCommand2 = defineCommand130({
|
|
15933
16131
|
meta: {
|
|
15934
16132
|
name: "create",
|
|
15935
16133
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -15977,7 +16175,7 @@ var createCommand2 = defineCommand128({
|
|
|
15977
16175
|
});
|
|
15978
16176
|
|
|
15979
16177
|
// src/commands/scheduled-actions/delete.ts
|
|
15980
|
-
import { defineCommand as
|
|
16178
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
15981
16179
|
registerSchema({
|
|
15982
16180
|
command: "scheduled-actions.delete",
|
|
15983
16181
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -15985,7 +16183,7 @@ registerSchema({
|
|
|
15985
16183
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
15986
16184
|
}
|
|
15987
16185
|
});
|
|
15988
|
-
var deleteCommand2 =
|
|
16186
|
+
var deleteCommand2 = defineCommand131({
|
|
15989
16187
|
meta: {
|
|
15990
16188
|
name: "delete",
|
|
15991
16189
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -16014,7 +16212,7 @@ var deleteCommand2 = defineCommand129({
|
|
|
16014
16212
|
});
|
|
16015
16213
|
|
|
16016
16214
|
// src/commands/scheduled-actions/get.ts
|
|
16017
|
-
import { defineCommand as
|
|
16215
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
16018
16216
|
registerSchema({
|
|
16019
16217
|
command: "scheduled-actions.get",
|
|
16020
16218
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -16022,7 +16220,7 @@ registerSchema({
|
|
|
16022
16220
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
16023
16221
|
}
|
|
16024
16222
|
});
|
|
16025
|
-
var getCommand3 =
|
|
16223
|
+
var getCommand3 = defineCommand132({
|
|
16026
16224
|
meta: {
|
|
16027
16225
|
name: "get",
|
|
16028
16226
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -16059,13 +16257,13 @@ var getCommand3 = defineCommand130({
|
|
|
16059
16257
|
});
|
|
16060
16258
|
|
|
16061
16259
|
// src/commands/scheduled-actions/list.ts
|
|
16062
|
-
import { defineCommand as
|
|
16260
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
16063
16261
|
registerSchema({
|
|
16064
16262
|
command: "scheduled-actions.list",
|
|
16065
16263
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
16066
16264
|
args: {}
|
|
16067
16265
|
});
|
|
16068
|
-
var listCommand3 =
|
|
16266
|
+
var listCommand3 = defineCommand133({
|
|
16069
16267
|
meta: {
|
|
16070
16268
|
name: "list",
|
|
16071
16269
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -16086,7 +16284,7 @@ var listCommand3 = defineCommand131({
|
|
|
16086
16284
|
});
|
|
16087
16285
|
|
|
16088
16286
|
// src/commands/scheduled-actions/trigger.ts
|
|
16089
|
-
import { defineCommand as
|
|
16287
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
16090
16288
|
registerSchema({
|
|
16091
16289
|
command: "scheduled-actions.trigger",
|
|
16092
16290
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -16094,7 +16292,7 @@ registerSchema({
|
|
|
16094
16292
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
16095
16293
|
}
|
|
16096
16294
|
});
|
|
16097
|
-
var triggerCommand =
|
|
16295
|
+
var triggerCommand = defineCommand134({
|
|
16098
16296
|
meta: {
|
|
16099
16297
|
name: "trigger",
|
|
16100
16298
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -16131,7 +16329,7 @@ var triggerCommand = defineCommand132({
|
|
|
16131
16329
|
});
|
|
16132
16330
|
|
|
16133
16331
|
// src/commands/scheduled-actions/update.ts
|
|
16134
|
-
import { defineCommand as
|
|
16332
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
16135
16333
|
registerSchema({
|
|
16136
16334
|
command: "scheduled-actions.update",
|
|
16137
16335
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -16156,7 +16354,7 @@ registerSchema({
|
|
|
16156
16354
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
16157
16355
|
}
|
|
16158
16356
|
});
|
|
16159
|
-
var updateCommand2 =
|
|
16357
|
+
var updateCommand2 = defineCommand135({
|
|
16160
16358
|
meta: {
|
|
16161
16359
|
name: "update",
|
|
16162
16360
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -16226,7 +16424,7 @@ var updateCommand2 = defineCommand133({
|
|
|
16226
16424
|
});
|
|
16227
16425
|
|
|
16228
16426
|
// src/commands/scheduled-actions/index.ts
|
|
16229
|
-
var scheduledActionsCommand =
|
|
16427
|
+
var scheduledActionsCommand = defineCommand136({
|
|
16230
16428
|
meta: {
|
|
16231
16429
|
name: "scheduled-actions",
|
|
16232
16430
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -16252,8 +16450,8 @@ Examples:
|
|
|
16252
16450
|
});
|
|
16253
16451
|
|
|
16254
16452
|
// src/commands/schema.ts
|
|
16255
|
-
import { defineCommand as
|
|
16256
|
-
var schemaCommand =
|
|
16453
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
16454
|
+
var schemaCommand = defineCommand137({
|
|
16257
16455
|
meta: {
|
|
16258
16456
|
name: "schema",
|
|
16259
16457
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -16289,10 +16487,10 @@ var schemaCommand = defineCommand135({
|
|
|
16289
16487
|
});
|
|
16290
16488
|
|
|
16291
16489
|
// src/commands/testimonials/index.ts
|
|
16292
|
-
import { defineCommand as
|
|
16490
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
16293
16491
|
|
|
16294
16492
|
// src/commands/testimonials/get.ts
|
|
16295
|
-
import { defineCommand as
|
|
16493
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
16296
16494
|
registerSchema({
|
|
16297
16495
|
command: "testimonials.get",
|
|
16298
16496
|
description: "Get a single testimonial by ID",
|
|
@@ -16300,7 +16498,7 @@ registerSchema({
|
|
|
16300
16498
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
16301
16499
|
}
|
|
16302
16500
|
});
|
|
16303
|
-
var getCommand4 =
|
|
16501
|
+
var getCommand4 = defineCommand138({
|
|
16304
16502
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
16305
16503
|
args: {
|
|
16306
16504
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -16337,7 +16535,7 @@ var getCommand4 = defineCommand136({
|
|
|
16337
16535
|
});
|
|
16338
16536
|
|
|
16339
16537
|
// src/commands/testimonials/list.ts
|
|
16340
|
-
import { defineCommand as
|
|
16538
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
16341
16539
|
registerSchema({
|
|
16342
16540
|
command: "testimonials.list",
|
|
16343
16541
|
description: "List testimonials with optional filters.",
|
|
@@ -16367,7 +16565,7 @@ registerSchema({
|
|
|
16367
16565
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
16368
16566
|
}
|
|
16369
16567
|
});
|
|
16370
|
-
var listCommand4 =
|
|
16568
|
+
var listCommand4 = defineCommand139({
|
|
16371
16569
|
meta: {
|
|
16372
16570
|
name: "list",
|
|
16373
16571
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -16416,7 +16614,7 @@ var listCommand4 = defineCommand137({
|
|
|
16416
16614
|
});
|
|
16417
16615
|
|
|
16418
16616
|
// src/commands/testimonials/search.ts
|
|
16419
|
-
import { defineCommand as
|
|
16617
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
16420
16618
|
registerSchema({
|
|
16421
16619
|
command: "testimonials.search",
|
|
16422
16620
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -16447,7 +16645,7 @@ registerSchema({
|
|
|
16447
16645
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
16448
16646
|
}
|
|
16449
16647
|
});
|
|
16450
|
-
var searchCommand2 =
|
|
16648
|
+
var searchCommand2 = defineCommand140({
|
|
16451
16649
|
meta: {
|
|
16452
16650
|
name: "search",
|
|
16453
16651
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -16521,7 +16719,7 @@ var searchCommand2 = defineCommand138({
|
|
|
16521
16719
|
var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
16522
16720
|
|
|
16523
16721
|
// src/commands/testimonials/index.ts
|
|
16524
|
-
var testimonialsCommand =
|
|
16722
|
+
var testimonialsCommand = defineCommand141({
|
|
16525
16723
|
meta: {
|
|
16526
16724
|
name: "testimonials",
|
|
16527
16725
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -16542,10 +16740,10 @@ Examples:
|
|
|
16542
16740
|
});
|
|
16543
16741
|
|
|
16544
16742
|
// src/commands/videos/index.ts
|
|
16545
|
-
import { defineCommand as
|
|
16743
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
16546
16744
|
|
|
16547
16745
|
// src/commands/videos/delete.ts
|
|
16548
|
-
import { defineCommand as
|
|
16746
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
16549
16747
|
registerSchema({
|
|
16550
16748
|
command: "videos.delete",
|
|
16551
16749
|
description: "Delete a video by ID",
|
|
@@ -16559,7 +16757,7 @@ registerSchema({
|
|
|
16559
16757
|
}
|
|
16560
16758
|
}
|
|
16561
16759
|
});
|
|
16562
|
-
var deleteCommand3 =
|
|
16760
|
+
var deleteCommand3 = defineCommand142({
|
|
16563
16761
|
meta: {
|
|
16564
16762
|
name: "delete",
|
|
16565
16763
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -16600,7 +16798,7 @@ var deleteCommand3 = defineCommand140({
|
|
|
16600
16798
|
});
|
|
16601
16799
|
|
|
16602
16800
|
// src/commands/videos/get.ts
|
|
16603
|
-
import { defineCommand as
|
|
16801
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
16604
16802
|
registerSchema({
|
|
16605
16803
|
command: "videos.get",
|
|
16606
16804
|
description: "Get a single video by ID",
|
|
@@ -16608,7 +16806,7 @@ registerSchema({
|
|
|
16608
16806
|
id: { type: "string", description: "Video ID", required: true }
|
|
16609
16807
|
}
|
|
16610
16808
|
});
|
|
16611
|
-
var getCommand5 =
|
|
16809
|
+
var getCommand5 = defineCommand143({
|
|
16612
16810
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
16613
16811
|
args: {
|
|
16614
16812
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -16645,7 +16843,7 @@ var getCommand5 = defineCommand141({
|
|
|
16645
16843
|
});
|
|
16646
16844
|
|
|
16647
16845
|
// src/commands/videos/search.ts
|
|
16648
|
-
import { defineCommand as
|
|
16846
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
16649
16847
|
registerSchema({
|
|
16650
16848
|
command: "videos.search",
|
|
16651
16849
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -16655,7 +16853,7 @@ registerSchema({
|
|
|
16655
16853
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
16656
16854
|
}
|
|
16657
16855
|
});
|
|
16658
|
-
var searchCommand3 =
|
|
16856
|
+
var searchCommand3 = defineCommand144({
|
|
16659
16857
|
meta: {
|
|
16660
16858
|
name: "search",
|
|
16661
16859
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -16705,9 +16903,9 @@ var searchCommand3 = defineCommand142({
|
|
|
16705
16903
|
var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
16706
16904
|
|
|
16707
16905
|
// src/commands/videos/upload.ts
|
|
16708
|
-
import { readFile as
|
|
16709
|
-
import { extname as
|
|
16710
|
-
import { defineCommand as
|
|
16906
|
+
import { readFile as readFile11, stat as stat3 } from "fs/promises";
|
|
16907
|
+
import { extname as extname4 } from "path";
|
|
16908
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
16711
16909
|
var MIME_MAP2 = {
|
|
16712
16910
|
".mp4": "video/mp4",
|
|
16713
16911
|
".mov": "video/quicktime",
|
|
@@ -16734,14 +16932,14 @@ registerSchema({
|
|
|
16734
16932
|
}
|
|
16735
16933
|
});
|
|
16736
16934
|
function detectContentType2(filePath) {
|
|
16737
|
-
const ext =
|
|
16935
|
+
const ext = extname4(filePath).toLowerCase();
|
|
16738
16936
|
const mime = MIME_MAP2[ext];
|
|
16739
16937
|
if (!mime) {
|
|
16740
16938
|
throw new ApiError("VALIDATION_ERROR", `Cannot detect content type for extension "${ext}". Use --content-type.`);
|
|
16741
16939
|
}
|
|
16742
16940
|
return mime;
|
|
16743
16941
|
}
|
|
16744
|
-
var uploadCommand2 =
|
|
16942
|
+
var uploadCommand2 = defineCommand145({
|
|
16745
16943
|
meta: {
|
|
16746
16944
|
name: "upload",
|
|
16747
16945
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -16770,7 +16968,7 @@ var uploadCommand2 = defineCommand143({
|
|
|
16770
16968
|
return;
|
|
16771
16969
|
}
|
|
16772
16970
|
const { uploadUrl, videoId } = await apiPost("/api/videos/upload", {});
|
|
16773
|
-
const fileBuffer = await
|
|
16971
|
+
const fileBuffer = await readFile11(filePath);
|
|
16774
16972
|
const uploadResponse = await fetch(uploadUrl, {
|
|
16775
16973
|
method: "PUT",
|
|
16776
16974
|
headers: { "Content-Type": contentType },
|
|
@@ -16795,7 +16993,7 @@ var uploadCommand2 = defineCommand143({
|
|
|
16795
16993
|
});
|
|
16796
16994
|
|
|
16797
16995
|
// src/commands/videos/index.ts
|
|
16798
|
-
var videosCommand =
|
|
16996
|
+
var videosCommand = defineCommand146({
|
|
16799
16997
|
meta: {
|
|
16800
16998
|
name: "videos",
|
|
16801
16999
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -16818,10 +17016,10 @@ Examples:
|
|
|
16818
17016
|
});
|
|
16819
17017
|
|
|
16820
17018
|
// src/commands/winning-ads/index.ts
|
|
16821
|
-
import { defineCommand as
|
|
17019
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
16822
17020
|
|
|
16823
17021
|
// src/commands/winning-ads/advertisers.ts
|
|
16824
|
-
import { defineCommand as
|
|
17022
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
16825
17023
|
registerSchema({
|
|
16826
17024
|
command: "winning-ads.advertisers",
|
|
16827
17025
|
description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
|
|
@@ -16834,7 +17032,7 @@ registerSchema({
|
|
|
16834
17032
|
function identity(record) {
|
|
16835
17033
|
return record;
|
|
16836
17034
|
}
|
|
16837
|
-
var advertisersCommand2 =
|
|
17035
|
+
var advertisersCommand2 = defineCommand147({
|
|
16838
17036
|
meta: {
|
|
16839
17037
|
name: "advertisers",
|
|
16840
17038
|
description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
|
|
@@ -16885,7 +17083,7 @@ var advertisersCommand2 = defineCommand145({
|
|
|
16885
17083
|
});
|
|
16886
17084
|
|
|
16887
17085
|
// src/commands/winning-ads/search.ts
|
|
16888
|
-
import { defineCommand as
|
|
17086
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
16889
17087
|
registerSchema({
|
|
16890
17088
|
command: "winning-ads.search",
|
|
16891
17089
|
description: "Search the ad-dna corpus of scored winning ads. Returns a lean shortlist (advertiser, summary, scores, media_url) to pick a reference to reproduce.",
|
|
@@ -16993,7 +17191,7 @@ function buildSearchBody(args) {
|
|
|
16993
17191
|
}
|
|
16994
17192
|
return body;
|
|
16995
17193
|
}
|
|
16996
|
-
var searchCommand4 =
|
|
17194
|
+
var searchCommand4 = defineCommand148({
|
|
16997
17195
|
meta: {
|
|
16998
17196
|
name: "search",
|
|
16999
17197
|
description: "Search winning reference ads. Example: baker winning-ads search 'B2B SaaS before/after AI automation' --platform meta --format static --winner-category winner --exclude-advertiser adv_123 --output md"
|
|
@@ -17105,7 +17303,7 @@ var searchCommand4 = defineCommand146({
|
|
|
17105
17303
|
});
|
|
17106
17304
|
|
|
17107
17305
|
// src/commands/winning-ads/index.ts
|
|
17108
|
-
var winningAdsCommand =
|
|
17306
|
+
var winningAdsCommand = defineCommand149({
|
|
17109
17307
|
meta: {
|
|
17110
17308
|
name: "winning-ads",
|
|
17111
17309
|
description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
|
|
@@ -17145,7 +17343,7 @@ function getCliVersion() {
|
|
|
17145
17343
|
}
|
|
17146
17344
|
|
|
17147
17345
|
// src/cli.ts
|
|
17148
|
-
var main =
|
|
17346
|
+
var main = defineCommand150({
|
|
17149
17347
|
meta: {
|
|
17150
17348
|
name: "baker",
|
|
17151
17349
|
version: getCliVersion(),
|
|
@@ -17164,6 +17362,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
17164
17362
|
ga4: ga4Command,
|
|
17165
17363
|
gsc: gscCommand,
|
|
17166
17364
|
research: researchCommand,
|
|
17365
|
+
creatives: creativesCommand3,
|
|
17167
17366
|
images: imagesCommand,
|
|
17168
17367
|
videos: videosCommand,
|
|
17169
17368
|
testimonials: testimonialsCommand,
|