@koda-sl/baker-cli 0.98.1 → 0.99.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/cli.js +594 -342
- package/dist/cli.js.map +1 -1
- package/package.json +5 -3
package/dist/cli.js
CHANGED
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
} from "./chunk-3JVYU72O.js";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
|
-
import { defineCommand as
|
|
15
|
+
import { defineCommand as defineCommand152, runMain } from "citty";
|
|
16
16
|
|
|
17
17
|
// src/commands/actions/index.ts
|
|
18
|
-
import { defineCommand as
|
|
18
|
+
import { defineCommand as defineCommand18 } from "citty";
|
|
19
19
|
|
|
20
20
|
// src/commands/actions/claim.ts
|
|
21
21
|
import { defineCommand } from "citty";
|
|
@@ -557,12 +557,17 @@ var claimCommand = defineCommand({
|
|
|
557
557
|
|
|
558
558
|
// src/commands/actions/complete.ts
|
|
559
559
|
import { defineCommand as defineCommand2 } from "citty";
|
|
560
|
+
var COMPLETE_NOTE_MIN = 20;
|
|
560
561
|
registerSchema({
|
|
561
562
|
command: "actions.complete",
|
|
562
|
-
description: "Stage completion of an action (it was DONE). Accepts a real action ID (must be claimed) or a temp ID from the same draft. The action becomes completed when the chat is published. Do NOT use this to drop an action you no longer want \u2014 to remove a staged op use `actions draft remove`, to close an unwanted published action use `actions discard`.",
|
|
563
|
+
description: "Stage completion of an action (it was DONE). Accepts a real action ID (must be claimed) or a temp ID from the same draft. The action becomes completed when the chat is published. --note is REQUIRED and must describe what you actually did to resolve it (what changed, where, and the outcome) \u2014 it is the client-facing record surfaced by `baker actions log`. Do NOT use this to drop an action you no longer want \u2014 to remove a staged op use `actions draft remove`, to close an unwanted published action use `actions discard`.",
|
|
563
564
|
args: {
|
|
564
565
|
id: { type: "string", description: "Action ID or temp ID", required: true },
|
|
565
|
-
note: {
|
|
566
|
+
note: {
|
|
567
|
+
type: "string",
|
|
568
|
+
description: "REQUIRED. Detailed description of what you did to resolve this: what changed, where, and the outcome. This is the durable, client-facing record shown by `baker actions log`.",
|
|
569
|
+
required: true
|
|
570
|
+
}
|
|
566
571
|
}
|
|
567
572
|
});
|
|
568
573
|
var completeCommand = defineCommand2({
|
|
@@ -573,7 +578,11 @@ var completeCommand = defineCommand2({
|
|
|
573
578
|
args: {
|
|
574
579
|
id: { type: "positional", description: "Action ID or temp ID", required: false },
|
|
575
580
|
"action-id": { type: "string", description: "Action ID or temp ID", required: false },
|
|
576
|
-
note: {
|
|
581
|
+
note: {
|
|
582
|
+
type: "string",
|
|
583
|
+
description: "REQUIRED. What you did to resolve this: what changed, where, and the outcome.",
|
|
584
|
+
required: false
|
|
585
|
+
}
|
|
577
586
|
},
|
|
578
587
|
run: async ({ args }) => {
|
|
579
588
|
try {
|
|
@@ -584,8 +593,14 @@ var completeCommand = defineCommand2({
|
|
|
584
593
|
if (!isTempId(id)) {
|
|
585
594
|
validateConvexId(id);
|
|
586
595
|
}
|
|
596
|
+
const note = args.note?.trim() ?? "";
|
|
597
|
+
if (note.length < COMPLETE_NOTE_MIN) {
|
|
598
|
+
failValidation(
|
|
599
|
+
`--note is required and must describe what you did (\u2265${COMPLETE_NOTE_MIN} chars): what changed, where, and the outcome. This becomes the client-facing record surfaced by \`baker actions log\`.`
|
|
600
|
+
);
|
|
601
|
+
}
|
|
587
602
|
const chatId = requireChatId();
|
|
588
|
-
await apiPost("/api/actions/complete", { chatId, actionRef: id, note
|
|
603
|
+
await apiPost("/api/actions/complete", { chatId, actionRef: id, note });
|
|
589
604
|
writeOk();
|
|
590
605
|
} catch (err) {
|
|
591
606
|
failApi(err);
|
|
@@ -965,8 +980,77 @@ var listCommand2 = defineCommand8({
|
|
|
965
980
|
}
|
|
966
981
|
});
|
|
967
982
|
|
|
968
|
-
// src/commands/actions/
|
|
983
|
+
// src/commands/actions/log.ts
|
|
969
984
|
import { defineCommand as defineCommand9 } from "citty";
|
|
985
|
+
var DAY_MS = 864e5;
|
|
986
|
+
function startOfLocalDay(date) {
|
|
987
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
|
|
988
|
+
}
|
|
989
|
+
function resolveWindow(args) {
|
|
990
|
+
const fromArg = args.from;
|
|
991
|
+
const toArg = args.to;
|
|
992
|
+
if (fromArg) {
|
|
993
|
+
const fromMs = Date.parse(fromArg);
|
|
994
|
+
if (Number.isNaN(fromMs)) {
|
|
995
|
+
failValidation(`--from is not a valid ISO date/datetime: ${fromArg}`);
|
|
996
|
+
}
|
|
997
|
+
const toMs = toArg ? Date.parse(toArg) : Date.now();
|
|
998
|
+
if (Number.isNaN(toMs)) {
|
|
999
|
+
failValidation(`--to is not a valid ISO date/datetime: ${toArg}`);
|
|
1000
|
+
}
|
|
1001
|
+
return { fromMs, toMs };
|
|
1002
|
+
}
|
|
1003
|
+
const since = (args.since ?? "today").trim().toLowerCase();
|
|
1004
|
+
const now = Date.now();
|
|
1005
|
+
if (since === "today") {
|
|
1006
|
+
return { fromMs: startOfLocalDay(new Date(now)), toMs: now };
|
|
1007
|
+
}
|
|
1008
|
+
if (since === "yesterday") {
|
|
1009
|
+
const todayStart = startOfLocalDay(new Date(now));
|
|
1010
|
+
return { fromMs: todayStart - DAY_MS, toMs: todayStart };
|
|
1011
|
+
}
|
|
1012
|
+
const days = /^(\d+)d$/.exec(since);
|
|
1013
|
+
if (days) {
|
|
1014
|
+
return { fromMs: now - Number(days[1]) * DAY_MS, toMs: now };
|
|
1015
|
+
}
|
|
1016
|
+
return failValidation(`--since must be one of: today | yesterday | <N>d (e.g. 7d). Got: ${since}`);
|
|
1017
|
+
}
|
|
1018
|
+
registerSchema({
|
|
1019
|
+
command: "actions.log",
|
|
1020
|
+
description: "List actions COMPLETED in a time window, newest first, each with its completion note (what was done). Use this to report to the client what was accomplished \u2014 e.g. `baker actions log` for today, or `baker actions log --since 7d` for the last week. Only published completions appear (not ops staged in an unpublished chat). Window defaults to today in local time.",
|
|
1021
|
+
args: {
|
|
1022
|
+
since: {
|
|
1023
|
+
type: "string",
|
|
1024
|
+
description: "Relative window: today | yesterday | <N>d (e.g. 7d). Default: today.",
|
|
1025
|
+
required: false
|
|
1026
|
+
},
|
|
1027
|
+
from: { type: "string", description: "Window start (ISO date/datetime). Overrides --since.", required: false },
|
|
1028
|
+
to: { type: "string", description: "Window end (ISO date/datetime). Defaults to now.", required: false }
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
var logCommand = defineCommand9({
|
|
1032
|
+
meta: {
|
|
1033
|
+
name: "log",
|
|
1034
|
+
description: "List completed actions in a window with their completion notes (what was done). Example: baker actions log --since today"
|
|
1035
|
+
},
|
|
1036
|
+
args: {
|
|
1037
|
+
since: { type: "string", description: "today | yesterday | <N>d (default: today)", required: false },
|
|
1038
|
+
from: { type: "string", description: "Window start (ISO). Overrides --since", required: false },
|
|
1039
|
+
to: { type: "string", description: "Window end (ISO). Defaults to now", required: false }
|
|
1040
|
+
},
|
|
1041
|
+
run: async ({ args }) => {
|
|
1042
|
+
try {
|
|
1043
|
+
const { fromMs, toMs } = resolveWindow(args);
|
|
1044
|
+
const response = await apiPost("/api/actions/log", { fromMs, toMs });
|
|
1045
|
+
writeJson(response);
|
|
1046
|
+
} catch (err) {
|
|
1047
|
+
failApi(err);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
|
|
1052
|
+
// src/commands/actions/release.ts
|
|
1053
|
+
import { defineCommand as defineCommand10 } from "citty";
|
|
970
1054
|
registerSchema({
|
|
971
1055
|
command: "actions.release",
|
|
972
1056
|
description: "Release an action you previously claimed (no-op if you don't own the claim).",
|
|
@@ -974,7 +1058,7 @@ registerSchema({
|
|
|
974
1058
|
id: { type: "string", description: "Action ID", required: true }
|
|
975
1059
|
}
|
|
976
1060
|
});
|
|
977
|
-
var releaseCommand =
|
|
1061
|
+
var releaseCommand = defineCommand10({
|
|
978
1062
|
meta: {
|
|
979
1063
|
name: "release",
|
|
980
1064
|
description: "Release a claim you made on an action. Example: baker actions release <action-id>"
|
|
@@ -1000,7 +1084,7 @@ var releaseCommand = defineCommand9({
|
|
|
1000
1084
|
});
|
|
1001
1085
|
|
|
1002
1086
|
// src/commands/actions/status.ts
|
|
1003
|
-
import { defineCommand as
|
|
1087
|
+
import { defineCommand as defineCommand11 } from "citty";
|
|
1004
1088
|
registerSchema({
|
|
1005
1089
|
command: "actions.status",
|
|
1006
1090
|
description: "Resolve one or more Work Action refs by real action ID or temp_* ref in a single batch call. When BAKER_CHAT_ID is set, a temp_* ref still staged in THIS chat resolves to status 'draft' (not 'not_found') \u2014 staged ops only become published actions on chat publish.",
|
|
@@ -1008,7 +1092,7 @@ registerSchema({
|
|
|
1008
1092
|
refs: { type: "string", description: "One or more action refs: real action IDs or temp_* refs", required: true }
|
|
1009
1093
|
}
|
|
1010
1094
|
});
|
|
1011
|
-
var statusCommand =
|
|
1095
|
+
var statusCommand = defineCommand11({
|
|
1012
1096
|
meta: {
|
|
1013
1097
|
name: "status",
|
|
1014
1098
|
description: "Resolve Work Action refs by real ID or temp_* ref. Example: baker actions status temp_hero jx123"
|
|
@@ -1033,10 +1117,10 @@ var statusCommand = defineCommand10({
|
|
|
1033
1117
|
});
|
|
1034
1118
|
|
|
1035
1119
|
// src/commands/actions/tags/index.ts
|
|
1036
|
-
import { defineCommand as
|
|
1120
|
+
import { defineCommand as defineCommand15 } from "citty";
|
|
1037
1121
|
|
|
1038
1122
|
// src/commands/actions/tags/create.ts
|
|
1039
|
-
import { defineCommand as
|
|
1123
|
+
import { defineCommand as defineCommand12 } from "citty";
|
|
1040
1124
|
registerSchema({
|
|
1041
1125
|
command: "actions.tags.create",
|
|
1042
1126
|
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.",
|
|
@@ -1045,7 +1129,7 @@ registerSchema({
|
|
|
1045
1129
|
description: { type: "string", description: "What this tag means", required: false }
|
|
1046
1130
|
}
|
|
1047
1131
|
});
|
|
1048
|
-
var tagsCreateCommand =
|
|
1132
|
+
var tagsCreateCommand = defineCommand12({
|
|
1049
1133
|
meta: {
|
|
1050
1134
|
name: "create",
|
|
1051
1135
|
description: 'Create a custom action tag. Example: baker actions tags create --slug pmax --description "Performance Max work"'
|
|
@@ -1072,7 +1156,7 @@ var tagsCreateCommand = defineCommand11({
|
|
|
1072
1156
|
});
|
|
1073
1157
|
|
|
1074
1158
|
// src/commands/actions/tags/delete.ts
|
|
1075
|
-
import { defineCommand as
|
|
1159
|
+
import { defineCommand as defineCommand13 } from "citty";
|
|
1076
1160
|
registerSchema({
|
|
1077
1161
|
command: "actions.tags.delete",
|
|
1078
1162
|
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).",
|
|
@@ -1080,7 +1164,7 @@ registerSchema({
|
|
|
1080
1164
|
slug: { type: "string", description: "Custom tag slug to delete", required: true }
|
|
1081
1165
|
}
|
|
1082
1166
|
});
|
|
1083
|
-
var tagsDeleteCommand =
|
|
1167
|
+
var tagsDeleteCommand = defineCommand13({
|
|
1084
1168
|
meta: {
|
|
1085
1169
|
name: "delete",
|
|
1086
1170
|
description: "Delete a custom action tag. Example: baker actions tags delete --slug pmax"
|
|
@@ -1103,13 +1187,13 @@ var tagsDeleteCommand = defineCommand12({
|
|
|
1103
1187
|
});
|
|
1104
1188
|
|
|
1105
1189
|
// src/commands/actions/tags/list.ts
|
|
1106
|
-
import { defineCommand as
|
|
1190
|
+
import { defineCommand as defineCommand14 } from "citty";
|
|
1107
1191
|
registerSchema({
|
|
1108
1192
|
command: "actions.tags.list",
|
|
1109
1193
|
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
1194
|
args: { output: { type: "string", description: "Output format: md|json", required: false, default: "md" } }
|
|
1111
1195
|
});
|
|
1112
|
-
var tagsListCommand =
|
|
1196
|
+
var tagsListCommand = defineCommand14({
|
|
1113
1197
|
meta: {
|
|
1114
1198
|
name: "list",
|
|
1115
1199
|
description: "List available action tag names (defaults + company custom tags). Use before --tags. Example: baker actions tags list"
|
|
@@ -1139,7 +1223,7 @@ var tagsListCommand = defineCommand13({
|
|
|
1139
1223
|
});
|
|
1140
1224
|
|
|
1141
1225
|
// src/commands/actions/tags/index.ts
|
|
1142
|
-
var tagsCommand =
|
|
1226
|
+
var tagsCommand = defineCommand15({
|
|
1143
1227
|
meta: {
|
|
1144
1228
|
name: "tags",
|
|
1145
1229
|
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.
|
|
@@ -1157,7 +1241,7 @@ Examples:
|
|
|
1157
1241
|
});
|
|
1158
1242
|
|
|
1159
1243
|
// src/commands/actions/unlink.ts
|
|
1160
|
-
import { defineCommand as
|
|
1244
|
+
import { defineCommand as defineCommand16 } from "citty";
|
|
1161
1245
|
registerSchema({
|
|
1162
1246
|
command: "actions.unlink",
|
|
1163
1247
|
description: "Stage removal of a 'blocker -> blocked' dependency. The blocked action must be claimed by current chat.",
|
|
@@ -1166,7 +1250,7 @@ registerSchema({
|
|
|
1166
1250
|
blocked: { type: "string", description: "Blocked action ID (must be claimed by current chat)", required: true }
|
|
1167
1251
|
}
|
|
1168
1252
|
});
|
|
1169
|
-
var unlinkCommand =
|
|
1253
|
+
var unlinkCommand = defineCommand16({
|
|
1170
1254
|
meta: {
|
|
1171
1255
|
name: "unlink",
|
|
1172
1256
|
description: "Stage removal of a dependency. Example: baker actions unlink --blocker <id> --blocked <id>"
|
|
@@ -1198,7 +1282,7 @@ var unlinkCommand = defineCommand15({
|
|
|
1198
1282
|
});
|
|
1199
1283
|
|
|
1200
1284
|
// src/commands/actions/update.ts
|
|
1201
|
-
import { defineCommand as
|
|
1285
|
+
import { defineCommand as defineCommand17 } from "citty";
|
|
1202
1286
|
registerSchema({
|
|
1203
1287
|
command: "actions.update",
|
|
1204
1288
|
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).",
|
|
@@ -1218,7 +1302,7 @@ registerSchema({
|
|
|
1218
1302
|
}
|
|
1219
1303
|
}
|
|
1220
1304
|
});
|
|
1221
|
-
var updateCommand =
|
|
1305
|
+
var updateCommand = defineCommand17({
|
|
1222
1306
|
meta: {
|
|
1223
1307
|
name: "update",
|
|
1224
1308
|
description: 'Stage an update on a claimed action. Example: baker actions update <id> --name "New name"'
|
|
@@ -1260,10 +1344,10 @@ var updateCommand = defineCommand16({
|
|
|
1260
1344
|
});
|
|
1261
1345
|
|
|
1262
1346
|
// src/commands/actions/index.ts
|
|
1263
|
-
var actionsCommand =
|
|
1347
|
+
var actionsCommand = defineCommand18({
|
|
1264
1348
|
meta: {
|
|
1265
1349
|
name: "actions",
|
|
1266
|
-
description: `Manage action items for the current chat. Subcommands: list, draft, get, status, claim, release, create, update, complete, discard, link, unlink.
|
|
1350
|
+
description: `Manage action items for the current chat. Subcommands: list, log, draft, get, status, claim, release, create, update, complete, discard, link, unlink.
|
|
1267
1351
|
|
|
1268
1352
|
Lifecycle: claim an action before working on it. Stage create/update/complete/discard/link via this CLI; they apply when the chat is published. Release if you decide not to work on it after all.
|
|
1269
1353
|
|
|
@@ -1271,6 +1355,8 @@ Staged vs published: create/update/complete/discard/link are STAGED in this chat
|
|
|
1271
1355
|
|
|
1272
1356
|
Examples:
|
|
1273
1357
|
baker actions list # bucketed view of PUBLISHED actions
|
|
1358
|
+
baker actions log # actions COMPLETED today, with what was done (client report)
|
|
1359
|
+
baker actions log --since 7d # everything completed in the last 7 days
|
|
1274
1360
|
baker actions draft # review what THIS chat has staged (pre-publish)
|
|
1275
1361
|
baker actions draft remove temp_hero # drop a staged create (cascades its complete/link ops)
|
|
1276
1362
|
baker actions draft clear # drop everything staged in this chat
|
|
@@ -1283,6 +1369,7 @@ Examples:
|
|
|
1283
1369
|
},
|
|
1284
1370
|
subCommands: {
|
|
1285
1371
|
list: listCommand2,
|
|
1372
|
+
log: logCommand,
|
|
1286
1373
|
draft: draftCommand,
|
|
1287
1374
|
get: getCommand,
|
|
1288
1375
|
status: statusCommand,
|
|
@@ -1299,13 +1386,13 @@ Examples:
|
|
|
1299
1386
|
});
|
|
1300
1387
|
|
|
1301
1388
|
// src/commands/ads/index.ts
|
|
1302
|
-
import { defineCommand as
|
|
1389
|
+
import { defineCommand as defineCommand78 } from "citty";
|
|
1303
1390
|
|
|
1304
1391
|
// src/commands/ads/google/index.ts
|
|
1305
|
-
import { defineCommand as
|
|
1392
|
+
import { defineCommand as defineCommand29 } from "citty";
|
|
1306
1393
|
|
|
1307
1394
|
// src/commands/ads/google/accounts.ts
|
|
1308
|
-
import { defineCommand as
|
|
1395
|
+
import { defineCommand as defineCommand19 } from "citty";
|
|
1309
1396
|
|
|
1310
1397
|
// src/commands/ads/cache.ts
|
|
1311
1398
|
import { createHash } from "crypto";
|
|
@@ -1581,7 +1668,7 @@ function handleAccountsError(err) {
|
|
|
1581
1668
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
1582
1669
|
process.exit(1);
|
|
1583
1670
|
}
|
|
1584
|
-
var accountsCommand =
|
|
1671
|
+
var accountsCommand = defineCommand19({
|
|
1585
1672
|
meta: {
|
|
1586
1673
|
name: "accounts",
|
|
1587
1674
|
description: `List accessible Google Ads accounts. Returns customer IDs needed for all other commands.
|
|
@@ -1621,7 +1708,7 @@ Examples:
|
|
|
1621
1708
|
});
|
|
1622
1709
|
|
|
1623
1710
|
// src/commands/ads/google/changes.ts
|
|
1624
|
-
import { defineCommand as
|
|
1711
|
+
import { defineCommand as defineCommand20 } from "citty";
|
|
1625
1712
|
|
|
1626
1713
|
// src/commands/ads/field-descriptions.ts
|
|
1627
1714
|
var FIELD_DESCRIPTIONS = {
|
|
@@ -2173,7 +2260,7 @@ registerSchema({
|
|
|
2173
2260
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
2174
2261
|
}
|
|
2175
2262
|
});
|
|
2176
|
-
var changesCommand =
|
|
2263
|
+
var changesCommand = defineCommand20({
|
|
2177
2264
|
meta: {
|
|
2178
2265
|
name: "changes",
|
|
2179
2266
|
description: `Get recent changes in a Google Ads account with performance data.
|
|
@@ -2224,7 +2311,7 @@ Examples:
|
|
|
2224
2311
|
});
|
|
2225
2312
|
|
|
2226
2313
|
// src/commands/ads/google/currency.ts
|
|
2227
|
-
import { defineCommand as
|
|
2314
|
+
import { defineCommand as defineCommand21 } from "citty";
|
|
2228
2315
|
registerSchema({
|
|
2229
2316
|
command: "ads.google.currency",
|
|
2230
2317
|
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.",
|
|
@@ -2236,7 +2323,7 @@ registerSchema({
|
|
|
2236
2323
|
}
|
|
2237
2324
|
}
|
|
2238
2325
|
});
|
|
2239
|
-
var currencyCommand =
|
|
2326
|
+
var currencyCommand = defineCommand21({
|
|
2240
2327
|
meta: {
|
|
2241
2328
|
name: "currency",
|
|
2242
2329
|
description: `Get account currency code. Use this to interpret metrics.cost_micros values.
|
|
@@ -2285,10 +2372,10 @@ Examples:
|
|
|
2285
2372
|
});
|
|
2286
2373
|
|
|
2287
2374
|
// src/commands/ads/google/keywords/index.ts
|
|
2288
|
-
import { defineCommand as
|
|
2375
|
+
import { defineCommand as defineCommand26 } from "citty";
|
|
2289
2376
|
|
|
2290
2377
|
// src/commands/ads/google/keywords/discover.ts
|
|
2291
|
-
import { defineCommand as
|
|
2378
|
+
import { defineCommand as defineCommand22 } from "citty";
|
|
2292
2379
|
|
|
2293
2380
|
// src/geo-context.ts
|
|
2294
2381
|
var GOOGLE_ADS_LOCATIONS = [
|
|
@@ -2563,7 +2650,7 @@ function handleKeywordError(err) {
|
|
|
2563
2650
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
2564
2651
|
process.exit(1);
|
|
2565
2652
|
}
|
|
2566
|
-
var discoverCommand =
|
|
2653
|
+
var discoverCommand = defineCommand22({
|
|
2567
2654
|
meta: {
|
|
2568
2655
|
name: "discover",
|
|
2569
2656
|
description: `Discover new keyword ideas from seed keywords or competitor URLs.
|
|
@@ -2625,7 +2712,7 @@ Examples:
|
|
|
2625
2712
|
});
|
|
2626
2713
|
|
|
2627
2714
|
// src/commands/ads/google/keywords/languages.ts
|
|
2628
|
-
import { defineCommand as
|
|
2715
|
+
import { defineCommand as defineCommand23 } from "citty";
|
|
2629
2716
|
registerSchema({
|
|
2630
2717
|
command: "ads.google.keywords.languages",
|
|
2631
2718
|
description: "List all supported language IDs for --language flag in Google Ads keyword commands.",
|
|
@@ -2635,7 +2722,7 @@ var FIELDS = {
|
|
|
2635
2722
|
id: "Language ID to pass as --language",
|
|
2636
2723
|
name: "Language name"
|
|
2637
2724
|
};
|
|
2638
|
-
var languagesCommand =
|
|
2725
|
+
var languagesCommand = defineCommand23({
|
|
2639
2726
|
meta: {
|
|
2640
2727
|
name: "languages",
|
|
2641
2728
|
description: "List all supported language IDs for --language flag."
|
|
@@ -2646,7 +2733,7 @@ var languagesCommand = defineCommand22({
|
|
|
2646
2733
|
});
|
|
2647
2734
|
|
|
2648
2735
|
// src/commands/ads/google/keywords/locations.ts
|
|
2649
|
-
import { defineCommand as
|
|
2736
|
+
import { defineCommand as defineCommand24 } from "citty";
|
|
2650
2737
|
registerSchema({
|
|
2651
2738
|
command: "ads.google.keywords.locations",
|
|
2652
2739
|
description: "List all supported geo target IDs for --location flag in Google Ads keyword commands.",
|
|
@@ -2656,7 +2743,7 @@ var FIELDS2 = {
|
|
|
2656
2743
|
id: "Geo target ID to pass as --location",
|
|
2657
2744
|
name: "Country/region name"
|
|
2658
2745
|
};
|
|
2659
|
-
var locationsCommand =
|
|
2746
|
+
var locationsCommand = defineCommand24({
|
|
2660
2747
|
meta: {
|
|
2661
2748
|
name: "locations",
|
|
2662
2749
|
description: "List all supported geo target IDs for --location flag."
|
|
@@ -2667,7 +2754,7 @@ var locationsCommand = defineCommand23({
|
|
|
2667
2754
|
});
|
|
2668
2755
|
|
|
2669
2756
|
// src/commands/ads/google/keywords/metrics.ts
|
|
2670
|
-
import { defineCommand as
|
|
2757
|
+
import { defineCommand as defineCommand25 } from "citty";
|
|
2671
2758
|
registerSchema({
|
|
2672
2759
|
command: "ads.google.keywords.metrics",
|
|
2673
2760
|
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.",
|
|
@@ -2691,7 +2778,7 @@ registerSchema({
|
|
|
2691
2778
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
2692
2779
|
}
|
|
2693
2780
|
});
|
|
2694
|
-
var metricsCommand =
|
|
2781
|
+
var metricsCommand = defineCommand25({
|
|
2695
2782
|
meta: {
|
|
2696
2783
|
name: "metrics",
|
|
2697
2784
|
description: `Get historical search metrics for specific keywords.
|
|
@@ -2778,7 +2865,7 @@ Examples:
|
|
|
2778
2865
|
});
|
|
2779
2866
|
|
|
2780
2867
|
// src/commands/ads/google/keywords/index.ts
|
|
2781
|
-
var keywordsCommand =
|
|
2868
|
+
var keywordsCommand = defineCommand26({
|
|
2782
2869
|
meta: {
|
|
2783
2870
|
name: "keywords",
|
|
2784
2871
|
description: `Keyword research tools. Subcommands: discover, metrics, locations, languages.
|
|
@@ -2798,8 +2885,8 @@ Examples:
|
|
|
2798
2885
|
});
|
|
2799
2886
|
|
|
2800
2887
|
// src/commands/ads/google/library/index.ts
|
|
2801
|
-
import { defineCommand as
|
|
2802
|
-
var listAdvertisers =
|
|
2888
|
+
import { defineCommand as defineCommand27 } from "citty";
|
|
2889
|
+
var listAdvertisers = defineCommand27({
|
|
2803
2890
|
meta: {
|
|
2804
2891
|
name: "list-advertisers",
|
|
2805
2892
|
description: "List tracked Google advertisers and their accounts"
|
|
@@ -2816,7 +2903,7 @@ var listAdvertisers = defineCommand26({
|
|
|
2816
2903
|
}
|
|
2817
2904
|
}
|
|
2818
2905
|
});
|
|
2819
|
-
var syncStatus =
|
|
2906
|
+
var syncStatus = defineCommand27({
|
|
2820
2907
|
meta: {
|
|
2821
2908
|
name: "sync-status",
|
|
2822
2909
|
description: "Check the sync status and ad counts of a Google account"
|
|
@@ -2836,7 +2923,7 @@ var syncStatus = defineCommand26({
|
|
|
2836
2923
|
writeAdsJson({ ok: true, data });
|
|
2837
2924
|
}
|
|
2838
2925
|
});
|
|
2839
|
-
var searchAds =
|
|
2926
|
+
var searchAds = defineCommand27({
|
|
2840
2927
|
meta: {
|
|
2841
2928
|
name: "search-ads",
|
|
2842
2929
|
description: "Search and filter Google ads for an account"
|
|
@@ -2893,7 +2980,7 @@ var searchAds = defineCommand26({
|
|
|
2893
2980
|
}
|
|
2894
2981
|
}
|
|
2895
2982
|
});
|
|
2896
|
-
var searchAdvertiser =
|
|
2983
|
+
var searchAdvertiser = defineCommand27({
|
|
2897
2984
|
meta: {
|
|
2898
2985
|
name: "search-advertiser",
|
|
2899
2986
|
description: "Search for an advertiser on the Google Ads Transparency Center"
|
|
@@ -2928,7 +3015,7 @@ var searchAdvertiser = defineCommand26({
|
|
|
2928
3015
|
function sleep(ms) {
|
|
2929
3016
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
2930
3017
|
}
|
|
2931
|
-
var track =
|
|
3018
|
+
var track = defineCommand27({
|
|
2932
3019
|
meta: {
|
|
2933
3020
|
name: "track",
|
|
2934
3021
|
description: "Track a new Google advertiser (from search results). Waits for initial sync to complete before returning."
|
|
@@ -2986,7 +3073,7 @@ var track = defineCommand26({
|
|
|
2986
3073
|
process.exit(1);
|
|
2987
3074
|
}
|
|
2988
3075
|
});
|
|
2989
|
-
var sync =
|
|
3076
|
+
var sync = defineCommand27({
|
|
2990
3077
|
meta: {
|
|
2991
3078
|
name: "sync",
|
|
2992
3079
|
description: "Trigger an immediate sync for a Google account. Waits for completion before returning."
|
|
@@ -3030,7 +3117,7 @@ var sync = defineCommand26({
|
|
|
3030
3117
|
process.exit(1);
|
|
3031
3118
|
}
|
|
3032
3119
|
});
|
|
3033
|
-
var searchCompetitors =
|
|
3120
|
+
var searchCompetitors = defineCommand27({
|
|
3034
3121
|
meta: {
|
|
3035
3122
|
name: "search-competitors",
|
|
3036
3123
|
description: "Search for competitors running Google ads for a keyword (DataForSEO)"
|
|
@@ -3062,7 +3149,7 @@ var searchCompetitors = defineCommand26({
|
|
|
3062
3149
|
}
|
|
3063
3150
|
}
|
|
3064
3151
|
});
|
|
3065
|
-
var library =
|
|
3152
|
+
var library = defineCommand27({
|
|
3066
3153
|
meta: {
|
|
3067
3154
|
name: "library",
|
|
3068
3155
|
description: "Manage and search the Google Ads Library"
|
|
@@ -3081,7 +3168,7 @@ var library = defineCommand26({
|
|
|
3081
3168
|
// src/commands/ads/google/query.ts
|
|
3082
3169
|
import { appendFileSync, existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
3083
3170
|
import { resolve } from "path";
|
|
3084
|
-
import { defineCommand as
|
|
3171
|
+
import { defineCommand as defineCommand28 } from "citty";
|
|
3085
3172
|
|
|
3086
3173
|
// src/commands/ads/google/preflight.ts
|
|
3087
3174
|
function buildCommand2(query, customerId) {
|
|
@@ -3537,7 +3624,7 @@ function handleQueryError(err, finalQuery, customerId) {
|
|
|
3537
3624
|
});
|
|
3538
3625
|
process.exit(1);
|
|
3539
3626
|
}
|
|
3540
|
-
var queryCommand =
|
|
3627
|
+
var queryCommand = defineCommand28({
|
|
3541
3628
|
meta: {
|
|
3542
3629
|
name: "query",
|
|
3543
3630
|
description: `Run GAQL queries against Google Ads. Supports raw GAQL, presets, pagination, file export, and caching.
|
|
@@ -3595,7 +3682,7 @@ Examples:
|
|
|
3595
3682
|
});
|
|
3596
3683
|
|
|
3597
3684
|
// src/commands/ads/google/index.ts
|
|
3598
|
-
var googleCommand =
|
|
3685
|
+
var googleCommand = defineCommand29({
|
|
3599
3686
|
meta: {
|
|
3600
3687
|
name: "google",
|
|
3601
3688
|
description: `Google Ads commands. Query campaigns, keywords, search terms, and more via GAQL.
|
|
@@ -3623,7 +3710,7 @@ Examples:
|
|
|
3623
3710
|
});
|
|
3624
3711
|
|
|
3625
3712
|
// src/commands/ads/linkedin/index.ts
|
|
3626
|
-
import { defineCommand as
|
|
3713
|
+
import { defineCommand as defineCommand47 } from "citty";
|
|
3627
3714
|
|
|
3628
3715
|
// src/commands/ads/linkedin/schemas.ts
|
|
3629
3716
|
registerSchema({
|
|
@@ -3923,10 +4010,10 @@ registerSchema({
|
|
|
3923
4010
|
});
|
|
3924
4011
|
|
|
3925
4012
|
// src/commands/ads/linkedin/account.ts
|
|
3926
|
-
import { defineCommand as
|
|
4013
|
+
import { defineCommand as defineCommand30 } from "citty";
|
|
3927
4014
|
|
|
3928
4015
|
// src/commands/ads/linkedin/shared.ts
|
|
3929
|
-
var
|
|
4016
|
+
var DAY_MS2 = 864e5;
|
|
3930
4017
|
function handleLinkedinError(err) {
|
|
3931
4018
|
if (err instanceof ApiError) {
|
|
3932
4019
|
if (err.code === "UNAUTHORIZED") {
|
|
@@ -4009,7 +4096,7 @@ function todayIso() {
|
|
|
4009
4096
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
4010
4097
|
}
|
|
4011
4098
|
function daysAgoIso(days) {
|
|
4012
|
-
return new Date(Date.now() - days *
|
|
4099
|
+
return new Date(Date.now() - days * DAY_MS2).toISOString().slice(0, 10);
|
|
4013
4100
|
}
|
|
4014
4101
|
function csvOrJson(args) {
|
|
4015
4102
|
return args.output ?? "json";
|
|
@@ -4026,7 +4113,7 @@ function resolveStatusFilter(args) {
|
|
|
4026
4113
|
}
|
|
4027
4114
|
|
|
4028
4115
|
// src/commands/ads/linkedin/account.ts
|
|
4029
|
-
var accountCommand =
|
|
4116
|
+
var accountCommand = defineCommand30({
|
|
4030
4117
|
meta: {
|
|
4031
4118
|
name: "account",
|
|
4032
4119
|
description: `Single LinkedIn ad account detail (currency, status, type).
|
|
@@ -4060,9 +4147,9 @@ Examples:
|
|
|
4060
4147
|
});
|
|
4061
4148
|
|
|
4062
4149
|
// src/commands/ads/linkedin/accounts.ts
|
|
4063
|
-
import { defineCommand as
|
|
4150
|
+
import { defineCommand as defineCommand31 } from "citty";
|
|
4064
4151
|
var ACCOUNTS_TTL_MS = 60 * 60 * 1e3;
|
|
4065
|
-
var accountsCommand2 =
|
|
4152
|
+
var accountsCommand2 = defineCommand31({
|
|
4066
4153
|
meta: {
|
|
4067
4154
|
name: "accounts",
|
|
4068
4155
|
description: `List LinkedIn ad accounts in this company's connected scope.
|
|
@@ -4110,7 +4197,7 @@ Examples:
|
|
|
4110
4197
|
});
|
|
4111
4198
|
|
|
4112
4199
|
// src/commands/ads/linkedin/analytics.ts
|
|
4113
|
-
import { defineCommand as
|
|
4200
|
+
import { defineCommand as defineCommand32 } from "citty";
|
|
4114
4201
|
|
|
4115
4202
|
// src/commands/ads/linkedin/presets.ts
|
|
4116
4203
|
var INTENTS = {
|
|
@@ -4382,7 +4469,7 @@ function numberOf(v) {
|
|
|
4382
4469
|
}
|
|
4383
4470
|
return 0;
|
|
4384
4471
|
}
|
|
4385
|
-
var analyticsCommand =
|
|
4472
|
+
var analyticsCommand = defineCommand32({
|
|
4386
4473
|
meta: {
|
|
4387
4474
|
name: "analytics",
|
|
4388
4475
|
description: `Performance reporting \u2014 the workhorse for AI agents.
|
|
@@ -4510,7 +4597,7 @@ Examples \u2014 common AI questions:
|
|
|
4510
4597
|
|
|
4511
4598
|
// src/commands/ads/linkedin/audience-size.ts
|
|
4512
4599
|
import { readFileSync as readFileSync3 } from "fs";
|
|
4513
|
-
import { defineCommand as
|
|
4600
|
+
import { defineCommand as defineCommand33 } from "citty";
|
|
4514
4601
|
function loadTargeting(args) {
|
|
4515
4602
|
const inline = args.targeting;
|
|
4516
4603
|
if (inline) {
|
|
@@ -4532,7 +4619,7 @@ function loadTargeting(args) {
|
|
|
4532
4619
|
}
|
|
4533
4620
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
4534
4621
|
}
|
|
4535
|
-
var audienceSizeCommand =
|
|
4622
|
+
var audienceSizeCommand = defineCommand33({
|
|
4536
4623
|
meta: {
|
|
4537
4624
|
name: "audience-size",
|
|
4538
4625
|
description: `Estimate audience size for a targeting payload \u2014 pre-launch sanity check.
|
|
@@ -4577,7 +4664,7 @@ Examples:
|
|
|
4577
4664
|
});
|
|
4578
4665
|
|
|
4579
4666
|
// src/commands/ads/linkedin/audit.ts
|
|
4580
|
-
import { defineCommand as
|
|
4667
|
+
import { defineCommand as defineCommand34 } from "citty";
|
|
4581
4668
|
var SEVERITY_RANK = {
|
|
4582
4669
|
critical: 0,
|
|
4583
4670
|
high: 1,
|
|
@@ -4636,7 +4723,7 @@ function noteOf(f) {
|
|
|
4636
4723
|
const fix = f.fix?.explanation ?? "";
|
|
4637
4724
|
return [fix, ev].filter(Boolean).join(" \u2014 ");
|
|
4638
4725
|
}
|
|
4639
|
-
var auditCommand =
|
|
4726
|
+
var auditCommand = defineCommand34({
|
|
4640
4727
|
meta: {
|
|
4641
4728
|
name: "audit",
|
|
4642
4729
|
description: `Run a LinkedIn Ads playbook audit \u2014 30+ checks across Settings, Tracking,
|
|
@@ -4703,7 +4790,7 @@ Examples:
|
|
|
4703
4790
|
|
|
4704
4791
|
// src/commands/ads/linkedin/bid-pricing.ts
|
|
4705
4792
|
import { readFileSync as readFileSync4 } from "fs";
|
|
4706
|
-
import { defineCommand as
|
|
4793
|
+
import { defineCommand as defineCommand35 } from "citty";
|
|
4707
4794
|
function loadTargeting2(args) {
|
|
4708
4795
|
const inline = args.targeting;
|
|
4709
4796
|
if (inline) {
|
|
@@ -4725,7 +4812,7 @@ function loadTargeting2(args) {
|
|
|
4725
4812
|
}
|
|
4726
4813
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
4727
4814
|
}
|
|
4728
|
-
var bidPricingCommand =
|
|
4815
|
+
var bidPricingCommand = defineCommand35({
|
|
4729
4816
|
meta: {
|
|
4730
4817
|
name: "bid-pricing",
|
|
4731
4818
|
description: `Get LinkedIn's suggested bid range for a targeting + objective + cost type.
|
|
@@ -4775,8 +4862,8 @@ Examples:
|
|
|
4775
4862
|
});
|
|
4776
4863
|
|
|
4777
4864
|
// src/commands/ads/linkedin/campaign-groups.ts
|
|
4778
|
-
import { defineCommand as
|
|
4779
|
-
var campaignGroupsCommand =
|
|
4865
|
+
import { defineCommand as defineCommand36 } from "citty";
|
|
4866
|
+
var campaignGroupsCommand = defineCommand36({
|
|
4780
4867
|
meta: {
|
|
4781
4868
|
name: "campaign-groups",
|
|
4782
4869
|
description: `List LinkedIn campaign groups.
|
|
@@ -4819,8 +4906,8 @@ Examples:
|
|
|
4819
4906
|
});
|
|
4820
4907
|
|
|
4821
4908
|
// src/commands/ads/linkedin/campaigns.ts
|
|
4822
|
-
import { defineCommand as
|
|
4823
|
-
var campaignsCommand =
|
|
4909
|
+
import { defineCommand as defineCommand37 } from "citty";
|
|
4910
|
+
var campaignsCommand = defineCommand37({
|
|
4824
4911
|
meta: {
|
|
4825
4912
|
name: "campaigns",
|
|
4826
4913
|
description: `List LinkedIn campaigns.
|
|
@@ -4869,8 +4956,8 @@ Examples:
|
|
|
4869
4956
|
});
|
|
4870
4957
|
|
|
4871
4958
|
// src/commands/ads/linkedin/conversation.ts
|
|
4872
|
-
import { defineCommand as
|
|
4873
|
-
var conversationCommand =
|
|
4959
|
+
import { defineCommand as defineCommand38 } from "citty";
|
|
4960
|
+
var conversationCommand = defineCommand38({
|
|
4874
4961
|
meta: {
|
|
4875
4962
|
name: "conversation",
|
|
4876
4963
|
description: `Per-button click rates inside Sponsored Messaging / Conversation Ads.
|
|
@@ -4933,14 +5020,14 @@ Examples:
|
|
|
4933
5020
|
});
|
|
4934
5021
|
|
|
4935
5022
|
// src/commands/ads/linkedin/conversions.ts
|
|
4936
|
-
import { defineCommand as
|
|
4937
|
-
var
|
|
5023
|
+
import { defineCommand as defineCommand39 } from "citty";
|
|
5024
|
+
var DAY_MS3 = 864e5;
|
|
4938
5025
|
function healthOf(rules) {
|
|
4939
5026
|
const enabled = rules.filter((r) => r.enabled !== false);
|
|
4940
5027
|
const capi = enabled.filter((r) => r.conversionMethod === "CONVERSIONS_API");
|
|
4941
5028
|
const pixel = enabled.filter((r) => r.conversionMethod === "PIXEL");
|
|
4942
5029
|
const staleCapi = capi.filter(
|
|
4943
|
-
(r) => !r.lastConversionReportedAt || Date.now() - r.lastConversionReportedAt > 7 *
|
|
5030
|
+
(r) => !r.lastConversionReportedAt || Date.now() - r.lastConversionReportedAt > 7 * DAY_MS3
|
|
4944
5031
|
);
|
|
4945
5032
|
const longView = enabled.filter(
|
|
4946
5033
|
(r) => r.viewThroughAttributionWindowSize !== void 0 && r.viewThroughAttributionWindowSize > 7
|
|
@@ -4959,7 +5046,7 @@ function healthOf(rules) {
|
|
|
4959
5046
|
wrongLeadDedup: wrongDedup
|
|
4960
5047
|
};
|
|
4961
5048
|
}
|
|
4962
|
-
var listCmd =
|
|
5049
|
+
var listCmd = defineCommand39({
|
|
4963
5050
|
meta: {
|
|
4964
5051
|
name: "list",
|
|
4965
5052
|
description: `List conversion rules on the account.`
|
|
@@ -4987,7 +5074,7 @@ var listCmd = defineCommand38({
|
|
|
4987
5074
|
}
|
|
4988
5075
|
}
|
|
4989
5076
|
});
|
|
4990
|
-
var healthCmd =
|
|
5077
|
+
var healthCmd = defineCommand39({
|
|
4991
5078
|
meta: {
|
|
4992
5079
|
name: "health",
|
|
4993
5080
|
description: `5-point Insight Tag / CAPI health check (playbook \xA707).
|
|
@@ -5017,7 +5104,7 @@ Surfaces:
|
|
|
5017
5104
|
}
|
|
5018
5105
|
}
|
|
5019
5106
|
});
|
|
5020
|
-
var conversionsCommand =
|
|
5107
|
+
var conversionsCommand = defineCommand39({
|
|
5021
5108
|
meta: {
|
|
5022
5109
|
name: "conversions",
|
|
5023
5110
|
description: `Conversion rules \u2014 Insight Tag and Conversions API.
|
|
@@ -5033,8 +5120,8 @@ Subcommands:
|
|
|
5033
5120
|
});
|
|
5034
5121
|
|
|
5035
5122
|
// src/commands/ads/linkedin/creatives.ts
|
|
5036
|
-
import { defineCommand as
|
|
5037
|
-
var creativesCommand =
|
|
5123
|
+
import { defineCommand as defineCommand40 } from "citty";
|
|
5124
|
+
var creativesCommand = defineCommand40({
|
|
5038
5125
|
meta: {
|
|
5039
5126
|
name: "creatives",
|
|
5040
5127
|
description: `List LinkedIn creatives (ads).
|
|
@@ -5083,7 +5170,7 @@ Examples:
|
|
|
5083
5170
|
});
|
|
5084
5171
|
|
|
5085
5172
|
// src/commands/ads/linkedin/demographics.ts
|
|
5086
|
-
import { defineCommand as
|
|
5173
|
+
import { defineCommand as defineCommand41 } from "citty";
|
|
5087
5174
|
var DEFAULT_PIVOTS = ["job-title", "company", "industry", "seniority", "job-function", "company-size"];
|
|
5088
5175
|
function numberOf2(v) {
|
|
5089
5176
|
if (typeof v === "number") return Number.isFinite(v) ? v : 0;
|
|
@@ -5096,7 +5183,7 @@ function numberOf2(v) {
|
|
|
5096
5183
|
function topByImpressions(rows, limit) {
|
|
5097
5184
|
return [...rows].sort((a, b) => numberOf2(b.impressions) - numberOf2(a.impressions)).slice(0, limit);
|
|
5098
5185
|
}
|
|
5099
|
-
var demographicsCommand =
|
|
5186
|
+
var demographicsCommand = defineCommand41({
|
|
5100
5187
|
meta: {
|
|
5101
5188
|
name: "demographics",
|
|
5102
5189
|
description: `Sweep all firmographic pivots in one command \u2014 LinkedIn's superpower.
|
|
@@ -5193,8 +5280,8 @@ function resolveRange(args) {
|
|
|
5193
5280
|
}
|
|
5194
5281
|
|
|
5195
5282
|
// src/commands/ads/linkedin/facets.ts
|
|
5196
|
-
import { defineCommand as
|
|
5197
|
-
var listCmd2 =
|
|
5283
|
+
import { defineCommand as defineCommand42 } from "citty";
|
|
5284
|
+
var listCmd2 = defineCommand42({
|
|
5198
5285
|
meta: {
|
|
5199
5286
|
name: "list",
|
|
5200
5287
|
description: `List every targeting facet LinkedIn supports.
|
|
@@ -5222,7 +5309,7 @@ seniorities, titles, employers, growthRate, companyCategory, skills, etc.).`
|
|
|
5222
5309
|
}
|
|
5223
5310
|
}
|
|
5224
5311
|
});
|
|
5225
|
-
var valuesCmd =
|
|
5312
|
+
var valuesCmd = defineCommand42({
|
|
5226
5313
|
meta: {
|
|
5227
5314
|
name: "values",
|
|
5228
5315
|
description: `Look up entity values for a single facet \u2014 full list or typeahead search.
|
|
@@ -5263,7 +5350,7 @@ or the full URN (urn:li:adTargetingFacet:industries).`
|
|
|
5263
5350
|
}
|
|
5264
5351
|
}
|
|
5265
5352
|
});
|
|
5266
|
-
var facetsCommand =
|
|
5353
|
+
var facetsCommand = defineCommand42({
|
|
5267
5354
|
meta: {
|
|
5268
5355
|
name: "facets",
|
|
5269
5356
|
description: `LinkedIn targeting facets and entity lookup.
|
|
@@ -5281,7 +5368,7 @@ Subcommands:
|
|
|
5281
5368
|
|
|
5282
5369
|
// src/commands/ads/linkedin/forecast.ts
|
|
5283
5370
|
import { readFileSync as readFileSync5 } from "fs";
|
|
5284
|
-
import { defineCommand as
|
|
5371
|
+
import { defineCommand as defineCommand43 } from "citty";
|
|
5285
5372
|
function loadTargeting3(args) {
|
|
5286
5373
|
const inline = args.targeting;
|
|
5287
5374
|
if (inline) {
|
|
@@ -5311,7 +5398,7 @@ function parseMoney(raw) {
|
|
|
5311
5398
|
}
|
|
5312
5399
|
return { amount: m[1] ?? "0", currencyCode: m[2] ?? "USD" };
|
|
5313
5400
|
}
|
|
5314
|
-
var forecastCommand =
|
|
5401
|
+
var forecastCommand = defineCommand43({
|
|
5315
5402
|
meta: {
|
|
5316
5403
|
name: "forecast",
|
|
5317
5404
|
description: `Forecast reach + impressions + clicks + spend for a hypothetical campaign.
|
|
@@ -5358,9 +5445,9 @@ Examples:
|
|
|
5358
5445
|
});
|
|
5359
5446
|
|
|
5360
5447
|
// src/commands/ads/linkedin/leads.ts
|
|
5361
|
-
import { defineCommand as
|
|
5362
|
-
var
|
|
5363
|
-
var leadsCommand =
|
|
5448
|
+
import { defineCommand as defineCommand44 } from "citty";
|
|
5449
|
+
var DAY_MS4 = 864e5;
|
|
5450
|
+
var leadsCommand = defineCommand44({
|
|
5364
5451
|
meta: {
|
|
5365
5452
|
name: "leads",
|
|
5366
5453
|
description: `List Lead Gen Form responses (playbook \xA707).
|
|
@@ -5395,7 +5482,7 @@ Examples:
|
|
|
5395
5482
|
if (args["form-id"]) params["form-id"] = String(args["form-id"]);
|
|
5396
5483
|
if (args["campaign-id"]) params["campaign-id"] = String(args["campaign-id"]);
|
|
5397
5484
|
const sinceDays = args["since-days"] ? Number(args["since-days"]) : void 0;
|
|
5398
|
-
const sinceMs = args["since-ms"] ? Number(args["since-ms"]) : sinceDays ? Date.now() - sinceDays *
|
|
5485
|
+
const sinceMs = args["since-ms"] ? Number(args["since-ms"]) : sinceDays ? Date.now() - sinceDays * DAY_MS4 : void 0;
|
|
5399
5486
|
if (sinceMs) params["since-ms"] = String(sinceMs);
|
|
5400
5487
|
if (args.limit) params.limit = String(args.limit);
|
|
5401
5488
|
if (args["skip-cache"]) params["skip-cache"] = "true";
|
|
@@ -5420,7 +5507,7 @@ Examples:
|
|
|
5420
5507
|
});
|
|
5421
5508
|
|
|
5422
5509
|
// src/commands/ads/linkedin/resolve.ts
|
|
5423
|
-
import { defineCommand as
|
|
5510
|
+
import { defineCommand as defineCommand45 } from "citty";
|
|
5424
5511
|
function toOrgUrn(raw) {
|
|
5425
5512
|
const trimmed = raw.trim();
|
|
5426
5513
|
if (trimmed.length === 0) {
|
|
@@ -5431,7 +5518,7 @@ function toOrgUrn(raw) {
|
|
|
5431
5518
|
}
|
|
5432
5519
|
return /^\d+$/.test(trimmed) ? `urn:li:organization:${trimmed}` : null;
|
|
5433
5520
|
}
|
|
5434
|
-
var resolveCommand =
|
|
5521
|
+
var resolveCommand = defineCommand45({
|
|
5435
5522
|
meta: {
|
|
5436
5523
|
name: "resolve",
|
|
5437
5524
|
description: `Resolve organization URNs to company names.
|
|
@@ -5473,8 +5560,8 @@ couldn't be resolved \u2014 typically an org outside LinkedIn's targetable set.`
|
|
|
5473
5560
|
});
|
|
5474
5561
|
|
|
5475
5562
|
// src/commands/ads/linkedin/top-companies.ts
|
|
5476
|
-
import { defineCommand as
|
|
5477
|
-
var topCompaniesCommand =
|
|
5563
|
+
import { defineCommand as defineCommand46 } from "citty";
|
|
5564
|
+
var topCompaniesCommand = defineCommand46({
|
|
5478
5565
|
meta: {
|
|
5479
5566
|
name: "top-companies",
|
|
5480
5567
|
description: `Top companies whose employees saw / clicked / converted on a campaign.
|
|
@@ -5545,7 +5632,7 @@ Examples:
|
|
|
5545
5632
|
});
|
|
5546
5633
|
|
|
5547
5634
|
// src/commands/ads/linkedin/index.ts
|
|
5548
|
-
var linkedinCommand =
|
|
5635
|
+
var linkedinCommand = defineCommand47({
|
|
5549
5636
|
meta: {
|
|
5550
5637
|
name: "linkedin",
|
|
5551
5638
|
description: `LinkedIn Marketing API \u2014 AI-first command surface for B2B ad insights.
|
|
@@ -5597,13 +5684,13 @@ Account ID format:
|
|
|
5597
5684
|
});
|
|
5598
5685
|
|
|
5599
5686
|
// src/commands/ads/meta/index.ts
|
|
5600
|
-
import { defineCommand as
|
|
5687
|
+
import { defineCommand as defineCommand60 } from "citty";
|
|
5601
5688
|
|
|
5602
5689
|
// src/commands/ads/meta/account.ts
|
|
5603
|
-
import { defineCommand as
|
|
5690
|
+
import { defineCommand as defineCommand48 } from "citty";
|
|
5604
5691
|
|
|
5605
5692
|
// src/commands/ads/meta/shared.ts
|
|
5606
|
-
var
|
|
5693
|
+
var DAY_MS5 = 864e5;
|
|
5607
5694
|
function handleMetaError(err) {
|
|
5608
5695
|
if (err instanceof ApiError) {
|
|
5609
5696
|
if (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND") {
|
|
@@ -5662,7 +5749,7 @@ function todayIso2() {
|
|
|
5662
5749
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
5663
5750
|
}
|
|
5664
5751
|
function daysAgoIso2(days) {
|
|
5665
|
-
return new Date(Date.now() - days *
|
|
5752
|
+
return new Date(Date.now() - days * DAY_MS5).toISOString().slice(0, 10);
|
|
5666
5753
|
}
|
|
5667
5754
|
function csvOrJson2(args) {
|
|
5668
5755
|
return args.output ?? "json";
|
|
@@ -5679,7 +5766,7 @@ function resolveEffectiveStatus(args) {
|
|
|
5679
5766
|
}
|
|
5680
5767
|
|
|
5681
5768
|
// src/commands/ads/meta/account.ts
|
|
5682
|
-
var accountCommand2 =
|
|
5769
|
+
var accountCommand2 = defineCommand48({
|
|
5683
5770
|
meta: {
|
|
5684
5771
|
name: "account",
|
|
5685
5772
|
description: `Show single Meta ad account detail (currency, timezone, balance, business).
|
|
@@ -5706,8 +5793,8 @@ Examples:
|
|
|
5706
5793
|
});
|
|
5707
5794
|
|
|
5708
5795
|
// src/commands/ads/meta/accounts.ts
|
|
5709
|
-
import { defineCommand as
|
|
5710
|
-
var accountsCommand3 =
|
|
5796
|
+
import { defineCommand as defineCommand49 } from "citty";
|
|
5797
|
+
var accountsCommand3 = defineCommand49({
|
|
5711
5798
|
meta: {
|
|
5712
5799
|
name: "accounts",
|
|
5713
5800
|
description: `List Meta ad accounts in this company's connected scope.
|
|
@@ -5755,8 +5842,8 @@ Examples:
|
|
|
5755
5842
|
});
|
|
5756
5843
|
|
|
5757
5844
|
// src/commands/ads/meta/activities.ts
|
|
5758
|
-
import { defineCommand as
|
|
5759
|
-
var activitiesCommand =
|
|
5845
|
+
import { defineCommand as defineCommand50 } from "citty";
|
|
5846
|
+
var activitiesCommand = defineCommand50({
|
|
5760
5847
|
meta: {
|
|
5761
5848
|
name: "activities",
|
|
5762
5849
|
description: `Audit log of recent ad-account changes (created, paused, edited). Default lookback 7 days,
|
|
@@ -5793,8 +5880,8 @@ Examples:
|
|
|
5793
5880
|
});
|
|
5794
5881
|
|
|
5795
5882
|
// src/commands/ads/meta/ads.ts
|
|
5796
|
-
import { defineCommand as
|
|
5797
|
-
var adsListCommand =
|
|
5883
|
+
import { defineCommand as defineCommand51 } from "citty";
|
|
5884
|
+
var adsListCommand = defineCommand51({
|
|
5798
5885
|
meta: {
|
|
5799
5886
|
name: "ads",
|
|
5800
5887
|
description: `List ads in a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -5842,8 +5929,8 @@ Examples:
|
|
|
5842
5929
|
});
|
|
5843
5930
|
|
|
5844
5931
|
// src/commands/ads/meta/adsets.ts
|
|
5845
|
-
import { defineCommand as
|
|
5846
|
-
var adsetsCommand =
|
|
5932
|
+
import { defineCommand as defineCommand52 } from "citty";
|
|
5933
|
+
var adsetsCommand = defineCommand52({
|
|
5847
5934
|
meta: {
|
|
5848
5935
|
name: "adsets",
|
|
5849
5936
|
description: `List ad sets in a Meta ad account, optionally scoped to one campaign. Defaults to ACTIVE only.
|
|
@@ -5885,8 +5972,8 @@ Examples:
|
|
|
5885
5972
|
});
|
|
5886
5973
|
|
|
5887
5974
|
// src/commands/ads/meta/audiences.ts
|
|
5888
|
-
import { defineCommand as
|
|
5889
|
-
var audiencesCommand =
|
|
5975
|
+
import { defineCommand as defineCommand53 } from "citty";
|
|
5976
|
+
var audiencesCommand = defineCommand53({
|
|
5890
5977
|
meta: {
|
|
5891
5978
|
name: "audiences",
|
|
5892
5979
|
description: `List custom audiences for a Meta ad account. Includes lookalikes, website-pixel audiences,
|
|
@@ -5921,8 +6008,8 @@ Examples:
|
|
|
5921
6008
|
});
|
|
5922
6009
|
|
|
5923
6010
|
// src/commands/ads/meta/businesses.ts
|
|
5924
|
-
import { defineCommand as
|
|
5925
|
-
var businessesCommand =
|
|
6011
|
+
import { defineCommand as defineCommand54 } from "citty";
|
|
6012
|
+
var businessesCommand = defineCommand54({
|
|
5926
6013
|
meta: {
|
|
5927
6014
|
name: "businesses",
|
|
5928
6015
|
description: `List Meta Business Manager accounts the connected user has access to. Required for ad-studies and product-catalogs commands.
|
|
@@ -5952,8 +6039,8 @@ Examples:
|
|
|
5952
6039
|
});
|
|
5953
6040
|
|
|
5954
6041
|
// src/commands/ads/meta/campaigns.ts
|
|
5955
|
-
import { defineCommand as
|
|
5956
|
-
var campaignsCommand2 =
|
|
6042
|
+
import { defineCommand as defineCommand55 } from "citty";
|
|
6043
|
+
var campaignsCommand2 = defineCommand55({
|
|
5957
6044
|
meta: {
|
|
5958
6045
|
name: "campaigns",
|
|
5959
6046
|
description: `List campaigns for a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -5997,8 +6084,8 @@ Examples:
|
|
|
5997
6084
|
});
|
|
5998
6085
|
|
|
5999
6086
|
// src/commands/ads/meta/creatives.ts
|
|
6000
|
-
import { defineCommand as
|
|
6001
|
-
var creativesCommand2 =
|
|
6087
|
+
import { defineCommand as defineCommand56 } from "citty";
|
|
6088
|
+
var creativesCommand2 = defineCommand56({
|
|
6002
6089
|
meta: {
|
|
6003
6090
|
name: "creatives",
|
|
6004
6091
|
description: `List ad creatives in an account, or fetch a single creative by ID.
|
|
@@ -6042,7 +6129,7 @@ Examples:
|
|
|
6042
6129
|
});
|
|
6043
6130
|
|
|
6044
6131
|
// src/commands/ads/meta/insights.ts
|
|
6045
|
-
import { defineCommand as
|
|
6132
|
+
import { defineCommand as defineCommand57 } from "citty";
|
|
6046
6133
|
|
|
6047
6134
|
// src/commands/ads/meta/presets.ts
|
|
6048
6135
|
var INSIGHTS_INTENTS = {
|
|
@@ -6247,7 +6334,7 @@ function sortRowsBySpendDesc(rows) {
|
|
|
6247
6334
|
return sb - sa;
|
|
6248
6335
|
});
|
|
6249
6336
|
}
|
|
6250
|
-
var insightsCommand =
|
|
6337
|
+
var insightsCommand = defineCommand57({
|
|
6251
6338
|
meta: {
|
|
6252
6339
|
name: "insights",
|
|
6253
6340
|
description: `Performance reporting \u2014 the main Meta tool for AI agents.
|
|
@@ -6348,8 +6435,8 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
|
|
|
6348
6435
|
});
|
|
6349
6436
|
|
|
6350
6437
|
// src/commands/ads/meta/pixels.ts
|
|
6351
|
-
import { defineCommand as
|
|
6352
|
-
var pixelsCommand =
|
|
6438
|
+
import { defineCommand as defineCommand58 } from "citty";
|
|
6439
|
+
var pixelsCommand = defineCommand58({
|
|
6353
6440
|
meta: {
|
|
6354
6441
|
name: "pixels",
|
|
6355
6442
|
description: `List Meta Pixels for an ad account, or fetch firing stats for one pixel.
|
|
@@ -6420,7 +6507,7 @@ function emit(data, args) {
|
|
|
6420
6507
|
|
|
6421
6508
|
// src/commands/ads/meta/preview.ts
|
|
6422
6509
|
import { writeFileSync as writeFileSync3 } from "fs";
|
|
6423
|
-
import { defineCommand as
|
|
6510
|
+
import { defineCommand as defineCommand59 } from "citty";
|
|
6424
6511
|
var VALID_AD_FORMATS = [
|
|
6425
6512
|
"DESKTOP_FEED_STANDARD",
|
|
6426
6513
|
"MOBILE_FEED_STANDARD",
|
|
@@ -6454,7 +6541,7 @@ var VALID_AD_FORMATS = [
|
|
|
6454
6541
|
"MARKETPLACE_MOBILE",
|
|
6455
6542
|
"BIZ_DISCO_FEED_MOBILE"
|
|
6456
6543
|
];
|
|
6457
|
-
var previewCommand =
|
|
6544
|
+
var previewCommand = defineCommand59({
|
|
6458
6545
|
meta: {
|
|
6459
6546
|
name: "preview",
|
|
6460
6547
|
description: `Generate a Meta-hosted preview iframe for a creative or ad. Returns iframe HTML which you
|
|
@@ -6501,7 +6588,7 @@ Examples:
|
|
|
6501
6588
|
});
|
|
6502
6589
|
|
|
6503
6590
|
// src/commands/ads/meta/index.ts
|
|
6504
|
-
var metaCommand =
|
|
6591
|
+
var metaCommand = defineCommand60({
|
|
6505
6592
|
meta: {
|
|
6506
6593
|
name: "meta",
|
|
6507
6594
|
description: `Meta Marketing API \u2014 AI-first command surface (Facebook + Instagram ads).
|
|
@@ -6553,10 +6640,10 @@ Audit & review:
|
|
|
6553
6640
|
});
|
|
6554
6641
|
|
|
6555
6642
|
// src/commands/ads/x/index.ts
|
|
6556
|
-
import { defineCommand as
|
|
6643
|
+
import { defineCommand as defineCommand77 } from "citty";
|
|
6557
6644
|
|
|
6558
6645
|
// src/commands/ads/x/accounts.ts
|
|
6559
|
-
import { defineCommand as
|
|
6646
|
+
import { defineCommand as defineCommand61 } from "citty";
|
|
6560
6647
|
registerSchema({
|
|
6561
6648
|
command: "ads.x.accounts",
|
|
6562
6649
|
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.",
|
|
@@ -6584,7 +6671,7 @@ function handleAccountsError2(err) {
|
|
|
6584
6671
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
6585
6672
|
process.exit(1);
|
|
6586
6673
|
}
|
|
6587
|
-
var accountsCommand4 =
|
|
6674
|
+
var accountsCommand4 = defineCommand61({
|
|
6588
6675
|
meta: {
|
|
6589
6676
|
name: "accounts",
|
|
6590
6677
|
description: `List accessible X Ads accounts. Returns account IDs needed for all other commands.
|
|
@@ -6624,7 +6711,7 @@ Examples:
|
|
|
6624
6711
|
});
|
|
6625
6712
|
|
|
6626
6713
|
// src/commands/ads/x/active-entities.ts
|
|
6627
|
-
import { defineCommand as
|
|
6714
|
+
import { defineCommand as defineCommand62 } from "citty";
|
|
6628
6715
|
|
|
6629
6716
|
// src/commands/ads/x/error-parser.ts
|
|
6630
6717
|
function mapXErrorCode(message) {
|
|
@@ -6775,7 +6862,7 @@ function parseCsv(v) {
|
|
|
6775
6862
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
6776
6863
|
return parts.length > 0 ? parts : void 0;
|
|
6777
6864
|
}
|
|
6778
|
-
var activeEntitiesCommand =
|
|
6865
|
+
var activeEntitiesCommand = defineCommand62({
|
|
6779
6866
|
meta: {
|
|
6780
6867
|
name: "active-entities",
|
|
6781
6868
|
description: `List entities with metric activity in a time range.
|
|
@@ -6833,7 +6920,7 @@ Examples:
|
|
|
6833
6920
|
});
|
|
6834
6921
|
|
|
6835
6922
|
// src/commands/ads/x/audiences.ts
|
|
6836
|
-
import { defineCommand as
|
|
6923
|
+
import { defineCommand as defineCommand63 } from "citty";
|
|
6837
6924
|
registerSchema({
|
|
6838
6925
|
command: "ads.x.audiences",
|
|
6839
6926
|
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.",
|
|
@@ -6842,7 +6929,7 @@ registerSchema({
|
|
|
6842
6929
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6843
6930
|
}
|
|
6844
6931
|
});
|
|
6845
|
-
var audiencesCommand2 =
|
|
6932
|
+
var audiencesCommand2 = defineCommand63({
|
|
6846
6933
|
meta: {
|
|
6847
6934
|
name: "audiences",
|
|
6848
6935
|
description: `List X Ads custom audiences.
|
|
@@ -6891,7 +6978,7 @@ Examples:
|
|
|
6891
6978
|
});
|
|
6892
6979
|
|
|
6893
6980
|
// src/commands/ads/x/campaigns.ts
|
|
6894
|
-
import { defineCommand as
|
|
6981
|
+
import { defineCommand as defineCommand64 } from "citty";
|
|
6895
6982
|
|
|
6896
6983
|
// src/commands/ads/x/run-list.ts
|
|
6897
6984
|
function buildCleanParams(opts) {
|
|
@@ -6954,7 +7041,7 @@ registerSchema({
|
|
|
6954
7041
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6955
7042
|
}
|
|
6956
7043
|
});
|
|
6957
|
-
var campaignsCommand3 =
|
|
7044
|
+
var campaignsCommand3 = defineCommand64({
|
|
6958
7045
|
meta: {
|
|
6959
7046
|
name: "campaigns",
|
|
6960
7047
|
description: `List X Ads campaigns. Returns budget, schedule, funding instrument, status.
|
|
@@ -6996,7 +7083,7 @@ Examples:
|
|
|
6996
7083
|
});
|
|
6997
7084
|
|
|
6998
7085
|
// src/commands/ads/x/cards.ts
|
|
6999
|
-
import { defineCommand as
|
|
7086
|
+
import { defineCommand as defineCommand65 } from "citty";
|
|
7000
7087
|
registerSchema({
|
|
7001
7088
|
command: "ads.x.cards",
|
|
7002
7089
|
description: "List website cards, video cards, and carousels for an X Ads account.",
|
|
@@ -7005,7 +7092,7 @@ registerSchema({
|
|
|
7005
7092
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7006
7093
|
}
|
|
7007
7094
|
});
|
|
7008
|
-
var cardsCommand =
|
|
7095
|
+
var cardsCommand = defineCommand65({
|
|
7009
7096
|
meta: {
|
|
7010
7097
|
name: "cards",
|
|
7011
7098
|
description: `List X Ads cards (rich creatives).
|
|
@@ -7054,7 +7141,7 @@ Examples:
|
|
|
7054
7141
|
});
|
|
7055
7142
|
|
|
7056
7143
|
// src/commands/ads/x/funding.ts
|
|
7057
|
-
import { defineCommand as
|
|
7144
|
+
import { defineCommand as defineCommand66 } from "citty";
|
|
7058
7145
|
registerSchema({
|
|
7059
7146
|
command: "ads.x.funding",
|
|
7060
7147
|
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.",
|
|
@@ -7063,7 +7150,7 @@ registerSchema({
|
|
|
7063
7150
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7064
7151
|
}
|
|
7065
7152
|
});
|
|
7066
|
-
var fundingCommand =
|
|
7153
|
+
var fundingCommand = defineCommand66({
|
|
7067
7154
|
meta: {
|
|
7068
7155
|
name: "funding",
|
|
7069
7156
|
description: `List funding instruments for an X Ads account.
|
|
@@ -7112,7 +7199,7 @@ Examples:
|
|
|
7112
7199
|
});
|
|
7113
7200
|
|
|
7114
7201
|
// src/commands/ads/x/line-items.ts
|
|
7115
|
-
import { defineCommand as
|
|
7202
|
+
import { defineCommand as defineCommand67 } from "citty";
|
|
7116
7203
|
registerSchema({
|
|
7117
7204
|
command: "ads.x.lineItems",
|
|
7118
7205
|
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).",
|
|
@@ -7124,7 +7211,7 @@ registerSchema({
|
|
|
7124
7211
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7125
7212
|
}
|
|
7126
7213
|
});
|
|
7127
|
-
var lineItemsCommand =
|
|
7214
|
+
var lineItemsCommand = defineCommand67({
|
|
7128
7215
|
meta: {
|
|
7129
7216
|
name: "line-items",
|
|
7130
7217
|
description: `List X Ads line items (ad groups).
|
|
@@ -7165,7 +7252,7 @@ Examples:
|
|
|
7165
7252
|
});
|
|
7166
7253
|
|
|
7167
7254
|
// src/commands/ads/x/media.ts
|
|
7168
|
-
import { defineCommand as
|
|
7255
|
+
import { defineCommand as defineCommand68 } from "citty";
|
|
7169
7256
|
registerSchema({
|
|
7170
7257
|
command: "ads.x.media",
|
|
7171
7258
|
description: "List media assets in the X Ads media library (images, GIFs, videos). Filter by media-type (IMAGE, GIF, VIDEO).",
|
|
@@ -7175,7 +7262,7 @@ registerSchema({
|
|
|
7175
7262
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7176
7263
|
}
|
|
7177
7264
|
});
|
|
7178
|
-
var mediaCommand =
|
|
7265
|
+
var mediaCommand = defineCommand68({
|
|
7179
7266
|
meta: {
|
|
7180
7267
|
name: "media",
|
|
7181
7268
|
description: `List media assets in the X Ads media library.
|
|
@@ -7227,7 +7314,7 @@ Examples:
|
|
|
7227
7314
|
});
|
|
7228
7315
|
|
|
7229
7316
|
// src/commands/ads/x/promoted-tweets.ts
|
|
7230
|
-
import { defineCommand as
|
|
7317
|
+
import { defineCommand as defineCommand69 } from "citty";
|
|
7231
7318
|
registerSchema({
|
|
7232
7319
|
command: "ads.x.promotedTweets",
|
|
7233
7320
|
description: "List promoted tweets for an X Ads account. Returns id, line_item_id, tweet_id, approval_status. Filter by line-item-ids (CSV).",
|
|
@@ -7238,7 +7325,7 @@ registerSchema({
|
|
|
7238
7325
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7239
7326
|
}
|
|
7240
7327
|
});
|
|
7241
|
-
var promotedTweetsCommand =
|
|
7328
|
+
var promotedTweetsCommand = defineCommand69({
|
|
7242
7329
|
meta: {
|
|
7243
7330
|
name: "promoted-tweets",
|
|
7244
7331
|
description: `List X Ads promoted tweets.
|
|
@@ -7292,11 +7379,11 @@ Examples:
|
|
|
7292
7379
|
});
|
|
7293
7380
|
|
|
7294
7381
|
// src/commands/ads/x/stats/index.ts
|
|
7295
|
-
import { defineCommand as
|
|
7382
|
+
import { defineCommand as defineCommand74 } from "citty";
|
|
7296
7383
|
|
|
7297
7384
|
// src/commands/ads/x/stats/job.ts
|
|
7298
7385
|
import { gunzipSync } from "zlib";
|
|
7299
|
-
import { defineCommand as
|
|
7386
|
+
import { defineCommand as defineCommand70 } from "citty";
|
|
7300
7387
|
var POLL_INTERVAL_MS2 = 1e4;
|
|
7301
7388
|
var DEADLINE_MS = 12 * 60 * 1e3;
|
|
7302
7389
|
var RESULT_CACHE_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
@@ -7366,7 +7453,7 @@ async function pollUntilDone(accountId, jobId) {
|
|
|
7366
7453
|
function buildCacheKey(body) {
|
|
7367
7454
|
return `stats-job:${JSON.stringify(body)}`;
|
|
7368
7455
|
}
|
|
7369
|
-
var statsJobCommand =
|
|
7456
|
+
var statsJobCommand = defineCommand70({
|
|
7370
7457
|
meta: {
|
|
7371
7458
|
name: "job",
|
|
7372
7459
|
description: `Async X Ads stats job, sync from the CLI's perspective. Creates \u2192 polls \u2192 downloads \u2192 returns.
|
|
@@ -7471,7 +7558,7 @@ For fine-grained control (don't wait, poll yourself), use:
|
|
|
7471
7558
|
});
|
|
7472
7559
|
|
|
7473
7560
|
// src/commands/ads/x/stats/job-create.ts
|
|
7474
|
-
import { defineCommand as
|
|
7561
|
+
import { defineCommand as defineCommand71 } from "citty";
|
|
7475
7562
|
registerSchema({
|
|
7476
7563
|
command: "ads.x.statsJobCreate",
|
|
7477
7564
|
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.",
|
|
@@ -7494,7 +7581,7 @@ function parseCsv3(v) {
|
|
|
7494
7581
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
7495
7582
|
return parts.length > 0 ? parts : void 0;
|
|
7496
7583
|
}
|
|
7497
|
-
var statsJobCreateCommand =
|
|
7584
|
+
var statsJobCreateCommand = defineCommand71({
|
|
7498
7585
|
meta: {
|
|
7499
7586
|
name: "job-create",
|
|
7500
7587
|
description: `Create an async X Ads stats job (up to 90 days, supports segmentation).
|
|
@@ -7557,7 +7644,7 @@ Examples:
|
|
|
7557
7644
|
});
|
|
7558
7645
|
|
|
7559
7646
|
// src/commands/ads/x/stats/job-status.ts
|
|
7560
|
-
import { defineCommand as
|
|
7647
|
+
import { defineCommand as defineCommand72 } from "citty";
|
|
7561
7648
|
registerSchema({
|
|
7562
7649
|
command: "ads.x.statsJobStatus",
|
|
7563
7650
|
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).",
|
|
@@ -7567,7 +7654,7 @@ registerSchema({
|
|
|
7567
7654
|
"job-ids": { type: "string", description: "CSV of job IDs", required: false }
|
|
7568
7655
|
}
|
|
7569
7656
|
});
|
|
7570
|
-
var statsJobStatusCommand =
|
|
7657
|
+
var statsJobStatusCommand = defineCommand72({
|
|
7571
7658
|
meta: {
|
|
7572
7659
|
name: "job-status",
|
|
7573
7660
|
description: `Poll the status of an async X Ads stats job.
|
|
@@ -7608,7 +7695,7 @@ Examples:
|
|
|
7608
7695
|
});
|
|
7609
7696
|
|
|
7610
7697
|
// src/commands/ads/x/stats/sync.ts
|
|
7611
|
-
import { defineCommand as
|
|
7698
|
+
import { defineCommand as defineCommand73 } from "citty";
|
|
7612
7699
|
|
|
7613
7700
|
// src/commands/ads/x/presets.ts
|
|
7614
7701
|
var X_STATS_PRESETS = [
|
|
@@ -7767,7 +7854,7 @@ async function runSync(args, q) {
|
|
|
7767
7854
|
process.exit(1);
|
|
7768
7855
|
}
|
|
7769
7856
|
}
|
|
7770
|
-
var statsSyncCommand =
|
|
7857
|
+
var statsSyncCommand = defineCommand73({
|
|
7771
7858
|
meta: {
|
|
7772
7859
|
name: "sync",
|
|
7773
7860
|
description: `Synchronous X Ads analytics (max 7-day window).
|
|
@@ -7810,7 +7897,7 @@ Examples:
|
|
|
7810
7897
|
});
|
|
7811
7898
|
|
|
7812
7899
|
// src/commands/ads/x/stats/index.ts
|
|
7813
|
-
var statsCommand =
|
|
7900
|
+
var statsCommand = defineCommand74({
|
|
7814
7901
|
meta: {
|
|
7815
7902
|
name: "stats",
|
|
7816
7903
|
description: `X Ads analytics. Sync (\u22647 days, no segmentation) or async jobs (\u226490 days, segmentable).
|
|
@@ -7838,7 +7925,7 @@ Examples:
|
|
|
7838
7925
|
});
|
|
7839
7926
|
|
|
7840
7927
|
// src/commands/ads/x/targeting-constants.ts
|
|
7841
|
-
import { defineCommand as
|
|
7928
|
+
import { defineCommand as defineCommand75 } from "citty";
|
|
7842
7929
|
var ALLOWED_CONSTANTS = [
|
|
7843
7930
|
"locations",
|
|
7844
7931
|
"interests",
|
|
@@ -7866,7 +7953,7 @@ registerSchema({
|
|
|
7866
7953
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7867
7954
|
}
|
|
7868
7955
|
});
|
|
7869
|
-
var targetingConstantsCommand =
|
|
7956
|
+
var targetingConstantsCommand = defineCommand75({
|
|
7870
7957
|
meta: {
|
|
7871
7958
|
name: "targeting-constants",
|
|
7872
7959
|
description: `Lookup X Ads targeting constants.
|
|
@@ -7916,7 +8003,7 @@ Examples:
|
|
|
7916
8003
|
});
|
|
7917
8004
|
|
|
7918
8005
|
// src/commands/ads/x/targeting-criteria.ts
|
|
7919
|
-
import { defineCommand as
|
|
8006
|
+
import { defineCommand as defineCommand76 } from "citty";
|
|
7920
8007
|
registerSchema({
|
|
7921
8008
|
command: "ads.x.targetingCriteria",
|
|
7922
8009
|
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.",
|
|
@@ -7926,7 +8013,7 @@ registerSchema({
|
|
|
7926
8013
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7927
8014
|
}
|
|
7928
8015
|
});
|
|
7929
|
-
var targetingCriteriaCommand =
|
|
8016
|
+
var targetingCriteriaCommand = defineCommand76({
|
|
7930
8017
|
meta: {
|
|
7931
8018
|
name: "targeting-criteria",
|
|
7932
8019
|
description: `List targeting criteria attached to line items.
|
|
@@ -7977,7 +8064,7 @@ Examples:
|
|
|
7977
8064
|
});
|
|
7978
8065
|
|
|
7979
8066
|
// src/commands/ads/x/index.ts
|
|
7980
|
-
var xCommand =
|
|
8067
|
+
var xCommand = defineCommand77({
|
|
7981
8068
|
meta: {
|
|
7982
8069
|
name: "x",
|
|
7983
8070
|
description: `X (Twitter) Ads commands. Read campaigns, line items, promoted tweets, creatives, audiences, and analytics.
|
|
@@ -8015,7 +8102,7 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
|
|
|
8015
8102
|
});
|
|
8016
8103
|
|
|
8017
8104
|
// src/commands/ads/index.ts
|
|
8018
|
-
var adsCommand =
|
|
8105
|
+
var adsCommand = defineCommand78({
|
|
8019
8106
|
meta: {
|
|
8020
8107
|
name: "ads",
|
|
8021
8108
|
description: `Ad platform commands. Each platform exposes its own native command surface \u2014 no forced parity.
|
|
@@ -8045,11 +8132,11 @@ Examples:
|
|
|
8045
8132
|
});
|
|
8046
8133
|
|
|
8047
8134
|
// src/commands/canvas/index.ts
|
|
8048
|
-
import { defineCommand as
|
|
8135
|
+
import { defineCommand as defineCommand86 } from "citty";
|
|
8049
8136
|
|
|
8050
8137
|
// src/commands/canvas/catalog.ts
|
|
8051
|
-
import { defineCommand as
|
|
8052
|
-
var catalogCommand =
|
|
8138
|
+
import { defineCommand as defineCommand79 } from "citty";
|
|
8139
|
+
var catalogCommand = defineCommand79({
|
|
8053
8140
|
meta: {
|
|
8054
8141
|
name: "catalog",
|
|
8055
8142
|
description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
|
|
@@ -8066,9 +8153,9 @@ import { execFile } from "child_process";
|
|
|
8066
8153
|
import { readdir, readFile, stat } from "fs/promises";
|
|
8067
8154
|
import path from "path";
|
|
8068
8155
|
import { promisify } from "util";
|
|
8069
|
-
import { defineCommand as
|
|
8156
|
+
import { defineCommand as defineCommand80 } from "citty";
|
|
8070
8157
|
var execFileAsync = promisify(execFile);
|
|
8071
|
-
var inspectCommand =
|
|
8158
|
+
var inspectCommand = defineCommand80({
|
|
8072
8159
|
meta: {
|
|
8073
8160
|
name: "inspect",
|
|
8074
8161
|
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."
|
|
@@ -8177,7 +8264,7 @@ async function probeDuration(filePath) {
|
|
|
8177
8264
|
// src/commands/canvas/run.ts
|
|
8178
8265
|
import { readFile as readFile2 } from "fs/promises";
|
|
8179
8266
|
import path4 from "path";
|
|
8180
|
-
import { defineCommand as
|
|
8267
|
+
import { defineCommand as defineCommand81 } from "citty";
|
|
8181
8268
|
|
|
8182
8269
|
// src/commands/canvas/placeholders.ts
|
|
8183
8270
|
function unsuppliedPlaceholderAssets(canvas) {
|
|
@@ -8247,7 +8334,7 @@ async function pruneOldRuns(outputsDir, keep, currentRunId, log) {
|
|
|
8247
8334
|
}
|
|
8248
8335
|
|
|
8249
8336
|
// src/commands/canvas/run.ts
|
|
8250
|
-
var runCommand =
|
|
8337
|
+
var runCommand = defineCommand81({
|
|
8251
8338
|
meta: { name: "run", description: "Validate and execute a canvas JSON file." },
|
|
8252
8339
|
args: {
|
|
8253
8340
|
file: { type: "positional", required: true, description: "Path to canvas JSON" },
|
|
@@ -8343,7 +8430,7 @@ var runCommand = defineCommand80({
|
|
|
8343
8430
|
// src/commands/canvas/scaffold-static-ad.ts
|
|
8344
8431
|
import { readFile as readFile3, writeFile } from "fs/promises";
|
|
8345
8432
|
import path5 from "path";
|
|
8346
|
-
import { defineCommand as
|
|
8433
|
+
import { defineCommand as defineCommand82 } from "citty";
|
|
8347
8434
|
|
|
8348
8435
|
// src/engine/scaffold/staticAd.ts
|
|
8349
8436
|
import { z as z2 } from "zod";
|
|
@@ -8662,7 +8749,7 @@ async function runVisionPasses(canvas) {
|
|
|
8662
8749
|
return fail("read_outputs", e instanceof Error ? e.message : String(e));
|
|
8663
8750
|
}
|
|
8664
8751
|
}
|
|
8665
|
-
var scaffoldStaticAdCommand =
|
|
8752
|
+
var scaffoldStaticAdCommand = defineCommand82({
|
|
8666
8753
|
meta: {
|
|
8667
8754
|
name: "scaffold-static-ad",
|
|
8668
8755
|
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."
|
|
@@ -8756,7 +8843,7 @@ var scaffoldStaticAdCommand = defineCommand81({
|
|
|
8756
8843
|
// src/commands/canvas/scaffold-video.ts
|
|
8757
8844
|
import { cp, mkdir, readFile as readFile6, writeFile as writeFile2 } from "fs/promises";
|
|
8758
8845
|
import path8 from "path";
|
|
8759
|
-
import { defineCommand as
|
|
8846
|
+
import { defineCommand as defineCommand83 } from "citty";
|
|
8760
8847
|
|
|
8761
8848
|
// src/engine/nodes/local/lib/sceneDetect.ts
|
|
8762
8849
|
import { execFile as execFile2 } from "child_process";
|
|
@@ -11588,7 +11675,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
|
|
|
11588
11675
|
return fail2("deconstruct", e instanceof Error ? e.message : String(e));
|
|
11589
11676
|
}
|
|
11590
11677
|
}
|
|
11591
|
-
var scaffoldVideoCommand =
|
|
11678
|
+
var scaffoldVideoCommand = defineCommand83({
|
|
11592
11679
|
meta: {
|
|
11593
11680
|
name: "scaffold-video",
|
|
11594
11681
|
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`."
|
|
@@ -11733,7 +11820,7 @@ var scaffoldVideoCommand = defineCommand82({
|
|
|
11733
11820
|
// src/commands/canvas/set-prompt.ts
|
|
11734
11821
|
import { readFile as readFile7, writeFile as writeFile3 } from "fs/promises";
|
|
11735
11822
|
import path9 from "path";
|
|
11736
|
-
import { defineCommand as
|
|
11823
|
+
import { defineCommand as defineCommand84 } from "citty";
|
|
11737
11824
|
function setNodePrompt(canvas, nodeId, text) {
|
|
11738
11825
|
const nodes = canvas?.nodes;
|
|
11739
11826
|
if (!Array.isArray(nodes)) throw new Error("canvas has no nodes array");
|
|
@@ -11748,7 +11835,7 @@ function setNodePrompt(canvas, nodeId, text) {
|
|
|
11748
11835
|
newNodes[idx] = newNode;
|
|
11749
11836
|
return { ...canvas, nodes: newNodes };
|
|
11750
11837
|
}
|
|
11751
|
-
var setPromptCommand =
|
|
11838
|
+
var setPromptCommand = defineCommand84({
|
|
11752
11839
|
meta: {
|
|
11753
11840
|
name: "set-prompt",
|
|
11754
11841
|
description: "Safely set a node's params.prompt (a frame description, motion prompt, etc.) without hand-editing the JSON. Prefer --text-file for multi-line/accented copy \u2014 it preserves UTF-8 exactly, unlike shell-quoted jq."
|
|
@@ -11808,8 +11895,8 @@ var setPromptCommand = defineCommand83({
|
|
|
11808
11895
|
// src/commands/canvas/validate.ts
|
|
11809
11896
|
import { readFile as readFile8 } from "fs/promises";
|
|
11810
11897
|
import path10 from "path";
|
|
11811
|
-
import { defineCommand as
|
|
11812
|
-
var validateCommand =
|
|
11898
|
+
import { defineCommand as defineCommand85 } from "citty";
|
|
11899
|
+
var validateCommand = defineCommand85({
|
|
11813
11900
|
meta: {
|
|
11814
11901
|
name: "validate",
|
|
11815
11902
|
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)."
|
|
@@ -11852,7 +11939,7 @@ var validateCommand = defineCommand84({
|
|
|
11852
11939
|
});
|
|
11853
11940
|
|
|
11854
11941
|
// src/commands/canvas/index.ts
|
|
11855
|
-
var canvasCommand =
|
|
11942
|
+
var canvasCommand = defineCommand86({
|
|
11856
11943
|
meta: {
|
|
11857
11944
|
name: "canvas",
|
|
11858
11945
|
description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
|
|
@@ -11878,11 +11965,194 @@ Subcommands:
|
|
|
11878
11965
|
}
|
|
11879
11966
|
});
|
|
11880
11967
|
|
|
11968
|
+
// src/commands/creatives/index.ts
|
|
11969
|
+
import { defineCommand as defineCommand88 } from "citty";
|
|
11970
|
+
|
|
11971
|
+
// src/commands/creatives/publish.ts
|
|
11972
|
+
import { defineCommand as defineCommand87 } from "citty";
|
|
11973
|
+
|
|
11974
|
+
// src/commands/images/api.ts
|
|
11975
|
+
import { readFile as readFile9 } from "fs/promises";
|
|
11976
|
+
import { extname } from "path";
|
|
11977
|
+
var imageProcessingTimeoutMs = 18e4;
|
|
11978
|
+
var imageReadyPollIntervalMs = 2e3;
|
|
11979
|
+
var mimeMap = {
|
|
11980
|
+
".png": "image/png",
|
|
11981
|
+
".jpg": "image/jpeg",
|
|
11982
|
+
".jpeg": "image/jpeg",
|
|
11983
|
+
".gif": "image/gif",
|
|
11984
|
+
".webp": "image/webp",
|
|
11985
|
+
".svg": "image/svg+xml",
|
|
11986
|
+
".avif": "image/avif"
|
|
11987
|
+
};
|
|
11988
|
+
var defaultImageApiDeps = {
|
|
11989
|
+
readFile: readFile9,
|
|
11990
|
+
post: apiPost,
|
|
11991
|
+
get: apiGet,
|
|
11992
|
+
sleep: (ms) => new Promise((resolve5) => setTimeout(resolve5, ms))
|
|
11993
|
+
};
|
|
11994
|
+
function detectImageContentType(filePath, opts = {}) {
|
|
11995
|
+
const ext = extname(filePath).toLowerCase();
|
|
11996
|
+
const contentType = mimeMap[ext];
|
|
11997
|
+
if (!contentType || opts.allowedContentTypes && !opts.allowedContentTypes.includes(contentType)) {
|
|
11998
|
+
throw new ApiError(
|
|
11999
|
+
"VALIDATION_ERROR",
|
|
12000
|
+
opts.unsupportedMessage ?? `Cannot detect content type for extension "${ext}". Use --content-type.`
|
|
12001
|
+
);
|
|
12002
|
+
}
|
|
12003
|
+
return contentType;
|
|
12004
|
+
}
|
|
12005
|
+
async function uploadLocalImage(args, deps = defaultImageApiDeps) {
|
|
12006
|
+
const fileBuffer = await deps.readFile(args.file);
|
|
12007
|
+
const body = {
|
|
12008
|
+
base64: fileBuffer.toString("base64"),
|
|
12009
|
+
contentType: args.contentType
|
|
12010
|
+
};
|
|
12011
|
+
if (args.source) body.source = args.source;
|
|
12012
|
+
if (args.descriptionContext) body.descriptionContext = args.descriptionContext;
|
|
12013
|
+
return deps.post("/api/images/upload", body, { timeoutMs: imageProcessingTimeoutMs });
|
|
12014
|
+
}
|
|
12015
|
+
function getImage(deps, imageId) {
|
|
12016
|
+
return deps.get("/api/images/get", { id: imageId });
|
|
12017
|
+
}
|
|
12018
|
+
function updateImageTags(deps, args) {
|
|
12019
|
+
return deps.post("/api/images/tag", args);
|
|
12020
|
+
}
|
|
12021
|
+
async function waitForReadyImage(deps, imageId, opts = {}) {
|
|
12022
|
+
const timeoutMs = opts.timeoutMs ?? imageProcessingTimeoutMs;
|
|
12023
|
+
const pollIntervalMs = opts.pollIntervalMs ?? imageReadyPollIntervalMs;
|
|
12024
|
+
const deadline = Date.now() + timeoutMs;
|
|
12025
|
+
let lastStatus = "unknown";
|
|
12026
|
+
while (Date.now() <= deadline) {
|
|
12027
|
+
const image = await getImage(deps, imageId);
|
|
12028
|
+
lastStatus = image.status ?? "unknown";
|
|
12029
|
+
if (image.status === "ready") {
|
|
12030
|
+
return image;
|
|
12031
|
+
}
|
|
12032
|
+
if (image.status === "error") {
|
|
12033
|
+
throw new ApiError("IMAGE_PROCESSING_ERROR", "Image processing failed");
|
|
12034
|
+
}
|
|
12035
|
+
await deps.sleep(pollIntervalMs);
|
|
12036
|
+
}
|
|
12037
|
+
throw new ApiError("TIMEOUT", `Image was not ready before timeout; last status: ${lastStatus}`);
|
|
12038
|
+
}
|
|
12039
|
+
|
|
12040
|
+
// src/commands/creatives/publish.ts
|
|
12041
|
+
var creativeTag = "creative";
|
|
12042
|
+
var creativeContentTypes = ["image/png", "image/jpeg", "image/webp"];
|
|
12043
|
+
registerSchema({
|
|
12044
|
+
command: "creatives.publish",
|
|
12045
|
+
description: "Publish a final static creative image to Baker Images, apply the official creative tag, and return an image reference.",
|
|
12046
|
+
args: {
|
|
12047
|
+
file: { type: "string", description: "Local PNG/JPG/WebP creative image path", required: true },
|
|
12048
|
+
title: { type: "string", description: "Human title for the creative output", required: true },
|
|
12049
|
+
context: { type: "string", description: "Optional describe context for the image row", required: false }
|
|
12050
|
+
}
|
|
12051
|
+
});
|
|
12052
|
+
function detectCreativeContentType(filePath) {
|
|
12053
|
+
return detectImageContentType(filePath, {
|
|
12054
|
+
allowedContentTypes: creativeContentTypes,
|
|
12055
|
+
unsupportedMessage: "Unsupported creative image extension. Use PNG, JPG, or WebP."
|
|
12056
|
+
});
|
|
12057
|
+
}
|
|
12058
|
+
function imageToCreativeReference(image, title) {
|
|
12059
|
+
if (!image.imageUrl) {
|
|
12060
|
+
throw new ApiError("IMAGE_PROCESSING_ERROR", "Published image is missing imageUrl");
|
|
12061
|
+
}
|
|
12062
|
+
return {
|
|
12063
|
+
type: "image",
|
|
12064
|
+
slug: image._id,
|
|
12065
|
+
title,
|
|
12066
|
+
tags: image.tags?.includes(creativeTag) ? image.tags : [...image.tags ?? [], creativeTag],
|
|
12067
|
+
imageUrl: image.imageUrl,
|
|
12068
|
+
thumbnailUrl: image.thumbnailUrl ?? image.imageUrl,
|
|
12069
|
+
storageKey: image.storageKey,
|
|
12070
|
+
width: image.width,
|
|
12071
|
+
height: image.height,
|
|
12072
|
+
aspectRatio: image.aspectRatio,
|
|
12073
|
+
source: image.source
|
|
12074
|
+
};
|
|
12075
|
+
}
|
|
12076
|
+
async function publishCreative(args, deps = defaultImageApiDeps) {
|
|
12077
|
+
const title = args.title.trim();
|
|
12078
|
+
if (!title) {
|
|
12079
|
+
throw new ApiError("VALIDATION_ERROR", "--title is required");
|
|
12080
|
+
}
|
|
12081
|
+
const contentType = detectCreativeContentType(args.file);
|
|
12082
|
+
const upload = await uploadLocalImage(
|
|
12083
|
+
{
|
|
12084
|
+
file: args.file,
|
|
12085
|
+
contentType,
|
|
12086
|
+
source: "ai_generated",
|
|
12087
|
+
descriptionContext: args.context ?? `Static ad creative: ${title}`
|
|
12088
|
+
},
|
|
12089
|
+
deps
|
|
12090
|
+
);
|
|
12091
|
+
const readyImage = await waitForReadyImage(deps, upload.imageId, { timeoutMs: imageProcessingTimeoutMs });
|
|
12092
|
+
await updateImageTags(deps, {
|
|
12093
|
+
imageIds: [upload.imageId],
|
|
12094
|
+
addTags: [creativeTag],
|
|
12095
|
+
removeTags: []
|
|
12096
|
+
});
|
|
12097
|
+
const taggedImage = await getImage(deps, upload.imageId);
|
|
12098
|
+
return { imageId: upload.imageId, reference: imageToCreativeReference({ ...readyImage, ...taggedImage }, title) };
|
|
12099
|
+
}
|
|
12100
|
+
var publishCommand = defineCommand87({
|
|
12101
|
+
meta: {
|
|
12102
|
+
name: "publish",
|
|
12103
|
+
description: "Publish a final static creative image to Baker Images, deterministically tag it as creative, and print the image reference JSON."
|
|
12104
|
+
},
|
|
12105
|
+
args: {
|
|
12106
|
+
file: { type: "positional", description: "Local PNG/JPG/WebP creative image path", required: false },
|
|
12107
|
+
title: { type: "string", description: "Human title for the creative output", required: false },
|
|
12108
|
+
context: { type: "string", description: "Optional describe context for the image row", required: false }
|
|
12109
|
+
},
|
|
12110
|
+
run: async ({ args }) => {
|
|
12111
|
+
try {
|
|
12112
|
+
const file = args.file;
|
|
12113
|
+
const title = args.title;
|
|
12114
|
+
if (!file) {
|
|
12115
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Image path is required" } });
|
|
12116
|
+
process.exit(1);
|
|
12117
|
+
}
|
|
12118
|
+
if (!title) {
|
|
12119
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "--title is required" } });
|
|
12120
|
+
process.exit(1);
|
|
12121
|
+
}
|
|
12122
|
+
const data = await publishCreative({ file, title, context: args.context });
|
|
12123
|
+
writeJson({ ok: true, data });
|
|
12124
|
+
} catch (err) {
|
|
12125
|
+
if (err instanceof ApiError) {
|
|
12126
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
12127
|
+
process.exit(1);
|
|
12128
|
+
}
|
|
12129
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
12130
|
+
process.exit(1);
|
|
12131
|
+
}
|
|
12132
|
+
}
|
|
12133
|
+
});
|
|
12134
|
+
|
|
12135
|
+
// src/commands/creatives/index.ts
|
|
12136
|
+
var creativesCommand3 = defineCommand88({
|
|
12137
|
+
meta: {
|
|
12138
|
+
name: "creatives",
|
|
12139
|
+
description: `Publish static ad creatives as first-class Baker outputs.
|
|
12140
|
+
|
|
12141
|
+
Static creative handoff:
|
|
12142
|
+
baker creatives publish ./canvas/run/final.png --title "Spring Offer Static Ad"
|
|
12143
|
+
|
|
12144
|
+
Publishing uploads the image to the Company image library, applies the official creative tag, and returns an image reference for chat previews.`
|
|
12145
|
+
},
|
|
12146
|
+
subCommands: {
|
|
12147
|
+
publish: publishCommand
|
|
12148
|
+
}
|
|
12149
|
+
});
|
|
12150
|
+
|
|
11881
12151
|
// src/commands/ga4/index.ts
|
|
11882
|
-
import { defineCommand as
|
|
12152
|
+
import { defineCommand as defineCommand92 } from "citty";
|
|
11883
12153
|
|
|
11884
12154
|
// src/commands/ga4/audit.ts
|
|
11885
|
-
import { defineCommand as
|
|
12155
|
+
import { defineCommand as defineCommand89 } from "citty";
|
|
11886
12156
|
|
|
11887
12157
|
// src/commands/ga4/resolve.ts
|
|
11888
12158
|
async function fetchProperties(useCache = true) {
|
|
@@ -11945,7 +12215,7 @@ registerSchema({
|
|
|
11945
12215
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11946
12216
|
}
|
|
11947
12217
|
});
|
|
11948
|
-
var auditCommand2 =
|
|
12218
|
+
var auditCommand2 = defineCommand89({
|
|
11949
12219
|
meta: {
|
|
11950
12220
|
name: "audit",
|
|
11951
12221
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -11997,7 +12267,7 @@ Examples:
|
|
|
11997
12267
|
});
|
|
11998
12268
|
|
|
11999
12269
|
// src/commands/ga4/properties.ts
|
|
12000
|
-
import { defineCommand as
|
|
12270
|
+
import { defineCommand as defineCommand90 } from "citty";
|
|
12001
12271
|
registerSchema({
|
|
12002
12272
|
command: "ga4.properties",
|
|
12003
12273
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -12005,7 +12275,7 @@ registerSchema({
|
|
|
12005
12275
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
12006
12276
|
}
|
|
12007
12277
|
});
|
|
12008
|
-
var propertiesCommand =
|
|
12278
|
+
var propertiesCommand = defineCommand90({
|
|
12009
12279
|
meta: {
|
|
12010
12280
|
name: "properties",
|
|
12011
12281
|
description: `List accessible GA4 properties.
|
|
@@ -12055,7 +12325,7 @@ Examples:
|
|
|
12055
12325
|
// src/commands/ga4/query.ts
|
|
12056
12326
|
import { appendFileSync as appendFileSync2, existsSync as existsSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
|
|
12057
12327
|
import { resolve as resolve2 } from "path";
|
|
12058
|
-
import { defineCommand as
|
|
12328
|
+
import { defineCommand as defineCommand91 } from "citty";
|
|
12059
12329
|
|
|
12060
12330
|
// src/commands/ga4/presets.ts
|
|
12061
12331
|
var GA4_PRESETS = [
|
|
@@ -12187,7 +12457,7 @@ function handleError(err) {
|
|
|
12187
12457
|
});
|
|
12188
12458
|
process.exit(1);
|
|
12189
12459
|
}
|
|
12190
|
-
var queryCommand2 =
|
|
12460
|
+
var queryCommand2 = defineCommand91({
|
|
12191
12461
|
meta: {
|
|
12192
12462
|
name: "query",
|
|
12193
12463
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -12258,7 +12528,7 @@ Free-form (escape hatch):
|
|
|
12258
12528
|
});
|
|
12259
12529
|
|
|
12260
12530
|
// src/commands/ga4/index.ts
|
|
12261
|
-
var ga4Command =
|
|
12531
|
+
var ga4Command = defineCommand92({
|
|
12262
12532
|
meta: {
|
|
12263
12533
|
name: "ga4",
|
|
12264
12534
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -12281,12 +12551,12 @@ Examples:
|
|
|
12281
12551
|
});
|
|
12282
12552
|
|
|
12283
12553
|
// src/commands/gsc/index.ts
|
|
12284
|
-
import { defineCommand as
|
|
12554
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
12285
12555
|
|
|
12286
12556
|
// src/commands/gsc/query.ts
|
|
12287
12557
|
import { appendFileSync as appendFileSync3, existsSync as existsSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
12288
12558
|
import { resolve as resolve3 } from "path";
|
|
12289
|
-
import { defineCommand as
|
|
12559
|
+
import { defineCommand as defineCommand93 } from "citty";
|
|
12290
12560
|
|
|
12291
12561
|
// src/commands/gsc/presets.ts
|
|
12292
12562
|
var GSC_PRESETS = [
|
|
@@ -12474,7 +12744,7 @@ function handleError2(err) {
|
|
|
12474
12744
|
});
|
|
12475
12745
|
process.exit(1);
|
|
12476
12746
|
}
|
|
12477
|
-
var queryCommand3 =
|
|
12747
|
+
var queryCommand3 = defineCommand93({
|
|
12478
12748
|
meta: {
|
|
12479
12749
|
name: "query",
|
|
12480
12750
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -12552,7 +12822,7 @@ Free-form (escape hatch):
|
|
|
12552
12822
|
});
|
|
12553
12823
|
|
|
12554
12824
|
// src/commands/gsc/sitemaps.ts
|
|
12555
|
-
import { defineCommand as
|
|
12825
|
+
import { defineCommand as defineCommand94 } from "citty";
|
|
12556
12826
|
registerSchema({
|
|
12557
12827
|
command: "gsc.sitemaps",
|
|
12558
12828
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -12561,7 +12831,7 @@ registerSchema({
|
|
|
12561
12831
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
12562
12832
|
}
|
|
12563
12833
|
});
|
|
12564
|
-
var sitemapsCommand =
|
|
12834
|
+
var sitemapsCommand = defineCommand94({
|
|
12565
12835
|
meta: {
|
|
12566
12836
|
name: "sitemaps",
|
|
12567
12837
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -12611,7 +12881,7 @@ Examples:
|
|
|
12611
12881
|
});
|
|
12612
12882
|
|
|
12613
12883
|
// src/commands/gsc/sites.ts
|
|
12614
|
-
import { defineCommand as
|
|
12884
|
+
import { defineCommand as defineCommand95 } from "citty";
|
|
12615
12885
|
registerSchema({
|
|
12616
12886
|
command: "gsc.sites",
|
|
12617
12887
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -12619,7 +12889,7 @@ registerSchema({
|
|
|
12619
12889
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
12620
12890
|
}
|
|
12621
12891
|
});
|
|
12622
|
-
var sitesCommand =
|
|
12892
|
+
var sitesCommand = defineCommand95({
|
|
12623
12893
|
meta: {
|
|
12624
12894
|
name: "sites",
|
|
12625
12895
|
description: `List verified Search Console sites.
|
|
@@ -12667,7 +12937,7 @@ Examples:
|
|
|
12667
12937
|
});
|
|
12668
12938
|
|
|
12669
12939
|
// src/commands/gsc/index.ts
|
|
12670
|
-
var gscCommand =
|
|
12940
|
+
var gscCommand = defineCommand96({
|
|
12671
12941
|
meta: {
|
|
12672
12942
|
name: "gsc",
|
|
12673
12943
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -12690,10 +12960,10 @@ Examples:
|
|
|
12690
12960
|
});
|
|
12691
12961
|
|
|
12692
12962
|
// src/commands/images/index.ts
|
|
12693
|
-
import { defineCommand as
|
|
12963
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
12694
12964
|
|
|
12695
12965
|
// src/commands/images/crop.ts
|
|
12696
|
-
import { defineCommand as
|
|
12966
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
12697
12967
|
|
|
12698
12968
|
// src/lib/image/crop-sprite.ts
|
|
12699
12969
|
import sharp from "sharp";
|
|
@@ -12708,8 +12978,8 @@ function cropSprite(input, region) {
|
|
|
12708
12978
|
|
|
12709
12979
|
// src/lib/image/io.ts
|
|
12710
12980
|
import { randomBytes } from "crypto";
|
|
12711
|
-
import { glob as fsGlob, readFile as
|
|
12712
|
-
import { dirname, extname, join as join3, resolve as resolve4 } from "path";
|
|
12981
|
+
import { glob as fsGlob, readFile as readFile10, rename, stat as stat2, writeFile as writeFile4 } from "fs/promises";
|
|
12982
|
+
import { dirname, extname as extname2, join as join3, resolve as resolve4 } from "path";
|
|
12713
12983
|
var REMOTE_RE = /^https?:\/\//i;
|
|
12714
12984
|
var GLOB_RE = /[*?[\]{}]/;
|
|
12715
12985
|
function isRemoteUrl(value) {
|
|
@@ -12744,7 +13014,7 @@ async function readImageBuffer(pathOrUrl) {
|
|
|
12744
13014
|
}
|
|
12745
13015
|
return Buffer.from(await response.arrayBuffer());
|
|
12746
13016
|
}
|
|
12747
|
-
return
|
|
13017
|
+
return readFile10(pathOrUrl);
|
|
12748
13018
|
}
|
|
12749
13019
|
async function isDirectory(path11) {
|
|
12750
13020
|
try {
|
|
@@ -12755,7 +13025,7 @@ async function isDirectory(path11) {
|
|
|
12755
13025
|
}
|
|
12756
13026
|
}
|
|
12757
13027
|
async function resolveOutputPath(inputPath, outputArg, options) {
|
|
12758
|
-
const base = options.newExtension ? inputPath.slice(0, -
|
|
13028
|
+
const base = options.newExtension ? inputPath.slice(0, -extname2(inputPath).length) + options.newExtension : inputPath;
|
|
12759
13029
|
if (!outputArg) return base;
|
|
12760
13030
|
if (options.multipleInputs || await isDirectory(outputArg)) {
|
|
12761
13031
|
const filename = base.split("/").pop() ?? "out.png";
|
|
@@ -12818,7 +13088,7 @@ function emitError2(err) {
|
|
|
12818
13088
|
}
|
|
12819
13089
|
process.exit(1);
|
|
12820
13090
|
}
|
|
12821
|
-
var cropCommand =
|
|
13091
|
+
var cropCommand = defineCommand97({
|
|
12822
13092
|
meta: {
|
|
12823
13093
|
name: "crop",
|
|
12824
13094
|
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"
|
|
@@ -12854,7 +13124,7 @@ var cropCommand = defineCommand94({
|
|
|
12854
13124
|
});
|
|
12855
13125
|
|
|
12856
13126
|
// src/commands/images/delete.ts
|
|
12857
|
-
import { defineCommand as
|
|
13127
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
12858
13128
|
registerSchema({
|
|
12859
13129
|
command: "images.delete",
|
|
12860
13130
|
description: "Delete an image by ID",
|
|
@@ -12868,7 +13138,7 @@ registerSchema({
|
|
|
12868
13138
|
}
|
|
12869
13139
|
}
|
|
12870
13140
|
});
|
|
12871
|
-
var deleteCommand =
|
|
13141
|
+
var deleteCommand = defineCommand98({
|
|
12872
13142
|
meta: {
|
|
12873
13143
|
name: "delete",
|
|
12874
13144
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -12909,7 +13179,7 @@ var deleteCommand = defineCommand95({
|
|
|
12909
13179
|
});
|
|
12910
13180
|
|
|
12911
13181
|
// src/commands/images/dimensions.ts
|
|
12912
|
-
import { defineCommand as
|
|
13182
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
12913
13183
|
|
|
12914
13184
|
// src/lib/image/dimensions.ts
|
|
12915
13185
|
import { imageSize } from "image-size";
|
|
@@ -12932,7 +13202,7 @@ registerSchema({
|
|
|
12932
13202
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
12933
13203
|
}
|
|
12934
13204
|
});
|
|
12935
|
-
var dimensionsCommand =
|
|
13205
|
+
var dimensionsCommand = defineCommand99({
|
|
12936
13206
|
meta: {
|
|
12937
13207
|
name: "dimensions",
|
|
12938
13208
|
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"
|
|
@@ -12976,7 +13246,7 @@ var dimensionsCommand = defineCommand96({
|
|
|
12976
13246
|
});
|
|
12977
13247
|
|
|
12978
13248
|
// src/commands/images/extract.ts
|
|
12979
|
-
import { defineCommand as
|
|
13249
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
12980
13250
|
registerSchema({
|
|
12981
13251
|
command: "images.extract",
|
|
12982
13252
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -12992,7 +13262,7 @@ registerSchema({
|
|
|
12992
13262
|
}
|
|
12993
13263
|
}
|
|
12994
13264
|
});
|
|
12995
|
-
var extractCommand =
|
|
13265
|
+
var extractCommand = defineCommand100({
|
|
12996
13266
|
meta: {
|
|
12997
13267
|
name: "extract",
|
|
12998
13268
|
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"
|
|
@@ -13030,7 +13300,7 @@ var extractCommand = defineCommand97({
|
|
|
13030
13300
|
});
|
|
13031
13301
|
|
|
13032
13302
|
// src/commands/images/find.ts
|
|
13033
|
-
import { defineCommand as
|
|
13303
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
13034
13304
|
registerSchema({
|
|
13035
13305
|
command: "images.find",
|
|
13036
13306
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -13062,7 +13332,7 @@ registerSchema({
|
|
|
13062
13332
|
}
|
|
13063
13333
|
}
|
|
13064
13334
|
});
|
|
13065
|
-
var findCommand =
|
|
13335
|
+
var findCommand = defineCommand101({
|
|
13066
13336
|
meta: {
|
|
13067
13337
|
name: "find",
|
|
13068
13338
|
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"
|
|
@@ -13108,8 +13378,8 @@ var findCommand = defineCommand98({
|
|
|
13108
13378
|
});
|
|
13109
13379
|
|
|
13110
13380
|
// src/commands/images/generate.ts
|
|
13111
|
-
import { readFile as
|
|
13112
|
-
import { defineCommand as
|
|
13381
|
+
import { readFile as readFile11 } from "fs/promises";
|
|
13382
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
13113
13383
|
import sharp2 from "sharp";
|
|
13114
13384
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
13115
13385
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -13191,7 +13461,7 @@ async function resolveReferences(spec) {
|
|
|
13191
13461
|
}
|
|
13192
13462
|
let raw;
|
|
13193
13463
|
try {
|
|
13194
|
-
raw = await
|
|
13464
|
+
raw = await readFile11(entry);
|
|
13195
13465
|
} catch {
|
|
13196
13466
|
throw new ApiError("VALIDATION_ERROR", `Reference file not found: ${entry}`);
|
|
13197
13467
|
}
|
|
@@ -13205,7 +13475,7 @@ async function resolveReferences(spec) {
|
|
|
13205
13475
|
}
|
|
13206
13476
|
return out;
|
|
13207
13477
|
}
|
|
13208
|
-
var generateCommand =
|
|
13478
|
+
var generateCommand = defineCommand102({
|
|
13209
13479
|
meta: {
|
|
13210
13480
|
name: "generate",
|
|
13211
13481
|
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]]'"
|
|
@@ -13257,7 +13527,7 @@ var generateCommand = defineCommand99({
|
|
|
13257
13527
|
});
|
|
13258
13528
|
|
|
13259
13529
|
// src/commands/images/get.ts
|
|
13260
|
-
import { defineCommand as
|
|
13530
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
13261
13531
|
registerSchema({
|
|
13262
13532
|
command: "images.get",
|
|
13263
13533
|
description: "Get a single image by ID",
|
|
@@ -13265,7 +13535,7 @@ registerSchema({
|
|
|
13265
13535
|
id: { type: "string", description: "Image ID", required: true }
|
|
13266
13536
|
}
|
|
13267
13537
|
});
|
|
13268
|
-
var getCommand2 =
|
|
13538
|
+
var getCommand2 = defineCommand103({
|
|
13269
13539
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
13270
13540
|
args: {
|
|
13271
13541
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -13301,7 +13571,7 @@ var getCommand2 = defineCommand100({
|
|
|
13301
13571
|
});
|
|
13302
13572
|
|
|
13303
13573
|
// src/commands/images/gif.ts
|
|
13304
|
-
import { defineCommand as
|
|
13574
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
13305
13575
|
registerSchema({
|
|
13306
13576
|
command: "images.gif",
|
|
13307
13577
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -13333,7 +13603,7 @@ registerSchema({
|
|
|
13333
13603
|
}
|
|
13334
13604
|
}
|
|
13335
13605
|
});
|
|
13336
|
-
var gifCommand =
|
|
13606
|
+
var gifCommand = defineCommand104({
|
|
13337
13607
|
meta: {
|
|
13338
13608
|
name: "gif",
|
|
13339
13609
|
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"
|
|
@@ -13380,7 +13650,7 @@ var gifCommand = defineCommand101({
|
|
|
13380
13650
|
});
|
|
13381
13651
|
|
|
13382
13652
|
// src/commands/images/google.ts
|
|
13383
|
-
import { defineCommand as
|
|
13653
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
13384
13654
|
registerSchema({
|
|
13385
13655
|
command: "images.google",
|
|
13386
13656
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -13416,7 +13686,7 @@ registerSchema({
|
|
|
13416
13686
|
}
|
|
13417
13687
|
}
|
|
13418
13688
|
});
|
|
13419
|
-
var googleCommand2 =
|
|
13689
|
+
var googleCommand2 = defineCommand105({
|
|
13420
13690
|
meta: {
|
|
13421
13691
|
name: "google",
|
|
13422
13692
|
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"
|
|
@@ -13464,7 +13734,7 @@ var googleCommand2 = defineCommand102({
|
|
|
13464
13734
|
});
|
|
13465
13735
|
|
|
13466
13736
|
// src/commands/images/icon.ts
|
|
13467
|
-
import { defineCommand as
|
|
13737
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
13468
13738
|
registerSchema({
|
|
13469
13739
|
command: "images.icon",
|
|
13470
13740
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -13490,7 +13760,7 @@ registerSchema({
|
|
|
13490
13760
|
}
|
|
13491
13761
|
}
|
|
13492
13762
|
});
|
|
13493
|
-
var iconCommand =
|
|
13763
|
+
var iconCommand = defineCommand106({
|
|
13494
13764
|
meta: {
|
|
13495
13765
|
name: "icon",
|
|
13496
13766
|
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'"
|
|
@@ -13530,7 +13800,7 @@ var iconCommand = defineCommand103({
|
|
|
13530
13800
|
});
|
|
13531
13801
|
|
|
13532
13802
|
// src/commands/images/ingest.ts
|
|
13533
|
-
import { defineCommand as
|
|
13803
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
13534
13804
|
registerSchema({
|
|
13535
13805
|
command: "images.ingest",
|
|
13536
13806
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -13542,7 +13812,7 @@ registerSchema({
|
|
|
13542
13812
|
context: { type: "string", description: "Description context hint", required: false }
|
|
13543
13813
|
}
|
|
13544
13814
|
});
|
|
13545
|
-
var ingestCommand =
|
|
13815
|
+
var ingestCommand = defineCommand107({
|
|
13546
13816
|
meta: {
|
|
13547
13817
|
name: "ingest",
|
|
13548
13818
|
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"
|
|
@@ -13584,7 +13854,7 @@ var ingestCommand = defineCommand104({
|
|
|
13584
13854
|
});
|
|
13585
13855
|
|
|
13586
13856
|
// src/commands/images/library.ts
|
|
13587
|
-
import { defineCommand as
|
|
13857
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
13588
13858
|
registerSchema({
|
|
13589
13859
|
command: "images.library",
|
|
13590
13860
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -13610,7 +13880,7 @@ registerSchema({
|
|
|
13610
13880
|
}
|
|
13611
13881
|
}
|
|
13612
13882
|
});
|
|
13613
|
-
var libraryCommand =
|
|
13883
|
+
var libraryCommand = defineCommand108({
|
|
13614
13884
|
meta: {
|
|
13615
13885
|
name: "library",
|
|
13616
13886
|
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"
|
|
@@ -13667,7 +13937,7 @@ var libraryCommand = defineCommand105({
|
|
|
13667
13937
|
});
|
|
13668
13938
|
|
|
13669
13939
|
// src/commands/images/logo.ts
|
|
13670
|
-
import { defineCommand as
|
|
13940
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
13671
13941
|
registerSchema({
|
|
13672
13942
|
command: "images.logo",
|
|
13673
13943
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -13692,7 +13962,7 @@ registerSchema({
|
|
|
13692
13962
|
}
|
|
13693
13963
|
}
|
|
13694
13964
|
});
|
|
13695
|
-
var logoCommand =
|
|
13965
|
+
var logoCommand = defineCommand109({
|
|
13696
13966
|
meta: {
|
|
13697
13967
|
name: "logo",
|
|
13698
13968
|
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"
|
|
@@ -13730,7 +14000,7 @@ var logoCommand = defineCommand106({
|
|
|
13730
14000
|
});
|
|
13731
14001
|
|
|
13732
14002
|
// src/commands/images/normalize.ts
|
|
13733
|
-
import { defineCommand as
|
|
14003
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
13734
14004
|
|
|
13735
14005
|
// src/lib/image/color-changer.ts
|
|
13736
14006
|
import quantize from "quantize";
|
|
@@ -14462,7 +14732,7 @@ function coerceRawArgs(args) {
|
|
|
14462
14732
|
"dry-run": bool(args["dry-run"])
|
|
14463
14733
|
};
|
|
14464
14734
|
}
|
|
14465
|
-
var normalizeCommand =
|
|
14735
|
+
var normalizeCommand = defineCommand110({
|
|
14466
14736
|
meta: {
|
|
14467
14737
|
name: "normalize",
|
|
14468
14738
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -14517,7 +14787,7 @@ Examples:
|
|
|
14517
14787
|
});
|
|
14518
14788
|
|
|
14519
14789
|
// src/commands/images/pinterest.ts
|
|
14520
|
-
import { defineCommand as
|
|
14790
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
14521
14791
|
registerSchema({
|
|
14522
14792
|
command: "images.pinterest",
|
|
14523
14793
|
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.",
|
|
@@ -14537,7 +14807,7 @@ registerSchema({
|
|
|
14537
14807
|
}
|
|
14538
14808
|
}
|
|
14539
14809
|
});
|
|
14540
|
-
var pinterestCommand =
|
|
14810
|
+
var pinterestCommand = defineCommand111({
|
|
14541
14811
|
meta: {
|
|
14542
14812
|
name: "pinterest",
|
|
14543
14813
|
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'"
|
|
@@ -14577,7 +14847,7 @@ var pinterestCommand = defineCommand108({
|
|
|
14577
14847
|
});
|
|
14578
14848
|
|
|
14579
14849
|
// src/commands/images/screenshot.ts
|
|
14580
|
-
import { defineCommand as
|
|
14850
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
14581
14851
|
registerSchema({
|
|
14582
14852
|
command: "images.screenshot",
|
|
14583
14853
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -14593,7 +14863,7 @@ registerSchema({
|
|
|
14593
14863
|
}
|
|
14594
14864
|
}
|
|
14595
14865
|
});
|
|
14596
|
-
var screenshotCommand =
|
|
14866
|
+
var screenshotCommand = defineCommand112({
|
|
14597
14867
|
meta: {
|
|
14598
14868
|
name: "screenshot",
|
|
14599
14869
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -14643,7 +14913,7 @@ var screenshotCommand = defineCommand109({
|
|
|
14643
14913
|
});
|
|
14644
14914
|
|
|
14645
14915
|
// src/commands/images/search.ts
|
|
14646
|
-
import { defineCommand as
|
|
14916
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
14647
14917
|
registerSchema({
|
|
14648
14918
|
command: "images.search",
|
|
14649
14919
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -14659,7 +14929,7 @@ registerSchema({
|
|
|
14659
14929
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
14660
14930
|
}
|
|
14661
14931
|
});
|
|
14662
|
-
var searchCommand =
|
|
14932
|
+
var searchCommand = defineCommand113({
|
|
14663
14933
|
meta: {
|
|
14664
14934
|
name: "search",
|
|
14665
14935
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -14719,7 +14989,7 @@ var searchCommand = defineCommand110({
|
|
|
14719
14989
|
});
|
|
14720
14990
|
|
|
14721
14991
|
// src/commands/images/sticker.ts
|
|
14722
|
-
import { defineCommand as
|
|
14992
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
14723
14993
|
registerSchema({
|
|
14724
14994
|
command: "images.sticker",
|
|
14725
14995
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -14751,7 +15021,7 @@ registerSchema({
|
|
|
14751
15021
|
}
|
|
14752
15022
|
}
|
|
14753
15023
|
});
|
|
14754
|
-
var stickerCommand =
|
|
15024
|
+
var stickerCommand = defineCommand114({
|
|
14755
15025
|
meta: {
|
|
14756
15026
|
name: "sticker",
|
|
14757
15027
|
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"
|
|
@@ -14798,7 +15068,7 @@ var stickerCommand = defineCommand111({
|
|
|
14798
15068
|
});
|
|
14799
15069
|
|
|
14800
15070
|
// src/commands/images/stock.ts
|
|
14801
|
-
import { defineCommand as
|
|
15071
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
14802
15072
|
registerSchema({
|
|
14803
15073
|
command: "images.stock",
|
|
14804
15074
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -14856,7 +15126,7 @@ registerSchema({
|
|
|
14856
15126
|
}
|
|
14857
15127
|
}
|
|
14858
15128
|
});
|
|
14859
|
-
var stockCommand =
|
|
15129
|
+
var stockCommand = defineCommand115({
|
|
14860
15130
|
meta: {
|
|
14861
15131
|
name: "stock",
|
|
14862
15132
|
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"
|
|
@@ -14912,7 +15182,7 @@ var stockCommand = defineCommand112({
|
|
|
14912
15182
|
});
|
|
14913
15183
|
|
|
14914
15184
|
// src/lib/tags-command.ts
|
|
14915
|
-
import { defineCommand as
|
|
15185
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
14916
15186
|
function makeTagsCommand(command, label, endpoint) {
|
|
14917
15187
|
registerSchema({
|
|
14918
15188
|
command: `${command}.tags`,
|
|
@@ -14921,7 +15191,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
14921
15191
|
output: { type: "string", description: "Output format: md|json", required: false, default: "md" }
|
|
14922
15192
|
}
|
|
14923
15193
|
});
|
|
14924
|
-
return
|
|
15194
|
+
return defineCommand116({
|
|
14925
15195
|
meta: {
|
|
14926
15196
|
name: "tags",
|
|
14927
15197
|
description: `List the available ${label} tag names (defaults + company custom tags). Use before filtering with --tags. Example: baker ${command} tags`
|
|
@@ -14957,18 +15227,7 @@ function makeTagsCommand(command, label, endpoint) {
|
|
|
14957
15227
|
var tagsCommand2 = makeTagsCommand("images", "image", "/api/images/tags");
|
|
14958
15228
|
|
|
14959
15229
|
// src/commands/images/upload.ts
|
|
14960
|
-
import {
|
|
14961
|
-
import { extname as extname2 } from "path";
|
|
14962
|
-
import { defineCommand as defineCommand114 } from "citty";
|
|
14963
|
-
var MIME_MAP = {
|
|
14964
|
-
".png": "image/png",
|
|
14965
|
-
".jpg": "image/jpeg",
|
|
14966
|
-
".jpeg": "image/jpeg",
|
|
14967
|
-
".gif": "image/gif",
|
|
14968
|
-
".webp": "image/webp",
|
|
14969
|
-
".svg": "image/svg+xml",
|
|
14970
|
-
".avif": "image/avif"
|
|
14971
|
-
};
|
|
15230
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
14972
15231
|
registerSchema({
|
|
14973
15232
|
command: "images.upload",
|
|
14974
15233
|
description: "Upload an image to the library \u2014 local file path or remote http(s) URL.",
|
|
@@ -15006,15 +15265,7 @@ registerSchema({
|
|
|
15006
15265
|
function isRemoteUrl2(value) {
|
|
15007
15266
|
return /^https?:\/\//i.test(value);
|
|
15008
15267
|
}
|
|
15009
|
-
|
|
15010
|
-
const ext = extname2(filePath).toLowerCase();
|
|
15011
|
-
const mime = MIME_MAP[ext];
|
|
15012
|
-
if (!mime) {
|
|
15013
|
-
throw new ApiError("VALIDATION_ERROR", `Cannot detect content type for extension "${ext}". Use --content-type.`);
|
|
15014
|
-
}
|
|
15015
|
-
return mime;
|
|
15016
|
-
}
|
|
15017
|
-
var uploadCommand = defineCommand114({
|
|
15268
|
+
var uploadCommand = defineCommand117({
|
|
15018
15269
|
meta: {
|
|
15019
15270
|
name: "upload",
|
|
15020
15271
|
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'"
|
|
@@ -15082,7 +15333,7 @@ async function uploadRemote(target, args) {
|
|
|
15082
15333
|
writeJson({ ok: true, data });
|
|
15083
15334
|
}
|
|
15084
15335
|
async function uploadLocal(target, args) {
|
|
15085
|
-
const contentType = args["content-type"] ||
|
|
15336
|
+
const contentType = args["content-type"] || detectImageContentType(target);
|
|
15086
15337
|
if (args["dry-run"]) {
|
|
15087
15338
|
writeJson({
|
|
15088
15339
|
ok: true,
|
|
@@ -15097,17 +15348,17 @@ async function uploadLocal(target, args) {
|
|
|
15097
15348
|
});
|
|
15098
15349
|
return;
|
|
15099
15350
|
}
|
|
15100
|
-
const
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15351
|
+
const data = await uploadLocalImage({
|
|
15352
|
+
file: target,
|
|
15353
|
+
contentType,
|
|
15354
|
+
source: args.source,
|
|
15355
|
+
descriptionContext: args.context
|
|
15356
|
+
});
|
|
15106
15357
|
writeJson({ ok: true, data });
|
|
15107
15358
|
}
|
|
15108
15359
|
|
|
15109
15360
|
// src/commands/images/upscale.ts
|
|
15110
|
-
import { defineCommand as
|
|
15361
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
15111
15362
|
registerSchema({
|
|
15112
15363
|
command: "images.upscale",
|
|
15113
15364
|
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).",
|
|
@@ -15122,7 +15373,7 @@ registerSchema({
|
|
|
15122
15373
|
}
|
|
15123
15374
|
});
|
|
15124
15375
|
var POLL_INTERVAL_MS3 = 1500;
|
|
15125
|
-
var upscaleCommand =
|
|
15376
|
+
var upscaleCommand = defineCommand118({
|
|
15126
15377
|
meta: {
|
|
15127
15378
|
name: "upscale",
|
|
15128
15379
|
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"
|
|
@@ -15177,7 +15428,7 @@ var upscaleCommand = defineCommand115({
|
|
|
15177
15428
|
});
|
|
15178
15429
|
|
|
15179
15430
|
// src/commands/images/use.ts
|
|
15180
|
-
import { defineCommand as
|
|
15431
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
15181
15432
|
registerSchema({
|
|
15182
15433
|
command: "images.use",
|
|
15183
15434
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -15193,7 +15444,7 @@ registerSchema({
|
|
|
15193
15444
|
}
|
|
15194
15445
|
});
|
|
15195
15446
|
var POLL_INTERVAL_MS4 = 1500;
|
|
15196
|
-
var useCommand =
|
|
15447
|
+
var useCommand = defineCommand119({
|
|
15197
15448
|
meta: {
|
|
15198
15449
|
name: "use",
|
|
15199
15450
|
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"
|
|
@@ -15239,7 +15490,7 @@ var useCommand = defineCommand116({
|
|
|
15239
15490
|
});
|
|
15240
15491
|
|
|
15241
15492
|
// src/commands/images/index.ts
|
|
15242
|
-
var imagesCommand =
|
|
15493
|
+
var imagesCommand = defineCommand120({
|
|
15243
15494
|
meta: {
|
|
15244
15495
|
name: "images",
|
|
15245
15496
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -15309,10 +15560,10 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
15309
15560
|
});
|
|
15310
15561
|
|
|
15311
15562
|
// src/commands/research/index.ts
|
|
15312
|
-
import { defineCommand as
|
|
15563
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
15313
15564
|
|
|
15314
15565
|
// src/commands/research/advertisers.ts
|
|
15315
|
-
import { defineCommand as
|
|
15566
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
15316
15567
|
|
|
15317
15568
|
// src/commands/research/output.ts
|
|
15318
15569
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -15425,7 +15676,7 @@ var FIELDS3 = {
|
|
|
15425
15676
|
etv: "Estimated traffic value (USD)",
|
|
15426
15677
|
visibility: "SERP visibility score (0-1)"
|
|
15427
15678
|
};
|
|
15428
|
-
var advertisersCommand =
|
|
15679
|
+
var advertisersCommand = defineCommand121({
|
|
15429
15680
|
meta: {
|
|
15430
15681
|
name: "advertisers",
|
|
15431
15682
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -15472,7 +15723,7 @@ Examples:
|
|
|
15472
15723
|
});
|
|
15473
15724
|
|
|
15474
15725
|
// src/commands/research/autocomplete.ts
|
|
15475
|
-
import { defineCommand as
|
|
15726
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
15476
15727
|
registerSchema({
|
|
15477
15728
|
command: "research.autocomplete",
|
|
15478
15729
|
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).",
|
|
@@ -15495,7 +15746,7 @@ registerSchema({
|
|
|
15495
15746
|
var FIELDS4 = {
|
|
15496
15747
|
suggestion: "Autocomplete suggestion from Google"
|
|
15497
15748
|
};
|
|
15498
|
-
var autocompleteCommand =
|
|
15749
|
+
var autocompleteCommand = defineCommand122({
|
|
15499
15750
|
meta: {
|
|
15500
15751
|
name: "autocomplete",
|
|
15501
15752
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -15541,7 +15792,7 @@ Examples:
|
|
|
15541
15792
|
});
|
|
15542
15793
|
|
|
15543
15794
|
// src/commands/research/countries.ts
|
|
15544
|
-
import { defineCommand as
|
|
15795
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
15545
15796
|
registerSchema({
|
|
15546
15797
|
command: "research.countries",
|
|
15547
15798
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -15598,7 +15849,7 @@ var FIELDS5 = {
|
|
|
15598
15849
|
code: "Country code to pass as --location",
|
|
15599
15850
|
name: "Country name"
|
|
15600
15851
|
};
|
|
15601
|
-
var countriesCommand =
|
|
15852
|
+
var countriesCommand = defineCommand123({
|
|
15602
15853
|
meta: {
|
|
15603
15854
|
name: "countries",
|
|
15604
15855
|
description: "List all supported country codes for --location flag."
|
|
@@ -15609,7 +15860,7 @@ var countriesCommand = defineCommand120({
|
|
|
15609
15860
|
});
|
|
15610
15861
|
|
|
15611
15862
|
// src/commands/research/intent.ts
|
|
15612
|
-
import { defineCommand as
|
|
15863
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
15613
15864
|
registerSchema({
|
|
15614
15865
|
command: "research.intent",
|
|
15615
15866
|
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.",
|
|
@@ -15632,7 +15883,7 @@ var FIELDS6 = {
|
|
|
15632
15883
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
15633
15884
|
probability: "Confidence score 0.0-1.0"
|
|
15634
15885
|
};
|
|
15635
|
-
var intentCommand =
|
|
15886
|
+
var intentCommand = defineCommand124({
|
|
15636
15887
|
meta: {
|
|
15637
15888
|
name: "intent",
|
|
15638
15889
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -15680,7 +15931,7 @@ Examples:
|
|
|
15680
15931
|
});
|
|
15681
15932
|
|
|
15682
15933
|
// src/commands/research/keyword-gap.ts
|
|
15683
|
-
import { defineCommand as
|
|
15934
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
15684
15935
|
registerSchema({
|
|
15685
15936
|
command: "research.keyword-gap",
|
|
15686
15937
|
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.",
|
|
@@ -15709,7 +15960,7 @@ var FIELDS7 = {
|
|
|
15709
15960
|
cpc: "Cost per click USD",
|
|
15710
15961
|
their_position: "Competitor's ranking position"
|
|
15711
15962
|
};
|
|
15712
|
-
var keywordGapCommand =
|
|
15963
|
+
var keywordGapCommand = defineCommand125({
|
|
15713
15964
|
meta: {
|
|
15714
15965
|
name: "keyword-gap",
|
|
15715
15966
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -15783,7 +16034,7 @@ Examples:
|
|
|
15783
16034
|
});
|
|
15784
16035
|
|
|
15785
16036
|
// src/commands/research/keywords-for-site.ts
|
|
15786
|
-
import { defineCommand as
|
|
16037
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
15787
16038
|
registerSchema({
|
|
15788
16039
|
command: "research.keywords-for-site",
|
|
15789
16040
|
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.",
|
|
@@ -15816,7 +16067,7 @@ var FIELDS8 = {
|
|
|
15816
16067
|
competition: "LOW, MEDIUM, or HIGH",
|
|
15817
16068
|
competition_index: "Competition score 0-100"
|
|
15818
16069
|
};
|
|
15819
|
-
var keywordsForSiteCommand =
|
|
16070
|
+
var keywordsForSiteCommand = defineCommand126({
|
|
15820
16071
|
meta: {
|
|
15821
16072
|
name: "keywords-for-site",
|
|
15822
16073
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -15869,7 +16120,7 @@ Examples:
|
|
|
15869
16120
|
});
|
|
15870
16121
|
|
|
15871
16122
|
// src/commands/research/languages.ts
|
|
15872
|
-
import { defineCommand as
|
|
16123
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
15873
16124
|
registerSchema({
|
|
15874
16125
|
command: "research.languages",
|
|
15875
16126
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -15899,7 +16150,7 @@ var FIELDS9 = {
|
|
|
15899
16150
|
code: "Language code to pass as --language",
|
|
15900
16151
|
name: "Language name (also accepted by --language)"
|
|
15901
16152
|
};
|
|
15902
|
-
var languagesCommand2 =
|
|
16153
|
+
var languagesCommand2 = defineCommand127({
|
|
15903
16154
|
meta: {
|
|
15904
16155
|
name: "languages",
|
|
15905
16156
|
description: "List all supported language codes for --language flag."
|
|
@@ -15910,7 +16161,7 @@ var languagesCommand2 = defineCommand124({
|
|
|
15910
16161
|
});
|
|
15911
16162
|
|
|
15912
16163
|
// src/commands/research/lighthouse.ts
|
|
15913
|
-
import { defineCommand as
|
|
16164
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
15914
16165
|
registerSchema({
|
|
15915
16166
|
command: "research.lighthouse",
|
|
15916
16167
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -15929,7 +16180,7 @@ var FIELDS10 = {
|
|
|
15929
16180
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
15930
16181
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
15931
16182
|
};
|
|
15932
|
-
var lighthouseCommand =
|
|
16183
|
+
var lighthouseCommand = defineCommand128({
|
|
15933
16184
|
meta: {
|
|
15934
16185
|
name: "lighthouse",
|
|
15935
16186
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -15967,7 +16218,7 @@ Examples:
|
|
|
15967
16218
|
});
|
|
15968
16219
|
|
|
15969
16220
|
// src/commands/research/relevant-pages.ts
|
|
15970
|
-
import { defineCommand as
|
|
16221
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
15971
16222
|
registerSchema({
|
|
15972
16223
|
command: "research.relevant-pages",
|
|
15973
16224
|
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).",
|
|
@@ -15993,7 +16244,7 @@ var FIELDS11 = {
|
|
|
15993
16244
|
keywords: "Total organic keywords the page ranks for",
|
|
15994
16245
|
top_10: "Keywords in positions 1-10"
|
|
15995
16246
|
};
|
|
15996
|
-
var relevantPagesCommand =
|
|
16247
|
+
var relevantPagesCommand = defineCommand129({
|
|
15997
16248
|
meta: {
|
|
15998
16249
|
name: "relevant-pages",
|
|
15999
16250
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -16039,7 +16290,7 @@ Examples:
|
|
|
16039
16290
|
});
|
|
16040
16291
|
|
|
16041
16292
|
// src/commands/research/web.ts
|
|
16042
|
-
import { defineCommand as
|
|
16293
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
16043
16294
|
registerSchema({
|
|
16044
16295
|
command: "research.web",
|
|
16045
16296
|
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).",
|
|
@@ -16090,7 +16341,7 @@ async function runDeepResearch(question) {
|
|
|
16090
16341
|
}
|
|
16091
16342
|
throw new Error("Deep research timed out");
|
|
16092
16343
|
}
|
|
16093
|
-
var webCommand =
|
|
16344
|
+
var webCommand = defineCommand130({
|
|
16094
16345
|
meta: {
|
|
16095
16346
|
name: "web",
|
|
16096
16347
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -16150,7 +16401,7 @@ Examples:
|
|
|
16150
16401
|
});
|
|
16151
16402
|
|
|
16152
16403
|
// src/commands/research/index.ts
|
|
16153
|
-
var researchCommand =
|
|
16404
|
+
var researchCommand = defineCommand131({
|
|
16154
16405
|
meta: {
|
|
16155
16406
|
name: "research",
|
|
16156
16407
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -16190,10 +16441,10 @@ Examples:
|
|
|
16190
16441
|
});
|
|
16191
16442
|
|
|
16192
16443
|
// src/commands/scheduled-actions/index.ts
|
|
16193
|
-
import { defineCommand as
|
|
16444
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
16194
16445
|
|
|
16195
16446
|
// src/commands/scheduled-actions/create.ts
|
|
16196
|
-
import { defineCommand as
|
|
16447
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
16197
16448
|
|
|
16198
16449
|
// src/commands/scheduled-actions/shared.ts
|
|
16199
16450
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -16298,7 +16549,7 @@ registerSchema({
|
|
|
16298
16549
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
16299
16550
|
}
|
|
16300
16551
|
});
|
|
16301
|
-
var createCommand2 =
|
|
16552
|
+
var createCommand2 = defineCommand132({
|
|
16302
16553
|
meta: {
|
|
16303
16554
|
name: "create",
|
|
16304
16555
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -16346,7 +16597,7 @@ var createCommand2 = defineCommand129({
|
|
|
16346
16597
|
});
|
|
16347
16598
|
|
|
16348
16599
|
// src/commands/scheduled-actions/delete.ts
|
|
16349
|
-
import { defineCommand as
|
|
16600
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
16350
16601
|
registerSchema({
|
|
16351
16602
|
command: "scheduled-actions.delete",
|
|
16352
16603
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -16354,7 +16605,7 @@ registerSchema({
|
|
|
16354
16605
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
16355
16606
|
}
|
|
16356
16607
|
});
|
|
16357
|
-
var deleteCommand2 =
|
|
16608
|
+
var deleteCommand2 = defineCommand133({
|
|
16358
16609
|
meta: {
|
|
16359
16610
|
name: "delete",
|
|
16360
16611
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -16383,7 +16634,7 @@ var deleteCommand2 = defineCommand130({
|
|
|
16383
16634
|
});
|
|
16384
16635
|
|
|
16385
16636
|
// src/commands/scheduled-actions/get.ts
|
|
16386
|
-
import { defineCommand as
|
|
16637
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
16387
16638
|
registerSchema({
|
|
16388
16639
|
command: "scheduled-actions.get",
|
|
16389
16640
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -16391,7 +16642,7 @@ registerSchema({
|
|
|
16391
16642
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
16392
16643
|
}
|
|
16393
16644
|
});
|
|
16394
|
-
var getCommand3 =
|
|
16645
|
+
var getCommand3 = defineCommand134({
|
|
16395
16646
|
meta: {
|
|
16396
16647
|
name: "get",
|
|
16397
16648
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -16428,13 +16679,13 @@ var getCommand3 = defineCommand131({
|
|
|
16428
16679
|
});
|
|
16429
16680
|
|
|
16430
16681
|
// src/commands/scheduled-actions/list.ts
|
|
16431
|
-
import { defineCommand as
|
|
16682
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
16432
16683
|
registerSchema({
|
|
16433
16684
|
command: "scheduled-actions.list",
|
|
16434
16685
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
16435
16686
|
args: {}
|
|
16436
16687
|
});
|
|
16437
|
-
var listCommand3 =
|
|
16688
|
+
var listCommand3 = defineCommand135({
|
|
16438
16689
|
meta: {
|
|
16439
16690
|
name: "list",
|
|
16440
16691
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -16455,7 +16706,7 @@ var listCommand3 = defineCommand132({
|
|
|
16455
16706
|
});
|
|
16456
16707
|
|
|
16457
16708
|
// src/commands/scheduled-actions/trigger.ts
|
|
16458
|
-
import { defineCommand as
|
|
16709
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
16459
16710
|
registerSchema({
|
|
16460
16711
|
command: "scheduled-actions.trigger",
|
|
16461
16712
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -16463,7 +16714,7 @@ registerSchema({
|
|
|
16463
16714
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
16464
16715
|
}
|
|
16465
16716
|
});
|
|
16466
|
-
var triggerCommand =
|
|
16717
|
+
var triggerCommand = defineCommand136({
|
|
16467
16718
|
meta: {
|
|
16468
16719
|
name: "trigger",
|
|
16469
16720
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -16500,7 +16751,7 @@ var triggerCommand = defineCommand133({
|
|
|
16500
16751
|
});
|
|
16501
16752
|
|
|
16502
16753
|
// src/commands/scheduled-actions/update.ts
|
|
16503
|
-
import { defineCommand as
|
|
16754
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
16504
16755
|
registerSchema({
|
|
16505
16756
|
command: "scheduled-actions.update",
|
|
16506
16757
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -16525,7 +16776,7 @@ registerSchema({
|
|
|
16525
16776
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
16526
16777
|
}
|
|
16527
16778
|
});
|
|
16528
|
-
var updateCommand2 =
|
|
16779
|
+
var updateCommand2 = defineCommand137({
|
|
16529
16780
|
meta: {
|
|
16530
16781
|
name: "update",
|
|
16531
16782
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -16595,7 +16846,7 @@ var updateCommand2 = defineCommand134({
|
|
|
16595
16846
|
});
|
|
16596
16847
|
|
|
16597
16848
|
// src/commands/scheduled-actions/index.ts
|
|
16598
|
-
var scheduledActionsCommand =
|
|
16849
|
+
var scheduledActionsCommand = defineCommand138({
|
|
16599
16850
|
meta: {
|
|
16600
16851
|
name: "scheduled-actions",
|
|
16601
16852
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -16621,8 +16872,8 @@ Examples:
|
|
|
16621
16872
|
});
|
|
16622
16873
|
|
|
16623
16874
|
// src/commands/schema.ts
|
|
16624
|
-
import { defineCommand as
|
|
16625
|
-
var schemaCommand =
|
|
16875
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
16876
|
+
var schemaCommand = defineCommand139({
|
|
16626
16877
|
meta: {
|
|
16627
16878
|
name: "schema",
|
|
16628
16879
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -16658,10 +16909,10 @@ var schemaCommand = defineCommand136({
|
|
|
16658
16909
|
});
|
|
16659
16910
|
|
|
16660
16911
|
// src/commands/testimonials/index.ts
|
|
16661
|
-
import { defineCommand as
|
|
16912
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
16662
16913
|
|
|
16663
16914
|
// src/commands/testimonials/get.ts
|
|
16664
|
-
import { defineCommand as
|
|
16915
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
16665
16916
|
registerSchema({
|
|
16666
16917
|
command: "testimonials.get",
|
|
16667
16918
|
description: "Get a single testimonial by ID",
|
|
@@ -16669,7 +16920,7 @@ registerSchema({
|
|
|
16669
16920
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
16670
16921
|
}
|
|
16671
16922
|
});
|
|
16672
|
-
var getCommand4 =
|
|
16923
|
+
var getCommand4 = defineCommand140({
|
|
16673
16924
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
16674
16925
|
args: {
|
|
16675
16926
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -16706,7 +16957,7 @@ var getCommand4 = defineCommand137({
|
|
|
16706
16957
|
});
|
|
16707
16958
|
|
|
16708
16959
|
// src/commands/testimonials/list.ts
|
|
16709
|
-
import { defineCommand as
|
|
16960
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
16710
16961
|
registerSchema({
|
|
16711
16962
|
command: "testimonials.list",
|
|
16712
16963
|
description: "List testimonials with optional filters.",
|
|
@@ -16736,7 +16987,7 @@ registerSchema({
|
|
|
16736
16987
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
16737
16988
|
}
|
|
16738
16989
|
});
|
|
16739
|
-
var listCommand4 =
|
|
16990
|
+
var listCommand4 = defineCommand141({
|
|
16740
16991
|
meta: {
|
|
16741
16992
|
name: "list",
|
|
16742
16993
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -16785,7 +17036,7 @@ var listCommand4 = defineCommand138({
|
|
|
16785
17036
|
});
|
|
16786
17037
|
|
|
16787
17038
|
// src/commands/testimonials/search.ts
|
|
16788
|
-
import { defineCommand as
|
|
17039
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
16789
17040
|
registerSchema({
|
|
16790
17041
|
command: "testimonials.search",
|
|
16791
17042
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -16816,7 +17067,7 @@ registerSchema({
|
|
|
16816
17067
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
16817
17068
|
}
|
|
16818
17069
|
});
|
|
16819
|
-
var searchCommand2 =
|
|
17070
|
+
var searchCommand2 = defineCommand142({
|
|
16820
17071
|
meta: {
|
|
16821
17072
|
name: "search",
|
|
16822
17073
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -16890,7 +17141,7 @@ var searchCommand2 = defineCommand139({
|
|
|
16890
17141
|
var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
16891
17142
|
|
|
16892
17143
|
// src/commands/testimonials/index.ts
|
|
16893
|
-
var testimonialsCommand =
|
|
17144
|
+
var testimonialsCommand = defineCommand143({
|
|
16894
17145
|
meta: {
|
|
16895
17146
|
name: "testimonials",
|
|
16896
17147
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -16911,10 +17162,10 @@ Examples:
|
|
|
16911
17162
|
});
|
|
16912
17163
|
|
|
16913
17164
|
// src/commands/videos/index.ts
|
|
16914
|
-
import { defineCommand as
|
|
17165
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
16915
17166
|
|
|
16916
17167
|
// src/commands/videos/delete.ts
|
|
16917
|
-
import { defineCommand as
|
|
17168
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
16918
17169
|
registerSchema({
|
|
16919
17170
|
command: "videos.delete",
|
|
16920
17171
|
description: "Delete a video by ID",
|
|
@@ -16928,7 +17179,7 @@ registerSchema({
|
|
|
16928
17179
|
}
|
|
16929
17180
|
}
|
|
16930
17181
|
});
|
|
16931
|
-
var deleteCommand3 =
|
|
17182
|
+
var deleteCommand3 = defineCommand144({
|
|
16932
17183
|
meta: {
|
|
16933
17184
|
name: "delete",
|
|
16934
17185
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -16969,7 +17220,7 @@ var deleteCommand3 = defineCommand141({
|
|
|
16969
17220
|
});
|
|
16970
17221
|
|
|
16971
17222
|
// src/commands/videos/get.ts
|
|
16972
|
-
import { defineCommand as
|
|
17223
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
16973
17224
|
registerSchema({
|
|
16974
17225
|
command: "videos.get",
|
|
16975
17226
|
description: "Get a single video by ID",
|
|
@@ -16977,7 +17228,7 @@ registerSchema({
|
|
|
16977
17228
|
id: { type: "string", description: "Video ID", required: true }
|
|
16978
17229
|
}
|
|
16979
17230
|
});
|
|
16980
|
-
var getCommand5 =
|
|
17231
|
+
var getCommand5 = defineCommand145({
|
|
16981
17232
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
16982
17233
|
args: {
|
|
16983
17234
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -17014,7 +17265,7 @@ var getCommand5 = defineCommand142({
|
|
|
17014
17265
|
});
|
|
17015
17266
|
|
|
17016
17267
|
// src/commands/videos/search.ts
|
|
17017
|
-
import { defineCommand as
|
|
17268
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
17018
17269
|
registerSchema({
|
|
17019
17270
|
command: "videos.search",
|
|
17020
17271
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -17024,7 +17275,7 @@ registerSchema({
|
|
|
17024
17275
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
17025
17276
|
}
|
|
17026
17277
|
});
|
|
17027
|
-
var searchCommand3 =
|
|
17278
|
+
var searchCommand3 = defineCommand146({
|
|
17028
17279
|
meta: {
|
|
17029
17280
|
name: "search",
|
|
17030
17281
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -17076,8 +17327,8 @@ var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
|
17076
17327
|
// src/commands/videos/upload.ts
|
|
17077
17328
|
import { readFile as readFile12, stat as stat3 } from "fs/promises";
|
|
17078
17329
|
import { extname as extname3 } from "path";
|
|
17079
|
-
import { defineCommand as
|
|
17080
|
-
var
|
|
17330
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
17331
|
+
var MIME_MAP = {
|
|
17081
17332
|
".mp4": "video/mp4",
|
|
17082
17333
|
".mov": "video/quicktime",
|
|
17083
17334
|
".webm": "video/webm",
|
|
@@ -17102,15 +17353,15 @@ registerSchema({
|
|
|
17102
17353
|
}
|
|
17103
17354
|
}
|
|
17104
17355
|
});
|
|
17105
|
-
function
|
|
17356
|
+
function detectContentType(filePath) {
|
|
17106
17357
|
const ext = extname3(filePath).toLowerCase();
|
|
17107
|
-
const mime =
|
|
17358
|
+
const mime = MIME_MAP[ext];
|
|
17108
17359
|
if (!mime) {
|
|
17109
17360
|
throw new ApiError("VALIDATION_ERROR", `Cannot detect content type for extension "${ext}". Use --content-type.`);
|
|
17110
17361
|
}
|
|
17111
17362
|
return mime;
|
|
17112
17363
|
}
|
|
17113
|
-
var uploadCommand2 =
|
|
17364
|
+
var uploadCommand2 = defineCommand147({
|
|
17114
17365
|
meta: {
|
|
17115
17366
|
name: "upload",
|
|
17116
17367
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -17127,7 +17378,7 @@ var uploadCommand2 = defineCommand144({
|
|
|
17127
17378
|
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "File path is required" } });
|
|
17128
17379
|
process.exit(1);
|
|
17129
17380
|
}
|
|
17130
|
-
const contentType = args["content-type"] ||
|
|
17381
|
+
const contentType = args["content-type"] || detectContentType(filePath);
|
|
17131
17382
|
if (args["dry-run"]) {
|
|
17132
17383
|
const fileStats = await stat3(filePath);
|
|
17133
17384
|
writeJson({
|
|
@@ -17164,7 +17415,7 @@ var uploadCommand2 = defineCommand144({
|
|
|
17164
17415
|
});
|
|
17165
17416
|
|
|
17166
17417
|
// src/commands/videos/index.ts
|
|
17167
|
-
var videosCommand =
|
|
17418
|
+
var videosCommand = defineCommand148({
|
|
17168
17419
|
meta: {
|
|
17169
17420
|
name: "videos",
|
|
17170
17421
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -17187,10 +17438,10 @@ Examples:
|
|
|
17187
17438
|
});
|
|
17188
17439
|
|
|
17189
17440
|
// src/commands/winning-ads/index.ts
|
|
17190
|
-
import { defineCommand as
|
|
17441
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
17191
17442
|
|
|
17192
17443
|
// src/commands/winning-ads/advertisers.ts
|
|
17193
|
-
import { defineCommand as
|
|
17444
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
17194
17445
|
registerSchema({
|
|
17195
17446
|
command: "winning-ads.advertisers",
|
|
17196
17447
|
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).",
|
|
@@ -17203,7 +17454,7 @@ registerSchema({
|
|
|
17203
17454
|
function identity(record) {
|
|
17204
17455
|
return record;
|
|
17205
17456
|
}
|
|
17206
|
-
var advertisersCommand2 =
|
|
17457
|
+
var advertisersCommand2 = defineCommand149({
|
|
17207
17458
|
meta: {
|
|
17208
17459
|
name: "advertisers",
|
|
17209
17460
|
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'
|
|
@@ -17254,7 +17505,7 @@ var advertisersCommand2 = defineCommand146({
|
|
|
17254
17505
|
});
|
|
17255
17506
|
|
|
17256
17507
|
// src/commands/winning-ads/search.ts
|
|
17257
|
-
import { defineCommand as
|
|
17508
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
17258
17509
|
registerSchema({
|
|
17259
17510
|
command: "winning-ads.search",
|
|
17260
17511
|
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.",
|
|
@@ -17362,7 +17613,7 @@ function buildSearchBody(args) {
|
|
|
17362
17613
|
}
|
|
17363
17614
|
return body;
|
|
17364
17615
|
}
|
|
17365
|
-
var searchCommand4 =
|
|
17616
|
+
var searchCommand4 = defineCommand150({
|
|
17366
17617
|
meta: {
|
|
17367
17618
|
name: "search",
|
|
17368
17619
|
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"
|
|
@@ -17474,7 +17725,7 @@ var searchCommand4 = defineCommand147({
|
|
|
17474
17725
|
});
|
|
17475
17726
|
|
|
17476
17727
|
// src/commands/winning-ads/index.ts
|
|
17477
|
-
var winningAdsCommand =
|
|
17728
|
+
var winningAdsCommand = defineCommand151({
|
|
17478
17729
|
meta: {
|
|
17479
17730
|
name: "winning-ads",
|
|
17480
17731
|
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.
|
|
@@ -17514,7 +17765,7 @@ function getCliVersion() {
|
|
|
17514
17765
|
}
|
|
17515
17766
|
|
|
17516
17767
|
// src/cli.ts
|
|
17517
|
-
var main =
|
|
17768
|
+
var main = defineCommand152({
|
|
17518
17769
|
meta: {
|
|
17519
17770
|
name: "baker",
|
|
17520
17771
|
version: getCliVersion(),
|
|
@@ -17533,6 +17784,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
17533
17784
|
ga4: ga4Command,
|
|
17534
17785
|
gsc: gscCommand,
|
|
17535
17786
|
research: researchCommand,
|
|
17787
|
+
creatives: creativesCommand3,
|
|
17536
17788
|
images: imagesCommand,
|
|
17537
17789
|
videos: videosCommand,
|
|
17538
17790
|
testimonials: testimonialsCommand,
|