@koda-sl/baker-cli 0.148.0 → 0.149.0-dev.183ac88ea
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 +23 -25
- package/dist/{chunk-2F5SCTNS.js → chunk-JBDSJZBZ.js} +64 -21
- package/dist/chunk-JBDSJZBZ.js.map +1 -0
- package/dist/cli.js +652 -80
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2F5SCTNS.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
imageProfileFor,
|
|
25
25
|
isPersistedAssetRef,
|
|
26
26
|
looksLikeHttpUrl,
|
|
27
|
+
nearestSupportedAspectRatio,
|
|
27
28
|
parseRefExpr,
|
|
28
29
|
platformFormats,
|
|
29
30
|
requireCredentialsFromEnv,
|
|
@@ -31,10 +32,11 @@ import {
|
|
|
31
32
|
sha256Hex,
|
|
32
33
|
spineInputFlags,
|
|
33
34
|
spineInputOps,
|
|
35
|
+
supportsParam,
|
|
34
36
|
toModelSafeImage,
|
|
35
37
|
ulid,
|
|
36
38
|
validateCanvasDeep
|
|
37
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-JBDSJZBZ.js";
|
|
38
40
|
import {
|
|
39
41
|
csvOrJson,
|
|
40
42
|
daysAgoIso,
|
|
@@ -73,7 +75,7 @@ import {
|
|
|
73
75
|
} from "./chunk-RK67WL4O.js";
|
|
74
76
|
|
|
75
77
|
// src/cli.ts
|
|
76
|
-
import { defineCommand as
|
|
78
|
+
import { defineCommand as defineCommand182, runMain } from "citty";
|
|
77
79
|
|
|
78
80
|
// src/commands/actions/index.ts
|
|
79
81
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -2131,6 +2133,7 @@ var chatChangeTypeSchema = z5.enum([
|
|
|
2131
2133
|
"linkedin-ads",
|
|
2132
2134
|
"google-ads",
|
|
2133
2135
|
"meta-ads",
|
|
2136
|
+
"tag-manager",
|
|
2134
2137
|
// Immediate (already-applied) library effects — see lib/chatChanges.ts.
|
|
2135
2138
|
"image",
|
|
2136
2139
|
"video",
|
|
@@ -2707,8 +2710,9 @@ var rgbTriple = z8.tuple([
|
|
|
2707
2710
|
z8.number().int().min(0).max(255)
|
|
2708
2711
|
]);
|
|
2709
2712
|
var imageGenerateModelSchema = z8.enum([
|
|
2713
|
+
"openai/gpt-image-2",
|
|
2714
|
+
// Legacy — see the registry entry; kept so pre-switch canvases still run.
|
|
2710
2715
|
"openai/gpt-5.4-image-2",
|
|
2711
|
-
"google/gemini-3.5-flash",
|
|
2712
2716
|
"google/gemini-3.1-flash-image-preview",
|
|
2713
2717
|
"google/gemini-3-pro-image-preview",
|
|
2714
2718
|
"recraft/recraft-v4.1-pro-vector"
|
|
@@ -16653,7 +16657,9 @@ function buildFrameRef(edge, url, framePrompt, present2, ctx, nodes) {
|
|
|
16653
16657
|
const imageProfile = imageProfileFor(ctx.imageModel);
|
|
16654
16658
|
const genParams = {
|
|
16655
16659
|
model: ctx.imageModel,
|
|
16656
|
-
|
|
16660
|
+
// gpt-image-2 derives pixel dimensions from the ratio and has no size knob,
|
|
16661
|
+
// so asking for 2K there is an `unknown_param` at validate.
|
|
16662
|
+
...supportsParam("image_generate", ctx.imageModel, "image_size") ? { image_size: "2K" } : {},
|
|
16657
16663
|
// Per-model image defaults (gpt-image: quality=high — OpenRouter forwards it; we do
|
|
16658
16664
|
// NOT send input_fidelity, which gpt-image-2 forces high automatically).
|
|
16659
16665
|
...imageProfile?.paramDefaults ?? {},
|
|
@@ -16668,7 +16674,7 @@ function buildFrameRef(edge, url, framePrompt, present2, ctx, nodes) {
|
|
|
16668
16674
|
ctx.imageModel
|
|
16669
16675
|
)
|
|
16670
16676
|
};
|
|
16671
|
-
if (ctx.genAr) genParams.aspect_ratio = ctx.genAr;
|
|
16677
|
+
if (ctx.genAr) genParams.aspect_ratio = nearestSupportedAspectRatio("image_generate", ctx.imageModel, ctx.genAr);
|
|
16672
16678
|
const genId = `s${ctx.sceneIndex}${tag}_${edge}`;
|
|
16673
16679
|
nodes.push({
|
|
16674
16680
|
id: genId,
|
|
@@ -20395,8 +20401,13 @@ function scaffoldStaticAd(input, elementsInput, opts) {
|
|
|
20395
20401
|
inputs: { reference, target_blueprint: "$ref:prompt.asset" },
|
|
20396
20402
|
params: {
|
|
20397
20403
|
model: opts.genModel,
|
|
20398
|
-
|
|
20399
|
-
|
|
20404
|
+
// The hero renders at the closest ratio its model actually accepts; the
|
|
20405
|
+
// placement fan-out below adapts it to the exact platform formats, which
|
|
20406
|
+
// is also how a 4:5 Meta feed ad gets made on a model that has no 4:5.
|
|
20407
|
+
aspect_ratio: nearestSupportedAspectRatio("image_generate", opts.genModel, baseAspectRatio(blueprint, opts)),
|
|
20408
|
+
...supportsParam("image_generate", opts.genModel, "image_size") ? { image_size: "2K" } : {},
|
|
20409
|
+
// Per-model image defaults (gpt-image: quality=high).
|
|
20410
|
+
...imageProfileFor(opts.genModel)?.paramDefaults ?? {},
|
|
20400
20411
|
prompt
|
|
20401
20412
|
}
|
|
20402
20413
|
});
|
|
@@ -20763,7 +20774,7 @@ function resolveModels(args) {
|
|
|
20763
20774
|
describeModel: pick("describe-model", "image_describe", "~google/gemini-pro-latest"),
|
|
20764
20775
|
selectModel: pick("select-model", "text_generate", "~google/gemini-flash-latest"),
|
|
20765
20776
|
layoutModel: pick("layout-model", "text_generate", "~google/gemini-flash-latest"),
|
|
20766
|
-
genModel: pick("gen-model", "image_generate", "openai/gpt-
|
|
20777
|
+
genModel: pick("gen-model", "image_generate", "openai/gpt-image-2")
|
|
20767
20778
|
};
|
|
20768
20779
|
}
|
|
20769
20780
|
var PLATFORM_PLACEMENTS = {
|
|
@@ -21405,7 +21416,7 @@ function resolveModels2(args) {
|
|
|
21405
21416
|
// Default to the strongest image model (matches the static-ad scaffold); the
|
|
21406
21417
|
// frame generators need the most faithful text/identity reproduction. Override
|
|
21407
21418
|
// with --image-model for a cheaper/faster pass.
|
|
21408
|
-
imageModel: pick("image-model", "image_generate", "openai/gpt-
|
|
21419
|
+
imageModel: pick("image-model", "image_generate", "openai/gpt-image-2")
|
|
21409
21420
|
};
|
|
21410
21421
|
}
|
|
21411
21422
|
function hasPhotorealCast(elements) {
|
|
@@ -24115,7 +24126,7 @@ async function resolveReferences(spec) {
|
|
|
24115
24126
|
var generateCommand = defineCommand114({
|
|
24116
24127
|
meta: {
|
|
24117
24128
|
name: "generate",
|
|
24118
|
-
description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: google/gemini-3.1-flash-image-preview (Nano Banana flash \u2014 default, fast, extreme aspect ratios)
|
|
24129
|
+
description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: google/gemini-3.1-flash-image-preview (Nano Banana flash \u2014 default, fast, extreme aspect ratios), google/gemini-3-pro-image-preview (Nano Banana Pro \u2014 highest fidelity), openai/gpt-image-2 (photoreal, cleanest in-image text, best for ad/landing reproduction \u2014 no --image-size, and no 4:5 / 5:4), 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 openai/gpt-image-2 --aspect-ratio 3:2\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]]'"
|
|
24119
24130
|
},
|
|
24120
24131
|
args: {
|
|
24121
24132
|
prompt: { type: "positional", description: "What to generate", required: false },
|
|
@@ -24288,6 +24299,34 @@ var gifCommand = defineCommand116({
|
|
|
24288
24299
|
|
|
24289
24300
|
// src/commands/images/google.ts
|
|
24290
24301
|
import { defineCommand as defineCommand117 } from "citty";
|
|
24302
|
+
|
|
24303
|
+
// src/commands/images/searchHints.ts
|
|
24304
|
+
var FALLBACK = {
|
|
24305
|
+
stock: "Still empty \u2192 `baker images find <query> --sources library,pinterest,google` (one call across the providers stock does not cover \u2014 `--sources` is required, `find` alone searches the library only) or `baker images generate` to make the asset. Do not re-run this search with reshuffled flags.",
|
|
24306
|
+
google: "Still empty \u2192 `baker images generate` to make the asset. Google is the last-resort provider; there is nothing below it to retry."
|
|
24307
|
+
};
|
|
24308
|
+
function emptyResultHints({ provider, hitCount, activeFilters }) {
|
|
24309
|
+
if (hitCount > 0) {
|
|
24310
|
+
return [];
|
|
24311
|
+
}
|
|
24312
|
+
const hints = [];
|
|
24313
|
+
if (activeFilters.length > 0) {
|
|
24314
|
+
hints.push(
|
|
24315
|
+
`No hits. Drop the filters before touching the query \u2014 ${activeFilters.join(", ")} narrowed this search and filter combinations are the usual cause of an empty result.`
|
|
24316
|
+
);
|
|
24317
|
+
}
|
|
24318
|
+
hints.push(FALLBACK[provider]);
|
|
24319
|
+
return hints;
|
|
24320
|
+
}
|
|
24321
|
+
function activeFilterFlags(args, candidates) {
|
|
24322
|
+
return candidates.filter((flag) => args[flag] !== void 0 && args[flag] !== "").map((flag) => `--${flag}`);
|
|
24323
|
+
}
|
|
24324
|
+
|
|
24325
|
+
// src/commands/images/google.ts
|
|
24326
|
+
var GOOGLE_ERROR_FIX = {
|
|
24327
|
+
action: "use_different_resource",
|
|
24328
|
+
explanation: "Generate the asset instead of retrying Google. Google is the last-resort image provider. Run `baker images generate` to make the asset. Never sleep-and-retry this command \u2014 the CLI already backs off on rate limits. If no image can be sourced, continue the rest of the task with a placeholder rather than aborting it."
|
|
24329
|
+
};
|
|
24291
24330
|
registerSchema({
|
|
24292
24331
|
command: "images.google",
|
|
24293
24332
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -24358,10 +24397,18 @@ var googleCommand2 = defineCommand117({
|
|
|
24358
24397
|
if (args["auto-ingest"]) body.autoIngest = Number(args["auto-ingest"]);
|
|
24359
24398
|
if (args.context) body.descriptionContext = args.context;
|
|
24360
24399
|
const data = await apiPost("/api/images/google", body);
|
|
24361
|
-
|
|
24400
|
+
const hints = emptyResultHints({
|
|
24401
|
+
provider: "google",
|
|
24402
|
+
hitCount: data.hits.length,
|
|
24403
|
+
activeFilters: activeFilterFlags(args, ["type", "size", "color", "safe"])
|
|
24404
|
+
});
|
|
24405
|
+
writeJson({ ok: true, data, ...hints.length ? { hints } : {} });
|
|
24362
24406
|
} catch (err) {
|
|
24363
24407
|
if (err instanceof ApiError) {
|
|
24364
|
-
writeJson({
|
|
24408
|
+
writeJson({
|
|
24409
|
+
ok: false,
|
|
24410
|
+
error: { code: err.code, message: err.message, fix: GOOGLE_ERROR_FIX }
|
|
24411
|
+
});
|
|
24365
24412
|
process.exit(1);
|
|
24366
24413
|
}
|
|
24367
24414
|
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
@@ -25719,6 +25766,10 @@ var stickerCommand = defineCommand126({
|
|
|
25719
25766
|
|
|
25720
25767
|
// src/commands/images/stock.ts
|
|
25721
25768
|
import { defineCommand as defineCommand127 } from "citty";
|
|
25769
|
+
var STOCK_ERROR_FIX = {
|
|
25770
|
+
action: "use_different_resource",
|
|
25771
|
+
explanation: "Switch provider instead of retrying stock search. Stock search is one of several image sources. Run `baker images find <query> --sources library,pinterest,google` (`--sources` is required \u2014 `find` alone searches the library only) or `baker images generate` to make the asset. Never sleep-and-retry this command \u2014 the CLI already backs off on rate limits. If no image can be sourced, continue the rest of the task with a placeholder rather than aborting it."
|
|
25772
|
+
};
|
|
25722
25773
|
registerSchema({
|
|
25723
25774
|
command: "images.stock",
|
|
25724
25775
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -25776,6 +25827,21 @@ registerSchema({
|
|
|
25776
25827
|
}
|
|
25777
25828
|
}
|
|
25778
25829
|
});
|
|
25830
|
+
function buildStockRequest(query, args) {
|
|
25831
|
+
const body = { query };
|
|
25832
|
+
if (args.type) body.contentType = args.type;
|
|
25833
|
+
if (args.orientation) body.orientation = args.orientation;
|
|
25834
|
+
if (args.license) body.license = args.license;
|
|
25835
|
+
if (args.color) body.color = args.color;
|
|
25836
|
+
if (args.ai) body.aiGenerated = args.ai;
|
|
25837
|
+
if (args.people) body.people = args.people;
|
|
25838
|
+
if (args.order) body.order = args.order;
|
|
25839
|
+
if (args.limit) body.limit = Number(args.limit);
|
|
25840
|
+
if (args.page) body.page = Number(args.page);
|
|
25841
|
+
if (args["auto-ingest"]) body.autoIngest = Number(args["auto-ingest"]);
|
|
25842
|
+
if (args.context) body.descriptionContext = args.context;
|
|
25843
|
+
return body;
|
|
25844
|
+
}
|
|
25779
25845
|
var stockCommand = defineCommand127({
|
|
25780
25846
|
meta: {
|
|
25781
25847
|
name: "stock",
|
|
@@ -25806,23 +25872,23 @@ var stockCommand = defineCommand127({
|
|
|
25806
25872
|
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Query is required" } });
|
|
25807
25873
|
process.exit(1);
|
|
25808
25874
|
}
|
|
25809
|
-
const
|
|
25810
|
-
|
|
25811
|
-
|
|
25812
|
-
|
|
25813
|
-
|
|
25814
|
-
|
|
25815
|
-
|
|
25816
|
-
if (args.order) body.order = args.order;
|
|
25817
|
-
if (args.limit) body.limit = Number(args.limit);
|
|
25818
|
-
if (args.page) body.page = Number(args.page);
|
|
25819
|
-
if (args["auto-ingest"]) body.autoIngest = Number(args["auto-ingest"]);
|
|
25820
|
-
if (args.context) body.descriptionContext = args.context;
|
|
25821
|
-
const data = await apiPost("/api/images/stock", body);
|
|
25822
|
-
writeJson({ ok: true, data });
|
|
25875
|
+
const data = await apiPost("/api/images/stock", buildStockRequest(query, args));
|
|
25876
|
+
const hints = emptyResultHints({
|
|
25877
|
+
provider: "stock",
|
|
25878
|
+
hitCount: data.hits.length,
|
|
25879
|
+
activeFilters: activeFilterFlags(args, ["type", "orientation", "license", "color", "ai", "people"])
|
|
25880
|
+
});
|
|
25881
|
+
writeJson({ ok: true, data, ...hints.length ? { hints } : {} });
|
|
25823
25882
|
} catch (err) {
|
|
25824
25883
|
if (err instanceof ApiError) {
|
|
25825
|
-
writeJson({
|
|
25884
|
+
writeJson({
|
|
25885
|
+
ok: false,
|
|
25886
|
+
error: {
|
|
25887
|
+
code: err.code,
|
|
25888
|
+
message: err.message,
|
|
25889
|
+
fix: STOCK_ERROR_FIX
|
|
25890
|
+
}
|
|
25891
|
+
});
|
|
25826
25892
|
process.exit(1);
|
|
25827
25893
|
}
|
|
25828
25894
|
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
@@ -28953,9 +29019,514 @@ var schemaCommand = defineCommand154({
|
|
|
28953
29019
|
}
|
|
28954
29020
|
});
|
|
28955
29021
|
|
|
28956
|
-
// src/commands/
|
|
29022
|
+
// src/commands/tag-manager/index.ts
|
|
29023
|
+
import { defineCommand as defineCommand158 } from "citty";
|
|
29024
|
+
|
|
29025
|
+
// src/commands/tag-manager/draft.ts
|
|
28957
29026
|
import { defineCommand as defineCommand155 } from "citty";
|
|
28958
29027
|
|
|
29028
|
+
// src/commands/tag-manager/shared.ts
|
|
29029
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
29030
|
+
function failValidation3(message) {
|
|
29031
|
+
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
29032
|
+
process.exit(1);
|
|
29033
|
+
}
|
|
29034
|
+
function requireTarget4(args, entity) {
|
|
29035
|
+
const positional = Array.isArray(args._) ? args._[0] : void 0;
|
|
29036
|
+
const target = args.id ?? args.target ?? positional;
|
|
29037
|
+
if (typeof target !== "string" || target.length === 0) {
|
|
29038
|
+
failValidation3(`pass the ${entity} id or path as the positional argument`);
|
|
29039
|
+
}
|
|
29040
|
+
return target;
|
|
29041
|
+
}
|
|
29042
|
+
function loadJsonArg(args, flag = "json") {
|
|
29043
|
+
const inline = args[flag];
|
|
29044
|
+
const file = args.file;
|
|
29045
|
+
const raw = typeof file === "string" && file.length > 0 ? readFileSync12(file, "utf8") : typeof inline === "string" && inline.length > 0 ? inline : void 0;
|
|
29046
|
+
if (raw === void 0) {
|
|
29047
|
+
failValidation3(`pass --${flag} with inline JSON or --file with a path to a JSON file`);
|
|
29048
|
+
}
|
|
29049
|
+
try {
|
|
29050
|
+
const parsed = JSON.parse(raw);
|
|
29051
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
29052
|
+
failValidation3(`--${flag} must be a JSON object`);
|
|
29053
|
+
}
|
|
29054
|
+
return parsed;
|
|
29055
|
+
} catch {
|
|
29056
|
+
return failValidation3(`--${flag} is not valid JSON`);
|
|
29057
|
+
}
|
|
29058
|
+
}
|
|
29059
|
+
function handleError3(err) {
|
|
29060
|
+
if (err instanceof ApiError) {
|
|
29061
|
+
const notConnected = err.code === "NOT_FOUND" || err.code === "UNAUTHORIZED";
|
|
29062
|
+
writeJsonEnvelope({
|
|
29063
|
+
ok: false,
|
|
29064
|
+
error: {
|
|
29065
|
+
code: err.code,
|
|
29066
|
+
message: err.message,
|
|
29067
|
+
...notConnected ? {
|
|
29068
|
+
fix: {
|
|
29069
|
+
action: "ask_user",
|
|
29070
|
+
explanation: "Tag Manager is not connected for this company yet. Ask the user to connect Tag Manager in Settings \u2192 Connections and pick the container to manage, then retry. Continue with the rest of the task in the meantime."
|
|
29071
|
+
}
|
|
29072
|
+
} : {},
|
|
29073
|
+
retryable: false
|
|
29074
|
+
}
|
|
29075
|
+
});
|
|
29076
|
+
process.exit(1);
|
|
29077
|
+
}
|
|
29078
|
+
writeJsonEnvelope({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
29079
|
+
process.exit(1);
|
|
29080
|
+
}
|
|
29081
|
+
function stageHints(response) {
|
|
29082
|
+
const hints = [];
|
|
29083
|
+
if (response.mode === "simulated") {
|
|
29084
|
+
hints.push(
|
|
29085
|
+
"Tag Manager writes are SIMULATED for this company \u2014 this change will not reach the real container on publish."
|
|
29086
|
+
);
|
|
29087
|
+
}
|
|
29088
|
+
hints.push(
|
|
29089
|
+
"Staged only. On publish these changes land in a new Tag Manager version that is NOT published \u2014 tell the user to publish that version in Tag Manager to make it live."
|
|
29090
|
+
);
|
|
29091
|
+
return hints;
|
|
29092
|
+
}
|
|
29093
|
+
async function stageOp3(op) {
|
|
29094
|
+
const chatId = requireChatId();
|
|
29095
|
+
try {
|
|
29096
|
+
const data = await apiPost("/api/tag-manager/draft/stage", { chatId, op });
|
|
29097
|
+
writeJsonEnvelope({ ok: true, data, hints: stageHints(data) });
|
|
29098
|
+
} catch (err) {
|
|
29099
|
+
handleError3(err);
|
|
29100
|
+
}
|
|
29101
|
+
}
|
|
29102
|
+
async function draftAction2(path27, body) {
|
|
29103
|
+
const chatId = requireChatId();
|
|
29104
|
+
try {
|
|
29105
|
+
const data = await apiPost(path27, { chatId, ...body });
|
|
29106
|
+
writeJsonEnvelope({ ok: true, data });
|
|
29107
|
+
return data;
|
|
29108
|
+
} catch (err) {
|
|
29109
|
+
handleError3(err);
|
|
29110
|
+
}
|
|
29111
|
+
}
|
|
29112
|
+
function renderDraft(response) {
|
|
29113
|
+
if (response.count === 0) {
|
|
29114
|
+
return "No Tag Manager changes staged on this chat.";
|
|
29115
|
+
}
|
|
29116
|
+
const lines = [
|
|
29117
|
+
`${response.count} staged Tag Manager change(s) \u2014 mode: ${response.mode}`,
|
|
29118
|
+
...response.ops.map((op) => {
|
|
29119
|
+
const status = op.result ? ` [${op.result.status}]` : "";
|
|
29120
|
+
return ` ${op.ref} ${op.summary}${status}`;
|
|
29121
|
+
})
|
|
29122
|
+
];
|
|
29123
|
+
if (response.versionId) {
|
|
29124
|
+
lines.push(
|
|
29125
|
+
"",
|
|
29126
|
+
`Applied into Tag Manager version ${response.versionId}. It is NOT published \u2014 publish it in Tag Manager to go live.`
|
|
29127
|
+
);
|
|
29128
|
+
}
|
|
29129
|
+
if (response.compilerError) {
|
|
29130
|
+
lines.push("", `Tag Manager reported a problem building the version: ${response.compilerError}`);
|
|
29131
|
+
}
|
|
29132
|
+
return lines.join("\n");
|
|
29133
|
+
}
|
|
29134
|
+
async function draftList(json) {
|
|
29135
|
+
const chatId = requireChatId();
|
|
29136
|
+
try {
|
|
29137
|
+
const data = await apiPost("/api/tag-manager/draft", { chatId });
|
|
29138
|
+
if (json) {
|
|
29139
|
+
writeJsonEnvelope({ ok: true, data });
|
|
29140
|
+
return;
|
|
29141
|
+
}
|
|
29142
|
+
process.stdout.write(`${renderDraft(data)}
|
|
29143
|
+
`);
|
|
29144
|
+
} catch (err) {
|
|
29145
|
+
handleError3(err);
|
|
29146
|
+
}
|
|
29147
|
+
}
|
|
29148
|
+
|
|
29149
|
+
// src/commands/tag-manager/draft.ts
|
|
29150
|
+
registerSchema({
|
|
29151
|
+
command: "tagManager.draft",
|
|
29152
|
+
description: "Review and undo the Tag Manager changes staged on this chat. Use `list` to see everything staged, `show` to inspect one change in full before publish, `amend` to correct one in place, and `remove`/`clear` to drop them.",
|
|
29153
|
+
args: {
|
|
29154
|
+
json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list", required: false }
|
|
29155
|
+
}
|
|
29156
|
+
});
|
|
29157
|
+
var draftCommand3 = defineCommand155({
|
|
29158
|
+
meta: {
|
|
29159
|
+
name: "draft",
|
|
29160
|
+
description: "List, show, amend, remove, or clear staged Tag Manager changes for this chat"
|
|
29161
|
+
},
|
|
29162
|
+
subCommands: {
|
|
29163
|
+
list: defineCommand155({
|
|
29164
|
+
meta: {
|
|
29165
|
+
name: "list",
|
|
29166
|
+
description: "Review everything staged on this chat (--json for the raw envelope)"
|
|
29167
|
+
},
|
|
29168
|
+
args: { json: { type: "boolean", description: "Print the raw JSON envelope", required: false } },
|
|
29169
|
+
run: async ({ args }) => {
|
|
29170
|
+
await draftList(args.json === true);
|
|
29171
|
+
}
|
|
29172
|
+
}),
|
|
29173
|
+
show: defineCommand155({
|
|
29174
|
+
meta: {
|
|
29175
|
+
name: "show",
|
|
29176
|
+
description: "Print the full staged payload for one change \u2014 the receipt to verify it looks right before publish (never truncated)."
|
|
29177
|
+
},
|
|
29178
|
+
args: { ref: { type: "positional", description: "Staged ref (gtm_temp_*) or target", required: false } },
|
|
29179
|
+
run: async ({ args }) => {
|
|
29180
|
+
await draftAction2("/api/tag-manager/draft/show", {
|
|
29181
|
+
ref: requireTarget4(args, "change")
|
|
29182
|
+
});
|
|
29183
|
+
}
|
|
29184
|
+
}),
|
|
29185
|
+
amend: defineCommand155({
|
|
29186
|
+
meta: {
|
|
29187
|
+
name: "amend",
|
|
29188
|
+
description: "Update a staged change in place \u2014 merges a JSON patch into its payload (objects deep-merge, null deletes a key, arrays/scalars replace) and re-validates. Use this instead of remove + re-create."
|
|
29189
|
+
},
|
|
29190
|
+
args: {
|
|
29191
|
+
ref: { type: "positional", description: "Staged ref (gtm_temp_*) or target", required: false },
|
|
29192
|
+
patch: { type: "string", description: "Inline JSON patch object", required: false },
|
|
29193
|
+
file: { type: "string", description: "JSON file with the patch object", required: false }
|
|
29194
|
+
},
|
|
29195
|
+
run: async ({ args }) => {
|
|
29196
|
+
await draftAction2("/api/tag-manager/draft/amend", {
|
|
29197
|
+
ref: requireTarget4(args, "change"),
|
|
29198
|
+
patch: loadJsonArg(args, "patch")
|
|
29199
|
+
});
|
|
29200
|
+
}
|
|
29201
|
+
}),
|
|
29202
|
+
remove: defineCommand155({
|
|
29203
|
+
meta: { name: "remove", description: "Remove one staged change (cascades to anything depending on it)" },
|
|
29204
|
+
args: { ref: { type: "positional", description: "Staged ref (gtm_temp_*) or target", required: false } },
|
|
29205
|
+
run: async ({ args }) => {
|
|
29206
|
+
await draftAction2("/api/tag-manager/draft/remove", {
|
|
29207
|
+
ref: requireTarget4(args, "change")
|
|
29208
|
+
});
|
|
29209
|
+
}
|
|
29210
|
+
}),
|
|
29211
|
+
clear: defineCommand155({
|
|
29212
|
+
meta: { name: "clear", description: "Discard all Tag Manager changes staged on this chat" },
|
|
29213
|
+
run: async () => {
|
|
29214
|
+
await draftAction2("/api/tag-manager/draft/clear", {});
|
|
29215
|
+
}
|
|
29216
|
+
})
|
|
29217
|
+
}
|
|
29218
|
+
});
|
|
29219
|
+
|
|
29220
|
+
// src/commands/tag-manager/read.ts
|
|
29221
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
29222
|
+
registerSchema({
|
|
29223
|
+
command: "tagManager.containers",
|
|
29224
|
+
description: "List the Google Tag Manager containers this company's connection can reach. The connected container is flagged. Start here to confirm which container you are managing.",
|
|
29225
|
+
args: {}
|
|
29226
|
+
});
|
|
29227
|
+
registerSchema({
|
|
29228
|
+
command: "tagManager.read",
|
|
29229
|
+
description: "Read what is currently inside a Tag Manager container: tags, triggers, variables, folders and enabled built-in variables. Start here before proposing any change, so you edit what exists instead of duplicating it. Compact by default; pass --full for raw Tag Manager objects.",
|
|
29230
|
+
args: {
|
|
29231
|
+
container: { type: "string", description: "Numeric container id (defaults to the connected one)", required: false },
|
|
29232
|
+
workspace: { type: "string", description: "Workspace id (defaults to the default workspace)", required: false },
|
|
29233
|
+
entities: {
|
|
29234
|
+
type: "string",
|
|
29235
|
+
description: "Comma-separated subset: tag,trigger,variable,folder,builtInVariable",
|
|
29236
|
+
required: false
|
|
29237
|
+
},
|
|
29238
|
+
full: { type: "boolean", description: "Include the raw Tag Manager object for each entity", required: false }
|
|
29239
|
+
}
|
|
29240
|
+
});
|
|
29241
|
+
function fail6(err) {
|
|
29242
|
+
if (err instanceof ApiError) {
|
|
29243
|
+
const notConnected = err.code === "NOT_FOUND" || err.code === "UNAUTHORIZED";
|
|
29244
|
+
writeJsonEnvelope({
|
|
29245
|
+
ok: false,
|
|
29246
|
+
error: {
|
|
29247
|
+
code: err.code,
|
|
29248
|
+
message: err.message,
|
|
29249
|
+
...notConnected ? {
|
|
29250
|
+
fix: {
|
|
29251
|
+
action: "ask_user",
|
|
29252
|
+
explanation: "Tag Manager is not connected for this company yet. Ask the user to connect Tag Manager in Settings \u2192 Connections and choose the container to manage, then retry. Continue with the rest of the task in the meantime."
|
|
29253
|
+
}
|
|
29254
|
+
} : {},
|
|
29255
|
+
retryable: false
|
|
29256
|
+
}
|
|
29257
|
+
});
|
|
29258
|
+
process.exit(1);
|
|
29259
|
+
}
|
|
29260
|
+
writeJsonEnvelope({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
29261
|
+
process.exit(1);
|
|
29262
|
+
}
|
|
29263
|
+
var containersCommand = defineCommand156({
|
|
29264
|
+
meta: {
|
|
29265
|
+
name: "containers",
|
|
29266
|
+
description: `List Tag Manager containers reachable by this company's connection.
|
|
29267
|
+
|
|
29268
|
+
Start here:
|
|
29269
|
+
baker tag-manager containers`
|
|
29270
|
+
},
|
|
29271
|
+
run: async () => {
|
|
29272
|
+
try {
|
|
29273
|
+
const data = await apiGet("/api/tag-manager/containers");
|
|
29274
|
+
writeJsonEnvelope({ ok: true, data });
|
|
29275
|
+
} catch (err) {
|
|
29276
|
+
fail6(err);
|
|
29277
|
+
}
|
|
29278
|
+
}
|
|
29279
|
+
});
|
|
29280
|
+
var readCommand = defineCommand156({
|
|
29281
|
+
meta: {
|
|
29282
|
+
name: "read",
|
|
29283
|
+
description: `Read the current contents of the Tag Manager container \u2014 always do this before staging changes.
|
|
29284
|
+
|
|
29285
|
+
Examples:
|
|
29286
|
+
baker tag-manager read
|
|
29287
|
+
baker tag-manager read --entities tag,trigger
|
|
29288
|
+
baker tag-manager read --full`
|
|
29289
|
+
},
|
|
29290
|
+
args: {
|
|
29291
|
+
container: { type: "string", description: "Numeric container id", required: false },
|
|
29292
|
+
workspace: { type: "string", description: "Workspace id", required: false },
|
|
29293
|
+
entities: { type: "string", description: "Comma-separated entity subset", required: false },
|
|
29294
|
+
full: { type: "boolean", description: "Include raw Tag Manager objects", required: false }
|
|
29295
|
+
},
|
|
29296
|
+
run: async ({ args }) => {
|
|
29297
|
+
const entities = typeof args.entities === "string" && args.entities.length > 0 ? args.entities.split(",").map((entry) => entry.trim()) : void 0;
|
|
29298
|
+
try {
|
|
29299
|
+
const data = await apiPost("/api/tag-manager/read", {
|
|
29300
|
+
containerId: args.container,
|
|
29301
|
+
workspaceId: args.workspace,
|
|
29302
|
+
entities,
|
|
29303
|
+
full: args.full === true
|
|
29304
|
+
});
|
|
29305
|
+
const hints = [];
|
|
29306
|
+
if (data.installedContainerMismatch) {
|
|
29307
|
+
hints.push(data.installedContainerMismatch);
|
|
29308
|
+
}
|
|
29309
|
+
hints.push(
|
|
29310
|
+
"Reference an existing trigger or variable by its numeric id or {{Name}}. To reference something you are staging in this same chat, use its gtm_temp_* ref and the executor resolves it at publish."
|
|
29311
|
+
);
|
|
29312
|
+
writeJsonEnvelope({ ok: true, data, hints });
|
|
29313
|
+
} catch (err) {
|
|
29314
|
+
fail6(err);
|
|
29315
|
+
}
|
|
29316
|
+
}
|
|
29317
|
+
});
|
|
29318
|
+
|
|
29319
|
+
// src/commands/tag-manager/write-commands.ts
|
|
29320
|
+
import { defineCommand as defineCommand157 } from "citty";
|
|
29321
|
+
var ENTITIES = [
|
|
29322
|
+
{
|
|
29323
|
+
entity: "tag",
|
|
29324
|
+
noun: "tag",
|
|
29325
|
+
createHint: 'Payload needs name + type (e.g. "gaawe" for a GA4 event) and usually parameter[] and firingTriggerId[]. Reference a trigger by its numeric id, or by a gtm_temp_* ref if you are staging it in this same chat.'
|
|
29326
|
+
},
|
|
29327
|
+
{
|
|
29328
|
+
entity: "trigger",
|
|
29329
|
+
noun: "trigger",
|
|
29330
|
+
createHint: 'Payload needs name + type (e.g. "pageview", "click", "customEvent"). Stage the trigger BEFORE the tag that fires on it, then reference it by its gtm_temp_* ref.'
|
|
29331
|
+
},
|
|
29332
|
+
{
|
|
29333
|
+
entity: "variable",
|
|
29334
|
+
noun: "variable",
|
|
29335
|
+
createHint: 'Payload needs name + type (e.g. "v" for a data layer variable, "c" for a constant). Other entities reference a variable by NAME as {{Variable Name}}.'
|
|
29336
|
+
},
|
|
29337
|
+
{
|
|
29338
|
+
entity: "folder",
|
|
29339
|
+
noun: "folder",
|
|
29340
|
+
createHint: "Payload needs name. Use folders to keep a large container legible."
|
|
29341
|
+
}
|
|
29342
|
+
];
|
|
29343
|
+
for (const { entity, noun, createHint } of ENTITIES) {
|
|
29344
|
+
registerSchema({
|
|
29345
|
+
command: `tagManager.${entity}.create`,
|
|
29346
|
+
description: `Stage the creation of a Tag Manager ${noun}. ${createHint} Staged only \u2014 applies on publish into an unpublished container version.`,
|
|
29347
|
+
args: {
|
|
29348
|
+
json: { type: "string", description: `Inline JSON ${noun} definition`, required: false },
|
|
29349
|
+
file: { type: "string", description: `Path to a JSON file with the ${noun} definition`, required: false },
|
|
29350
|
+
container: { type: "string", description: "Numeric container id", required: false }
|
|
29351
|
+
}
|
|
29352
|
+
});
|
|
29353
|
+
registerSchema({
|
|
29354
|
+
command: `tagManager.${entity}.update`,
|
|
29355
|
+
description: `Stage an update to an existing Tag Manager ${noun}. Pass the ${noun} id or path as the positional argument and the changed fields as JSON. Read the container first so you send the fields you mean to change.`,
|
|
29356
|
+
args: {
|
|
29357
|
+
json: { type: "string", description: "Inline JSON with the changed fields", required: false },
|
|
29358
|
+
file: { type: "string", description: "Path to a JSON file with the changed fields", required: false }
|
|
29359
|
+
}
|
|
29360
|
+
});
|
|
29361
|
+
registerSchema({
|
|
29362
|
+
command: `tagManager.${entity}.delete`,
|
|
29363
|
+
description: `Stage the deletion of a Tag Manager ${noun}. Pass its id or path as the positional argument. Deleting is irreversible once the resulting version is published \u2014 confirm with the user first.`,
|
|
29364
|
+
args: {}
|
|
29365
|
+
});
|
|
29366
|
+
}
|
|
29367
|
+
function entityCommand(entity, noun) {
|
|
29368
|
+
return defineCommand157({
|
|
29369
|
+
meta: { name: entity, description: `Stage ${noun} changes on this chat's Tag Manager draft` },
|
|
29370
|
+
subCommands: {
|
|
29371
|
+
create: defineCommand157({
|
|
29372
|
+
meta: {
|
|
29373
|
+
name: "create",
|
|
29374
|
+
description: `Stage a new ${noun}
|
|
29375
|
+
|
|
29376
|
+
Examples:
|
|
29377
|
+
baker tag-manager ${entity} create --json '{"name":"GA4 Config","type":"googtag"}'
|
|
29378
|
+
baker tag-manager ${entity} create --file ./${entity}.json`
|
|
29379
|
+
},
|
|
29380
|
+
args: {
|
|
29381
|
+
json: { type: "string", description: "Inline JSON definition", required: false },
|
|
29382
|
+
file: { type: "string", description: "Path to a JSON file", required: false },
|
|
29383
|
+
container: { type: "string", description: "Numeric container id", required: false }
|
|
29384
|
+
},
|
|
29385
|
+
run: async ({ args }) => {
|
|
29386
|
+
await stageOp3({
|
|
29387
|
+
kind: `tagManager.${entity}.create`,
|
|
29388
|
+
payload: loadJsonArg(args),
|
|
29389
|
+
...typeof args.container === "string" ? { containerId: args.container } : {}
|
|
29390
|
+
});
|
|
29391
|
+
}
|
|
29392
|
+
}),
|
|
29393
|
+
update: defineCommand157({
|
|
29394
|
+
meta: {
|
|
29395
|
+
name: "update",
|
|
29396
|
+
description: `Stage an update to an existing ${noun} (pass its id or path)`
|
|
29397
|
+
},
|
|
29398
|
+
args: {
|
|
29399
|
+
id: { type: "positional", description: `${noun} id or path`, required: false },
|
|
29400
|
+
json: { type: "string", description: "Inline JSON with changed fields", required: false },
|
|
29401
|
+
file: { type: "string", description: "Path to a JSON file", required: false },
|
|
29402
|
+
container: { type: "string", description: "Numeric container id", required: false }
|
|
29403
|
+
},
|
|
29404
|
+
run: async ({ args }) => {
|
|
29405
|
+
await stageOp3({
|
|
29406
|
+
kind: `tagManager.${entity}.update`,
|
|
29407
|
+
target: requireTarget4(args, noun),
|
|
29408
|
+
payload: loadJsonArg(args),
|
|
29409
|
+
...typeof args.container === "string" ? { containerId: args.container } : {}
|
|
29410
|
+
});
|
|
29411
|
+
}
|
|
29412
|
+
}),
|
|
29413
|
+
delete: defineCommand157({
|
|
29414
|
+
meta: { name: "delete", description: `Stage the deletion of a ${noun} (pass its id or path)` },
|
|
29415
|
+
args: {
|
|
29416
|
+
id: { type: "positional", description: `${noun} id or path`, required: false },
|
|
29417
|
+
container: { type: "string", description: "Numeric container id", required: false }
|
|
29418
|
+
},
|
|
29419
|
+
run: async ({ args }) => {
|
|
29420
|
+
await stageOp3({
|
|
29421
|
+
kind: `tagManager.${entity}.delete`,
|
|
29422
|
+
target: requireTarget4(args, noun),
|
|
29423
|
+
...typeof args.container === "string" ? { containerId: args.container } : {}
|
|
29424
|
+
});
|
|
29425
|
+
}
|
|
29426
|
+
})
|
|
29427
|
+
}
|
|
29428
|
+
});
|
|
29429
|
+
}
|
|
29430
|
+
var tagCommand = entityCommand("tag", "tag");
|
|
29431
|
+
var triggerCommand2 = entityCommand("trigger", "trigger");
|
|
29432
|
+
var variableCommand = entityCommand("variable", "variable");
|
|
29433
|
+
var folderCommand = entityCommand("folder", "folder");
|
|
29434
|
+
registerSchema({
|
|
29435
|
+
command: "tagManager.builtin",
|
|
29436
|
+
description: "Enable or disable Tag Manager built-in variables by type (e.g. clickUrl, pageUrl, formId). Built-in variables must be enabled before a trigger or tag can reference them as {{Click URL}}.",
|
|
29437
|
+
args: {
|
|
29438
|
+
types: { type: "string", description: "Comma-separated built-in variable types", required: true }
|
|
29439
|
+
}
|
|
29440
|
+
});
|
|
29441
|
+
function builtinTypes(args) {
|
|
29442
|
+
const raw = args.types;
|
|
29443
|
+
if (typeof raw !== "string" || raw.length === 0) {
|
|
29444
|
+
process.stdout.write(
|
|
29445
|
+
`${JSON.stringify({ ok: false, error: { code: "VALIDATION_ERROR", message: "pass --types with comma-separated built-in variable types" } }, null, 2)}
|
|
29446
|
+
`
|
|
29447
|
+
);
|
|
29448
|
+
process.exit(1);
|
|
29449
|
+
}
|
|
29450
|
+
return raw.split(",").map((entry) => entry.trim());
|
|
29451
|
+
}
|
|
29452
|
+
var builtinCommand = defineCommand157({
|
|
29453
|
+
meta: {
|
|
29454
|
+
name: "builtin",
|
|
29455
|
+
description: `Enable or disable built-in variables
|
|
29456
|
+
|
|
29457
|
+
Examples:
|
|
29458
|
+
baker tag-manager builtin enable --types clickUrl,clickText
|
|
29459
|
+
baker tag-manager builtin disable --types formId`
|
|
29460
|
+
},
|
|
29461
|
+
subCommands: {
|
|
29462
|
+
enable: defineCommand157({
|
|
29463
|
+
meta: { name: "enable", description: "Stage enabling built-in variables" },
|
|
29464
|
+
args: {
|
|
29465
|
+
types: { type: "string", description: "Comma-separated types", required: false },
|
|
29466
|
+
container: { type: "string", description: "Numeric container id", required: false }
|
|
29467
|
+
},
|
|
29468
|
+
run: async ({ args }) => {
|
|
29469
|
+
await stageOp3({
|
|
29470
|
+
kind: "tagManager.builtInVariable.enable",
|
|
29471
|
+
payload: { type: builtinTypes(args) },
|
|
29472
|
+
...typeof args.container === "string" ? { containerId: args.container } : {}
|
|
29473
|
+
});
|
|
29474
|
+
}
|
|
29475
|
+
}),
|
|
29476
|
+
disable: defineCommand157({
|
|
29477
|
+
meta: { name: "disable", description: "Stage disabling built-in variables" },
|
|
29478
|
+
args: {
|
|
29479
|
+
types: { type: "string", description: "Comma-separated types", required: false },
|
|
29480
|
+
container: { type: "string", description: "Numeric container id", required: false }
|
|
29481
|
+
},
|
|
29482
|
+
run: async ({ args }) => {
|
|
29483
|
+
await stageOp3({
|
|
29484
|
+
kind: "tagManager.builtInVariable.disable",
|
|
29485
|
+
payload: { type: builtinTypes(args) },
|
|
29486
|
+
...typeof args.container === "string" ? { containerId: args.container } : {}
|
|
29487
|
+
});
|
|
29488
|
+
}
|
|
29489
|
+
})
|
|
29490
|
+
}
|
|
29491
|
+
});
|
|
29492
|
+
|
|
29493
|
+
// src/commands/tag-manager/index.ts
|
|
29494
|
+
var tagManagerCommand = defineCommand158({
|
|
29495
|
+
meta: {
|
|
29496
|
+
name: "tag-manager",
|
|
29497
|
+
description: `Read and change what lives inside the client's Google Tag Manager container \u2014 tags, triggers, variables, folders and built-in variables.
|
|
29498
|
+
|
|
29499
|
+
Start here:
|
|
29500
|
+
baker tag-manager read \u2014 see what the container holds today
|
|
29501
|
+
|
|
29502
|
+
Then stage changes (nothing is sent to Tag Manager until publish):
|
|
29503
|
+
baker tag-manager trigger create --json '{"name":"Quote Submit","type":"customEvent"}'
|
|
29504
|
+
baker tag-manager tag create --json '{"name":"GA4 Quote","type":"gaawe","firingTriggerId":["gtm_temp_trigger_..."]}'
|
|
29505
|
+
baker tag-manager draft list \u2014 review everything staged
|
|
29506
|
+
|
|
29507
|
+
On publish, staged changes are written into a new Tag Manager version that is NOT published.
|
|
29508
|
+
Tell the user to publish that version in Tag Manager to make it live.
|
|
29509
|
+
|
|
29510
|
+
This owns the CONTENTS of the container. Installing the container snippet on the site is a
|
|
29511
|
+
different job \u2014 that is \`baker tags\` with the googleTagManager tag.
|
|
29512
|
+
|
|
29513
|
+
Full guide: __tooling__/docs/tools/baker/tag-manager.md`
|
|
29514
|
+
},
|
|
29515
|
+
subCommands: {
|
|
29516
|
+
containers: containersCommand,
|
|
29517
|
+
read: readCommand,
|
|
29518
|
+
tag: tagCommand,
|
|
29519
|
+
trigger: triggerCommand2,
|
|
29520
|
+
variable: variableCommand,
|
|
29521
|
+
folder: folderCommand,
|
|
29522
|
+
builtin: builtinCommand,
|
|
29523
|
+
draft: draftCommand3
|
|
29524
|
+
}
|
|
29525
|
+
});
|
|
29526
|
+
|
|
29527
|
+
// src/commands/tags/index.ts
|
|
29528
|
+
import { defineCommand as defineCommand159 } from "citty";
|
|
29529
|
+
|
|
28959
29530
|
// src/commands/tags/shared.ts
|
|
28960
29531
|
function failApi3(err) {
|
|
28961
29532
|
if (err instanceof ApiError) {
|
|
@@ -29020,7 +29591,7 @@ async function listTags(json) {
|
|
|
29020
29591
|
failApi3(err);
|
|
29021
29592
|
}
|
|
29022
29593
|
}
|
|
29023
|
-
var listCommand10 =
|
|
29594
|
+
var listCommand10 = defineCommand159({
|
|
29024
29595
|
meta: {
|
|
29025
29596
|
name: "list",
|
|
29026
29597
|
description: "Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) \u2014 reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
|
|
@@ -29039,7 +29610,7 @@ async function listDraft3() {
|
|
|
29039
29610
|
failApi3(err);
|
|
29040
29611
|
}
|
|
29041
29612
|
}
|
|
29042
|
-
var
|
|
29613
|
+
var draftCommand4 = defineCommand159({
|
|
29043
29614
|
meta: {
|
|
29044
29615
|
name: "draft",
|
|
29045
29616
|
description: "Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published; to amend or drop one, propose a follow-up change through the same tool (a delete on a tag_temp_* ref drops the staged create)."
|
|
@@ -29048,7 +29619,7 @@ var draftCommand3 = defineCommand155({
|
|
|
29048
29619
|
await listDraft3();
|
|
29049
29620
|
}
|
|
29050
29621
|
});
|
|
29051
|
-
var tagsCommand3 =
|
|
29622
|
+
var tagsCommand3 = defineCommand159({
|
|
29052
29623
|
meta: {
|
|
29053
29624
|
name: "tags",
|
|
29054
29625
|
description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, \u2026) \u2014 production tags plus the changes staged in this chat.
|
|
@@ -29066,7 +29637,7 @@ Full guide: __tooling__/docs/tools/baker/tags.md`
|
|
|
29066
29637
|
},
|
|
29067
29638
|
subCommands: {
|
|
29068
29639
|
list: listCommand10,
|
|
29069
|
-
draft:
|
|
29640
|
+
draft: draftCommand4
|
|
29070
29641
|
},
|
|
29071
29642
|
run: async () => {
|
|
29072
29643
|
await listTags(false);
|
|
@@ -29074,10 +29645,10 @@ Full guide: __tooling__/docs/tools/baker/tags.md`
|
|
|
29074
29645
|
});
|
|
29075
29646
|
|
|
29076
29647
|
// src/commands/testimonials/index.ts
|
|
29077
|
-
import { defineCommand as
|
|
29648
|
+
import { defineCommand as defineCommand163 } from "citty";
|
|
29078
29649
|
|
|
29079
29650
|
// src/commands/testimonials/get.ts
|
|
29080
|
-
import { defineCommand as
|
|
29651
|
+
import { defineCommand as defineCommand160 } from "citty";
|
|
29081
29652
|
registerSchema({
|
|
29082
29653
|
command: "testimonials.get",
|
|
29083
29654
|
description: "Get a single testimonial by ID",
|
|
@@ -29085,7 +29656,7 @@ registerSchema({
|
|
|
29085
29656
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
29086
29657
|
}
|
|
29087
29658
|
});
|
|
29088
|
-
var getCommand4 =
|
|
29659
|
+
var getCommand4 = defineCommand160({
|
|
29089
29660
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
29090
29661
|
args: {
|
|
29091
29662
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -29122,7 +29693,7 @@ var getCommand4 = defineCommand156({
|
|
|
29122
29693
|
});
|
|
29123
29694
|
|
|
29124
29695
|
// src/commands/testimonials/list.ts
|
|
29125
|
-
import { defineCommand as
|
|
29696
|
+
import { defineCommand as defineCommand161 } from "citty";
|
|
29126
29697
|
registerSchema({
|
|
29127
29698
|
command: "testimonials.list",
|
|
29128
29699
|
description: "List testimonials with optional filters.",
|
|
@@ -29152,7 +29723,7 @@ registerSchema({
|
|
|
29152
29723
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
29153
29724
|
}
|
|
29154
29725
|
});
|
|
29155
|
-
var listCommand11 =
|
|
29726
|
+
var listCommand11 = defineCommand161({
|
|
29156
29727
|
meta: {
|
|
29157
29728
|
name: "list",
|
|
29158
29729
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -29201,7 +29772,7 @@ var listCommand11 = defineCommand157({
|
|
|
29201
29772
|
});
|
|
29202
29773
|
|
|
29203
29774
|
// src/commands/testimonials/search.ts
|
|
29204
|
-
import { defineCommand as
|
|
29775
|
+
import { defineCommand as defineCommand162 } from "citty";
|
|
29205
29776
|
function languageBiasHint(results, requestedLanguage) {
|
|
29206
29777
|
if (requestedLanguage) {
|
|
29207
29778
|
return null;
|
|
@@ -29279,7 +29850,7 @@ function buildSearchRequest(query, args) {
|
|
|
29279
29850
|
}
|
|
29280
29851
|
return body;
|
|
29281
29852
|
}
|
|
29282
|
-
var searchCommand2 =
|
|
29853
|
+
var searchCommand2 = defineCommand162({
|
|
29283
29854
|
meta: {
|
|
29284
29855
|
name: "search",
|
|
29285
29856
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -29335,7 +29906,7 @@ var searchCommand2 = defineCommand158({
|
|
|
29335
29906
|
var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
29336
29907
|
|
|
29337
29908
|
// src/commands/testimonials/index.ts
|
|
29338
|
-
var testimonialsCommand =
|
|
29909
|
+
var testimonialsCommand = defineCommand163({
|
|
29339
29910
|
meta: {
|
|
29340
29911
|
name: "testimonials",
|
|
29341
29912
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -29357,10 +29928,10 @@ Full guide: __tooling__/docs/tools/baker/testimonials.md`
|
|
|
29357
29928
|
});
|
|
29358
29929
|
|
|
29359
29930
|
// src/commands/videos/index.ts
|
|
29360
|
-
import { defineCommand as
|
|
29931
|
+
import { defineCommand as defineCommand168 } from "citty";
|
|
29361
29932
|
|
|
29362
29933
|
// src/commands/videos/delete.ts
|
|
29363
|
-
import { defineCommand as
|
|
29934
|
+
import { defineCommand as defineCommand164 } from "citty";
|
|
29364
29935
|
registerSchema({
|
|
29365
29936
|
command: "videos.delete",
|
|
29366
29937
|
description: "Delete a video by ID",
|
|
@@ -29374,7 +29945,7 @@ registerSchema({
|
|
|
29374
29945
|
}
|
|
29375
29946
|
}
|
|
29376
29947
|
});
|
|
29377
|
-
var deleteCommand3 =
|
|
29948
|
+
var deleteCommand3 = defineCommand164({
|
|
29378
29949
|
meta: {
|
|
29379
29950
|
name: "delete",
|
|
29380
29951
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -29415,7 +29986,7 @@ var deleteCommand3 = defineCommand160({
|
|
|
29415
29986
|
});
|
|
29416
29987
|
|
|
29417
29988
|
// src/commands/videos/get.ts
|
|
29418
|
-
import { defineCommand as
|
|
29989
|
+
import { defineCommand as defineCommand165 } from "citty";
|
|
29419
29990
|
registerSchema({
|
|
29420
29991
|
command: "videos.get",
|
|
29421
29992
|
description: "Get a single video by ID",
|
|
@@ -29423,7 +29994,7 @@ registerSchema({
|
|
|
29423
29994
|
id: { type: "string", description: "Video ID", required: true }
|
|
29424
29995
|
}
|
|
29425
29996
|
});
|
|
29426
|
-
var getCommand5 =
|
|
29997
|
+
var getCommand5 = defineCommand165({
|
|
29427
29998
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
29428
29999
|
args: {
|
|
29429
30000
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -29460,7 +30031,7 @@ var getCommand5 = defineCommand161({
|
|
|
29460
30031
|
});
|
|
29461
30032
|
|
|
29462
30033
|
// src/commands/videos/search.ts
|
|
29463
|
-
import { defineCommand as
|
|
30034
|
+
import { defineCommand as defineCommand166 } from "citty";
|
|
29464
30035
|
registerSchema({
|
|
29465
30036
|
command: "videos.search",
|
|
29466
30037
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -29470,7 +30041,7 @@ registerSchema({
|
|
|
29470
30041
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
29471
30042
|
}
|
|
29472
30043
|
});
|
|
29473
|
-
var searchCommand3 =
|
|
30044
|
+
var searchCommand3 = defineCommand166({
|
|
29474
30045
|
meta: {
|
|
29475
30046
|
name: "search",
|
|
29476
30047
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -29522,7 +30093,7 @@ var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
|
29522
30093
|
// src/commands/videos/upload.ts
|
|
29523
30094
|
import { readFile as readFile22, stat as stat7 } from "fs/promises";
|
|
29524
30095
|
import { extname as extname3 } from "path";
|
|
29525
|
-
import { defineCommand as
|
|
30096
|
+
import { defineCommand as defineCommand167 } from "citty";
|
|
29526
30097
|
var MIME_MAP = {
|
|
29527
30098
|
".mp4": "video/mp4",
|
|
29528
30099
|
".mov": "video/quicktime",
|
|
@@ -29556,7 +30127,7 @@ function detectContentType(filePath) {
|
|
|
29556
30127
|
}
|
|
29557
30128
|
return mime;
|
|
29558
30129
|
}
|
|
29559
|
-
var uploadCommand2 =
|
|
30130
|
+
var uploadCommand2 = defineCommand167({
|
|
29560
30131
|
meta: {
|
|
29561
30132
|
name: "upload",
|
|
29562
30133
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -29610,7 +30181,7 @@ var uploadCommand2 = defineCommand163({
|
|
|
29610
30181
|
});
|
|
29611
30182
|
|
|
29612
30183
|
// src/commands/videos/index.ts
|
|
29613
|
-
var videosCommand =
|
|
30184
|
+
var videosCommand = defineCommand168({
|
|
29614
30185
|
meta: {
|
|
29615
30186
|
name: "videos",
|
|
29616
30187
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -29634,10 +30205,10 @@ Full guide: __tooling__/docs/tools/baker/videos.md`
|
|
|
29634
30205
|
});
|
|
29635
30206
|
|
|
29636
30207
|
// src/commands/winning-ads/index.ts
|
|
29637
|
-
import { defineCommand as
|
|
30208
|
+
import { defineCommand as defineCommand181 } from "citty";
|
|
29638
30209
|
|
|
29639
30210
|
// src/commands/winning-ads/advertisers.ts
|
|
29640
|
-
import { defineCommand as
|
|
30211
|
+
import { defineCommand as defineCommand169 } from "citty";
|
|
29641
30212
|
|
|
29642
30213
|
// src/commands/winning-ads/shared.ts
|
|
29643
30214
|
function splitList(value) {
|
|
@@ -29690,7 +30261,7 @@ function advertiserNormalizer(record, full) {
|
|
|
29690
30261
|
last_synced_at: record.last_synced_at ?? null
|
|
29691
30262
|
};
|
|
29692
30263
|
}
|
|
29693
|
-
var advertisersCommand2 =
|
|
30264
|
+
var advertisersCommand2 = defineCommand169({
|
|
29694
30265
|
meta: {
|
|
29695
30266
|
name: "advertisers",
|
|
29696
30267
|
description: 'List corpus advertisers by name or domain. Find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id / winners. Example: baker winning-ads advertisers "Deel" --output md'
|
|
@@ -29748,7 +30319,7 @@ var advertisersCommand2 = defineCommand165({
|
|
|
29748
30319
|
});
|
|
29749
30320
|
|
|
29750
30321
|
// src/commands/winning-ads/brief.ts
|
|
29751
|
-
import { defineCommand as
|
|
30322
|
+
import { defineCommand as defineCommand170 } from "citty";
|
|
29752
30323
|
registerSchema({
|
|
29753
30324
|
command: "winning-ads.brief",
|
|
29754
30325
|
description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
|
|
@@ -29794,7 +30365,7 @@ function parseDna(raw) {
|
|
|
29794
30365
|
}
|
|
29795
30366
|
return parsed;
|
|
29796
30367
|
}
|
|
29797
|
-
var briefCommand =
|
|
30368
|
+
var briefCommand = defineCommand170({
|
|
29798
30369
|
meta: {
|
|
29799
30370
|
name: "brief",
|
|
29800
30371
|
description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
|
|
@@ -29830,7 +30401,7 @@ var briefCommand = defineCommand166({
|
|
|
29830
30401
|
});
|
|
29831
30402
|
|
|
29832
30403
|
// src/commands/winning-ads/content.ts
|
|
29833
|
-
import { defineCommand as
|
|
30404
|
+
import { defineCommand as defineCommand171 } from "citty";
|
|
29834
30405
|
registerSchema({
|
|
29835
30406
|
command: "winning-ads.content",
|
|
29836
30407
|
description: "Read what's INSIDE one winning ad: the spoken transcript, the on-screen text, and the ad copy. Use this after `search`/`winners`/`feed` return a shortlist \u2014 pass an ad_id to understand a reference before reproducing it. Add --full for speech, pacing, and soundtrack detail. Video ads carry the transcript/on-screen text; static ads carry only the copy.",
|
|
@@ -29843,7 +30414,7 @@ registerSchema({
|
|
|
29843
30414
|
}
|
|
29844
30415
|
}
|
|
29845
30416
|
});
|
|
29846
|
-
var contentCommand =
|
|
30417
|
+
var contentCommand = defineCommand171({
|
|
29847
30418
|
meta: {
|
|
29848
30419
|
name: "content",
|
|
29849
30420
|
description: "Read the transcript + on-screen text + copy of one winning ad. Example: baker winning-ads content adg_123 --platform meta --full --output md"
|
|
@@ -29892,7 +30463,7 @@ var contentCommand = defineCommand167({
|
|
|
29892
30463
|
});
|
|
29893
30464
|
|
|
29894
30465
|
// src/commands/winning-ads/feed.ts
|
|
29895
|
-
import { defineCommand as
|
|
30466
|
+
import { defineCommand as defineCommand172 } from "citty";
|
|
29896
30467
|
function buildFeedParams(input) {
|
|
29897
30468
|
const params = {};
|
|
29898
30469
|
const advertiser = splitList(input.advertiser);
|
|
@@ -29944,7 +30515,7 @@ registerSchema({
|
|
|
29944
30515
|
format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
|
|
29945
30516
|
}
|
|
29946
30517
|
});
|
|
29947
|
-
var feedCommand =
|
|
30518
|
+
var feedCommand = defineCommand172({
|
|
29948
30519
|
meta: {
|
|
29949
30520
|
name: "feed",
|
|
29950
30521
|
description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
|
|
@@ -30029,7 +30600,7 @@ var feedCommand = defineCommand168({
|
|
|
30029
30600
|
});
|
|
30030
30601
|
|
|
30031
30602
|
// src/commands/winning-ads/follow.ts
|
|
30032
|
-
import { defineCommand as
|
|
30603
|
+
import { defineCommand as defineCommand173 } from "citty";
|
|
30033
30604
|
var PLATFORMS = ["meta", "linkedin"];
|
|
30034
30605
|
registerSchema({
|
|
30035
30606
|
command: "winning-ads.follow",
|
|
@@ -30044,7 +30615,7 @@ registerSchema({
|
|
|
30044
30615
|
label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
|
|
30045
30616
|
}
|
|
30046
30617
|
});
|
|
30047
|
-
var followCommand =
|
|
30618
|
+
var followCommand = defineCommand173({
|
|
30048
30619
|
meta: {
|
|
30049
30620
|
name: "follow",
|
|
30050
30621
|
description: 'Follow a brand to track ALL its ads \u2014 every platform and country. --platform is how we read your input, not a limit. A domain tracks both Meta + LinkedIn. Example: baker winning-ads follow "deel.com" --platform meta'
|
|
@@ -30091,7 +30662,7 @@ var followCommand = defineCommand169({
|
|
|
30091
30662
|
});
|
|
30092
30663
|
|
|
30093
30664
|
// src/commands/winning-ads/follow-competitors.ts
|
|
30094
|
-
import { defineCommand as
|
|
30665
|
+
import { defineCommand as defineCommand174 } from "citty";
|
|
30095
30666
|
var PLATFORMS2 = ["meta", "linkedin"];
|
|
30096
30667
|
var BATCH_TIMEOUT_MS = 3e5;
|
|
30097
30668
|
function buildFollowBatchBody(input) {
|
|
@@ -30124,7 +30695,7 @@ registerSchema({
|
|
|
30124
30695
|
}
|
|
30125
30696
|
}
|
|
30126
30697
|
});
|
|
30127
|
-
var followCompetitorsCommand =
|
|
30698
|
+
var followCompetitorsCommand = defineCommand174({
|
|
30128
30699
|
meta: {
|
|
30129
30700
|
name: "follow-competitors",
|
|
30130
30701
|
description: 'Follow many brands at once by domain \u2014 add every competitor in one call. Example: baker winning-ads follow-competitors "deel.com,notion.so,hubspot.com"'
|
|
@@ -30199,7 +30770,7 @@ var followCompetitorsCommand = defineCommand170({
|
|
|
30199
30770
|
});
|
|
30200
30771
|
|
|
30201
30772
|
// src/commands/winning-ads/following.ts
|
|
30202
|
-
import { defineCommand as
|
|
30773
|
+
import { defineCommand as defineCommand175 } from "citty";
|
|
30203
30774
|
registerSchema({
|
|
30204
30775
|
command: "winning-ads.following",
|
|
30205
30776
|
description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
|
|
@@ -30232,7 +30803,7 @@ function followingNormalizer(record, full) {
|
|
|
30232
30803
|
platforms: Array.isArray(record.platforms) ? record.platforms : []
|
|
30233
30804
|
};
|
|
30234
30805
|
}
|
|
30235
|
-
var followingCommand =
|
|
30806
|
+
var followingCommand = defineCommand175({
|
|
30236
30807
|
meta: {
|
|
30237
30808
|
name: "following",
|
|
30238
30809
|
description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
|
|
@@ -30267,7 +30838,7 @@ var followingCommand = defineCommand171({
|
|
|
30267
30838
|
});
|
|
30268
30839
|
|
|
30269
30840
|
// src/commands/winning-ads/patterns.ts
|
|
30270
|
-
import { defineCommand as
|
|
30841
|
+
import { defineCommand as defineCommand176 } from "citty";
|
|
30271
30842
|
registerSchema({
|
|
30272
30843
|
command: "winning-ads.patterns",
|
|
30273
30844
|
description: "Mine what separates two cohorts of ads: pass a comma-list of winning ad ids (--winners) and a comma-list of weaker ad ids (--duds). Returns the discriminating DNA fields.",
|
|
@@ -30306,7 +30877,7 @@ function discriminatorRow(record) {
|
|
|
30306
30877
|
top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
|
|
30307
30878
|
};
|
|
30308
30879
|
}
|
|
30309
|
-
var patternsCommand =
|
|
30880
|
+
var patternsCommand = defineCommand176({
|
|
30310
30881
|
meta: {
|
|
30311
30882
|
name: "patterns",
|
|
30312
30883
|
description: "Discover what separates winning ads from weak ones. Example: baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --output md"
|
|
@@ -30362,7 +30933,7 @@ var patternsCommand = defineCommand172({
|
|
|
30362
30933
|
});
|
|
30363
30934
|
|
|
30364
30935
|
// src/commands/winning-ads/search.ts
|
|
30365
|
-
import { defineCommand as
|
|
30936
|
+
import { defineCommand as defineCommand177 } from "citty";
|
|
30366
30937
|
registerSchema({
|
|
30367
30938
|
command: "winning-ads.search",
|
|
30368
30939
|
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.",
|
|
@@ -30470,7 +31041,7 @@ function buildSearchBody(args) {
|
|
|
30470
31041
|
}
|
|
30471
31042
|
return body;
|
|
30472
31043
|
}
|
|
30473
|
-
var searchCommand4 =
|
|
31044
|
+
var searchCommand4 = defineCommand177({
|
|
30474
31045
|
meta: {
|
|
30475
31046
|
name: "search",
|
|
30476
31047
|
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"
|
|
@@ -30585,7 +31156,7 @@ var searchCommand4 = defineCommand173({
|
|
|
30585
31156
|
});
|
|
30586
31157
|
|
|
30587
31158
|
// src/commands/winning-ads/seeds.ts
|
|
30588
|
-
import { defineCommand as
|
|
31159
|
+
import { defineCommand as defineCommand178 } from "citty";
|
|
30589
31160
|
function leanRow(r) {
|
|
30590
31161
|
return {
|
|
30591
31162
|
key: r.key,
|
|
@@ -30613,7 +31184,7 @@ function makeSeedCommand(opts) {
|
|
|
30613
31184
|
limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
|
|
30614
31185
|
}
|
|
30615
31186
|
});
|
|
30616
|
-
return
|
|
31187
|
+
return defineCommand178({
|
|
30617
31188
|
meta: { name: opts.name, description: opts.description },
|
|
30618
31189
|
args: {
|
|
30619
31190
|
platform: { type: "string", description: "Single platform to segment on", required: false },
|
|
@@ -30662,7 +31233,7 @@ var formatsCommand = makeSeedCommand({
|
|
|
30662
31233
|
});
|
|
30663
31234
|
|
|
30664
31235
|
// src/commands/winning-ads/unfollow.ts
|
|
30665
|
-
import { defineCommand as
|
|
31236
|
+
import { defineCommand as defineCommand179 } from "citty";
|
|
30666
31237
|
registerSchema({
|
|
30667
31238
|
command: "winning-ads.unfollow",
|
|
30668
31239
|
description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
|
|
@@ -30670,7 +31241,7 @@ registerSchema({
|
|
|
30670
31241
|
advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
|
|
30671
31242
|
}
|
|
30672
31243
|
});
|
|
30673
|
-
var unfollowCommand =
|
|
31244
|
+
var unfollowCommand = defineCommand179({
|
|
30674
31245
|
meta: {
|
|
30675
31246
|
name: "unfollow",
|
|
30676
31247
|
description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
|
|
@@ -30691,7 +31262,7 @@ var unfollowCommand = defineCommand175({
|
|
|
30691
31262
|
});
|
|
30692
31263
|
|
|
30693
31264
|
// src/commands/winning-ads/winners.ts
|
|
30694
|
-
import { defineCommand as
|
|
31265
|
+
import { defineCommand as defineCommand180 } from "citty";
|
|
30695
31266
|
registerSchema({
|
|
30696
31267
|
command: "winning-ads.winners",
|
|
30697
31268
|
description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
|
|
@@ -30701,7 +31272,7 @@ registerSchema({
|
|
|
30701
31272
|
platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
|
|
30702
31273
|
}
|
|
30703
31274
|
});
|
|
30704
|
-
var winnersCommand =
|
|
31275
|
+
var winnersCommand = defineCommand180({
|
|
30705
31276
|
meta: {
|
|
30706
31277
|
name: "winners",
|
|
30707
31278
|
description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
|
|
@@ -30751,7 +31322,7 @@ var winnersCommand = defineCommand176({
|
|
|
30751
31322
|
});
|
|
30752
31323
|
|
|
30753
31324
|
// src/commands/winning-ads/index.ts
|
|
30754
|
-
var winningAdsCommand =
|
|
31325
|
+
var winningAdsCommand = defineCommand181({
|
|
30755
31326
|
meta: {
|
|
30756
31327
|
name: "winning-ads",
|
|
30757
31328
|
description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce, and manage the brands your library tracks. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
|
|
@@ -30807,7 +31378,7 @@ Full guide: __tooling__/docs/tools/baker/winning-ads.md`
|
|
|
30807
31378
|
});
|
|
30808
31379
|
|
|
30809
31380
|
// src/version.ts
|
|
30810
|
-
import { readFileSync as
|
|
31381
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
30811
31382
|
function packageJsonUrl() {
|
|
30812
31383
|
return new URL("../package.json", import.meta.url);
|
|
30813
31384
|
}
|
|
@@ -30819,15 +31390,15 @@ function parsePackageVersion(raw) {
|
|
|
30819
31390
|
throw new Error("Invalid CLI package.json: missing version");
|
|
30820
31391
|
}
|
|
30821
31392
|
function getCliVersion() {
|
|
30822
|
-
return parsePackageVersion(
|
|
31393
|
+
return parsePackageVersion(readFileSync13(packageJsonUrl(), "utf8"));
|
|
30823
31394
|
}
|
|
30824
31395
|
|
|
30825
31396
|
// src/cli.ts
|
|
30826
|
-
var main =
|
|
31397
|
+
var main = defineCommand182({
|
|
30827
31398
|
meta: {
|
|
30828
31399
|
name: "baker",
|
|
30829
31400
|
version: getCliVersion(),
|
|
30830
|
-
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, marketing tags, account history, and ad platform data in Baker.
|
|
31401
|
+
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, marketing tags, Tag Manager containers, account history, and ad platform data in Baker.
|
|
30831
31402
|
|
|
30832
31403
|
Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
|
|
30833
31404
|
Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
|
|
@@ -30850,6 +31421,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
30850
31421
|
testimonials: testimonialsCommand,
|
|
30851
31422
|
canvas: canvasCommand,
|
|
30852
31423
|
tags: tagsCommand3,
|
|
31424
|
+
"tag-manager": tagManagerCommand,
|
|
30853
31425
|
chats: chatsCommand,
|
|
30854
31426
|
history: historyCommand,
|
|
30855
31427
|
"winning-ads": winningAdsCommand,
|