@koda-sl/baker-cli 0.95.1 → 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 +11 -3
- package/dist/{chunk-RCPMJKI7.js → chunk-7HSLFPZI.js} +4 -4
- package/dist/chunk-7HSLFPZI.js.map +1 -0
- package/dist/cli.js +663 -310
- 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,13 +9,13 @@ 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
|
-
import { defineCommand as
|
|
18
|
+
import { defineCommand as defineCommand17 } from "citty";
|
|
19
19
|
|
|
20
20
|
// src/commands/actions/claim.ts
|
|
21
21
|
import { defineCommand } from "citty";
|
|
@@ -465,6 +465,13 @@ function generateTempId() {
|
|
|
465
465
|
function isTempId(id) {
|
|
466
466
|
return id.startsWith("temp_");
|
|
467
467
|
}
|
|
468
|
+
function parseTagList(value) {
|
|
469
|
+
if (typeof value !== "string") {
|
|
470
|
+
return void 0;
|
|
471
|
+
}
|
|
472
|
+
const tags = value.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
|
|
473
|
+
return [...new Set(tags)];
|
|
474
|
+
}
|
|
468
475
|
var SCHEDULE_SIGNALS = [
|
|
469
476
|
/\brecurr(?:ing|ence)\b/i,
|
|
470
477
|
/\bcadence\b/i,
|
|
@@ -476,6 +483,33 @@ var SCHEDULE_SIGNALS = [
|
|
|
476
483
|
/\bremind(?:er|s)?\b/i,
|
|
477
484
|
/\brun\s+at\b/i
|
|
478
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
|
+
}
|
|
479
513
|
function looksScheduled(name, description) {
|
|
480
514
|
const haystack = `${name}
|
|
481
515
|
${description}`;
|
|
@@ -563,7 +597,7 @@ var completeCommand = defineCommand2({
|
|
|
563
597
|
import { defineCommand as defineCommand3 } from "citty";
|
|
564
598
|
registerSchema({
|
|
565
599
|
command: "actions.create",
|
|
566
|
-
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. After creating, check if this action blocks or is blocked by other actions and wire dependencies with `baker actions link`.",
|
|
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`.",
|
|
567
601
|
args: {
|
|
568
602
|
name: { type: "string", description: "Action name (short, action-verb, \u22646 words)", required: true },
|
|
569
603
|
description: {
|
|
@@ -571,6 +605,16 @@ registerSchema({
|
|
|
571
605
|
description: "Context-complete description: what / why / where / done-when",
|
|
572
606
|
required: false
|
|
573
607
|
},
|
|
608
|
+
tags: {
|
|
609
|
+
type: "string",
|
|
610
|
+
description: "Comma-separated tag slugs (e.g. google-ads,audit-finding). Must be known \u2014 see `baker actions tags list`.",
|
|
611
|
+
required: false
|
|
612
|
+
},
|
|
613
|
+
priority: {
|
|
614
|
+
type: "string",
|
|
615
|
+
description: `User priority for the do-first ordering. One of: ${ACTION_PRIORITIES.join(", ")}.`,
|
|
616
|
+
required: false
|
|
617
|
+
},
|
|
574
618
|
"temp-id": { type: "string", description: "Custom tempId (auto-generated if omitted)", required: false }
|
|
575
619
|
}
|
|
576
620
|
});
|
|
@@ -582,6 +626,8 @@ var createCommand = defineCommand3({
|
|
|
582
626
|
args: {
|
|
583
627
|
name: { type: "string", description: "Action name", required: false },
|
|
584
628
|
description: { type: "string", description: "Description", required: false, default: "" },
|
|
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 },
|
|
585
631
|
"temp-id": { type: "string", description: "Optional custom tempId", required: false }
|
|
586
632
|
},
|
|
587
633
|
run: async ({ args }) => {
|
|
@@ -592,11 +638,15 @@ var createCommand = defineCommand3({
|
|
|
592
638
|
}
|
|
593
639
|
const chatId = requireChatId();
|
|
594
640
|
const tempId = args["temp-id"] || generateTempId();
|
|
641
|
+
const tags = parseTagList(args.tags);
|
|
642
|
+
const priority = parsePriority(args.priority, { allowClear: false });
|
|
595
643
|
const response = await apiPost("/api/actions/create", {
|
|
596
644
|
chatId,
|
|
597
645
|
tempId,
|
|
598
646
|
name,
|
|
599
|
-
description: args.description ?? ""
|
|
647
|
+
description: args.description ?? "",
|
|
648
|
+
...tags ? { tags } : {},
|
|
649
|
+
...priority !== void 0 && priority !== null ? { priority } : {}
|
|
600
650
|
});
|
|
601
651
|
const hints = [];
|
|
602
652
|
if (looksScheduled(name, args.description ?? "")) {
|
|
@@ -608,6 +658,16 @@ var createCommand = defineCommand3({
|
|
|
608
658
|
if (!args.description) {
|
|
609
659
|
hints.push("Add description: baker actions update <tempId> --description '...' (what/why/where/done-when)");
|
|
610
660
|
}
|
|
661
|
+
if (!tags || tags.length === 0) {
|
|
662
|
+
hints.push(
|
|
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>\`.`
|
|
669
|
+
);
|
|
670
|
+
}
|
|
611
671
|
writeJson({ ...response, hints });
|
|
612
672
|
} catch (err) {
|
|
613
673
|
failApi(err);
|
|
@@ -972,8 +1032,132 @@ var statusCommand = defineCommand10({
|
|
|
972
1032
|
}
|
|
973
1033
|
});
|
|
974
1034
|
|
|
975
|
-
// src/commands/actions/
|
|
1035
|
+
// src/commands/actions/tags/index.ts
|
|
1036
|
+
import { defineCommand as defineCommand14 } from "citty";
|
|
1037
|
+
|
|
1038
|
+
// src/commands/actions/tags/create.ts
|
|
976
1039
|
import { defineCommand as defineCommand11 } from "citty";
|
|
1040
|
+
registerSchema({
|
|
1041
|
+
command: "actions.tags.create",
|
|
1042
|
+
description: "Create a company custom action tag, minting a new slug usable with --tags. The name is slugified (lowercased, spaces\u2192hyphens). Use when no existing tag fits the work.",
|
|
1043
|
+
args: {
|
|
1044
|
+
slug: { type: "string", description: "Tag name/slug (e.g. pmax, retargeting)", required: true },
|
|
1045
|
+
description: { type: "string", description: "What this tag means", required: false }
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
var tagsCreateCommand = defineCommand11({
|
|
1049
|
+
meta: {
|
|
1050
|
+
name: "create",
|
|
1051
|
+
description: 'Create a custom action tag. Example: baker actions tags create --slug pmax --description "Performance Max work"'
|
|
1052
|
+
},
|
|
1053
|
+
args: {
|
|
1054
|
+
slug: { type: "string", description: "Tag name/slug", required: false },
|
|
1055
|
+
description: { type: "string", description: "Description", required: false }
|
|
1056
|
+
},
|
|
1057
|
+
run: async ({ args }) => {
|
|
1058
|
+
try {
|
|
1059
|
+
const slug = args.slug;
|
|
1060
|
+
if (!slug || slug.trim().length === 0) {
|
|
1061
|
+
failValidation("--slug is required.");
|
|
1062
|
+
}
|
|
1063
|
+
const response = await apiPost("/api/actions/tags/create", {
|
|
1064
|
+
name: slug,
|
|
1065
|
+
description: args.description
|
|
1066
|
+
});
|
|
1067
|
+
writeOk(response.data);
|
|
1068
|
+
} catch (err) {
|
|
1069
|
+
failApi(err);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1074
|
+
// src/commands/actions/tags/delete.ts
|
|
1075
|
+
import { defineCommand as defineCommand12 } from "citty";
|
|
1076
|
+
registerSchema({
|
|
1077
|
+
command: "actions.tags.delete",
|
|
1078
|
+
description: "Delete a company custom action tag by slug. Built-in default tags cannot be deleted. Existing actions keep the slug (it just stops appearing in the taxonomy).",
|
|
1079
|
+
args: {
|
|
1080
|
+
slug: { type: "string", description: "Custom tag slug to delete", required: true }
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
1083
|
+
var tagsDeleteCommand = defineCommand12({
|
|
1084
|
+
meta: {
|
|
1085
|
+
name: "delete",
|
|
1086
|
+
description: "Delete a custom action tag. Example: baker actions tags delete --slug pmax"
|
|
1087
|
+
},
|
|
1088
|
+
args: {
|
|
1089
|
+
slug: { type: "string", description: "Custom tag slug", required: false }
|
|
1090
|
+
},
|
|
1091
|
+
run: async ({ args }) => {
|
|
1092
|
+
try {
|
|
1093
|
+
const slug = args.slug;
|
|
1094
|
+
if (!slug || slug.trim().length === 0) {
|
|
1095
|
+
failValidation("--slug is required.");
|
|
1096
|
+
}
|
|
1097
|
+
await apiPost("/api/actions/tags/delete", { name: slug });
|
|
1098
|
+
writeOk();
|
|
1099
|
+
} catch (err) {
|
|
1100
|
+
failApi(err);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
|
|
1105
|
+
// src/commands/actions/tags/list.ts
|
|
1106
|
+
import { defineCommand as defineCommand13 } from "citty";
|
|
1107
|
+
registerSchema({
|
|
1108
|
+
command: "actions.tags.list",
|
|
1109
|
+
description: "List the available action tag taxonomy (built-in defaults + this company's custom tags). Tags are strict \u2014 only these names are accepted by --tags. Run before tagging.",
|
|
1110
|
+
args: { output: { type: "string", description: "Output format: md|json", required: false, default: "md" } }
|
|
1111
|
+
});
|
|
1112
|
+
var tagsListCommand = defineCommand13({
|
|
1113
|
+
meta: {
|
|
1114
|
+
name: "list",
|
|
1115
|
+
description: "List available action tag names (defaults + company custom tags). Use before --tags. Example: baker actions tags list"
|
|
1116
|
+
},
|
|
1117
|
+
args: { output: { type: "string", description: "Output format: md|json", required: false, default: "md" } },
|
|
1118
|
+
run: async ({ args }) => {
|
|
1119
|
+
try {
|
|
1120
|
+
const { markdown } = await apiGet("/api/actions/tags");
|
|
1121
|
+
if (args.output === "json") {
|
|
1122
|
+
writeJson({ ok: true, data: { markdown } });
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
process.stdout.write(`${markdown.trimEnd()}
|
|
1126
|
+
`);
|
|
1127
|
+
} catch (err) {
|
|
1128
|
+
const code = err instanceof ApiError ? err.code : "INTERNAL_ERROR";
|
|
1129
|
+
const message = err instanceof ApiError ? err.message : "Unexpected error";
|
|
1130
|
+
if (args.output === "json") {
|
|
1131
|
+
writeJson({ ok: false, error: { code, message } });
|
|
1132
|
+
} else {
|
|
1133
|
+
process.stderr.write(`Error: ${message}
|
|
1134
|
+
`);
|
|
1135
|
+
}
|
|
1136
|
+
process.exit(1);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
// src/commands/actions/tags/index.ts
|
|
1142
|
+
var tagsCommand = defineCommand14({
|
|
1143
|
+
meta: {
|
|
1144
|
+
name: "tags",
|
|
1145
|
+
description: `Manage the action tag taxonomy (built-in defaults + company custom tags). Tags are strict \u2014 only listed names work with --tags on create/update.
|
|
1146
|
+
|
|
1147
|
+
Examples:
|
|
1148
|
+
baker actions tags list # available tags (defaults + custom)
|
|
1149
|
+
baker actions tags create --slug pmax --description "\u2026" # mint a custom tag
|
|
1150
|
+
baker actions tags delete --slug pmax # remove a custom tag`
|
|
1151
|
+
},
|
|
1152
|
+
subCommands: {
|
|
1153
|
+
list: tagsListCommand,
|
|
1154
|
+
create: tagsCreateCommand,
|
|
1155
|
+
delete: tagsDeleteCommand
|
|
1156
|
+
}
|
|
1157
|
+
});
|
|
1158
|
+
|
|
1159
|
+
// src/commands/actions/unlink.ts
|
|
1160
|
+
import { defineCommand as defineCommand15 } from "citty";
|
|
977
1161
|
registerSchema({
|
|
978
1162
|
command: "actions.unlink",
|
|
979
1163
|
description: "Stage removal of a 'blocker -> blocked' dependency. The blocked action must be claimed by current chat.",
|
|
@@ -982,7 +1166,7 @@ registerSchema({
|
|
|
982
1166
|
blocked: { type: "string", description: "Blocked action ID (must be claimed by current chat)", required: true }
|
|
983
1167
|
}
|
|
984
1168
|
});
|
|
985
|
-
var unlinkCommand =
|
|
1169
|
+
var unlinkCommand = defineCommand15({
|
|
986
1170
|
meta: {
|
|
987
1171
|
name: "unlink",
|
|
988
1172
|
description: "Stage removal of a dependency. Example: baker actions unlink --blocker <id> --blocked <id>"
|
|
@@ -1014,17 +1198,27 @@ var unlinkCommand = defineCommand11({
|
|
|
1014
1198
|
});
|
|
1015
1199
|
|
|
1016
1200
|
// src/commands/actions/update.ts
|
|
1017
|
-
import { defineCommand as
|
|
1201
|
+
import { defineCommand as defineCommand16 } from "citty";
|
|
1018
1202
|
registerSchema({
|
|
1019
1203
|
command: "actions.update",
|
|
1020
|
-
description: "Stage an update on a claimed action (name 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).",
|
|
1021
1205
|
args: {
|
|
1022
1206
|
id: { type: "string", description: "Action ID (must be claimed by current chat)", required: true },
|
|
1023
1207
|
name: { type: "string", description: "New name", required: false },
|
|
1024
|
-
description: { type: "string", description: "New description", required: false }
|
|
1208
|
+
description: { type: "string", description: "New description", required: false },
|
|
1209
|
+
tags: {
|
|
1210
|
+
type: "string",
|
|
1211
|
+
description: "Comma-separated tag slugs \u2014 REPLACES existing tags ('' clears)",
|
|
1212
|
+
required: false
|
|
1213
|
+
},
|
|
1214
|
+
priority: {
|
|
1215
|
+
type: "string",
|
|
1216
|
+
description: `User priority: ${ACTION_PRIORITIES.join("|")}, or 'none' to clear.`,
|
|
1217
|
+
required: false
|
|
1218
|
+
}
|
|
1025
1219
|
}
|
|
1026
1220
|
});
|
|
1027
|
-
var updateCommand =
|
|
1221
|
+
var updateCommand = defineCommand16({
|
|
1028
1222
|
meta: {
|
|
1029
1223
|
name: "update",
|
|
1030
1224
|
description: 'Stage an update on a claimed action. Example: baker actions update <id> --name "New name"'
|
|
@@ -1033,7 +1227,9 @@ var updateCommand = defineCommand12({
|
|
|
1033
1227
|
id: { type: "positional", description: "Action ID", required: false },
|
|
1034
1228
|
"action-id": { type: "string", description: "Action ID", required: false },
|
|
1035
1229
|
name: { type: "string", description: "New name", required: false },
|
|
1036
|
-
description: { type: "string", description: "New description", required: false }
|
|
1230
|
+
description: { type: "string", description: "New description", 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 }
|
|
1037
1233
|
},
|
|
1038
1234
|
run: async ({ args }) => {
|
|
1039
1235
|
try {
|
|
@@ -1042,15 +1238,19 @@ var updateCommand = defineCommand12({
|
|
|
1042
1238
|
failValidation("Action ID is required.");
|
|
1043
1239
|
}
|
|
1044
1240
|
validateConvexId(id);
|
|
1045
|
-
|
|
1046
|
-
|
|
1241
|
+
const tags = parseTagList(args.tags);
|
|
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.");
|
|
1047
1245
|
}
|
|
1048
1246
|
const chatId = requireChatId();
|
|
1049
1247
|
await apiPost("/api/actions/update", {
|
|
1050
1248
|
chatId,
|
|
1051
1249
|
actionId: id,
|
|
1052
1250
|
name: args.name,
|
|
1053
|
-
description: args.description
|
|
1251
|
+
description: args.description,
|
|
1252
|
+
...tags !== void 0 ? { tags } : {},
|
|
1253
|
+
...priority !== void 0 ? { priority } : {}
|
|
1054
1254
|
});
|
|
1055
1255
|
writeOk();
|
|
1056
1256
|
} catch (err) {
|
|
@@ -1060,7 +1260,7 @@ var updateCommand = defineCommand12({
|
|
|
1060
1260
|
});
|
|
1061
1261
|
|
|
1062
1262
|
// src/commands/actions/index.ts
|
|
1063
|
-
var actionsCommand =
|
|
1263
|
+
var actionsCommand = defineCommand17({
|
|
1064
1264
|
meta: {
|
|
1065
1265
|
name: "actions",
|
|
1066
1266
|
description: `Manage action items for the current chat. Subcommands: list, draft, get, status, claim, release, create, update, complete, discard, link, unlink.
|
|
@@ -1075,8 +1275,9 @@ Examples:
|
|
|
1075
1275
|
baker actions draft remove temp_hero # drop a staged create (cascades its complete/link ops)
|
|
1076
1276
|
baker actions draft clear # drop everything staged in this chat
|
|
1077
1277
|
baker actions status temp_hero jx123 # batch resolve real IDs and temp_* refs
|
|
1278
|
+
baker actions tags list # available tags (defaults + company custom)
|
|
1078
1279
|
baker actions claim <id>
|
|
1079
|
-
baker actions create --name "Build hero" --description "..."
|
|
1280
|
+
baker actions create --name "Build hero" --tags landing,creative --description "..."
|
|
1080
1281
|
baker actions complete <id>
|
|
1081
1282
|
baker actions discard <id> --reason "obsolete"`
|
|
1082
1283
|
},
|
|
@@ -1092,18 +1293,19 @@ Examples:
|
|
|
1092
1293
|
complete: completeCommand,
|
|
1093
1294
|
discard: discardCommand,
|
|
1094
1295
|
link: linkCommand,
|
|
1095
|
-
unlink: unlinkCommand
|
|
1296
|
+
unlink: unlinkCommand,
|
|
1297
|
+
tags: tagsCommand
|
|
1096
1298
|
}
|
|
1097
1299
|
});
|
|
1098
1300
|
|
|
1099
1301
|
// src/commands/ads/index.ts
|
|
1100
|
-
import { defineCommand as
|
|
1302
|
+
import { defineCommand as defineCommand77 } from "citty";
|
|
1101
1303
|
|
|
1102
1304
|
// src/commands/ads/google/index.ts
|
|
1103
|
-
import { defineCommand as
|
|
1305
|
+
import { defineCommand as defineCommand28 } from "citty";
|
|
1104
1306
|
|
|
1105
1307
|
// src/commands/ads/google/accounts.ts
|
|
1106
|
-
import { defineCommand as
|
|
1308
|
+
import { defineCommand as defineCommand18 } from "citty";
|
|
1107
1309
|
|
|
1108
1310
|
// src/commands/ads/cache.ts
|
|
1109
1311
|
import { createHash } from "crypto";
|
|
@@ -1379,7 +1581,7 @@ function handleAccountsError(err) {
|
|
|
1379
1581
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
1380
1582
|
process.exit(1);
|
|
1381
1583
|
}
|
|
1382
|
-
var accountsCommand =
|
|
1584
|
+
var accountsCommand = defineCommand18({
|
|
1383
1585
|
meta: {
|
|
1384
1586
|
name: "accounts",
|
|
1385
1587
|
description: `List accessible Google Ads accounts. Returns customer IDs needed for all other commands.
|
|
@@ -1419,7 +1621,7 @@ Examples:
|
|
|
1419
1621
|
});
|
|
1420
1622
|
|
|
1421
1623
|
// src/commands/ads/google/changes.ts
|
|
1422
|
-
import { defineCommand as
|
|
1624
|
+
import { defineCommand as defineCommand19 } from "citty";
|
|
1423
1625
|
|
|
1424
1626
|
// src/commands/ads/field-descriptions.ts
|
|
1425
1627
|
var FIELD_DESCRIPTIONS = {
|
|
@@ -1971,7 +2173,7 @@ registerSchema({
|
|
|
1971
2173
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
1972
2174
|
}
|
|
1973
2175
|
});
|
|
1974
|
-
var changesCommand =
|
|
2176
|
+
var changesCommand = defineCommand19({
|
|
1975
2177
|
meta: {
|
|
1976
2178
|
name: "changes",
|
|
1977
2179
|
description: `Get recent changes in a Google Ads account with performance data.
|
|
@@ -2022,7 +2224,7 @@ Examples:
|
|
|
2022
2224
|
});
|
|
2023
2225
|
|
|
2024
2226
|
// src/commands/ads/google/currency.ts
|
|
2025
|
-
import { defineCommand as
|
|
2227
|
+
import { defineCommand as defineCommand20 } from "citty";
|
|
2026
2228
|
registerSchema({
|
|
2027
2229
|
command: "ads.google.currency",
|
|
2028
2230
|
description: "Get the currency code for a Google Ads account. Returns currency_code, customer_id, account_name, and access_type. Call this before interpreting cost_micros values.",
|
|
@@ -2034,7 +2236,7 @@ registerSchema({
|
|
|
2034
2236
|
}
|
|
2035
2237
|
}
|
|
2036
2238
|
});
|
|
2037
|
-
var currencyCommand =
|
|
2239
|
+
var currencyCommand = defineCommand20({
|
|
2038
2240
|
meta: {
|
|
2039
2241
|
name: "currency",
|
|
2040
2242
|
description: `Get account currency code. Use this to interpret metrics.cost_micros values.
|
|
@@ -2083,10 +2285,10 @@ Examples:
|
|
|
2083
2285
|
});
|
|
2084
2286
|
|
|
2085
2287
|
// src/commands/ads/google/keywords/index.ts
|
|
2086
|
-
import { defineCommand as
|
|
2288
|
+
import { defineCommand as defineCommand25 } from "citty";
|
|
2087
2289
|
|
|
2088
2290
|
// src/commands/ads/google/keywords/discover.ts
|
|
2089
|
-
import { defineCommand as
|
|
2291
|
+
import { defineCommand as defineCommand21 } from "citty";
|
|
2090
2292
|
|
|
2091
2293
|
// src/geo-context.ts
|
|
2092
2294
|
var GOOGLE_ADS_LOCATIONS = [
|
|
@@ -2361,7 +2563,7 @@ function handleKeywordError(err) {
|
|
|
2361
2563
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
2362
2564
|
process.exit(1);
|
|
2363
2565
|
}
|
|
2364
|
-
var discoverCommand =
|
|
2566
|
+
var discoverCommand = defineCommand21({
|
|
2365
2567
|
meta: {
|
|
2366
2568
|
name: "discover",
|
|
2367
2569
|
description: `Discover new keyword ideas from seed keywords or competitor URLs.
|
|
@@ -2423,7 +2625,7 @@ Examples:
|
|
|
2423
2625
|
});
|
|
2424
2626
|
|
|
2425
2627
|
// src/commands/ads/google/keywords/languages.ts
|
|
2426
|
-
import { defineCommand as
|
|
2628
|
+
import { defineCommand as defineCommand22 } from "citty";
|
|
2427
2629
|
registerSchema({
|
|
2428
2630
|
command: "ads.google.keywords.languages",
|
|
2429
2631
|
description: "List all supported language IDs for --language flag in Google Ads keyword commands.",
|
|
@@ -2433,7 +2635,7 @@ var FIELDS = {
|
|
|
2433
2635
|
id: "Language ID to pass as --language",
|
|
2434
2636
|
name: "Language name"
|
|
2435
2637
|
};
|
|
2436
|
-
var languagesCommand =
|
|
2638
|
+
var languagesCommand = defineCommand22({
|
|
2437
2639
|
meta: {
|
|
2438
2640
|
name: "languages",
|
|
2439
2641
|
description: "List all supported language IDs for --language flag."
|
|
@@ -2444,7 +2646,7 @@ var languagesCommand = defineCommand18({
|
|
|
2444
2646
|
});
|
|
2445
2647
|
|
|
2446
2648
|
// src/commands/ads/google/keywords/locations.ts
|
|
2447
|
-
import { defineCommand as
|
|
2649
|
+
import { defineCommand as defineCommand23 } from "citty";
|
|
2448
2650
|
registerSchema({
|
|
2449
2651
|
command: "ads.google.keywords.locations",
|
|
2450
2652
|
description: "List all supported geo target IDs for --location flag in Google Ads keyword commands.",
|
|
@@ -2454,7 +2656,7 @@ var FIELDS2 = {
|
|
|
2454
2656
|
id: "Geo target ID to pass as --location",
|
|
2455
2657
|
name: "Country/region name"
|
|
2456
2658
|
};
|
|
2457
|
-
var locationsCommand =
|
|
2659
|
+
var locationsCommand = defineCommand23({
|
|
2458
2660
|
meta: {
|
|
2459
2661
|
name: "locations",
|
|
2460
2662
|
description: "List all supported geo target IDs for --location flag."
|
|
@@ -2465,7 +2667,7 @@ var locationsCommand = defineCommand19({
|
|
|
2465
2667
|
});
|
|
2466
2668
|
|
|
2467
2669
|
// src/commands/ads/google/keywords/metrics.ts
|
|
2468
|
-
import { defineCommand as
|
|
2670
|
+
import { defineCommand as defineCommand24 } from "citty";
|
|
2469
2671
|
registerSchema({
|
|
2470
2672
|
command: "ads.google.keywords.metrics",
|
|
2471
2673
|
description: "Get historical metrics for specific keywords. Returns { historical_metrics: [...] } with snake_case fields matching the Google Ads API. IMPORTANT: If --location and --language are omitted, defaults to United States (2840) and English (1000). The response includes a query_context object showing which location/language were used.",
|
|
@@ -2489,7 +2691,7 @@ registerSchema({
|
|
|
2489
2691
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
2490
2692
|
}
|
|
2491
2693
|
});
|
|
2492
|
-
var metricsCommand =
|
|
2694
|
+
var metricsCommand = defineCommand24({
|
|
2493
2695
|
meta: {
|
|
2494
2696
|
name: "metrics",
|
|
2495
2697
|
description: `Get historical search metrics for specific keywords.
|
|
@@ -2576,7 +2778,7 @@ Examples:
|
|
|
2576
2778
|
});
|
|
2577
2779
|
|
|
2578
2780
|
// src/commands/ads/google/keywords/index.ts
|
|
2579
|
-
var keywordsCommand =
|
|
2781
|
+
var keywordsCommand = defineCommand25({
|
|
2580
2782
|
meta: {
|
|
2581
2783
|
name: "keywords",
|
|
2582
2784
|
description: `Keyword research tools. Subcommands: discover, metrics, locations, languages.
|
|
@@ -2596,8 +2798,8 @@ Examples:
|
|
|
2596
2798
|
});
|
|
2597
2799
|
|
|
2598
2800
|
// src/commands/ads/google/library/index.ts
|
|
2599
|
-
import { defineCommand as
|
|
2600
|
-
var listAdvertisers =
|
|
2801
|
+
import { defineCommand as defineCommand26 } from "citty";
|
|
2802
|
+
var listAdvertisers = defineCommand26({
|
|
2601
2803
|
meta: {
|
|
2602
2804
|
name: "list-advertisers",
|
|
2603
2805
|
description: "List tracked Google advertisers and their accounts"
|
|
@@ -2614,7 +2816,7 @@ var listAdvertisers = defineCommand22({
|
|
|
2614
2816
|
}
|
|
2615
2817
|
}
|
|
2616
2818
|
});
|
|
2617
|
-
var syncStatus =
|
|
2819
|
+
var syncStatus = defineCommand26({
|
|
2618
2820
|
meta: {
|
|
2619
2821
|
name: "sync-status",
|
|
2620
2822
|
description: "Check the sync status and ad counts of a Google account"
|
|
@@ -2634,7 +2836,7 @@ var syncStatus = defineCommand22({
|
|
|
2634
2836
|
writeAdsJson({ ok: true, data });
|
|
2635
2837
|
}
|
|
2636
2838
|
});
|
|
2637
|
-
var searchAds =
|
|
2839
|
+
var searchAds = defineCommand26({
|
|
2638
2840
|
meta: {
|
|
2639
2841
|
name: "search-ads",
|
|
2640
2842
|
description: "Search and filter Google ads for an account"
|
|
@@ -2691,7 +2893,7 @@ var searchAds = defineCommand22({
|
|
|
2691
2893
|
}
|
|
2692
2894
|
}
|
|
2693
2895
|
});
|
|
2694
|
-
var searchAdvertiser =
|
|
2896
|
+
var searchAdvertiser = defineCommand26({
|
|
2695
2897
|
meta: {
|
|
2696
2898
|
name: "search-advertiser",
|
|
2697
2899
|
description: "Search for an advertiser on the Google Ads Transparency Center"
|
|
@@ -2726,7 +2928,7 @@ var searchAdvertiser = defineCommand22({
|
|
|
2726
2928
|
function sleep(ms) {
|
|
2727
2929
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
2728
2930
|
}
|
|
2729
|
-
var track =
|
|
2931
|
+
var track = defineCommand26({
|
|
2730
2932
|
meta: {
|
|
2731
2933
|
name: "track",
|
|
2732
2934
|
description: "Track a new Google advertiser (from search results). Waits for initial sync to complete before returning."
|
|
@@ -2784,7 +2986,7 @@ var track = defineCommand22({
|
|
|
2784
2986
|
process.exit(1);
|
|
2785
2987
|
}
|
|
2786
2988
|
});
|
|
2787
|
-
var sync =
|
|
2989
|
+
var sync = defineCommand26({
|
|
2788
2990
|
meta: {
|
|
2789
2991
|
name: "sync",
|
|
2790
2992
|
description: "Trigger an immediate sync for a Google account. Waits for completion before returning."
|
|
@@ -2828,7 +3030,7 @@ var sync = defineCommand22({
|
|
|
2828
3030
|
process.exit(1);
|
|
2829
3031
|
}
|
|
2830
3032
|
});
|
|
2831
|
-
var searchCompetitors =
|
|
3033
|
+
var searchCompetitors = defineCommand26({
|
|
2832
3034
|
meta: {
|
|
2833
3035
|
name: "search-competitors",
|
|
2834
3036
|
description: "Search for competitors running Google ads for a keyword (DataForSEO)"
|
|
@@ -2860,7 +3062,7 @@ var searchCompetitors = defineCommand22({
|
|
|
2860
3062
|
}
|
|
2861
3063
|
}
|
|
2862
3064
|
});
|
|
2863
|
-
var library =
|
|
3065
|
+
var library = defineCommand26({
|
|
2864
3066
|
meta: {
|
|
2865
3067
|
name: "library",
|
|
2866
3068
|
description: "Manage and search the Google Ads Library"
|
|
@@ -2879,7 +3081,7 @@ var library = defineCommand22({
|
|
|
2879
3081
|
// src/commands/ads/google/query.ts
|
|
2880
3082
|
import { appendFileSync, existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
2881
3083
|
import { resolve } from "path";
|
|
2882
|
-
import { defineCommand as
|
|
3084
|
+
import { defineCommand as defineCommand27 } from "citty";
|
|
2883
3085
|
|
|
2884
3086
|
// src/commands/ads/google/preflight.ts
|
|
2885
3087
|
function buildCommand2(query, customerId) {
|
|
@@ -3335,7 +3537,7 @@ function handleQueryError(err, finalQuery, customerId) {
|
|
|
3335
3537
|
});
|
|
3336
3538
|
process.exit(1);
|
|
3337
3539
|
}
|
|
3338
|
-
var queryCommand =
|
|
3540
|
+
var queryCommand = defineCommand27({
|
|
3339
3541
|
meta: {
|
|
3340
3542
|
name: "query",
|
|
3341
3543
|
description: `Run GAQL queries against Google Ads. Supports raw GAQL, presets, pagination, file export, and caching.
|
|
@@ -3393,7 +3595,7 @@ Examples:
|
|
|
3393
3595
|
});
|
|
3394
3596
|
|
|
3395
3597
|
// src/commands/ads/google/index.ts
|
|
3396
|
-
var googleCommand =
|
|
3598
|
+
var googleCommand = defineCommand28({
|
|
3397
3599
|
meta: {
|
|
3398
3600
|
name: "google",
|
|
3399
3601
|
description: `Google Ads commands. Query campaigns, keywords, search terms, and more via GAQL.
|
|
@@ -3421,7 +3623,7 @@ Examples:
|
|
|
3421
3623
|
});
|
|
3422
3624
|
|
|
3423
3625
|
// src/commands/ads/linkedin/index.ts
|
|
3424
|
-
import { defineCommand as
|
|
3626
|
+
import { defineCommand as defineCommand46 } from "citty";
|
|
3425
3627
|
|
|
3426
3628
|
// src/commands/ads/linkedin/schemas.ts
|
|
3427
3629
|
registerSchema({
|
|
@@ -3721,7 +3923,7 @@ registerSchema({
|
|
|
3721
3923
|
});
|
|
3722
3924
|
|
|
3723
3925
|
// src/commands/ads/linkedin/account.ts
|
|
3724
|
-
import { defineCommand as
|
|
3926
|
+
import { defineCommand as defineCommand29 } from "citty";
|
|
3725
3927
|
|
|
3726
3928
|
// src/commands/ads/linkedin/shared.ts
|
|
3727
3929
|
var DAY_MS = 864e5;
|
|
@@ -3824,7 +4026,7 @@ function resolveStatusFilter(args) {
|
|
|
3824
4026
|
}
|
|
3825
4027
|
|
|
3826
4028
|
// src/commands/ads/linkedin/account.ts
|
|
3827
|
-
var accountCommand =
|
|
4029
|
+
var accountCommand = defineCommand29({
|
|
3828
4030
|
meta: {
|
|
3829
4031
|
name: "account",
|
|
3830
4032
|
description: `Single LinkedIn ad account detail (currency, status, type).
|
|
@@ -3858,9 +4060,9 @@ Examples:
|
|
|
3858
4060
|
});
|
|
3859
4061
|
|
|
3860
4062
|
// src/commands/ads/linkedin/accounts.ts
|
|
3861
|
-
import { defineCommand as
|
|
4063
|
+
import { defineCommand as defineCommand30 } from "citty";
|
|
3862
4064
|
var ACCOUNTS_TTL_MS = 60 * 60 * 1e3;
|
|
3863
|
-
var accountsCommand2 =
|
|
4065
|
+
var accountsCommand2 = defineCommand30({
|
|
3864
4066
|
meta: {
|
|
3865
4067
|
name: "accounts",
|
|
3866
4068
|
description: `List LinkedIn ad accounts in this company's connected scope.
|
|
@@ -3908,7 +4110,7 @@ Examples:
|
|
|
3908
4110
|
});
|
|
3909
4111
|
|
|
3910
4112
|
// src/commands/ads/linkedin/analytics.ts
|
|
3911
|
-
import { defineCommand as
|
|
4113
|
+
import { defineCommand as defineCommand31 } from "citty";
|
|
3912
4114
|
|
|
3913
4115
|
// src/commands/ads/linkedin/presets.ts
|
|
3914
4116
|
var INTENTS = {
|
|
@@ -4180,7 +4382,7 @@ function numberOf(v) {
|
|
|
4180
4382
|
}
|
|
4181
4383
|
return 0;
|
|
4182
4384
|
}
|
|
4183
|
-
var analyticsCommand =
|
|
4385
|
+
var analyticsCommand = defineCommand31({
|
|
4184
4386
|
meta: {
|
|
4185
4387
|
name: "analytics",
|
|
4186
4388
|
description: `Performance reporting \u2014 the workhorse for AI agents.
|
|
@@ -4308,7 +4510,7 @@ Examples \u2014 common AI questions:
|
|
|
4308
4510
|
|
|
4309
4511
|
// src/commands/ads/linkedin/audience-size.ts
|
|
4310
4512
|
import { readFileSync as readFileSync3 } from "fs";
|
|
4311
|
-
import { defineCommand as
|
|
4513
|
+
import { defineCommand as defineCommand32 } from "citty";
|
|
4312
4514
|
function loadTargeting(args) {
|
|
4313
4515
|
const inline = args.targeting;
|
|
4314
4516
|
if (inline) {
|
|
@@ -4330,7 +4532,7 @@ function loadTargeting(args) {
|
|
|
4330
4532
|
}
|
|
4331
4533
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
4332
4534
|
}
|
|
4333
|
-
var audienceSizeCommand =
|
|
4535
|
+
var audienceSizeCommand = defineCommand32({
|
|
4334
4536
|
meta: {
|
|
4335
4537
|
name: "audience-size",
|
|
4336
4538
|
description: `Estimate audience size for a targeting payload \u2014 pre-launch sanity check.
|
|
@@ -4375,7 +4577,7 @@ Examples:
|
|
|
4375
4577
|
});
|
|
4376
4578
|
|
|
4377
4579
|
// src/commands/ads/linkedin/audit.ts
|
|
4378
|
-
import { defineCommand as
|
|
4580
|
+
import { defineCommand as defineCommand33 } from "citty";
|
|
4379
4581
|
var SEVERITY_RANK = {
|
|
4380
4582
|
critical: 0,
|
|
4381
4583
|
high: 1,
|
|
@@ -4434,7 +4636,7 @@ function noteOf(f) {
|
|
|
4434
4636
|
const fix = f.fix?.explanation ?? "";
|
|
4435
4637
|
return [fix, ev].filter(Boolean).join(" \u2014 ");
|
|
4436
4638
|
}
|
|
4437
|
-
var auditCommand =
|
|
4639
|
+
var auditCommand = defineCommand33({
|
|
4438
4640
|
meta: {
|
|
4439
4641
|
name: "audit",
|
|
4440
4642
|
description: `Run a LinkedIn Ads playbook audit \u2014 30+ checks across Settings, Tracking,
|
|
@@ -4501,7 +4703,7 @@ Examples:
|
|
|
4501
4703
|
|
|
4502
4704
|
// src/commands/ads/linkedin/bid-pricing.ts
|
|
4503
4705
|
import { readFileSync as readFileSync4 } from "fs";
|
|
4504
|
-
import { defineCommand as
|
|
4706
|
+
import { defineCommand as defineCommand34 } from "citty";
|
|
4505
4707
|
function loadTargeting2(args) {
|
|
4506
4708
|
const inline = args.targeting;
|
|
4507
4709
|
if (inline) {
|
|
@@ -4523,7 +4725,7 @@ function loadTargeting2(args) {
|
|
|
4523
4725
|
}
|
|
4524
4726
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
4525
4727
|
}
|
|
4526
|
-
var bidPricingCommand =
|
|
4728
|
+
var bidPricingCommand = defineCommand34({
|
|
4527
4729
|
meta: {
|
|
4528
4730
|
name: "bid-pricing",
|
|
4529
4731
|
description: `Get LinkedIn's suggested bid range for a targeting + objective + cost type.
|
|
@@ -4573,8 +4775,8 @@ Examples:
|
|
|
4573
4775
|
});
|
|
4574
4776
|
|
|
4575
4777
|
// src/commands/ads/linkedin/campaign-groups.ts
|
|
4576
|
-
import { defineCommand as
|
|
4577
|
-
var campaignGroupsCommand =
|
|
4778
|
+
import { defineCommand as defineCommand35 } from "citty";
|
|
4779
|
+
var campaignGroupsCommand = defineCommand35({
|
|
4578
4780
|
meta: {
|
|
4579
4781
|
name: "campaign-groups",
|
|
4580
4782
|
description: `List LinkedIn campaign groups.
|
|
@@ -4617,8 +4819,8 @@ Examples:
|
|
|
4617
4819
|
});
|
|
4618
4820
|
|
|
4619
4821
|
// src/commands/ads/linkedin/campaigns.ts
|
|
4620
|
-
import { defineCommand as
|
|
4621
|
-
var campaignsCommand =
|
|
4822
|
+
import { defineCommand as defineCommand36 } from "citty";
|
|
4823
|
+
var campaignsCommand = defineCommand36({
|
|
4622
4824
|
meta: {
|
|
4623
4825
|
name: "campaigns",
|
|
4624
4826
|
description: `List LinkedIn campaigns.
|
|
@@ -4667,8 +4869,8 @@ Examples:
|
|
|
4667
4869
|
});
|
|
4668
4870
|
|
|
4669
4871
|
// src/commands/ads/linkedin/conversation.ts
|
|
4670
|
-
import { defineCommand as
|
|
4671
|
-
var conversationCommand =
|
|
4872
|
+
import { defineCommand as defineCommand37 } from "citty";
|
|
4873
|
+
var conversationCommand = defineCommand37({
|
|
4672
4874
|
meta: {
|
|
4673
4875
|
name: "conversation",
|
|
4674
4876
|
description: `Per-button click rates inside Sponsored Messaging / Conversation Ads.
|
|
@@ -4731,7 +4933,7 @@ Examples:
|
|
|
4731
4933
|
});
|
|
4732
4934
|
|
|
4733
4935
|
// src/commands/ads/linkedin/conversions.ts
|
|
4734
|
-
import { defineCommand as
|
|
4936
|
+
import { defineCommand as defineCommand38 } from "citty";
|
|
4735
4937
|
var DAY_MS2 = 864e5;
|
|
4736
4938
|
function healthOf(rules) {
|
|
4737
4939
|
const enabled = rules.filter((r) => r.enabled !== false);
|
|
@@ -4757,7 +4959,7 @@ function healthOf(rules) {
|
|
|
4757
4959
|
wrongLeadDedup: wrongDedup
|
|
4758
4960
|
};
|
|
4759
4961
|
}
|
|
4760
|
-
var listCmd =
|
|
4962
|
+
var listCmd = defineCommand38({
|
|
4761
4963
|
meta: {
|
|
4762
4964
|
name: "list",
|
|
4763
4965
|
description: `List conversion rules on the account.`
|
|
@@ -4785,7 +4987,7 @@ var listCmd = defineCommand34({
|
|
|
4785
4987
|
}
|
|
4786
4988
|
}
|
|
4787
4989
|
});
|
|
4788
|
-
var healthCmd =
|
|
4990
|
+
var healthCmd = defineCommand38({
|
|
4789
4991
|
meta: {
|
|
4790
4992
|
name: "health",
|
|
4791
4993
|
description: `5-point Insight Tag / CAPI health check (playbook \xA707).
|
|
@@ -4815,7 +5017,7 @@ Surfaces:
|
|
|
4815
5017
|
}
|
|
4816
5018
|
}
|
|
4817
5019
|
});
|
|
4818
|
-
var conversionsCommand =
|
|
5020
|
+
var conversionsCommand = defineCommand38({
|
|
4819
5021
|
meta: {
|
|
4820
5022
|
name: "conversions",
|
|
4821
5023
|
description: `Conversion rules \u2014 Insight Tag and Conversions API.
|
|
@@ -4831,8 +5033,8 @@ Subcommands:
|
|
|
4831
5033
|
});
|
|
4832
5034
|
|
|
4833
5035
|
// src/commands/ads/linkedin/creatives.ts
|
|
4834
|
-
import { defineCommand as
|
|
4835
|
-
var creativesCommand =
|
|
5036
|
+
import { defineCommand as defineCommand39 } from "citty";
|
|
5037
|
+
var creativesCommand = defineCommand39({
|
|
4836
5038
|
meta: {
|
|
4837
5039
|
name: "creatives",
|
|
4838
5040
|
description: `List LinkedIn creatives (ads).
|
|
@@ -4881,7 +5083,7 @@ Examples:
|
|
|
4881
5083
|
});
|
|
4882
5084
|
|
|
4883
5085
|
// src/commands/ads/linkedin/demographics.ts
|
|
4884
|
-
import { defineCommand as
|
|
5086
|
+
import { defineCommand as defineCommand40 } from "citty";
|
|
4885
5087
|
var DEFAULT_PIVOTS = ["job-title", "company", "industry", "seniority", "job-function", "company-size"];
|
|
4886
5088
|
function numberOf2(v) {
|
|
4887
5089
|
if (typeof v === "number") return Number.isFinite(v) ? v : 0;
|
|
@@ -4894,7 +5096,7 @@ function numberOf2(v) {
|
|
|
4894
5096
|
function topByImpressions(rows, limit) {
|
|
4895
5097
|
return [...rows].sort((a, b) => numberOf2(b.impressions) - numberOf2(a.impressions)).slice(0, limit);
|
|
4896
5098
|
}
|
|
4897
|
-
var demographicsCommand =
|
|
5099
|
+
var demographicsCommand = defineCommand40({
|
|
4898
5100
|
meta: {
|
|
4899
5101
|
name: "demographics",
|
|
4900
5102
|
description: `Sweep all firmographic pivots in one command \u2014 LinkedIn's superpower.
|
|
@@ -4991,8 +5193,8 @@ function resolveRange(args) {
|
|
|
4991
5193
|
}
|
|
4992
5194
|
|
|
4993
5195
|
// src/commands/ads/linkedin/facets.ts
|
|
4994
|
-
import { defineCommand as
|
|
4995
|
-
var listCmd2 =
|
|
5196
|
+
import { defineCommand as defineCommand41 } from "citty";
|
|
5197
|
+
var listCmd2 = defineCommand41({
|
|
4996
5198
|
meta: {
|
|
4997
5199
|
name: "list",
|
|
4998
5200
|
description: `List every targeting facet LinkedIn supports.
|
|
@@ -5020,7 +5222,7 @@ seniorities, titles, employers, growthRate, companyCategory, skills, etc.).`
|
|
|
5020
5222
|
}
|
|
5021
5223
|
}
|
|
5022
5224
|
});
|
|
5023
|
-
var valuesCmd =
|
|
5225
|
+
var valuesCmd = defineCommand41({
|
|
5024
5226
|
meta: {
|
|
5025
5227
|
name: "values",
|
|
5026
5228
|
description: `Look up entity values for a single facet \u2014 full list or typeahead search.
|
|
@@ -5061,7 +5263,7 @@ or the full URN (urn:li:adTargetingFacet:industries).`
|
|
|
5061
5263
|
}
|
|
5062
5264
|
}
|
|
5063
5265
|
});
|
|
5064
|
-
var facetsCommand =
|
|
5266
|
+
var facetsCommand = defineCommand41({
|
|
5065
5267
|
meta: {
|
|
5066
5268
|
name: "facets",
|
|
5067
5269
|
description: `LinkedIn targeting facets and entity lookup.
|
|
@@ -5079,7 +5281,7 @@ Subcommands:
|
|
|
5079
5281
|
|
|
5080
5282
|
// src/commands/ads/linkedin/forecast.ts
|
|
5081
5283
|
import { readFileSync as readFileSync5 } from "fs";
|
|
5082
|
-
import { defineCommand as
|
|
5284
|
+
import { defineCommand as defineCommand42 } from "citty";
|
|
5083
5285
|
function loadTargeting3(args) {
|
|
5084
5286
|
const inline = args.targeting;
|
|
5085
5287
|
if (inline) {
|
|
@@ -5109,7 +5311,7 @@ function parseMoney(raw) {
|
|
|
5109
5311
|
}
|
|
5110
5312
|
return { amount: m[1] ?? "0", currencyCode: m[2] ?? "USD" };
|
|
5111
5313
|
}
|
|
5112
|
-
var forecastCommand =
|
|
5314
|
+
var forecastCommand = defineCommand42({
|
|
5113
5315
|
meta: {
|
|
5114
5316
|
name: "forecast",
|
|
5115
5317
|
description: `Forecast reach + impressions + clicks + spend for a hypothetical campaign.
|
|
@@ -5156,9 +5358,9 @@ Examples:
|
|
|
5156
5358
|
});
|
|
5157
5359
|
|
|
5158
5360
|
// src/commands/ads/linkedin/leads.ts
|
|
5159
|
-
import { defineCommand as
|
|
5361
|
+
import { defineCommand as defineCommand43 } from "citty";
|
|
5160
5362
|
var DAY_MS3 = 864e5;
|
|
5161
|
-
var leadsCommand =
|
|
5363
|
+
var leadsCommand = defineCommand43({
|
|
5162
5364
|
meta: {
|
|
5163
5365
|
name: "leads",
|
|
5164
5366
|
description: `List Lead Gen Form responses (playbook \xA707).
|
|
@@ -5218,7 +5420,7 @@ Examples:
|
|
|
5218
5420
|
});
|
|
5219
5421
|
|
|
5220
5422
|
// src/commands/ads/linkedin/resolve.ts
|
|
5221
|
-
import { defineCommand as
|
|
5423
|
+
import { defineCommand as defineCommand44 } from "citty";
|
|
5222
5424
|
function toOrgUrn(raw) {
|
|
5223
5425
|
const trimmed = raw.trim();
|
|
5224
5426
|
if (trimmed.length === 0) {
|
|
@@ -5229,7 +5431,7 @@ function toOrgUrn(raw) {
|
|
|
5229
5431
|
}
|
|
5230
5432
|
return /^\d+$/.test(trimmed) ? `urn:li:organization:${trimmed}` : null;
|
|
5231
5433
|
}
|
|
5232
|
-
var resolveCommand =
|
|
5434
|
+
var resolveCommand = defineCommand44({
|
|
5233
5435
|
meta: {
|
|
5234
5436
|
name: "resolve",
|
|
5235
5437
|
description: `Resolve organization URNs to company names.
|
|
@@ -5271,8 +5473,8 @@ couldn't be resolved \u2014 typically an org outside LinkedIn's targetable set.`
|
|
|
5271
5473
|
});
|
|
5272
5474
|
|
|
5273
5475
|
// src/commands/ads/linkedin/top-companies.ts
|
|
5274
|
-
import { defineCommand as
|
|
5275
|
-
var topCompaniesCommand =
|
|
5476
|
+
import { defineCommand as defineCommand45 } from "citty";
|
|
5477
|
+
var topCompaniesCommand = defineCommand45({
|
|
5276
5478
|
meta: {
|
|
5277
5479
|
name: "top-companies",
|
|
5278
5480
|
description: `Top companies whose employees saw / clicked / converted on a campaign.
|
|
@@ -5343,7 +5545,7 @@ Examples:
|
|
|
5343
5545
|
});
|
|
5344
5546
|
|
|
5345
5547
|
// src/commands/ads/linkedin/index.ts
|
|
5346
|
-
var linkedinCommand =
|
|
5548
|
+
var linkedinCommand = defineCommand46({
|
|
5347
5549
|
meta: {
|
|
5348
5550
|
name: "linkedin",
|
|
5349
5551
|
description: `LinkedIn Marketing API \u2014 AI-first command surface for B2B ad insights.
|
|
@@ -5395,10 +5597,10 @@ Account ID format:
|
|
|
5395
5597
|
});
|
|
5396
5598
|
|
|
5397
5599
|
// src/commands/ads/meta/index.ts
|
|
5398
|
-
import { defineCommand as
|
|
5600
|
+
import { defineCommand as defineCommand59 } from "citty";
|
|
5399
5601
|
|
|
5400
5602
|
// src/commands/ads/meta/account.ts
|
|
5401
|
-
import { defineCommand as
|
|
5603
|
+
import { defineCommand as defineCommand47 } from "citty";
|
|
5402
5604
|
|
|
5403
5605
|
// src/commands/ads/meta/shared.ts
|
|
5404
5606
|
var DAY_MS4 = 864e5;
|
|
@@ -5477,7 +5679,7 @@ function resolveEffectiveStatus(args) {
|
|
|
5477
5679
|
}
|
|
5478
5680
|
|
|
5479
5681
|
// src/commands/ads/meta/account.ts
|
|
5480
|
-
var accountCommand2 =
|
|
5682
|
+
var accountCommand2 = defineCommand47({
|
|
5481
5683
|
meta: {
|
|
5482
5684
|
name: "account",
|
|
5483
5685
|
description: `Show single Meta ad account detail (currency, timezone, balance, business).
|
|
@@ -5504,8 +5706,8 @@ Examples:
|
|
|
5504
5706
|
});
|
|
5505
5707
|
|
|
5506
5708
|
// src/commands/ads/meta/accounts.ts
|
|
5507
|
-
import { defineCommand as
|
|
5508
|
-
var accountsCommand3 =
|
|
5709
|
+
import { defineCommand as defineCommand48 } from "citty";
|
|
5710
|
+
var accountsCommand3 = defineCommand48({
|
|
5509
5711
|
meta: {
|
|
5510
5712
|
name: "accounts",
|
|
5511
5713
|
description: `List Meta ad accounts in this company's connected scope.
|
|
@@ -5553,8 +5755,8 @@ Examples:
|
|
|
5553
5755
|
});
|
|
5554
5756
|
|
|
5555
5757
|
// src/commands/ads/meta/activities.ts
|
|
5556
|
-
import { defineCommand as
|
|
5557
|
-
var activitiesCommand =
|
|
5758
|
+
import { defineCommand as defineCommand49 } from "citty";
|
|
5759
|
+
var activitiesCommand = defineCommand49({
|
|
5558
5760
|
meta: {
|
|
5559
5761
|
name: "activities",
|
|
5560
5762
|
description: `Audit log of recent ad-account changes (created, paused, edited). Default lookback 7 days,
|
|
@@ -5591,8 +5793,8 @@ Examples:
|
|
|
5591
5793
|
});
|
|
5592
5794
|
|
|
5593
5795
|
// src/commands/ads/meta/ads.ts
|
|
5594
|
-
import { defineCommand as
|
|
5595
|
-
var adsListCommand =
|
|
5796
|
+
import { defineCommand as defineCommand50 } from "citty";
|
|
5797
|
+
var adsListCommand = defineCommand50({
|
|
5596
5798
|
meta: {
|
|
5597
5799
|
name: "ads",
|
|
5598
5800
|
description: `List ads in a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -5640,8 +5842,8 @@ Examples:
|
|
|
5640
5842
|
});
|
|
5641
5843
|
|
|
5642
5844
|
// src/commands/ads/meta/adsets.ts
|
|
5643
|
-
import { defineCommand as
|
|
5644
|
-
var adsetsCommand =
|
|
5845
|
+
import { defineCommand as defineCommand51 } from "citty";
|
|
5846
|
+
var adsetsCommand = defineCommand51({
|
|
5645
5847
|
meta: {
|
|
5646
5848
|
name: "adsets",
|
|
5647
5849
|
description: `List ad sets in a Meta ad account, optionally scoped to one campaign. Defaults to ACTIVE only.
|
|
@@ -5683,8 +5885,8 @@ Examples:
|
|
|
5683
5885
|
});
|
|
5684
5886
|
|
|
5685
5887
|
// src/commands/ads/meta/audiences.ts
|
|
5686
|
-
import { defineCommand as
|
|
5687
|
-
var audiencesCommand =
|
|
5888
|
+
import { defineCommand as defineCommand52 } from "citty";
|
|
5889
|
+
var audiencesCommand = defineCommand52({
|
|
5688
5890
|
meta: {
|
|
5689
5891
|
name: "audiences",
|
|
5690
5892
|
description: `List custom audiences for a Meta ad account. Includes lookalikes, website-pixel audiences,
|
|
@@ -5719,8 +5921,8 @@ Examples:
|
|
|
5719
5921
|
});
|
|
5720
5922
|
|
|
5721
5923
|
// src/commands/ads/meta/businesses.ts
|
|
5722
|
-
import { defineCommand as
|
|
5723
|
-
var businessesCommand =
|
|
5924
|
+
import { defineCommand as defineCommand53 } from "citty";
|
|
5925
|
+
var businessesCommand = defineCommand53({
|
|
5724
5926
|
meta: {
|
|
5725
5927
|
name: "businesses",
|
|
5726
5928
|
description: `List Meta Business Manager accounts the connected user has access to. Required for ad-studies and product-catalogs commands.
|
|
@@ -5750,8 +5952,8 @@ Examples:
|
|
|
5750
5952
|
});
|
|
5751
5953
|
|
|
5752
5954
|
// src/commands/ads/meta/campaigns.ts
|
|
5753
|
-
import { defineCommand as
|
|
5754
|
-
var campaignsCommand2 =
|
|
5955
|
+
import { defineCommand as defineCommand54 } from "citty";
|
|
5956
|
+
var campaignsCommand2 = defineCommand54({
|
|
5755
5957
|
meta: {
|
|
5756
5958
|
name: "campaigns",
|
|
5757
5959
|
description: `List campaigns for a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -5795,8 +5997,8 @@ Examples:
|
|
|
5795
5997
|
});
|
|
5796
5998
|
|
|
5797
5999
|
// src/commands/ads/meta/creatives.ts
|
|
5798
|
-
import { defineCommand as
|
|
5799
|
-
var creativesCommand2 =
|
|
6000
|
+
import { defineCommand as defineCommand55 } from "citty";
|
|
6001
|
+
var creativesCommand2 = defineCommand55({
|
|
5800
6002
|
meta: {
|
|
5801
6003
|
name: "creatives",
|
|
5802
6004
|
description: `List ad creatives in an account, or fetch a single creative by ID.
|
|
@@ -5840,7 +6042,7 @@ Examples:
|
|
|
5840
6042
|
});
|
|
5841
6043
|
|
|
5842
6044
|
// src/commands/ads/meta/insights.ts
|
|
5843
|
-
import { defineCommand as
|
|
6045
|
+
import { defineCommand as defineCommand56 } from "citty";
|
|
5844
6046
|
|
|
5845
6047
|
// src/commands/ads/meta/presets.ts
|
|
5846
6048
|
var INSIGHTS_INTENTS = {
|
|
@@ -6045,7 +6247,7 @@ function sortRowsBySpendDesc(rows) {
|
|
|
6045
6247
|
return sb - sa;
|
|
6046
6248
|
});
|
|
6047
6249
|
}
|
|
6048
|
-
var insightsCommand =
|
|
6250
|
+
var insightsCommand = defineCommand56({
|
|
6049
6251
|
meta: {
|
|
6050
6252
|
name: "insights",
|
|
6051
6253
|
description: `Performance reporting \u2014 the main Meta tool for AI agents.
|
|
@@ -6146,8 +6348,8 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
|
|
|
6146
6348
|
});
|
|
6147
6349
|
|
|
6148
6350
|
// src/commands/ads/meta/pixels.ts
|
|
6149
|
-
import { defineCommand as
|
|
6150
|
-
var pixelsCommand =
|
|
6351
|
+
import { defineCommand as defineCommand57 } from "citty";
|
|
6352
|
+
var pixelsCommand = defineCommand57({
|
|
6151
6353
|
meta: {
|
|
6152
6354
|
name: "pixels",
|
|
6153
6355
|
description: `List Meta Pixels for an ad account, or fetch firing stats for one pixel.
|
|
@@ -6218,7 +6420,7 @@ function emit(data, args) {
|
|
|
6218
6420
|
|
|
6219
6421
|
// src/commands/ads/meta/preview.ts
|
|
6220
6422
|
import { writeFileSync as writeFileSync3 } from "fs";
|
|
6221
|
-
import { defineCommand as
|
|
6423
|
+
import { defineCommand as defineCommand58 } from "citty";
|
|
6222
6424
|
var VALID_AD_FORMATS = [
|
|
6223
6425
|
"DESKTOP_FEED_STANDARD",
|
|
6224
6426
|
"MOBILE_FEED_STANDARD",
|
|
@@ -6252,7 +6454,7 @@ var VALID_AD_FORMATS = [
|
|
|
6252
6454
|
"MARKETPLACE_MOBILE",
|
|
6253
6455
|
"BIZ_DISCO_FEED_MOBILE"
|
|
6254
6456
|
];
|
|
6255
|
-
var previewCommand =
|
|
6457
|
+
var previewCommand = defineCommand58({
|
|
6256
6458
|
meta: {
|
|
6257
6459
|
name: "preview",
|
|
6258
6460
|
description: `Generate a Meta-hosted preview iframe for a creative or ad. Returns iframe HTML which you
|
|
@@ -6299,7 +6501,7 @@ Examples:
|
|
|
6299
6501
|
});
|
|
6300
6502
|
|
|
6301
6503
|
// src/commands/ads/meta/index.ts
|
|
6302
|
-
var metaCommand =
|
|
6504
|
+
var metaCommand = defineCommand59({
|
|
6303
6505
|
meta: {
|
|
6304
6506
|
name: "meta",
|
|
6305
6507
|
description: `Meta Marketing API \u2014 AI-first command surface (Facebook + Instagram ads).
|
|
@@ -6351,10 +6553,10 @@ Audit & review:
|
|
|
6351
6553
|
});
|
|
6352
6554
|
|
|
6353
6555
|
// src/commands/ads/x/index.ts
|
|
6354
|
-
import { defineCommand as
|
|
6556
|
+
import { defineCommand as defineCommand76 } from "citty";
|
|
6355
6557
|
|
|
6356
6558
|
// src/commands/ads/x/accounts.ts
|
|
6357
|
-
import { defineCommand as
|
|
6559
|
+
import { defineCommand as defineCommand60 } from "citty";
|
|
6358
6560
|
registerSchema({
|
|
6359
6561
|
command: "ads.x.accounts",
|
|
6360
6562
|
description: "List all accessible X Ads accounts. Returns accounts with id (base36), name, approval_status, timezone, currency. Run this first to find account IDs for other commands.",
|
|
@@ -6382,7 +6584,7 @@ function handleAccountsError2(err) {
|
|
|
6382
6584
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
6383
6585
|
process.exit(1);
|
|
6384
6586
|
}
|
|
6385
|
-
var accountsCommand4 =
|
|
6587
|
+
var accountsCommand4 = defineCommand60({
|
|
6386
6588
|
meta: {
|
|
6387
6589
|
name: "accounts",
|
|
6388
6590
|
description: `List accessible X Ads accounts. Returns account IDs needed for all other commands.
|
|
@@ -6422,7 +6624,7 @@ Examples:
|
|
|
6422
6624
|
});
|
|
6423
6625
|
|
|
6424
6626
|
// src/commands/ads/x/active-entities.ts
|
|
6425
|
-
import { defineCommand as
|
|
6627
|
+
import { defineCommand as defineCommand61 } from "citty";
|
|
6426
6628
|
|
|
6427
6629
|
// src/commands/ads/x/error-parser.ts
|
|
6428
6630
|
function mapXErrorCode(message) {
|
|
@@ -6573,7 +6775,7 @@ function parseCsv(v) {
|
|
|
6573
6775
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
6574
6776
|
return parts.length > 0 ? parts : void 0;
|
|
6575
6777
|
}
|
|
6576
|
-
var activeEntitiesCommand =
|
|
6778
|
+
var activeEntitiesCommand = defineCommand61({
|
|
6577
6779
|
meta: {
|
|
6578
6780
|
name: "active-entities",
|
|
6579
6781
|
description: `List entities with metric activity in a time range.
|
|
@@ -6631,7 +6833,7 @@ Examples:
|
|
|
6631
6833
|
});
|
|
6632
6834
|
|
|
6633
6835
|
// src/commands/ads/x/audiences.ts
|
|
6634
|
-
import { defineCommand as
|
|
6836
|
+
import { defineCommand as defineCommand62 } from "citty";
|
|
6635
6837
|
registerSchema({
|
|
6636
6838
|
command: "ads.x.audiences",
|
|
6637
6839
|
description: "List custom audiences for an X Ads account. Returns id, name, audience_size, audience_type, targetable status. Audiences need 100+ active users in the past 90 days to be targetable.",
|
|
@@ -6640,7 +6842,7 @@ registerSchema({
|
|
|
6640
6842
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6641
6843
|
}
|
|
6642
6844
|
});
|
|
6643
|
-
var audiencesCommand2 =
|
|
6845
|
+
var audiencesCommand2 = defineCommand62({
|
|
6644
6846
|
meta: {
|
|
6645
6847
|
name: "audiences",
|
|
6646
6848
|
description: `List X Ads custom audiences.
|
|
@@ -6689,7 +6891,7 @@ Examples:
|
|
|
6689
6891
|
});
|
|
6690
6892
|
|
|
6691
6893
|
// src/commands/ads/x/campaigns.ts
|
|
6692
|
-
import { defineCommand as
|
|
6894
|
+
import { defineCommand as defineCommand63 } from "citty";
|
|
6693
6895
|
|
|
6694
6896
|
// src/commands/ads/x/run-list.ts
|
|
6695
6897
|
function buildCleanParams(opts) {
|
|
@@ -6752,7 +6954,7 @@ registerSchema({
|
|
|
6752
6954
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6753
6955
|
}
|
|
6754
6956
|
});
|
|
6755
|
-
var campaignsCommand3 =
|
|
6957
|
+
var campaignsCommand3 = defineCommand63({
|
|
6756
6958
|
meta: {
|
|
6757
6959
|
name: "campaigns",
|
|
6758
6960
|
description: `List X Ads campaigns. Returns budget, schedule, funding instrument, status.
|
|
@@ -6794,7 +6996,7 @@ Examples:
|
|
|
6794
6996
|
});
|
|
6795
6997
|
|
|
6796
6998
|
// src/commands/ads/x/cards.ts
|
|
6797
|
-
import { defineCommand as
|
|
6999
|
+
import { defineCommand as defineCommand64 } from "citty";
|
|
6798
7000
|
registerSchema({
|
|
6799
7001
|
command: "ads.x.cards",
|
|
6800
7002
|
description: "List website cards, video cards, and carousels for an X Ads account.",
|
|
@@ -6803,7 +7005,7 @@ registerSchema({
|
|
|
6803
7005
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6804
7006
|
}
|
|
6805
7007
|
});
|
|
6806
|
-
var cardsCommand =
|
|
7008
|
+
var cardsCommand = defineCommand64({
|
|
6807
7009
|
meta: {
|
|
6808
7010
|
name: "cards",
|
|
6809
7011
|
description: `List X Ads cards (rich creatives).
|
|
@@ -6852,7 +7054,7 @@ Examples:
|
|
|
6852
7054
|
});
|
|
6853
7055
|
|
|
6854
7056
|
// src/commands/ads/x/funding.ts
|
|
6855
|
-
import { defineCommand as
|
|
7057
|
+
import { defineCommand as defineCommand65 } from "citty";
|
|
6856
7058
|
registerSchema({
|
|
6857
7059
|
command: "ads.x.funding",
|
|
6858
7060
|
description: "List funding instruments for an X Ads account. Returns id, type, currency, credit_limit_local_micro, funded_amount_local_micro, status. Falls back to BAKER_X_ADS_ACCOUNT_ID env var.",
|
|
@@ -6861,7 +7063,7 @@ registerSchema({
|
|
|
6861
7063
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6862
7064
|
}
|
|
6863
7065
|
});
|
|
6864
|
-
var fundingCommand =
|
|
7066
|
+
var fundingCommand = defineCommand65({
|
|
6865
7067
|
meta: {
|
|
6866
7068
|
name: "funding",
|
|
6867
7069
|
description: `List funding instruments for an X Ads account.
|
|
@@ -6910,7 +7112,7 @@ Examples:
|
|
|
6910
7112
|
});
|
|
6911
7113
|
|
|
6912
7114
|
// src/commands/ads/x/line-items.ts
|
|
6913
|
-
import { defineCommand as
|
|
7115
|
+
import { defineCommand as defineCommand66 } from "citty";
|
|
6914
7116
|
registerSchema({
|
|
6915
7117
|
command: "ads.x.lineItems",
|
|
6916
7118
|
description: "List line items (ad groups) for an X Ads account. Returns bid, product_type, objective, placements, schedule. Filter by campaign-ids or line-item-ids (CSV).",
|
|
@@ -6922,7 +7124,7 @@ registerSchema({
|
|
|
6922
7124
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6923
7125
|
}
|
|
6924
7126
|
});
|
|
6925
|
-
var lineItemsCommand =
|
|
7127
|
+
var lineItemsCommand = defineCommand66({
|
|
6926
7128
|
meta: {
|
|
6927
7129
|
name: "line-items",
|
|
6928
7130
|
description: `List X Ads line items (ad groups).
|
|
@@ -6963,7 +7165,7 @@ Examples:
|
|
|
6963
7165
|
});
|
|
6964
7166
|
|
|
6965
7167
|
// src/commands/ads/x/media.ts
|
|
6966
|
-
import { defineCommand as
|
|
7168
|
+
import { defineCommand as defineCommand67 } from "citty";
|
|
6967
7169
|
registerSchema({
|
|
6968
7170
|
command: "ads.x.media",
|
|
6969
7171
|
description: "List media assets in the X Ads media library (images, GIFs, videos). Filter by media-type (IMAGE, GIF, VIDEO).",
|
|
@@ -6973,7 +7175,7 @@ registerSchema({
|
|
|
6973
7175
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6974
7176
|
}
|
|
6975
7177
|
});
|
|
6976
|
-
var mediaCommand =
|
|
7178
|
+
var mediaCommand = defineCommand67({
|
|
6977
7179
|
meta: {
|
|
6978
7180
|
name: "media",
|
|
6979
7181
|
description: `List media assets in the X Ads media library.
|
|
@@ -7025,7 +7227,7 @@ Examples:
|
|
|
7025
7227
|
});
|
|
7026
7228
|
|
|
7027
7229
|
// src/commands/ads/x/promoted-tweets.ts
|
|
7028
|
-
import { defineCommand as
|
|
7230
|
+
import { defineCommand as defineCommand68 } from "citty";
|
|
7029
7231
|
registerSchema({
|
|
7030
7232
|
command: "ads.x.promotedTweets",
|
|
7031
7233
|
description: "List promoted tweets for an X Ads account. Returns id, line_item_id, tweet_id, approval_status. Filter by line-item-ids (CSV).",
|
|
@@ -7036,7 +7238,7 @@ registerSchema({
|
|
|
7036
7238
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7037
7239
|
}
|
|
7038
7240
|
});
|
|
7039
|
-
var promotedTweetsCommand =
|
|
7241
|
+
var promotedTweetsCommand = defineCommand68({
|
|
7040
7242
|
meta: {
|
|
7041
7243
|
name: "promoted-tweets",
|
|
7042
7244
|
description: `List X Ads promoted tweets.
|
|
@@ -7090,11 +7292,11 @@ Examples:
|
|
|
7090
7292
|
});
|
|
7091
7293
|
|
|
7092
7294
|
// src/commands/ads/x/stats/index.ts
|
|
7093
|
-
import { defineCommand as
|
|
7295
|
+
import { defineCommand as defineCommand73 } from "citty";
|
|
7094
7296
|
|
|
7095
7297
|
// src/commands/ads/x/stats/job.ts
|
|
7096
7298
|
import { gunzipSync } from "zlib";
|
|
7097
|
-
import { defineCommand as
|
|
7299
|
+
import { defineCommand as defineCommand69 } from "citty";
|
|
7098
7300
|
var POLL_INTERVAL_MS2 = 1e4;
|
|
7099
7301
|
var DEADLINE_MS = 12 * 60 * 1e3;
|
|
7100
7302
|
var RESULT_CACHE_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
@@ -7164,7 +7366,7 @@ async function pollUntilDone(accountId, jobId) {
|
|
|
7164
7366
|
function buildCacheKey(body) {
|
|
7165
7367
|
return `stats-job:${JSON.stringify(body)}`;
|
|
7166
7368
|
}
|
|
7167
|
-
var statsJobCommand =
|
|
7369
|
+
var statsJobCommand = defineCommand69({
|
|
7168
7370
|
meta: {
|
|
7169
7371
|
name: "job",
|
|
7170
7372
|
description: `Async X Ads stats job, sync from the CLI's perspective. Creates \u2192 polls \u2192 downloads \u2192 returns.
|
|
@@ -7269,7 +7471,7 @@ For fine-grained control (don't wait, poll yourself), use:
|
|
|
7269
7471
|
});
|
|
7270
7472
|
|
|
7271
7473
|
// src/commands/ads/x/stats/job-create.ts
|
|
7272
|
-
import { defineCommand as
|
|
7474
|
+
import { defineCommand as defineCommand70 } from "citty";
|
|
7273
7475
|
registerSchema({
|
|
7274
7476
|
command: "ads.x.statsJobCreate",
|
|
7275
7477
|
description: "Create an asynchronous X Ads stats job (range up to 90 days non-segmented, 45 days segmented). Returns a job id; poll with `stats job-status`. Times must be ISO 8601 hour-aligned.",
|
|
@@ -7292,7 +7494,7 @@ function parseCsv3(v) {
|
|
|
7292
7494
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
7293
7495
|
return parts.length > 0 ? parts : void 0;
|
|
7294
7496
|
}
|
|
7295
|
-
var statsJobCreateCommand =
|
|
7497
|
+
var statsJobCreateCommand = defineCommand70({
|
|
7296
7498
|
meta: {
|
|
7297
7499
|
name: "job-create",
|
|
7298
7500
|
description: `Create an async X Ads stats job (up to 90 days, supports segmentation).
|
|
@@ -7355,7 +7557,7 @@ Examples:
|
|
|
7355
7557
|
});
|
|
7356
7558
|
|
|
7357
7559
|
// src/commands/ads/x/stats/job-status.ts
|
|
7358
|
-
import { defineCommand as
|
|
7560
|
+
import { defineCommand as defineCommand71 } from "citty";
|
|
7359
7561
|
registerSchema({
|
|
7360
7562
|
command: "ads.x.statsJobStatus",
|
|
7361
7563
|
description: "Check the status of one or more X Ads stats jobs. Returns status (PROCESSING|SUCCESS|FAILED) and a downloadable url when SUCCESS. Pass --job-id or --job-ids (CSV).",
|
|
@@ -7365,7 +7567,7 @@ registerSchema({
|
|
|
7365
7567
|
"job-ids": { type: "string", description: "CSV of job IDs", required: false }
|
|
7366
7568
|
}
|
|
7367
7569
|
});
|
|
7368
|
-
var statsJobStatusCommand =
|
|
7570
|
+
var statsJobStatusCommand = defineCommand71({
|
|
7369
7571
|
meta: {
|
|
7370
7572
|
name: "job-status",
|
|
7371
7573
|
description: `Poll the status of an async X Ads stats job.
|
|
@@ -7406,7 +7608,7 @@ Examples:
|
|
|
7406
7608
|
});
|
|
7407
7609
|
|
|
7408
7610
|
// src/commands/ads/x/stats/sync.ts
|
|
7409
|
-
import { defineCommand as
|
|
7611
|
+
import { defineCommand as defineCommand72 } from "citty";
|
|
7410
7612
|
|
|
7411
7613
|
// src/commands/ads/x/presets.ts
|
|
7412
7614
|
var X_STATS_PRESETS = [
|
|
@@ -7565,7 +7767,7 @@ async function runSync(args, q) {
|
|
|
7565
7767
|
process.exit(1);
|
|
7566
7768
|
}
|
|
7567
7769
|
}
|
|
7568
|
-
var statsSyncCommand =
|
|
7770
|
+
var statsSyncCommand = defineCommand72({
|
|
7569
7771
|
meta: {
|
|
7570
7772
|
name: "sync",
|
|
7571
7773
|
description: `Synchronous X Ads analytics (max 7-day window).
|
|
@@ -7608,7 +7810,7 @@ Examples:
|
|
|
7608
7810
|
});
|
|
7609
7811
|
|
|
7610
7812
|
// src/commands/ads/x/stats/index.ts
|
|
7611
|
-
var statsCommand =
|
|
7813
|
+
var statsCommand = defineCommand73({
|
|
7612
7814
|
meta: {
|
|
7613
7815
|
name: "stats",
|
|
7614
7816
|
description: `X Ads analytics. Sync (\u22647 days, no segmentation) or async jobs (\u226490 days, segmentable).
|
|
@@ -7636,7 +7838,7 @@ Examples:
|
|
|
7636
7838
|
});
|
|
7637
7839
|
|
|
7638
7840
|
// src/commands/ads/x/targeting-constants.ts
|
|
7639
|
-
import { defineCommand as
|
|
7841
|
+
import { defineCommand as defineCommand74 } from "citty";
|
|
7640
7842
|
var ALLOWED_CONSTANTS = [
|
|
7641
7843
|
"locations",
|
|
7642
7844
|
"interests",
|
|
@@ -7664,7 +7866,7 @@ registerSchema({
|
|
|
7664
7866
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7665
7867
|
}
|
|
7666
7868
|
});
|
|
7667
|
-
var targetingConstantsCommand =
|
|
7869
|
+
var targetingConstantsCommand = defineCommand74({
|
|
7668
7870
|
meta: {
|
|
7669
7871
|
name: "targeting-constants",
|
|
7670
7872
|
description: `Lookup X Ads targeting constants.
|
|
@@ -7714,7 +7916,7 @@ Examples:
|
|
|
7714
7916
|
});
|
|
7715
7917
|
|
|
7716
7918
|
// src/commands/ads/x/targeting-criteria.ts
|
|
7717
|
-
import { defineCommand as
|
|
7919
|
+
import { defineCommand as defineCommand75 } from "citty";
|
|
7718
7920
|
registerSchema({
|
|
7719
7921
|
command: "ads.x.targetingCriteria",
|
|
7720
7922
|
description: "List targeting criteria attached to line items in an X Ads account. Returns targeting_type, targeting_value, name, operator_type per criterion. Filter by line-item-ids.",
|
|
@@ -7724,7 +7926,7 @@ registerSchema({
|
|
|
7724
7926
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7725
7927
|
}
|
|
7726
7928
|
});
|
|
7727
|
-
var targetingCriteriaCommand =
|
|
7929
|
+
var targetingCriteriaCommand = defineCommand75({
|
|
7728
7930
|
meta: {
|
|
7729
7931
|
name: "targeting-criteria",
|
|
7730
7932
|
description: `List targeting criteria attached to line items.
|
|
@@ -7775,7 +7977,7 @@ Examples:
|
|
|
7775
7977
|
});
|
|
7776
7978
|
|
|
7777
7979
|
// src/commands/ads/x/index.ts
|
|
7778
|
-
var xCommand =
|
|
7980
|
+
var xCommand = defineCommand76({
|
|
7779
7981
|
meta: {
|
|
7780
7982
|
name: "x",
|
|
7781
7983
|
description: `X (Twitter) Ads commands. Read campaigns, line items, promoted tweets, creatives, audiences, and analytics.
|
|
@@ -7813,7 +8015,7 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
|
|
|
7813
8015
|
});
|
|
7814
8016
|
|
|
7815
8017
|
// src/commands/ads/index.ts
|
|
7816
|
-
var adsCommand =
|
|
8018
|
+
var adsCommand = defineCommand77({
|
|
7817
8019
|
meta: {
|
|
7818
8020
|
name: "ads",
|
|
7819
8021
|
description: `Ad platform commands. Each platform exposes its own native command surface \u2014 no forced parity.
|
|
@@ -7843,11 +8045,11 @@ Examples:
|
|
|
7843
8045
|
});
|
|
7844
8046
|
|
|
7845
8047
|
// src/commands/canvas/index.ts
|
|
7846
|
-
import { defineCommand as
|
|
8048
|
+
import { defineCommand as defineCommand84 } from "citty";
|
|
7847
8049
|
|
|
7848
8050
|
// src/commands/canvas/catalog.ts
|
|
7849
|
-
import { defineCommand as
|
|
7850
|
-
var catalogCommand =
|
|
8051
|
+
import { defineCommand as defineCommand78 } from "citty";
|
|
8052
|
+
var catalogCommand = defineCommand78({
|
|
7851
8053
|
meta: {
|
|
7852
8054
|
name: "catalog",
|
|
7853
8055
|
description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
|
|
@@ -7864,9 +8066,9 @@ import { execFile } from "child_process";
|
|
|
7864
8066
|
import { readdir, readFile, stat } from "fs/promises";
|
|
7865
8067
|
import path from "path";
|
|
7866
8068
|
import { promisify } from "util";
|
|
7867
|
-
import { defineCommand as
|
|
8069
|
+
import { defineCommand as defineCommand79 } from "citty";
|
|
7868
8070
|
var execFileAsync = promisify(execFile);
|
|
7869
|
-
var inspectCommand =
|
|
8071
|
+
var inspectCommand = defineCommand79({
|
|
7870
8072
|
meta: {
|
|
7871
8073
|
name: "inspect",
|
|
7872
8074
|
description: "Dump a one-page summary of a canvas run: per-node duration + cache status, list of output files in the run dir, and optionally three thumbnail frames per video output. Pass either a run_id (resolved against --outputs-dir) or an absolute run directory."
|
|
@@ -7975,7 +8177,7 @@ async function probeDuration(filePath) {
|
|
|
7975
8177
|
// src/commands/canvas/run.ts
|
|
7976
8178
|
import { readFile as readFile2 } from "fs/promises";
|
|
7977
8179
|
import path2 from "path";
|
|
7978
|
-
import { defineCommand as
|
|
8180
|
+
import { defineCommand as defineCommand80 } from "citty";
|
|
7979
8181
|
|
|
7980
8182
|
// src/commands/canvas/placeholders.ts
|
|
7981
8183
|
function unsuppliedPlaceholderAssets(canvas) {
|
|
@@ -7994,7 +8196,7 @@ function unsuppliedPlaceholderAssets(canvas) {
|
|
|
7994
8196
|
}
|
|
7995
8197
|
|
|
7996
8198
|
// src/commands/canvas/run.ts
|
|
7997
|
-
var runCommand =
|
|
8199
|
+
var runCommand = defineCommand80({
|
|
7998
8200
|
meta: { name: "run", description: "Validate and execute a canvas JSON file." },
|
|
7999
8201
|
args: {
|
|
8000
8202
|
file: { type: "positional", required: true, description: "Path to canvas JSON" },
|
|
@@ -8079,7 +8281,7 @@ var runCommand = defineCommand76({
|
|
|
8079
8281
|
// src/commands/canvas/scaffold-static-ad.ts
|
|
8080
8282
|
import { readFile as readFile3, writeFile } from "fs/promises";
|
|
8081
8283
|
import path3 from "path";
|
|
8082
|
-
import { defineCommand as
|
|
8284
|
+
import { defineCommand as defineCommand81 } from "citty";
|
|
8083
8285
|
|
|
8084
8286
|
// src/engine/scaffold/staticAd.ts
|
|
8085
8287
|
import { z as z2 } from "zod";
|
|
@@ -8398,7 +8600,7 @@ async function runVisionPasses(canvas) {
|
|
|
8398
8600
|
return fail("read_outputs", e instanceof Error ? e.message : String(e));
|
|
8399
8601
|
}
|
|
8400
8602
|
}
|
|
8401
|
-
var scaffoldStaticAdCommand =
|
|
8603
|
+
var scaffoldStaticAdCommand = defineCommand81({
|
|
8402
8604
|
meta: {
|
|
8403
8605
|
name: "scaffold-static-ad",
|
|
8404
8606
|
description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. Edit prompt.json and drop the real assets, then `baker canvas run` it."
|
|
@@ -8492,7 +8694,7 @@ var scaffoldStaticAdCommand = defineCommand77({
|
|
|
8492
8694
|
// src/commands/canvas/scaffold-video.ts
|
|
8493
8695
|
import { cp, mkdir, readFile as readFile5, writeFile as writeFile2 } from "fs/promises";
|
|
8494
8696
|
import path5 from "path";
|
|
8495
|
-
import { defineCommand as
|
|
8697
|
+
import { defineCommand as defineCommand82 } from "citty";
|
|
8496
8698
|
|
|
8497
8699
|
// src/engine/nodes/local/lib/sceneDetect.ts
|
|
8498
8700
|
import { execFile as execFile2 } from "child_process";
|
|
@@ -11143,7 +11345,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
|
|
|
11143
11345
|
return fail2("deconstruct", e instanceof Error ? e.message : String(e));
|
|
11144
11346
|
}
|
|
11145
11347
|
}
|
|
11146
|
-
var scaffoldVideoCommand =
|
|
11348
|
+
var scaffoldVideoCommand = defineCommand82({
|
|
11147
11349
|
meta: {
|
|
11148
11350
|
name: "scaffold-video",
|
|
11149
11351
|
description: "Turn a reference video into a runnable reproduction canvas in one command. Runs billed passes \u2014 video_deconstruct (the full scene-by-scene blueprint + transcript, baked to prompt.json as the editable 'prompt') and an AI selection of the video's RECURRING identity elements (person/animal/product/logo) \u2014 then scaffolds a pipeline where every scene boundary is a static-ad-grade frame (the blueprint as target_blueprint, a reference legend, the real frame as anchor) and each recurring element gets ONE shared [TODO] ingest slot wired into every frame it appears in. The clips feed Seedance an ultra-detailed motion brief (action, camera, dialogue, transcript). Edit prompt.json, drop the real source images, then `baker canvas run`."
|
|
@@ -11287,8 +11489,8 @@ var scaffoldVideoCommand = defineCommand78({
|
|
|
11287
11489
|
// src/commands/canvas/validate.ts
|
|
11288
11490
|
import { readFile as readFile6 } from "fs/promises";
|
|
11289
11491
|
import path6 from "path";
|
|
11290
|
-
import { defineCommand as
|
|
11291
|
-
var validateCommand =
|
|
11492
|
+
import { defineCommand as defineCommand83 } from "citty";
|
|
11493
|
+
var validateCommand = defineCommand83({
|
|
11292
11494
|
meta: {
|
|
11293
11495
|
name: "validate",
|
|
11294
11496
|
description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
|
|
@@ -11330,7 +11532,7 @@ var validateCommand = defineCommand79({
|
|
|
11330
11532
|
});
|
|
11331
11533
|
|
|
11332
11534
|
// src/commands/canvas/index.ts
|
|
11333
|
-
var canvasCommand =
|
|
11535
|
+
var canvasCommand = defineCommand84({
|
|
11334
11536
|
meta: {
|
|
11335
11537
|
name: "canvas",
|
|
11336
11538
|
description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
|
|
@@ -11355,11 +11557,161 @@ Subcommands:
|
|
|
11355
11557
|
}
|
|
11356
11558
|
});
|
|
11357
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
|
+
|
|
11358
11710
|
// src/commands/ga4/index.ts
|
|
11359
|
-
import { defineCommand as
|
|
11711
|
+
import { defineCommand as defineCommand90 } from "citty";
|
|
11360
11712
|
|
|
11361
11713
|
// src/commands/ga4/audit.ts
|
|
11362
|
-
import { defineCommand as
|
|
11714
|
+
import { defineCommand as defineCommand87 } from "citty";
|
|
11363
11715
|
|
|
11364
11716
|
// src/commands/ga4/resolve.ts
|
|
11365
11717
|
async function fetchProperties(useCache = true) {
|
|
@@ -11422,7 +11774,7 @@ registerSchema({
|
|
|
11422
11774
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11423
11775
|
}
|
|
11424
11776
|
});
|
|
11425
|
-
var auditCommand2 =
|
|
11777
|
+
var auditCommand2 = defineCommand87({
|
|
11426
11778
|
meta: {
|
|
11427
11779
|
name: "audit",
|
|
11428
11780
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -11474,7 +11826,7 @@ Examples:
|
|
|
11474
11826
|
});
|
|
11475
11827
|
|
|
11476
11828
|
// src/commands/ga4/properties.ts
|
|
11477
|
-
import { defineCommand as
|
|
11829
|
+
import { defineCommand as defineCommand88 } from "citty";
|
|
11478
11830
|
registerSchema({
|
|
11479
11831
|
command: "ga4.properties",
|
|
11480
11832
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -11482,7 +11834,7 @@ registerSchema({
|
|
|
11482
11834
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11483
11835
|
}
|
|
11484
11836
|
});
|
|
11485
|
-
var propertiesCommand =
|
|
11837
|
+
var propertiesCommand = defineCommand88({
|
|
11486
11838
|
meta: {
|
|
11487
11839
|
name: "properties",
|
|
11488
11840
|
description: `List accessible GA4 properties.
|
|
@@ -11532,7 +11884,7 @@ Examples:
|
|
|
11532
11884
|
// src/commands/ga4/query.ts
|
|
11533
11885
|
import { appendFileSync as appendFileSync2, existsSync as existsSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
|
|
11534
11886
|
import { resolve as resolve2 } from "path";
|
|
11535
|
-
import { defineCommand as
|
|
11887
|
+
import { defineCommand as defineCommand89 } from "citty";
|
|
11536
11888
|
|
|
11537
11889
|
// src/commands/ga4/presets.ts
|
|
11538
11890
|
var GA4_PRESETS = [
|
|
@@ -11664,7 +12016,7 @@ function handleError(err) {
|
|
|
11664
12016
|
});
|
|
11665
12017
|
process.exit(1);
|
|
11666
12018
|
}
|
|
11667
|
-
var queryCommand2 =
|
|
12019
|
+
var queryCommand2 = defineCommand89({
|
|
11668
12020
|
meta: {
|
|
11669
12021
|
name: "query",
|
|
11670
12022
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -11735,7 +12087,7 @@ Free-form (escape hatch):
|
|
|
11735
12087
|
});
|
|
11736
12088
|
|
|
11737
12089
|
// src/commands/ga4/index.ts
|
|
11738
|
-
var ga4Command =
|
|
12090
|
+
var ga4Command = defineCommand90({
|
|
11739
12091
|
meta: {
|
|
11740
12092
|
name: "ga4",
|
|
11741
12093
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -11758,12 +12110,12 @@ Examples:
|
|
|
11758
12110
|
});
|
|
11759
12111
|
|
|
11760
12112
|
// src/commands/gsc/index.ts
|
|
11761
|
-
import { defineCommand as
|
|
12113
|
+
import { defineCommand as defineCommand94 } from "citty";
|
|
11762
12114
|
|
|
11763
12115
|
// src/commands/gsc/query.ts
|
|
11764
12116
|
import { appendFileSync as appendFileSync3, existsSync as existsSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
11765
12117
|
import { resolve as resolve3 } from "path";
|
|
11766
|
-
import { defineCommand as
|
|
12118
|
+
import { defineCommand as defineCommand91 } from "citty";
|
|
11767
12119
|
|
|
11768
12120
|
// src/commands/gsc/presets.ts
|
|
11769
12121
|
var GSC_PRESETS = [
|
|
@@ -11951,7 +12303,7 @@ function handleError2(err) {
|
|
|
11951
12303
|
});
|
|
11952
12304
|
process.exit(1);
|
|
11953
12305
|
}
|
|
11954
|
-
var queryCommand3 =
|
|
12306
|
+
var queryCommand3 = defineCommand91({
|
|
11955
12307
|
meta: {
|
|
11956
12308
|
name: "query",
|
|
11957
12309
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -12029,7 +12381,7 @@ Free-form (escape hatch):
|
|
|
12029
12381
|
});
|
|
12030
12382
|
|
|
12031
12383
|
// src/commands/gsc/sitemaps.ts
|
|
12032
|
-
import { defineCommand as
|
|
12384
|
+
import { defineCommand as defineCommand92 } from "citty";
|
|
12033
12385
|
registerSchema({
|
|
12034
12386
|
command: "gsc.sitemaps",
|
|
12035
12387
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -12038,7 +12390,7 @@ registerSchema({
|
|
|
12038
12390
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
12039
12391
|
}
|
|
12040
12392
|
});
|
|
12041
|
-
var sitemapsCommand =
|
|
12393
|
+
var sitemapsCommand = defineCommand92({
|
|
12042
12394
|
meta: {
|
|
12043
12395
|
name: "sitemaps",
|
|
12044
12396
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -12088,7 +12440,7 @@ Examples:
|
|
|
12088
12440
|
});
|
|
12089
12441
|
|
|
12090
12442
|
// src/commands/gsc/sites.ts
|
|
12091
|
-
import { defineCommand as
|
|
12443
|
+
import { defineCommand as defineCommand93 } from "citty";
|
|
12092
12444
|
registerSchema({
|
|
12093
12445
|
command: "gsc.sites",
|
|
12094
12446
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -12096,7 +12448,7 @@ registerSchema({
|
|
|
12096
12448
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
12097
12449
|
}
|
|
12098
12450
|
});
|
|
12099
|
-
var sitesCommand =
|
|
12451
|
+
var sitesCommand = defineCommand93({
|
|
12100
12452
|
meta: {
|
|
12101
12453
|
name: "sites",
|
|
12102
12454
|
description: `List verified Search Console sites.
|
|
@@ -12144,7 +12496,7 @@ Examples:
|
|
|
12144
12496
|
});
|
|
12145
12497
|
|
|
12146
12498
|
// src/commands/gsc/index.ts
|
|
12147
|
-
var gscCommand =
|
|
12499
|
+
var gscCommand = defineCommand94({
|
|
12148
12500
|
meta: {
|
|
12149
12501
|
name: "gsc",
|
|
12150
12502
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -12167,10 +12519,10 @@ Examples:
|
|
|
12167
12519
|
});
|
|
12168
12520
|
|
|
12169
12521
|
// src/commands/images/index.ts
|
|
12170
|
-
import { defineCommand as
|
|
12522
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
12171
12523
|
|
|
12172
12524
|
// src/commands/images/crop.ts
|
|
12173
|
-
import { defineCommand as
|
|
12525
|
+
import { defineCommand as defineCommand95 } from "citty";
|
|
12174
12526
|
|
|
12175
12527
|
// src/lib/image/crop-sprite.ts
|
|
12176
12528
|
import sharp from "sharp";
|
|
@@ -12185,8 +12537,8 @@ function cropSprite(input, region) {
|
|
|
12185
12537
|
|
|
12186
12538
|
// src/lib/image/io.ts
|
|
12187
12539
|
import { randomBytes } from "crypto";
|
|
12188
|
-
import { glob as fsGlob, readFile as
|
|
12189
|
-
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";
|
|
12190
12542
|
var REMOTE_RE = /^https?:\/\//i;
|
|
12191
12543
|
var GLOB_RE = /[*?[\]{}]/;
|
|
12192
12544
|
function isRemoteUrl(value) {
|
|
@@ -12221,7 +12573,7 @@ async function readImageBuffer(pathOrUrl) {
|
|
|
12221
12573
|
}
|
|
12222
12574
|
return Buffer.from(await response.arrayBuffer());
|
|
12223
12575
|
}
|
|
12224
|
-
return
|
|
12576
|
+
return readFile8(pathOrUrl);
|
|
12225
12577
|
}
|
|
12226
12578
|
async function isDirectory(path7) {
|
|
12227
12579
|
try {
|
|
@@ -12232,7 +12584,7 @@ async function isDirectory(path7) {
|
|
|
12232
12584
|
}
|
|
12233
12585
|
}
|
|
12234
12586
|
async function resolveOutputPath(inputPath, outputArg, options) {
|
|
12235
|
-
const base = options.newExtension ? inputPath.slice(0, -
|
|
12587
|
+
const base = options.newExtension ? inputPath.slice(0, -extname2(inputPath).length) + options.newExtension : inputPath;
|
|
12236
12588
|
if (!outputArg) return base;
|
|
12237
12589
|
if (options.multipleInputs || await isDirectory(outputArg)) {
|
|
12238
12590
|
const filename = base.split("/").pop() ?? "out.png";
|
|
@@ -12295,7 +12647,7 @@ function emitError2(err) {
|
|
|
12295
12647
|
}
|
|
12296
12648
|
process.exit(1);
|
|
12297
12649
|
}
|
|
12298
|
-
var cropCommand =
|
|
12650
|
+
var cropCommand = defineCommand95({
|
|
12299
12651
|
meta: {
|
|
12300
12652
|
name: "crop",
|
|
12301
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"
|
|
@@ -12331,7 +12683,7 @@ var cropCommand = defineCommand89({
|
|
|
12331
12683
|
});
|
|
12332
12684
|
|
|
12333
12685
|
// src/commands/images/delete.ts
|
|
12334
|
-
import { defineCommand as
|
|
12686
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
12335
12687
|
registerSchema({
|
|
12336
12688
|
command: "images.delete",
|
|
12337
12689
|
description: "Delete an image by ID",
|
|
@@ -12345,7 +12697,7 @@ registerSchema({
|
|
|
12345
12697
|
}
|
|
12346
12698
|
}
|
|
12347
12699
|
});
|
|
12348
|
-
var deleteCommand =
|
|
12700
|
+
var deleteCommand = defineCommand96({
|
|
12349
12701
|
meta: {
|
|
12350
12702
|
name: "delete",
|
|
12351
12703
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -12386,7 +12738,7 @@ var deleteCommand = defineCommand90({
|
|
|
12386
12738
|
});
|
|
12387
12739
|
|
|
12388
12740
|
// src/commands/images/dimensions.ts
|
|
12389
|
-
import { defineCommand as
|
|
12741
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
12390
12742
|
|
|
12391
12743
|
// src/lib/image/dimensions.ts
|
|
12392
12744
|
import { imageSize } from "image-size";
|
|
@@ -12409,7 +12761,7 @@ registerSchema({
|
|
|
12409
12761
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
12410
12762
|
}
|
|
12411
12763
|
});
|
|
12412
|
-
var dimensionsCommand =
|
|
12764
|
+
var dimensionsCommand = defineCommand97({
|
|
12413
12765
|
meta: {
|
|
12414
12766
|
name: "dimensions",
|
|
12415
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"
|
|
@@ -12453,7 +12805,7 @@ var dimensionsCommand = defineCommand91({
|
|
|
12453
12805
|
});
|
|
12454
12806
|
|
|
12455
12807
|
// src/commands/images/extract.ts
|
|
12456
|
-
import { defineCommand as
|
|
12808
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
12457
12809
|
registerSchema({
|
|
12458
12810
|
command: "images.extract",
|
|
12459
12811
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -12469,7 +12821,7 @@ registerSchema({
|
|
|
12469
12821
|
}
|
|
12470
12822
|
}
|
|
12471
12823
|
});
|
|
12472
|
-
var extractCommand =
|
|
12824
|
+
var extractCommand = defineCommand98({
|
|
12473
12825
|
meta: {
|
|
12474
12826
|
name: "extract",
|
|
12475
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"
|
|
@@ -12507,7 +12859,7 @@ var extractCommand = defineCommand92({
|
|
|
12507
12859
|
});
|
|
12508
12860
|
|
|
12509
12861
|
// src/commands/images/find.ts
|
|
12510
|
-
import { defineCommand as
|
|
12862
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
12511
12863
|
registerSchema({
|
|
12512
12864
|
command: "images.find",
|
|
12513
12865
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -12539,7 +12891,7 @@ registerSchema({
|
|
|
12539
12891
|
}
|
|
12540
12892
|
}
|
|
12541
12893
|
});
|
|
12542
|
-
var findCommand =
|
|
12894
|
+
var findCommand = defineCommand99({
|
|
12543
12895
|
meta: {
|
|
12544
12896
|
name: "find",
|
|
12545
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"
|
|
@@ -12585,8 +12937,8 @@ var findCommand = defineCommand93({
|
|
|
12585
12937
|
});
|
|
12586
12938
|
|
|
12587
12939
|
// src/commands/images/generate.ts
|
|
12588
|
-
import { readFile as
|
|
12589
|
-
import { defineCommand as
|
|
12940
|
+
import { readFile as readFile9 } from "fs/promises";
|
|
12941
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
12590
12942
|
import sharp2 from "sharp";
|
|
12591
12943
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
12592
12944
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -12668,7 +13020,7 @@ async function resolveReferences(spec) {
|
|
|
12668
13020
|
}
|
|
12669
13021
|
let raw;
|
|
12670
13022
|
try {
|
|
12671
|
-
raw = await
|
|
13023
|
+
raw = await readFile9(entry);
|
|
12672
13024
|
} catch {
|
|
12673
13025
|
throw new ApiError("VALIDATION_ERROR", `Reference file not found: ${entry}`);
|
|
12674
13026
|
}
|
|
@@ -12682,7 +13034,7 @@ async function resolveReferences(spec) {
|
|
|
12682
13034
|
}
|
|
12683
13035
|
return out;
|
|
12684
13036
|
}
|
|
12685
|
-
var generateCommand =
|
|
13037
|
+
var generateCommand = defineCommand100({
|
|
12686
13038
|
meta: {
|
|
12687
13039
|
name: "generate",
|
|
12688
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]]'"
|
|
@@ -12734,7 +13086,7 @@ var generateCommand = defineCommand94({
|
|
|
12734
13086
|
});
|
|
12735
13087
|
|
|
12736
13088
|
// src/commands/images/get.ts
|
|
12737
|
-
import { defineCommand as
|
|
13089
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
12738
13090
|
registerSchema({
|
|
12739
13091
|
command: "images.get",
|
|
12740
13092
|
description: "Get a single image by ID",
|
|
@@ -12742,7 +13094,7 @@ registerSchema({
|
|
|
12742
13094
|
id: { type: "string", description: "Image ID", required: true }
|
|
12743
13095
|
}
|
|
12744
13096
|
});
|
|
12745
|
-
var getCommand2 =
|
|
13097
|
+
var getCommand2 = defineCommand101({
|
|
12746
13098
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
12747
13099
|
args: {
|
|
12748
13100
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -12778,7 +13130,7 @@ var getCommand2 = defineCommand95({
|
|
|
12778
13130
|
});
|
|
12779
13131
|
|
|
12780
13132
|
// src/commands/images/gif.ts
|
|
12781
|
-
import { defineCommand as
|
|
13133
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
12782
13134
|
registerSchema({
|
|
12783
13135
|
command: "images.gif",
|
|
12784
13136
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -12810,7 +13162,7 @@ registerSchema({
|
|
|
12810
13162
|
}
|
|
12811
13163
|
}
|
|
12812
13164
|
});
|
|
12813
|
-
var gifCommand =
|
|
13165
|
+
var gifCommand = defineCommand102({
|
|
12814
13166
|
meta: {
|
|
12815
13167
|
name: "gif",
|
|
12816
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"
|
|
@@ -12857,7 +13209,7 @@ var gifCommand = defineCommand96({
|
|
|
12857
13209
|
});
|
|
12858
13210
|
|
|
12859
13211
|
// src/commands/images/google.ts
|
|
12860
|
-
import { defineCommand as
|
|
13212
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
12861
13213
|
registerSchema({
|
|
12862
13214
|
command: "images.google",
|
|
12863
13215
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -12893,7 +13245,7 @@ registerSchema({
|
|
|
12893
13245
|
}
|
|
12894
13246
|
}
|
|
12895
13247
|
});
|
|
12896
|
-
var googleCommand2 =
|
|
13248
|
+
var googleCommand2 = defineCommand103({
|
|
12897
13249
|
meta: {
|
|
12898
13250
|
name: "google",
|
|
12899
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"
|
|
@@ -12941,7 +13293,7 @@ var googleCommand2 = defineCommand97({
|
|
|
12941
13293
|
});
|
|
12942
13294
|
|
|
12943
13295
|
// src/commands/images/icon.ts
|
|
12944
|
-
import { defineCommand as
|
|
13296
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
12945
13297
|
registerSchema({
|
|
12946
13298
|
command: "images.icon",
|
|
12947
13299
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -12967,7 +13319,7 @@ registerSchema({
|
|
|
12967
13319
|
}
|
|
12968
13320
|
}
|
|
12969
13321
|
});
|
|
12970
|
-
var iconCommand =
|
|
13322
|
+
var iconCommand = defineCommand104({
|
|
12971
13323
|
meta: {
|
|
12972
13324
|
name: "icon",
|
|
12973
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'"
|
|
@@ -13007,7 +13359,7 @@ var iconCommand = defineCommand98({
|
|
|
13007
13359
|
});
|
|
13008
13360
|
|
|
13009
13361
|
// src/commands/images/ingest.ts
|
|
13010
|
-
import { defineCommand as
|
|
13362
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
13011
13363
|
registerSchema({
|
|
13012
13364
|
command: "images.ingest",
|
|
13013
13365
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -13019,7 +13371,7 @@ registerSchema({
|
|
|
13019
13371
|
context: { type: "string", description: "Description context hint", required: false }
|
|
13020
13372
|
}
|
|
13021
13373
|
});
|
|
13022
|
-
var ingestCommand =
|
|
13374
|
+
var ingestCommand = defineCommand105({
|
|
13023
13375
|
meta: {
|
|
13024
13376
|
name: "ingest",
|
|
13025
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"
|
|
@@ -13061,7 +13413,7 @@ var ingestCommand = defineCommand99({
|
|
|
13061
13413
|
});
|
|
13062
13414
|
|
|
13063
13415
|
// src/commands/images/library.ts
|
|
13064
|
-
import { defineCommand as
|
|
13416
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
13065
13417
|
registerSchema({
|
|
13066
13418
|
command: "images.library",
|
|
13067
13419
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -13087,7 +13439,7 @@ registerSchema({
|
|
|
13087
13439
|
}
|
|
13088
13440
|
}
|
|
13089
13441
|
});
|
|
13090
|
-
var libraryCommand =
|
|
13442
|
+
var libraryCommand = defineCommand106({
|
|
13091
13443
|
meta: {
|
|
13092
13444
|
name: "library",
|
|
13093
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"
|
|
@@ -13144,7 +13496,7 @@ var libraryCommand = defineCommand100({
|
|
|
13144
13496
|
});
|
|
13145
13497
|
|
|
13146
13498
|
// src/commands/images/logo.ts
|
|
13147
|
-
import { defineCommand as
|
|
13499
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
13148
13500
|
registerSchema({
|
|
13149
13501
|
command: "images.logo",
|
|
13150
13502
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -13169,7 +13521,7 @@ registerSchema({
|
|
|
13169
13521
|
}
|
|
13170
13522
|
}
|
|
13171
13523
|
});
|
|
13172
|
-
var logoCommand =
|
|
13524
|
+
var logoCommand = defineCommand107({
|
|
13173
13525
|
meta: {
|
|
13174
13526
|
name: "logo",
|
|
13175
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"
|
|
@@ -13207,7 +13559,7 @@ var logoCommand = defineCommand101({
|
|
|
13207
13559
|
});
|
|
13208
13560
|
|
|
13209
13561
|
// src/commands/images/normalize.ts
|
|
13210
|
-
import { defineCommand as
|
|
13562
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
13211
13563
|
|
|
13212
13564
|
// src/lib/image/color-changer.ts
|
|
13213
13565
|
import quantize from "quantize";
|
|
@@ -13939,7 +14291,7 @@ function coerceRawArgs(args) {
|
|
|
13939
14291
|
"dry-run": bool(args["dry-run"])
|
|
13940
14292
|
};
|
|
13941
14293
|
}
|
|
13942
|
-
var normalizeCommand =
|
|
14294
|
+
var normalizeCommand = defineCommand108({
|
|
13943
14295
|
meta: {
|
|
13944
14296
|
name: "normalize",
|
|
13945
14297
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -13994,7 +14346,7 @@ Examples:
|
|
|
13994
14346
|
});
|
|
13995
14347
|
|
|
13996
14348
|
// src/commands/images/pinterest.ts
|
|
13997
|
-
import { defineCommand as
|
|
14349
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
13998
14350
|
registerSchema({
|
|
13999
14351
|
command: "images.pinterest",
|
|
14000
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.",
|
|
@@ -14014,7 +14366,7 @@ registerSchema({
|
|
|
14014
14366
|
}
|
|
14015
14367
|
}
|
|
14016
14368
|
});
|
|
14017
|
-
var pinterestCommand =
|
|
14369
|
+
var pinterestCommand = defineCommand109({
|
|
14018
14370
|
meta: {
|
|
14019
14371
|
name: "pinterest",
|
|
14020
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'"
|
|
@@ -14054,7 +14406,7 @@ var pinterestCommand = defineCommand103({
|
|
|
14054
14406
|
});
|
|
14055
14407
|
|
|
14056
14408
|
// src/commands/images/screenshot.ts
|
|
14057
|
-
import { defineCommand as
|
|
14409
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
14058
14410
|
registerSchema({
|
|
14059
14411
|
command: "images.screenshot",
|
|
14060
14412
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -14070,7 +14422,7 @@ registerSchema({
|
|
|
14070
14422
|
}
|
|
14071
14423
|
}
|
|
14072
14424
|
});
|
|
14073
|
-
var screenshotCommand =
|
|
14425
|
+
var screenshotCommand = defineCommand110({
|
|
14074
14426
|
meta: {
|
|
14075
14427
|
name: "screenshot",
|
|
14076
14428
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -14120,7 +14472,7 @@ var screenshotCommand = defineCommand104({
|
|
|
14120
14472
|
});
|
|
14121
14473
|
|
|
14122
14474
|
// src/commands/images/search.ts
|
|
14123
|
-
import { defineCommand as
|
|
14475
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
14124
14476
|
registerSchema({
|
|
14125
14477
|
command: "images.search",
|
|
14126
14478
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -14136,7 +14488,7 @@ registerSchema({
|
|
|
14136
14488
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
14137
14489
|
}
|
|
14138
14490
|
});
|
|
14139
|
-
var searchCommand =
|
|
14491
|
+
var searchCommand = defineCommand111({
|
|
14140
14492
|
meta: {
|
|
14141
14493
|
name: "search",
|
|
14142
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"
|
|
@@ -14196,7 +14548,7 @@ var searchCommand = defineCommand105({
|
|
|
14196
14548
|
});
|
|
14197
14549
|
|
|
14198
14550
|
// src/commands/images/sticker.ts
|
|
14199
|
-
import { defineCommand as
|
|
14551
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
14200
14552
|
registerSchema({
|
|
14201
14553
|
command: "images.sticker",
|
|
14202
14554
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -14228,7 +14580,7 @@ registerSchema({
|
|
|
14228
14580
|
}
|
|
14229
14581
|
}
|
|
14230
14582
|
});
|
|
14231
|
-
var stickerCommand =
|
|
14583
|
+
var stickerCommand = defineCommand112({
|
|
14232
14584
|
meta: {
|
|
14233
14585
|
name: "sticker",
|
|
14234
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"
|
|
@@ -14275,7 +14627,7 @@ var stickerCommand = defineCommand106({
|
|
|
14275
14627
|
});
|
|
14276
14628
|
|
|
14277
14629
|
// src/commands/images/stock.ts
|
|
14278
|
-
import { defineCommand as
|
|
14630
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
14279
14631
|
registerSchema({
|
|
14280
14632
|
command: "images.stock",
|
|
14281
14633
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -14333,7 +14685,7 @@ registerSchema({
|
|
|
14333
14685
|
}
|
|
14334
14686
|
}
|
|
14335
14687
|
});
|
|
14336
|
-
var stockCommand =
|
|
14688
|
+
var stockCommand = defineCommand113({
|
|
14337
14689
|
meta: {
|
|
14338
14690
|
name: "stock",
|
|
14339
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"
|
|
@@ -14389,7 +14741,7 @@ var stockCommand = defineCommand107({
|
|
|
14389
14741
|
});
|
|
14390
14742
|
|
|
14391
14743
|
// src/lib/tags-command.ts
|
|
14392
|
-
import { defineCommand as
|
|
14744
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
14393
14745
|
function makeTagsCommand(command, label, endpoint) {
|
|
14394
14746
|
registerSchema({
|
|
14395
14747
|
command: `${command}.tags`,
|
|
@@ -14398,7 +14750,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
14398
14750
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
14399
14751
|
}
|
|
14400
14752
|
});
|
|
14401
|
-
return
|
|
14753
|
+
return defineCommand114({
|
|
14402
14754
|
meta: {
|
|
14403
14755
|
name: "tags",
|
|
14404
14756
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -14431,12 +14783,12 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
14431
14783
|
}
|
|
14432
14784
|
|
|
14433
14785
|
// src/commands/images/tags.ts
|
|
14434
|
-
var
|
|
14786
|
+
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
14435
14787
|
|
|
14436
14788
|
// src/commands/images/upload.ts
|
|
14437
|
-
import { readFile as
|
|
14438
|
-
import { extname as
|
|
14439
|
-
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";
|
|
14440
14792
|
var MIME_MAP = {
|
|
14441
14793
|
".png": "image/png",
|
|
14442
14794
|
".jpg": "image/jpeg",
|
|
@@ -14484,14 +14836,14 @@ function isRemoteUrl2(value) {
|
|
|
14484
14836
|
return /^https?:\/\//i.test(value);
|
|
14485
14837
|
}
|
|
14486
14838
|
function detectContentType(filePath) {
|
|
14487
|
-
const ext =
|
|
14839
|
+
const ext = extname3(filePath).toLowerCase();
|
|
14488
14840
|
const mime = MIME_MAP[ext];
|
|
14489
14841
|
if (!mime) {
|
|
14490
14842
|
throw new ApiError("VALIDATION_ERROR", `Cannot detect content type for extension "${ext}". Use --content-type.`);
|
|
14491
14843
|
}
|
|
14492
14844
|
return mime;
|
|
14493
14845
|
}
|
|
14494
|
-
var uploadCommand =
|
|
14846
|
+
var uploadCommand = defineCommand115({
|
|
14495
14847
|
meta: {
|
|
14496
14848
|
name: "upload",
|
|
14497
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'"
|
|
@@ -14574,7 +14926,7 @@ async function uploadLocal(target, args) {
|
|
|
14574
14926
|
});
|
|
14575
14927
|
return;
|
|
14576
14928
|
}
|
|
14577
|
-
const fileBuffer = await
|
|
14929
|
+
const fileBuffer = await readFile10(target);
|
|
14578
14930
|
const base64 = fileBuffer.toString("base64");
|
|
14579
14931
|
const body = { base64, contentType };
|
|
14580
14932
|
if (args.source) body.source = args.source;
|
|
@@ -14584,7 +14936,7 @@ async function uploadLocal(target, args) {
|
|
|
14584
14936
|
}
|
|
14585
14937
|
|
|
14586
14938
|
// src/commands/images/upscale.ts
|
|
14587
|
-
import { defineCommand as
|
|
14939
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
14588
14940
|
registerSchema({
|
|
14589
14941
|
command: "images.upscale",
|
|
14590
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).",
|
|
@@ -14599,7 +14951,7 @@ registerSchema({
|
|
|
14599
14951
|
}
|
|
14600
14952
|
});
|
|
14601
14953
|
var POLL_INTERVAL_MS3 = 1500;
|
|
14602
|
-
var upscaleCommand =
|
|
14954
|
+
var upscaleCommand = defineCommand116({
|
|
14603
14955
|
meta: {
|
|
14604
14956
|
name: "upscale",
|
|
14605
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"
|
|
@@ -14654,7 +15006,7 @@ var upscaleCommand = defineCommand110({
|
|
|
14654
15006
|
});
|
|
14655
15007
|
|
|
14656
15008
|
// src/commands/images/use.ts
|
|
14657
|
-
import { defineCommand as
|
|
15009
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
14658
15010
|
registerSchema({
|
|
14659
15011
|
command: "images.use",
|
|
14660
15012
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -14670,7 +15022,7 @@ registerSchema({
|
|
|
14670
15022
|
}
|
|
14671
15023
|
});
|
|
14672
15024
|
var POLL_INTERVAL_MS4 = 1500;
|
|
14673
|
-
var useCommand =
|
|
15025
|
+
var useCommand = defineCommand117({
|
|
14674
15026
|
meta: {
|
|
14675
15027
|
name: "use",
|
|
14676
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"
|
|
@@ -14716,7 +15068,7 @@ var useCommand = defineCommand111({
|
|
|
14716
15068
|
});
|
|
14717
15069
|
|
|
14718
15070
|
// src/commands/images/index.ts
|
|
14719
|
-
var imagesCommand =
|
|
15071
|
+
var imagesCommand = defineCommand118({
|
|
14720
15072
|
meta: {
|
|
14721
15073
|
name: "images",
|
|
14722
15074
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -14781,15 +15133,15 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
14781
15133
|
crop: cropCommand,
|
|
14782
15134
|
dimensions: dimensionsCommand,
|
|
14783
15135
|
upscale: upscaleCommand,
|
|
14784
|
-
tags:
|
|
15136
|
+
tags: tagsCommand2
|
|
14785
15137
|
}
|
|
14786
15138
|
});
|
|
14787
15139
|
|
|
14788
15140
|
// src/commands/research/index.ts
|
|
14789
|
-
import { defineCommand as
|
|
15141
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
14790
15142
|
|
|
14791
15143
|
// src/commands/research/advertisers.ts
|
|
14792
|
-
import { defineCommand as
|
|
15144
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
14793
15145
|
|
|
14794
15146
|
// src/commands/research/output.ts
|
|
14795
15147
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -14902,7 +15254,7 @@ var FIELDS3 = {
|
|
|
14902
15254
|
etv: "Estimated traffic value (USD)",
|
|
14903
15255
|
visibility: "SERP visibility score (0-1)"
|
|
14904
15256
|
};
|
|
14905
|
-
var advertisersCommand =
|
|
15257
|
+
var advertisersCommand = defineCommand119({
|
|
14906
15258
|
meta: {
|
|
14907
15259
|
name: "advertisers",
|
|
14908
15260
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -14949,7 +15301,7 @@ Examples:
|
|
|
14949
15301
|
});
|
|
14950
15302
|
|
|
14951
15303
|
// src/commands/research/autocomplete.ts
|
|
14952
|
-
import { defineCommand as
|
|
15304
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
14953
15305
|
registerSchema({
|
|
14954
15306
|
command: "research.autocomplete",
|
|
14955
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).",
|
|
@@ -14972,7 +15324,7 @@ registerSchema({
|
|
|
14972
15324
|
var FIELDS4 = {
|
|
14973
15325
|
suggestion: "Autocomplete suggestion from Google"
|
|
14974
15326
|
};
|
|
14975
|
-
var autocompleteCommand =
|
|
15327
|
+
var autocompleteCommand = defineCommand120({
|
|
14976
15328
|
meta: {
|
|
14977
15329
|
name: "autocomplete",
|
|
14978
15330
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -15018,7 +15370,7 @@ Examples:
|
|
|
15018
15370
|
});
|
|
15019
15371
|
|
|
15020
15372
|
// src/commands/research/countries.ts
|
|
15021
|
-
import { defineCommand as
|
|
15373
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
15022
15374
|
registerSchema({
|
|
15023
15375
|
command: "research.countries",
|
|
15024
15376
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -15075,7 +15427,7 @@ var FIELDS5 = {
|
|
|
15075
15427
|
code: "Country code to pass as --location",
|
|
15076
15428
|
name: "Country name"
|
|
15077
15429
|
};
|
|
15078
|
-
var countriesCommand =
|
|
15430
|
+
var countriesCommand = defineCommand121({
|
|
15079
15431
|
meta: {
|
|
15080
15432
|
name: "countries",
|
|
15081
15433
|
description: "List all supported country codes for --location flag."
|
|
@@ -15086,7 +15438,7 @@ var countriesCommand = defineCommand115({
|
|
|
15086
15438
|
});
|
|
15087
15439
|
|
|
15088
15440
|
// src/commands/research/intent.ts
|
|
15089
|
-
import { defineCommand as
|
|
15441
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
15090
15442
|
registerSchema({
|
|
15091
15443
|
command: "research.intent",
|
|
15092
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.",
|
|
@@ -15109,7 +15461,7 @@ var FIELDS6 = {
|
|
|
15109
15461
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
15110
15462
|
probability: "Confidence score 0.0-1.0"
|
|
15111
15463
|
};
|
|
15112
|
-
var intentCommand =
|
|
15464
|
+
var intentCommand = defineCommand122({
|
|
15113
15465
|
meta: {
|
|
15114
15466
|
name: "intent",
|
|
15115
15467
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -15157,7 +15509,7 @@ Examples:
|
|
|
15157
15509
|
});
|
|
15158
15510
|
|
|
15159
15511
|
// src/commands/research/keyword-gap.ts
|
|
15160
|
-
import { defineCommand as
|
|
15512
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
15161
15513
|
registerSchema({
|
|
15162
15514
|
command: "research.keyword-gap",
|
|
15163
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.",
|
|
@@ -15186,7 +15538,7 @@ var FIELDS7 = {
|
|
|
15186
15538
|
cpc: "Cost per click USD",
|
|
15187
15539
|
their_position: "Competitor's ranking position"
|
|
15188
15540
|
};
|
|
15189
|
-
var keywordGapCommand =
|
|
15541
|
+
var keywordGapCommand = defineCommand123({
|
|
15190
15542
|
meta: {
|
|
15191
15543
|
name: "keyword-gap",
|
|
15192
15544
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -15260,7 +15612,7 @@ Examples:
|
|
|
15260
15612
|
});
|
|
15261
15613
|
|
|
15262
15614
|
// src/commands/research/keywords-for-site.ts
|
|
15263
|
-
import { defineCommand as
|
|
15615
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
15264
15616
|
registerSchema({
|
|
15265
15617
|
command: "research.keywords-for-site",
|
|
15266
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.",
|
|
@@ -15293,7 +15645,7 @@ var FIELDS8 = {
|
|
|
15293
15645
|
competition: "LOW, MEDIUM, or HIGH",
|
|
15294
15646
|
competition_index: "Competition score 0-100"
|
|
15295
15647
|
};
|
|
15296
|
-
var keywordsForSiteCommand =
|
|
15648
|
+
var keywordsForSiteCommand = defineCommand124({
|
|
15297
15649
|
meta: {
|
|
15298
15650
|
name: "keywords-for-site",
|
|
15299
15651
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -15346,7 +15698,7 @@ Examples:
|
|
|
15346
15698
|
});
|
|
15347
15699
|
|
|
15348
15700
|
// src/commands/research/languages.ts
|
|
15349
|
-
import { defineCommand as
|
|
15701
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
15350
15702
|
registerSchema({
|
|
15351
15703
|
command: "research.languages",
|
|
15352
15704
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -15376,7 +15728,7 @@ var FIELDS9 = {
|
|
|
15376
15728
|
code: "Language code to pass as --language",
|
|
15377
15729
|
name: "Language name (also accepted by --language)"
|
|
15378
15730
|
};
|
|
15379
|
-
var languagesCommand2 =
|
|
15731
|
+
var languagesCommand2 = defineCommand125({
|
|
15380
15732
|
meta: {
|
|
15381
15733
|
name: "languages",
|
|
15382
15734
|
description: "List all supported language codes for --language flag."
|
|
@@ -15387,7 +15739,7 @@ var languagesCommand2 = defineCommand119({
|
|
|
15387
15739
|
});
|
|
15388
15740
|
|
|
15389
15741
|
// src/commands/research/lighthouse.ts
|
|
15390
|
-
import { defineCommand as
|
|
15742
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
15391
15743
|
registerSchema({
|
|
15392
15744
|
command: "research.lighthouse",
|
|
15393
15745
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -15406,7 +15758,7 @@ var FIELDS10 = {
|
|
|
15406
15758
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
15407
15759
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
15408
15760
|
};
|
|
15409
|
-
var lighthouseCommand =
|
|
15761
|
+
var lighthouseCommand = defineCommand126({
|
|
15410
15762
|
meta: {
|
|
15411
15763
|
name: "lighthouse",
|
|
15412
15764
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -15444,7 +15796,7 @@ Examples:
|
|
|
15444
15796
|
});
|
|
15445
15797
|
|
|
15446
15798
|
// src/commands/research/relevant-pages.ts
|
|
15447
|
-
import { defineCommand as
|
|
15799
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
15448
15800
|
registerSchema({
|
|
15449
15801
|
command: "research.relevant-pages",
|
|
15450
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).",
|
|
@@ -15470,7 +15822,7 @@ var FIELDS11 = {
|
|
|
15470
15822
|
keywords: "Total organic keywords the page ranks for",
|
|
15471
15823
|
top_10: "Keywords in positions 1-10"
|
|
15472
15824
|
};
|
|
15473
|
-
var relevantPagesCommand =
|
|
15825
|
+
var relevantPagesCommand = defineCommand127({
|
|
15474
15826
|
meta: {
|
|
15475
15827
|
name: "relevant-pages",
|
|
15476
15828
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -15516,7 +15868,7 @@ Examples:
|
|
|
15516
15868
|
});
|
|
15517
15869
|
|
|
15518
15870
|
// src/commands/research/web.ts
|
|
15519
|
-
import { defineCommand as
|
|
15871
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
15520
15872
|
registerSchema({
|
|
15521
15873
|
command: "research.web",
|
|
15522
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).",
|
|
@@ -15567,7 +15919,7 @@ async function runDeepResearch(question) {
|
|
|
15567
15919
|
}
|
|
15568
15920
|
throw new Error("Deep research timed out");
|
|
15569
15921
|
}
|
|
15570
|
-
var webCommand =
|
|
15922
|
+
var webCommand = defineCommand128({
|
|
15571
15923
|
meta: {
|
|
15572
15924
|
name: "web",
|
|
15573
15925
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -15627,7 +15979,7 @@ Examples:
|
|
|
15627
15979
|
});
|
|
15628
15980
|
|
|
15629
15981
|
// src/commands/research/index.ts
|
|
15630
|
-
var researchCommand =
|
|
15982
|
+
var researchCommand = defineCommand129({
|
|
15631
15983
|
meta: {
|
|
15632
15984
|
name: "research",
|
|
15633
15985
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -15667,10 +16019,10 @@ Examples:
|
|
|
15667
16019
|
});
|
|
15668
16020
|
|
|
15669
16021
|
// src/commands/scheduled-actions/index.ts
|
|
15670
|
-
import { defineCommand as
|
|
16022
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
15671
16023
|
|
|
15672
16024
|
// src/commands/scheduled-actions/create.ts
|
|
15673
|
-
import { defineCommand as
|
|
16025
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
15674
16026
|
|
|
15675
16027
|
// src/commands/scheduled-actions/shared.ts
|
|
15676
16028
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -15775,7 +16127,7 @@ registerSchema({
|
|
|
15775
16127
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
15776
16128
|
}
|
|
15777
16129
|
});
|
|
15778
|
-
var createCommand2 =
|
|
16130
|
+
var createCommand2 = defineCommand130({
|
|
15779
16131
|
meta: {
|
|
15780
16132
|
name: "create",
|
|
15781
16133
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -15823,7 +16175,7 @@ var createCommand2 = defineCommand124({
|
|
|
15823
16175
|
});
|
|
15824
16176
|
|
|
15825
16177
|
// src/commands/scheduled-actions/delete.ts
|
|
15826
|
-
import { defineCommand as
|
|
16178
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
15827
16179
|
registerSchema({
|
|
15828
16180
|
command: "scheduled-actions.delete",
|
|
15829
16181
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -15831,7 +16183,7 @@ registerSchema({
|
|
|
15831
16183
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
15832
16184
|
}
|
|
15833
16185
|
});
|
|
15834
|
-
var deleteCommand2 =
|
|
16186
|
+
var deleteCommand2 = defineCommand131({
|
|
15835
16187
|
meta: {
|
|
15836
16188
|
name: "delete",
|
|
15837
16189
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -15860,7 +16212,7 @@ var deleteCommand2 = defineCommand125({
|
|
|
15860
16212
|
});
|
|
15861
16213
|
|
|
15862
16214
|
// src/commands/scheduled-actions/get.ts
|
|
15863
|
-
import { defineCommand as
|
|
16215
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
15864
16216
|
registerSchema({
|
|
15865
16217
|
command: "scheduled-actions.get",
|
|
15866
16218
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -15868,7 +16220,7 @@ registerSchema({
|
|
|
15868
16220
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
15869
16221
|
}
|
|
15870
16222
|
});
|
|
15871
|
-
var getCommand3 =
|
|
16223
|
+
var getCommand3 = defineCommand132({
|
|
15872
16224
|
meta: {
|
|
15873
16225
|
name: "get",
|
|
15874
16226
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -15905,13 +16257,13 @@ var getCommand3 = defineCommand126({
|
|
|
15905
16257
|
});
|
|
15906
16258
|
|
|
15907
16259
|
// src/commands/scheduled-actions/list.ts
|
|
15908
|
-
import { defineCommand as
|
|
16260
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
15909
16261
|
registerSchema({
|
|
15910
16262
|
command: "scheduled-actions.list",
|
|
15911
16263
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
15912
16264
|
args: {}
|
|
15913
16265
|
});
|
|
15914
|
-
var listCommand3 =
|
|
16266
|
+
var listCommand3 = defineCommand133({
|
|
15915
16267
|
meta: {
|
|
15916
16268
|
name: "list",
|
|
15917
16269
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -15932,7 +16284,7 @@ var listCommand3 = defineCommand127({
|
|
|
15932
16284
|
});
|
|
15933
16285
|
|
|
15934
16286
|
// src/commands/scheduled-actions/trigger.ts
|
|
15935
|
-
import { defineCommand as
|
|
16287
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
15936
16288
|
registerSchema({
|
|
15937
16289
|
command: "scheduled-actions.trigger",
|
|
15938
16290
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -15940,7 +16292,7 @@ registerSchema({
|
|
|
15940
16292
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
15941
16293
|
}
|
|
15942
16294
|
});
|
|
15943
|
-
var triggerCommand =
|
|
16295
|
+
var triggerCommand = defineCommand134({
|
|
15944
16296
|
meta: {
|
|
15945
16297
|
name: "trigger",
|
|
15946
16298
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -15977,7 +16329,7 @@ var triggerCommand = defineCommand128({
|
|
|
15977
16329
|
});
|
|
15978
16330
|
|
|
15979
16331
|
// src/commands/scheduled-actions/update.ts
|
|
15980
|
-
import { defineCommand as
|
|
16332
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
15981
16333
|
registerSchema({
|
|
15982
16334
|
command: "scheduled-actions.update",
|
|
15983
16335
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -16002,7 +16354,7 @@ registerSchema({
|
|
|
16002
16354
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
16003
16355
|
}
|
|
16004
16356
|
});
|
|
16005
|
-
var updateCommand2 =
|
|
16357
|
+
var updateCommand2 = defineCommand135({
|
|
16006
16358
|
meta: {
|
|
16007
16359
|
name: "update",
|
|
16008
16360
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -16072,7 +16424,7 @@ var updateCommand2 = defineCommand129({
|
|
|
16072
16424
|
});
|
|
16073
16425
|
|
|
16074
16426
|
// src/commands/scheduled-actions/index.ts
|
|
16075
|
-
var scheduledActionsCommand =
|
|
16427
|
+
var scheduledActionsCommand = defineCommand136({
|
|
16076
16428
|
meta: {
|
|
16077
16429
|
name: "scheduled-actions",
|
|
16078
16430
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -16098,8 +16450,8 @@ Examples:
|
|
|
16098
16450
|
});
|
|
16099
16451
|
|
|
16100
16452
|
// src/commands/schema.ts
|
|
16101
|
-
import { defineCommand as
|
|
16102
|
-
var schemaCommand =
|
|
16453
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
16454
|
+
var schemaCommand = defineCommand137({
|
|
16103
16455
|
meta: {
|
|
16104
16456
|
name: "schema",
|
|
16105
16457
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -16135,10 +16487,10 @@ var schemaCommand = defineCommand131({
|
|
|
16135
16487
|
});
|
|
16136
16488
|
|
|
16137
16489
|
// src/commands/testimonials/index.ts
|
|
16138
|
-
import { defineCommand as
|
|
16490
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
16139
16491
|
|
|
16140
16492
|
// src/commands/testimonials/get.ts
|
|
16141
|
-
import { defineCommand as
|
|
16493
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
16142
16494
|
registerSchema({
|
|
16143
16495
|
command: "testimonials.get",
|
|
16144
16496
|
description: "Get a single testimonial by ID",
|
|
@@ -16146,7 +16498,7 @@ registerSchema({
|
|
|
16146
16498
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
16147
16499
|
}
|
|
16148
16500
|
});
|
|
16149
|
-
var getCommand4 =
|
|
16501
|
+
var getCommand4 = defineCommand138({
|
|
16150
16502
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
16151
16503
|
args: {
|
|
16152
16504
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -16183,7 +16535,7 @@ var getCommand4 = defineCommand132({
|
|
|
16183
16535
|
});
|
|
16184
16536
|
|
|
16185
16537
|
// src/commands/testimonials/list.ts
|
|
16186
|
-
import { defineCommand as
|
|
16538
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
16187
16539
|
registerSchema({
|
|
16188
16540
|
command: "testimonials.list",
|
|
16189
16541
|
description: "List testimonials with optional filters.",
|
|
@@ -16213,7 +16565,7 @@ registerSchema({
|
|
|
16213
16565
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
16214
16566
|
}
|
|
16215
16567
|
});
|
|
16216
|
-
var listCommand4 =
|
|
16568
|
+
var listCommand4 = defineCommand139({
|
|
16217
16569
|
meta: {
|
|
16218
16570
|
name: "list",
|
|
16219
16571
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -16262,7 +16614,7 @@ var listCommand4 = defineCommand133({
|
|
|
16262
16614
|
});
|
|
16263
16615
|
|
|
16264
16616
|
// src/commands/testimonials/search.ts
|
|
16265
|
-
import { defineCommand as
|
|
16617
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
16266
16618
|
registerSchema({
|
|
16267
16619
|
command: "testimonials.search",
|
|
16268
16620
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -16293,7 +16645,7 @@ registerSchema({
|
|
|
16293
16645
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
16294
16646
|
}
|
|
16295
16647
|
});
|
|
16296
|
-
var searchCommand2 =
|
|
16648
|
+
var searchCommand2 = defineCommand140({
|
|
16297
16649
|
meta: {
|
|
16298
16650
|
name: "search",
|
|
16299
16651
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -16364,10 +16716,10 @@ var searchCommand2 = defineCommand134({
|
|
|
16364
16716
|
});
|
|
16365
16717
|
|
|
16366
16718
|
// src/commands/testimonials/tags.ts
|
|
16367
|
-
var
|
|
16719
|
+
var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
16368
16720
|
|
|
16369
16721
|
// src/commands/testimonials/index.ts
|
|
16370
|
-
var testimonialsCommand =
|
|
16722
|
+
var testimonialsCommand = defineCommand141({
|
|
16371
16723
|
meta: {
|
|
16372
16724
|
name: "testimonials",
|
|
16373
16725
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -16383,15 +16735,15 @@ Examples:
|
|
|
16383
16735
|
get: getCommand4,
|
|
16384
16736
|
search: searchCommand2,
|
|
16385
16737
|
list: listCommand4,
|
|
16386
|
-
tags:
|
|
16738
|
+
tags: tagsCommand3
|
|
16387
16739
|
}
|
|
16388
16740
|
});
|
|
16389
16741
|
|
|
16390
16742
|
// src/commands/videos/index.ts
|
|
16391
|
-
import { defineCommand as
|
|
16743
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
16392
16744
|
|
|
16393
16745
|
// src/commands/videos/delete.ts
|
|
16394
|
-
import { defineCommand as
|
|
16746
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
16395
16747
|
registerSchema({
|
|
16396
16748
|
command: "videos.delete",
|
|
16397
16749
|
description: "Delete a video by ID",
|
|
@@ -16405,7 +16757,7 @@ registerSchema({
|
|
|
16405
16757
|
}
|
|
16406
16758
|
}
|
|
16407
16759
|
});
|
|
16408
|
-
var deleteCommand3 =
|
|
16760
|
+
var deleteCommand3 = defineCommand142({
|
|
16409
16761
|
meta: {
|
|
16410
16762
|
name: "delete",
|
|
16411
16763
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -16446,7 +16798,7 @@ var deleteCommand3 = defineCommand136({
|
|
|
16446
16798
|
});
|
|
16447
16799
|
|
|
16448
16800
|
// src/commands/videos/get.ts
|
|
16449
|
-
import { defineCommand as
|
|
16801
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
16450
16802
|
registerSchema({
|
|
16451
16803
|
command: "videos.get",
|
|
16452
16804
|
description: "Get a single video by ID",
|
|
@@ -16454,7 +16806,7 @@ registerSchema({
|
|
|
16454
16806
|
id: { type: "string", description: "Video ID", required: true }
|
|
16455
16807
|
}
|
|
16456
16808
|
});
|
|
16457
|
-
var getCommand5 =
|
|
16809
|
+
var getCommand5 = defineCommand143({
|
|
16458
16810
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
16459
16811
|
args: {
|
|
16460
16812
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -16491,7 +16843,7 @@ var getCommand5 = defineCommand137({
|
|
|
16491
16843
|
});
|
|
16492
16844
|
|
|
16493
16845
|
// src/commands/videos/search.ts
|
|
16494
|
-
import { defineCommand as
|
|
16846
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
16495
16847
|
registerSchema({
|
|
16496
16848
|
command: "videos.search",
|
|
16497
16849
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -16501,7 +16853,7 @@ registerSchema({
|
|
|
16501
16853
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
16502
16854
|
}
|
|
16503
16855
|
});
|
|
16504
|
-
var searchCommand3 =
|
|
16856
|
+
var searchCommand3 = defineCommand144({
|
|
16505
16857
|
meta: {
|
|
16506
16858
|
name: "search",
|
|
16507
16859
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -16548,12 +16900,12 @@ var searchCommand3 = defineCommand138({
|
|
|
16548
16900
|
});
|
|
16549
16901
|
|
|
16550
16902
|
// src/commands/videos/tags.ts
|
|
16551
|
-
var
|
|
16903
|
+
var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
16552
16904
|
|
|
16553
16905
|
// src/commands/videos/upload.ts
|
|
16554
|
-
import { readFile as
|
|
16555
|
-
import { extname as
|
|
16556
|
-
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";
|
|
16557
16909
|
var MIME_MAP2 = {
|
|
16558
16910
|
".mp4": "video/mp4",
|
|
16559
16911
|
".mov": "video/quicktime",
|
|
@@ -16580,14 +16932,14 @@ registerSchema({
|
|
|
16580
16932
|
}
|
|
16581
16933
|
});
|
|
16582
16934
|
function detectContentType2(filePath) {
|
|
16583
|
-
const ext =
|
|
16935
|
+
const ext = extname4(filePath).toLowerCase();
|
|
16584
16936
|
const mime = MIME_MAP2[ext];
|
|
16585
16937
|
if (!mime) {
|
|
16586
16938
|
throw new ApiError("VALIDATION_ERROR", `Cannot detect content type for extension "${ext}". Use --content-type.`);
|
|
16587
16939
|
}
|
|
16588
16940
|
return mime;
|
|
16589
16941
|
}
|
|
16590
|
-
var uploadCommand2 =
|
|
16942
|
+
var uploadCommand2 = defineCommand145({
|
|
16591
16943
|
meta: {
|
|
16592
16944
|
name: "upload",
|
|
16593
16945
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -16616,7 +16968,7 @@ var uploadCommand2 = defineCommand139({
|
|
|
16616
16968
|
return;
|
|
16617
16969
|
}
|
|
16618
16970
|
const { uploadUrl, videoId } = await apiPost("/api/videos/upload", {});
|
|
16619
|
-
const fileBuffer = await
|
|
16971
|
+
const fileBuffer = await readFile11(filePath);
|
|
16620
16972
|
const uploadResponse = await fetch(uploadUrl, {
|
|
16621
16973
|
method: "PUT",
|
|
16622
16974
|
headers: { "Content-Type": contentType },
|
|
@@ -16641,7 +16993,7 @@ var uploadCommand2 = defineCommand139({
|
|
|
16641
16993
|
});
|
|
16642
16994
|
|
|
16643
16995
|
// src/commands/videos/index.ts
|
|
16644
|
-
var videosCommand =
|
|
16996
|
+
var videosCommand = defineCommand146({
|
|
16645
16997
|
meta: {
|
|
16646
16998
|
name: "videos",
|
|
16647
16999
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -16659,15 +17011,15 @@ Examples:
|
|
|
16659
17011
|
search: searchCommand3,
|
|
16660
17012
|
upload: uploadCommand2,
|
|
16661
17013
|
delete: deleteCommand3,
|
|
16662
|
-
tags:
|
|
17014
|
+
tags: tagsCommand4
|
|
16663
17015
|
}
|
|
16664
17016
|
});
|
|
16665
17017
|
|
|
16666
17018
|
// src/commands/winning-ads/index.ts
|
|
16667
|
-
import { defineCommand as
|
|
17019
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
16668
17020
|
|
|
16669
17021
|
// src/commands/winning-ads/advertisers.ts
|
|
16670
|
-
import { defineCommand as
|
|
17022
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
16671
17023
|
registerSchema({
|
|
16672
17024
|
command: "winning-ads.advertisers",
|
|
16673
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).",
|
|
@@ -16680,7 +17032,7 @@ registerSchema({
|
|
|
16680
17032
|
function identity(record) {
|
|
16681
17033
|
return record;
|
|
16682
17034
|
}
|
|
16683
|
-
var advertisersCommand2 =
|
|
17035
|
+
var advertisersCommand2 = defineCommand147({
|
|
16684
17036
|
meta: {
|
|
16685
17037
|
name: "advertisers",
|
|
16686
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'
|
|
@@ -16731,7 +17083,7 @@ var advertisersCommand2 = defineCommand141({
|
|
|
16731
17083
|
});
|
|
16732
17084
|
|
|
16733
17085
|
// src/commands/winning-ads/search.ts
|
|
16734
|
-
import { defineCommand as
|
|
17086
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
16735
17087
|
registerSchema({
|
|
16736
17088
|
command: "winning-ads.search",
|
|
16737
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.",
|
|
@@ -16839,7 +17191,7 @@ function buildSearchBody(args) {
|
|
|
16839
17191
|
}
|
|
16840
17192
|
return body;
|
|
16841
17193
|
}
|
|
16842
|
-
var searchCommand4 =
|
|
17194
|
+
var searchCommand4 = defineCommand148({
|
|
16843
17195
|
meta: {
|
|
16844
17196
|
name: "search",
|
|
16845
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"
|
|
@@ -16951,7 +17303,7 @@ var searchCommand4 = defineCommand142({
|
|
|
16951
17303
|
});
|
|
16952
17304
|
|
|
16953
17305
|
// src/commands/winning-ads/index.ts
|
|
16954
|
-
var winningAdsCommand =
|
|
17306
|
+
var winningAdsCommand = defineCommand149({
|
|
16955
17307
|
meta: {
|
|
16956
17308
|
name: "winning-ads",
|
|
16957
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.
|
|
@@ -16991,7 +17343,7 @@ function getCliVersion() {
|
|
|
16991
17343
|
}
|
|
16992
17344
|
|
|
16993
17345
|
// src/cli.ts
|
|
16994
|
-
var main =
|
|
17346
|
+
var main = defineCommand150({
|
|
16995
17347
|
meta: {
|
|
16996
17348
|
name: "baker",
|
|
16997
17349
|
version: getCliVersion(),
|
|
@@ -17010,6 +17362,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
17010
17362
|
ga4: ga4Command,
|
|
17011
17363
|
gsc: gscCommand,
|
|
17012
17364
|
research: researchCommand,
|
|
17365
|
+
creatives: creativesCommand3,
|
|
17013
17366
|
images: imagesCommand,
|
|
17014
17367
|
videos: videosCommand,
|
|
17015
17368
|
testimonials: testimonialsCommand,
|