@koda-sl/baker-cli 0.365.0-dev.846b2e487 → 0.365.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 +4 -19
- package/dist/{chunk-K2IKLMCM.js → chunk-AI4HWQVN.js} +4 -4
- package/dist/chunk-AI4HWQVN.js.map +1 -0
- package/dist/{chunk-VVQLRFCI.js → chunk-FXVELNAS.js} +7 -4
- package/dist/chunk-FXVELNAS.js.map +1 -0
- package/dist/{chunk-SR56QQTD.js → chunk-L4QXAYIC.js} +15 -3
- package/dist/{chunk-SR56QQTD.js.map → chunk-L4QXAYIC.js.map} +1 -1
- package/dist/cli.js +125 -258
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/{output-OSSBUGT7.js → output-AT5SRVH7.js} +2 -2
- package/dist/{shared-MSI4UMZ3.js → shared-HZ44PY2F.js} +5 -3
- package/package.json +1 -1
- package/dist/chunk-K2IKLMCM.js.map +0 -1
- package/dist/chunk-VVQLRFCI.js.map +0 -1
- /package/dist/{output-OSSBUGT7.js.map → output-AT5SRVH7.js.map} +0 -0
- /package/dist/{shared-MSI4UMZ3.js.map → shared-HZ44PY2F.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
validateCanvasDeep,
|
|
70
70
|
withoutCastName,
|
|
71
71
|
ytDlpBlockSignal
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-AI4HWQVN.js";
|
|
73
73
|
import {
|
|
74
74
|
csvOrJson,
|
|
75
75
|
daysAgoIso,
|
|
@@ -77,8 +77,9 @@ import {
|
|
|
77
77
|
handleMetaError,
|
|
78
78
|
resolveAccountIdArg,
|
|
79
79
|
resolveEffectiveStatus,
|
|
80
|
+
statusFilterHints,
|
|
80
81
|
todayIso
|
|
81
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-L4QXAYIC.js";
|
|
82
83
|
import {
|
|
83
84
|
buildQueryCacheKey,
|
|
84
85
|
cacheGet,
|
|
@@ -94,7 +95,7 @@ import {
|
|
|
94
95
|
writeAdsJson,
|
|
95
96
|
writeAdsOutput,
|
|
96
97
|
writeJsonEnvelope
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-FXVELNAS.js";
|
|
98
99
|
import {
|
|
99
100
|
ApiError,
|
|
100
101
|
apiGet,
|
|
@@ -4394,7 +4395,7 @@ var CAPABILITY_SURFACE_SPECS = {
|
|
|
4394
4395
|
provider: "google-analytics",
|
|
4395
4396
|
resourceNoun: "property",
|
|
4396
4397
|
// Like Tag Manager: staged during the chat, applied for real at publish,
|
|
4397
|
-
//
|
|
4398
|
+
// every time. A connection made before writes existed is
|
|
4398
4399
|
// read-only until it is reconnected, and `access` does NOT say so — it
|
|
4399
4400
|
// reports what the Baker app asks Google for, which is now app-wide
|
|
4400
4401
|
// read-write. The per-company signal is `scopeBlockers`, which compares
|
|
@@ -8538,7 +8539,7 @@ var SURFACE_RULES = [
|
|
|
8538
8539
|
];
|
|
8539
8540
|
var FAN_OUT_NUDGE_THRESHOLD = 2;
|
|
8540
8541
|
var FAN_OUT_THRESHOLD = 3;
|
|
8541
|
-
var SCHEDULED_HINT = 'This reads as recurring/scheduled work. If it should run on a cadence or a future date, create a Scheduled agent instead \u2014 baker scheduled-agents create --cron "0 9 * * MON" (or --run-at, or --trigger for a reaction rather than a clock; guide: `__tooling__/docs/tools/baker/scheduled-agents.md`). Do
|
|
8542
|
+
var SCHEDULED_HINT = 'This reads as recurring/scheduled work. If it should run on a cadence or a future date, create a Scheduled agent instead \u2014 baker scheduled-agents create --cron "0 9 * * MON" (or --run-at, or --trigger for a reaction rather than a clock; guide: `__tooling__/docs/tools/baker/scheduled-agents.md`). Do not capture "set up a schedule" as a Work Action.';
|
|
8542
8543
|
function looksExecutable(name, description) {
|
|
8543
8544
|
const foldedName = fold(name);
|
|
8544
8545
|
const full = `${foldedName}
|
|
@@ -8789,7 +8790,7 @@ var claimCommand = defineCommand({
|
|
|
8789
8790
|
import { defineCommand as defineCommand2 } from "citty";
|
|
8790
8791
|
registerSchema({
|
|
8791
8792
|
command: "actions.complete",
|
|
8792
|
-
description: "Stage completion of an action (it was
|
|
8793
|
+
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`. Don't 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`.",
|
|
8793
8794
|
args: {
|
|
8794
8795
|
id: { type: "string", description: "Action ID or temp ID", required: true },
|
|
8795
8796
|
note: {
|
|
@@ -12529,7 +12530,7 @@ var PLANNER_FIELD_DESCRIPTIONS = {
|
|
|
12529
12530
|
// src/commands/ads/google/keywords/discover.ts
|
|
12530
12531
|
registerSchema({
|
|
12531
12532
|
command: "ads.google.keywords.discover",
|
|
12532
|
-
description: 'Discover keyword ideas from seed keywords or URLs. Returns { source: "keyword_planner_estimate", keywords, total_results, next_page_token? }.
|
|
12533
|
+
description: 'Discover keyword ideas from seed keywords or URLs. Returns { source: "keyword_planner_estimate", keywords, total_results, next_page_token? }. These are Keyword Planner estimates of total market search volume, not this account\'s data: every row carries a source column and every metric is prefixed planner_ (planner_avg_monthly_searches, planner_competition, ...). Never report a planner_ number as impressions, clicks or any account metric \u2014 read those with `baker ads google query` against the account. If --location and --language are omitted, they default to United States (2840) and English (1000); `query_context` shows which were used.',
|
|
12533
12534
|
args: {
|
|
12534
12535
|
"customer-id": {
|
|
12535
12536
|
type: "string",
|
|
@@ -12540,12 +12541,12 @@ registerSchema({
|
|
|
12540
12541
|
url: { type: "string", description: "URL to extract keyword ideas from", required: false },
|
|
12541
12542
|
location: {
|
|
12542
12543
|
type: "string",
|
|
12543
|
-
description: "Geo target ID.
|
|
12544
|
+
description: "Geo target ID. Defaults to 2840 (United States) if omitted \u2014 always set this for non-US markets",
|
|
12544
12545
|
required: false
|
|
12545
12546
|
},
|
|
12546
12547
|
language: {
|
|
12547
12548
|
type: "string",
|
|
12548
|
-
description: "Language ID.
|
|
12549
|
+
description: "Language ID. Defaults to 1000 (English) if omitted \u2014 always set this for non-English markets",
|
|
12549
12550
|
required: false
|
|
12550
12551
|
},
|
|
12551
12552
|
limit: { type: "string", description: "Max keyword ideas (default: 20, max: 100)", required: false, default: 20 },
|
|
@@ -12706,7 +12707,7 @@ var locationsCommand = defineCommand25({
|
|
|
12706
12707
|
import { defineCommand as defineCommand26 } from "citty";
|
|
12707
12708
|
registerSchema({
|
|
12708
12709
|
command: "ads.google.keywords.metrics",
|
|
12709
|
-
description: 'Get historical market metrics for specific keywords. Returns { source: "keyword_planner_estimate", historical_metrics: [...] }.
|
|
12710
|
+
description: 'Get historical market metrics for specific keywords. Returns { source: "keyword_planner_estimate", historical_metrics: [...] }. These are Keyword Planner estimates of total market search volume, not this account\'s data: every row carries a source column and every metric is prefixed planner_ (planner_avg_monthly_searches, planner_competition, ...). Never report a planner_ number as impressions, clicks or any account metric \u2014 read those with `baker ads google query` against the account. If --location and --language are omitted, they default to United States (2840) and English (1000); `query_context` shows which were used.',
|
|
12710
12711
|
args: {
|
|
12711
12712
|
"customer-id": {
|
|
12712
12713
|
type: "string",
|
|
@@ -12716,12 +12717,12 @@ registerSchema({
|
|
|
12716
12717
|
keywords: { type: "string", description: "Comma-separated keywords to analyze (max 200)", required: true },
|
|
12717
12718
|
location: {
|
|
12718
12719
|
type: "string",
|
|
12719
|
-
description: "Geo target ID.
|
|
12720
|
+
description: "Geo target ID. Defaults to 2840 (United States) if omitted \u2014 always set this for non-US markets",
|
|
12720
12721
|
required: false
|
|
12721
12722
|
},
|
|
12722
12723
|
language: {
|
|
12723
12724
|
type: "string",
|
|
12724
|
-
description: "Language ID.
|
|
12725
|
+
description: "Language ID. Defaults to 1000 (English) if omitted \u2014 always set this for non-English markets",
|
|
12725
12726
|
required: false
|
|
12726
12727
|
},
|
|
12727
12728
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" },
|
|
@@ -13635,7 +13636,7 @@ function completenessWarnings(read) {
|
|
|
13635
13636
|
return [
|
|
13636
13637
|
{
|
|
13637
13638
|
code: "TRUNCATED_RESULTS",
|
|
13638
|
-
message: `INCOMPLETE READ \u2014 ${cause} These rows are a page, not the data set.
|
|
13639
|
+
message: `INCOMPLETE READ \u2014 ${cause} These rows are a page, not the data set. Don't count, total or describe them as the whole picture. ${fix}`
|
|
13639
13640
|
}
|
|
13640
13641
|
];
|
|
13641
13642
|
}
|
|
@@ -18212,6 +18213,7 @@ var fileArg = {
|
|
|
18212
18213
|
description: "The op payload: a JSON file path, or the JSON object inline (flags override it)"
|
|
18213
18214
|
}
|
|
18214
18215
|
};
|
|
18216
|
+
var STAGED_WRITE = "Stages only \u2014 applies to the live account when the chat is published. Field contract: `baker capabilities google-ads`.";
|
|
18215
18217
|
var BUDGET_DEMAND_HINTS = [
|
|
18216
18218
|
"Check this daily budget against the search volume you measured for these keywords, not against the plan you had before you measured it. A budget many times larger than the traffic the target pool can absorb never spends, and reads to the client as a number nobody costed.",
|
|
18217
18219
|
"No volume measured yet? Pull it first \u2014 `baker ads google query --preset search-terms` for what the account already captures, `baker ads google keywords metrics` for the market estimate (those are planner figures, never account performance)."
|
|
@@ -18223,11 +18225,14 @@ var budgetsCommand = defineCommand31({
|
|
|
18223
18225
|
// first. A budget several times what the target pool can absorb never spends, and reads to the
|
|
18224
18226
|
// client as a plan nobody costed.
|
|
18225
18227
|
create: defineCommand31({
|
|
18226
|
-
meta: {
|
|
18228
|
+
meta: {
|
|
18229
|
+
name: "create",
|
|
18230
|
+
description: `Stage a daily campaign budget; campaigns reference it by the g_temp_* ref it returns (--budget-ref). ${STAGED_WRITE}`
|
|
18231
|
+
},
|
|
18227
18232
|
args: {
|
|
18228
18233
|
...customerIdArg,
|
|
18229
18234
|
...fileArg,
|
|
18230
|
-
name: { type: "string", description:
|
|
18235
|
+
name: { type: "string", description: 'Budget name as shown in Google Ads (e.g. "Brand search \u2014 daily")' },
|
|
18231
18236
|
amount: { type: "string", description: "Daily amount in major currency units (e.g. 50)" },
|
|
18232
18237
|
delivery: { type: "string", description: "STANDARD | ACCELERATED" },
|
|
18233
18238
|
shared: { type: "boolean", description: "Explicitly shared budget" }
|
|
@@ -18244,11 +18249,14 @@ var budgetsCommand = defineCommand31({
|
|
|
18244
18249
|
}
|
|
18245
18250
|
}),
|
|
18246
18251
|
update: defineCommand31({
|
|
18247
|
-
meta: {
|
|
18252
|
+
meta: {
|
|
18253
|
+
name: "update",
|
|
18254
|
+
description: `Stage a change to an existing budget's name, daily amount or delivery. ${STAGED_WRITE}`
|
|
18255
|
+
},
|
|
18248
18256
|
args: {
|
|
18249
18257
|
...customerIdArg,
|
|
18250
18258
|
...fileArg,
|
|
18251
|
-
name: { type: "string" },
|
|
18259
|
+
name: { type: "string", description: "New budget name as shown in Google Ads" },
|
|
18252
18260
|
amount: { type: "string", description: "New daily amount in major currency units" },
|
|
18253
18261
|
delivery: { type: "string" }
|
|
18254
18262
|
},
|
|
@@ -18457,11 +18465,14 @@ var campaignsCommand = defineCommand31({
|
|
|
18457
18465
|
meta: { name: "campaigns", description: "Stage campaign create/update/pause/resume/remove" },
|
|
18458
18466
|
subCommands: {
|
|
18459
18467
|
create: defineCommand31({
|
|
18460
|
-
meta: {
|
|
18468
|
+
meta: {
|
|
18469
|
+
name: "create",
|
|
18470
|
+
description: `Stage a new campaign on a budget (--budget-ref); it is created paused unless --status ENABLED. ${STAGED_WRITE}`
|
|
18471
|
+
},
|
|
18461
18472
|
args: {
|
|
18462
18473
|
...customerIdArg,
|
|
18463
18474
|
...fileArg,
|
|
18464
|
-
name: { type: "string" },
|
|
18475
|
+
name: { type: "string", description: 'Campaign name, unique in the account (e.g. "Search \u2014 Brand \u2014 ES")' },
|
|
18465
18476
|
"channel-type": {
|
|
18466
18477
|
type: "string",
|
|
18467
18478
|
description: "SEARCH | DISPLAY | SHOPPING | VIDEO | PERFORMANCE_MAX | DEMAND_GEN | \u2026"
|
|
@@ -18524,11 +18535,14 @@ var campaignsCommand = defineCommand31({
|
|
|
18524
18535
|
}
|
|
18525
18536
|
}),
|
|
18526
18537
|
update: defineCommand31({
|
|
18527
|
-
meta: {
|
|
18538
|
+
meta: {
|
|
18539
|
+
name: "update",
|
|
18540
|
+
description: `Stage a change to an existing campaign's name, budget, bidding or settings. ${STAGED_WRITE}`
|
|
18541
|
+
},
|
|
18528
18542
|
args: {
|
|
18529
18543
|
...customerIdArg,
|
|
18530
18544
|
...fileArg,
|
|
18531
|
-
name: { type: "string" },
|
|
18545
|
+
name: { type: "string", description: "New campaign name, unique in the account" },
|
|
18532
18546
|
"budget-ref": { type: "string" },
|
|
18533
18547
|
"bidding-strategy": {
|
|
18534
18548
|
type: "string",
|
|
@@ -18608,15 +18622,21 @@ var adGroupsCommand = defineCommand31({
|
|
|
18608
18622
|
meta: { name: "ad-groups", description: "Stage ad group create/update/pause/resume/remove" },
|
|
18609
18623
|
subCommands: {
|
|
18610
18624
|
create: defineCommand31({
|
|
18611
|
-
meta: {
|
|
18625
|
+
meta: {
|
|
18626
|
+
name: "create",
|
|
18627
|
+
description: `Stage a new ad group in a campaign (--campaign-ref); it is created paused unless --status ENABLED. ${STAGED_WRITE}`
|
|
18628
|
+
},
|
|
18612
18629
|
args: {
|
|
18613
18630
|
...customerIdArg,
|
|
18614
18631
|
...fileArg,
|
|
18615
|
-
name: {
|
|
18632
|
+
name: {
|
|
18633
|
+
type: "string",
|
|
18634
|
+
description: 'Ad group name, unique within its campaign (e.g. "Solar panels \u2014 price")'
|
|
18635
|
+
},
|
|
18616
18636
|
"campaign-ref": { type: "string", description: "Campaign ref (g_temp_*, id, or resource name)" },
|
|
18617
18637
|
type: {
|
|
18618
18638
|
type: "string",
|
|
18619
|
-
description: "Ad group type \u2014 leave it out and Google derives it from the campaign's channel, which is
|
|
18639
|
+
description: "Ad group type \u2014 leave it out and Google derives it from the campaign's channel, which is required on a Demand Gen campaign (there is no Demand Gen ad group type). SEARCH_STANDARD | DISPLAY_STANDARD | SHOPPING_PRODUCT_ADS | VIDEO_*"
|
|
18620
18640
|
},
|
|
18621
18641
|
"cpc-bid": { type: "string", description: "Default CPC bid in major units" },
|
|
18622
18642
|
status: { type: "string" }
|
|
@@ -18634,11 +18654,14 @@ var adGroupsCommand = defineCommand31({
|
|
|
18634
18654
|
}
|
|
18635
18655
|
}),
|
|
18636
18656
|
update: defineCommand31({
|
|
18637
|
-
meta: {
|
|
18657
|
+
meta: {
|
|
18658
|
+
name: "update",
|
|
18659
|
+
description: `Stage a change to an existing ad group's name, default CPC bid or status. ${STAGED_WRITE}`
|
|
18660
|
+
},
|
|
18638
18661
|
args: {
|
|
18639
18662
|
...customerIdArg,
|
|
18640
18663
|
...fileArg,
|
|
18641
|
-
name: { type: "string" },
|
|
18664
|
+
name: { type: "string", description: "New ad group name, unique within its campaign" },
|
|
18642
18665
|
"cpc-bid": { type: "string" },
|
|
18643
18666
|
status: { type: "string" }
|
|
18644
18667
|
},
|
|
@@ -19416,7 +19439,7 @@ var assetsCommand = defineCommand31({
|
|
|
19416
19439
|
),
|
|
19417
19440
|
update: assetsUpdateCommand,
|
|
19418
19441
|
attach: fileCreateCommand("attach", "google.assetLink.attach", "Attach an asset to a campaign/adGroup/customer", [
|
|
19419
|
-
"Image extensions cannot be linked \u2014 Google refuses AD_IMAGE and every marketing-image field type at every level, on every API version \u2014 but stage the link anyway: it is skipped rather than stored, the rest of a batch is unaffected, and it is what records the handover Task naming those images and that campaign. That is the
|
|
19442
|
+
"Image extensions cannot be linked \u2014 Google refuses AD_IMAGE and every marketing-image field type at every level, on every API version \u2014 but stage the link anyway: it is skipped rather than stored, the rest of a batch is unaffected, and it is what records the handover Task naming those images and that campaign. That is the only record when the images are already in the account and you are uploading nothing. Then tell the user they are already in their Google Ads account and only need adding to the campaign under Assets; do not stage a second Task with `baker actions`. Two images that do link: the advertiser's logo through this command (`BUSINESS_LOGO`, campaign or customer level, on a verified account), and Performance Max asset-group images, which are a different mechanism (`asset-groups attach`)."
|
|
19420
19443
|
]),
|
|
19421
19444
|
detach: statusCommand2("google.assetLink.detach", "asset link", [
|
|
19422
19445
|
"Pass the resource name Google gave you \u2014 `SELECT campaign_asset.resource_name \u2026 FROM campaign_asset WHERE campaign_asset.status != 'REMOVED'` (or `ad_group_asset` / `customer_asset`) \u2014 never one composed out of an owner id and an asset id. A link's own status is not its campaign's and not its ad group's, so an inventory read scoped only to those lists extensions that are already detached, and a link between an asset and an owner that never held it parses fine and exists nowhere. Either way the target is read back before it is staged, and a detach of a link that is not there is refused here rather than at publish."
|
|
@@ -19426,14 +19449,14 @@ var assetsCommand = defineCommand31({
|
|
|
19426
19449
|
var audienceModeArg = {
|
|
19427
19450
|
mode: {
|
|
19428
19451
|
type: "string",
|
|
19429
|
-
description: "observation = the audience only adjusts bids, reach is unchanged | targeting = the ads are shown
|
|
19452
|
+
description: "observation = the audience only adjusts bids, reach is unchanged | targeting = the ads are shown only to people in the audiences attached to this campaign/ad group"
|
|
19430
19453
|
}
|
|
19431
19454
|
};
|
|
19432
19455
|
function requireAudienceMode(value) {
|
|
19433
19456
|
const mode = typeof value === "string" ? value.toLowerCase() : void 0;
|
|
19434
19457
|
if (mode !== "observation" && mode !== "targeting") {
|
|
19435
19458
|
failWriteValidation(
|
|
19436
|
-
`pass --mode observation (the audience adjusts bids and reach is unchanged \u2014 the Google Ads interface's default) or --mode targeting (the ads are shown
|
|
19459
|
+
`pass --mode observation (the audience adjusts bids and reach is unchanged \u2014 the Google Ads interface's default) or --mode targeting (the ads are shown only to people in the audiences on this campaign/ad group). There is no safe default: the API's own default is targeting, which can cut a campaign's reach to the size of the list.`
|
|
19437
19460
|
);
|
|
19438
19461
|
}
|
|
19439
19462
|
return mode === "observation" ? "OBSERVATION" : "TARGETING";
|
|
@@ -23927,7 +23950,7 @@ Performance \u2014 the workhorse (3 axes):
|
|
|
23927
23950
|
baker ads linkedin analytics --list-intents
|
|
23928
23951
|
baker ads linkedin analytics --list-pivots
|
|
23929
23952
|
|
|
23930
|
-
Staged writes (
|
|
23953
|
+
Staged writes (never hit LinkedIn directly \u2014 ops stage on this chat's draft,
|
|
23931
23954
|
show in the dashboard as pending LinkedIn changes, and apply when the chat is
|
|
23932
23955
|
published, at which point they reach the real ad account):
|
|
23933
23956
|
baker ads linkedin account url-params \u2014 UTMs for every ad in the account
|
|
@@ -26359,8 +26382,8 @@ Example: baker ads meta ads retag 120252158038400247 --url-tags "utm_source={{si
|
|
|
26359
26382
|
run: async ({ args: args5 }) => {
|
|
26360
26383
|
const { apiPost: apiPost2 } = await import("./client-3DGBQ2H3.js");
|
|
26361
26384
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
26362
|
-
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-
|
|
26363
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
26385
|
+
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-AT5SRVH7.js");
|
|
26386
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-HZ44PY2F.js");
|
|
26364
26387
|
try {
|
|
26365
26388
|
const accountId = bareAccountId2(args5);
|
|
26366
26389
|
const urlTags = typeof args5["url-tags"] === "string" ? args5["url-tags"] : void 0;
|
|
@@ -26507,8 +26530,8 @@ function duplicateCommand2(entity, label) {
|
|
|
26507
26530
|
run: async ({ args: args5 }) => {
|
|
26508
26531
|
const { apiPost: apiPost2 } = await import("./client-3DGBQ2H3.js");
|
|
26509
26532
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
26510
|
-
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-
|
|
26511
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
26533
|
+
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-AT5SRVH7.js");
|
|
26534
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-HZ44PY2F.js");
|
|
26512
26535
|
try {
|
|
26513
26536
|
const accountId = bareAccountId2(args5);
|
|
26514
26537
|
const chatId = requireChatId2();
|
|
@@ -26568,12 +26591,7 @@ var listCommand4 = defineCommand58({
|
|
|
26568
26591
|
if (args5.limit) params.limit = args5.limit;
|
|
26569
26592
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26570
26593
|
const data = await apiGet("/api/ads/meta/ads", params);
|
|
26571
|
-
|
|
26572
|
-
if (fmt !== "json") {
|
|
26573
|
-
writeAdsOutput(data, fmt);
|
|
26574
|
-
return;
|
|
26575
|
-
}
|
|
26576
|
-
writeAdsJson({ ok: true, data });
|
|
26594
|
+
writeAdsOutput(data, csvOrJson(args5), void 0, statusFilterHints(data, effectiveStatus, "ads"));
|
|
26577
26595
|
} catch (err) {
|
|
26578
26596
|
handleMetaError(err);
|
|
26579
26597
|
}
|
|
@@ -26639,12 +26657,7 @@ var listCommand5 = defineCommand59({
|
|
|
26639
26657
|
if (args5.limit) params.limit = args5.limit;
|
|
26640
26658
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26641
26659
|
const data = await apiGet("/api/ads/meta/adsets", params);
|
|
26642
|
-
|
|
26643
|
-
if (fmt !== "json") {
|
|
26644
|
-
writeAdsOutput(data, fmt);
|
|
26645
|
-
return;
|
|
26646
|
-
}
|
|
26647
|
-
writeAdsJson({ ok: true, data });
|
|
26660
|
+
writeAdsOutput(data, csvOrJson(args5), void 0, statusFilterHints(data, effectiveStatus, "ad sets"));
|
|
26648
26661
|
} catch (err) {
|
|
26649
26662
|
handleMetaError(err);
|
|
26650
26663
|
}
|
|
@@ -26789,12 +26802,7 @@ var listCommand7 = defineCommand62({
|
|
|
26789
26802
|
if (args5.limit) params.limit = args5.limit;
|
|
26790
26803
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26791
26804
|
const data = await apiGet("/api/ads/meta/campaigns", params);
|
|
26792
|
-
|
|
26793
|
-
if (fmt !== "json") {
|
|
26794
|
-
writeAdsOutput(data, fmt);
|
|
26795
|
-
return;
|
|
26796
|
-
}
|
|
26797
|
-
writeAdsJson({ ok: true, data });
|
|
26805
|
+
writeAdsOutput(data, csvOrJson(args5), void 0, statusFilterHints(data, effectiveStatus, "campaigns"));
|
|
26798
26806
|
} catch (err) {
|
|
26799
26807
|
handleMetaError(err);
|
|
26800
26808
|
}
|
|
@@ -33025,7 +33033,7 @@ var sourcesResponseSchema = z40.strictObject({
|
|
|
33025
33033
|
import { defineCommand as defineCommand98 } from "citty";
|
|
33026
33034
|
|
|
33027
33035
|
// src/commands/hubspot/refusal.ts
|
|
33028
|
-
var CONTINUE = "
|
|
33036
|
+
var CONTINUE = "Keep going with the wider task: say which part you could not read, skip it, and finish everything else. If the `request_connection` call fails, say so plainly and give the exact route: dashboard \u2192 Brain \u2192 Integrations \u2192 Tools \u2192 HubSpot.";
|
|
33029
33037
|
function hubspotRefusal(code, message) {
|
|
33030
33038
|
if (code === "NOT_FOUND" && message.includes(HUBSPOT_NOT_CONNECTED_MESSAGE)) {
|
|
33031
33039
|
return {
|
|
@@ -33041,7 +33049,7 @@ function hubspotRefusal(code, message) {
|
|
|
33041
33049
|
code: "HUBSPOT_RECONNECT_REQUIRED",
|
|
33042
33050
|
fix: {
|
|
33043
33051
|
action: "request_connection",
|
|
33044
|
-
explanation: 'AGENT INSTRUCTION: HubSpot
|
|
33052
|
+
explanation: 'AGENT INSTRUCTION: HubSpot is connected \u2014 do not tell the user it is missing, and do not retry. Its access does not cover this read (it was connected before Baker asked for it, or the access was withdrawn), and only the user can widen it. Call the `request_connection` tool with { platform: "hubspot", reason } naming what you need to read; the card offers them a Reconnect button. Run this command again once they have. ' + CONTINUE
|
|
33045
33053
|
}
|
|
33046
33054
|
};
|
|
33047
33055
|
}
|
|
@@ -34544,8 +34552,8 @@ import { defineCommand as defineCommand105 } from "citty";
|
|
|
34544
34552
|
import { defineCommand as defineCommand100 } from "citty";
|
|
34545
34553
|
|
|
34546
34554
|
// src/commands/avatars/casting.ts
|
|
34547
|
-
var CAST_FLAG_RULE = "Cast with `--avatar <handle>` on `baker studio generate`, `baker studio animate`, `baker canvas scaffold-ad`, `baker canvas scaffold-static-ad` and `baker canvas scaffold-video`.
|
|
34548
|
-
var VERBATIM_RULE = "When you do write the description yourself \u2014 a hand-built canvas node, a landing image, anywhere `--avatar` does not exist \u2014 copy `subjectDescription`
|
|
34555
|
+
var CAST_FLAG_RULE = "Cast with `--avatar <handle>` on `baker studio generate`, `baker studio animate`, `baker canvas scaffold-ad`, `baker canvas scaffold-static-ad` and `baker canvas scaffold-video`. Don't hand-roll it by pasting `subjectDescription` into the prompt or by passing the sheet through `--reference` \u2014 both render something that merely resembles them. `--avatar` is also the only thing that carries their accent and delivery into a clip. An avatar has no pinned voice by design (ADR 0005): the video model renders the voice, and the region on their profile is the only thing steering it \u2014 without the flag the clip is performed flat, in whatever accent the model picks on its own. `baker canvas scaffold-video` casts only their face: a reproduced video keeps the source ad's accent direction, so never tell the user it speaks in theirs.";
|
|
34556
|
+
var VERBATIM_RULE = "When you do write the description yourself \u2014 a hand-built canvas node, a landing image, anywhere `--avatar` does not exist \u2014 copy `subjectDescription` verbatim, word for word. Re-phrasing it per generation is the other reason a face drifts across a set.";
|
|
34549
34557
|
var VIDEO_ROUTING = "In video, a photoreal presenter renders on `google/veo-3.1` (or `google/veo-3.1-fast`), never `bytedance/seedance-2.0` \u2014 it refuses photoreal human faces, AI-generated ones included. Reproducing a video the user gave you: `baker canvas scaffold-video \u2026 --avatar <handle> --real-face`.";
|
|
34550
34558
|
function castingHints(avatar) {
|
|
34551
34559
|
if (avatar.status === "generating" && avatar.needsFace) {
|
|
@@ -34639,7 +34647,7 @@ function creationHints(created, profile) {
|
|
|
34639
34647
|
const casting = created.likeness === "synthetic" && created.faceChoice === "auto" ? [
|
|
34640
34648
|
`No one was asked about this face \u2014 \`--face auto\` cast it and it is kept. Do not tell the user they chose it, and do not offer them a pick you are not going to run. If this should have been theirs, say so and create it again with \`--face ask\`.`
|
|
34641
34649
|
] : created.likeness === "synthetic" ? [
|
|
34642
|
-
`The user is being shown real portraits of @${created.handle} right now, and the turn waits for them to pick \u2014 this happens on its own, triggered by the command you just ran.
|
|
34650
|
+
`The user is being shown real portraits of @${created.handle} right now, and the turn waits for them to pick \u2014 this happens on its own, triggered by the command you just ran. The picker is already showing, so don't call request_avatar_casting, don't ask about the face in a question of your own, and don't wait or poll: whatever you do next simply runs after they have chosen. Say what you created and get on with the work.`
|
|
34643
34651
|
] : [];
|
|
34644
34652
|
const hints2 = [
|
|
34645
34653
|
...casting,
|
|
@@ -34725,7 +34733,7 @@ function avatarFailureFix(err, handle, context = {}) {
|
|
|
34725
34733
|
if (err.code === "CONFLICT" && handle) {
|
|
34726
34734
|
return {
|
|
34727
34735
|
action: "use_the_existing_avatar",
|
|
34728
|
-
explanation: `@${handle} already exists in
|
|
34736
|
+
explanation: `@${handle} already exists in this company \u2014 avatars belong to the company, not to a chat, so one made in an earlier conversation is still here and still castable. If it is the person you want, use it as it is: \`--avatar ${handle}\`. Read it first with \`baker avatars get ${handle} --full\` and say who they already are. Do not create the same person under a second name: the user would be told about one avatar and handed another, and the company ends up with duplicates nobody chose a face for. If you genuinely need a different person, ask the user what to call them.`
|
|
34729
34737
|
};
|
|
34730
34738
|
}
|
|
34731
34739
|
return void 0;
|
|
@@ -34827,7 +34835,7 @@ registerSchema({
|
|
|
34827
34835
|
},
|
|
34828
34836
|
subject: {
|
|
34829
34837
|
type: "string",
|
|
34830
|
-
description: "The identity, reused
|
|
34838
|
+
description: "The identity, reused verbatim in every render: one person, plainly described (age, build, hair, skin, face). No scene, no lighting, no camera, no wardrobe \u2014 those belong in the render prompt or in --wardrobe/--setting.",
|
|
34831
34839
|
required: true
|
|
34832
34840
|
},
|
|
34833
34841
|
persona: { type: "string", description: "Who they are on camera \u2014 role, attitude, energy", required: false },
|
|
@@ -35055,7 +35063,7 @@ async function waitForSheet(first, read, sleep4 = (ms) => new Promise((resolve5)
|
|
|
35055
35063
|
// src/commands/avatars/get.ts
|
|
35056
35064
|
registerSchema({
|
|
35057
35065
|
command: "avatars.get",
|
|
35058
|
-
description: "Read one avatar by handle \u2014 the command you run before casting it. Returns its status (only `ready` can be cast), the identity sheet URL every render must be grounded on via --reference, and the subject description that goes into the prompt
|
|
35066
|
+
description: "Read one avatar by handle \u2014 the command you run before casting it. Returns its status (only `ready` can be cast), the identity sheet URL every render must be grounded on via --reference, and the subject description that goes into the prompt verbatim. Add --full for the whole written profile (persona, speech, motion, wardrobe, setting, guardrails, voice, source photos).",
|
|
35059
35067
|
args: {
|
|
35060
35068
|
handle: { type: "string", description: 'Avatar handle, e.g. "marta" (lowercase, dashes)', required: true },
|
|
35061
35069
|
full: {
|
|
@@ -35304,7 +35312,7 @@ How casting works:
|
|
|
35304
35312
|
2. baker avatars get <handle> Status, identity sheet URL, subject description
|
|
35305
35313
|
3. baker images generate "<scene>" --reference <sheetUrl>
|
|
35306
35314
|
Ground the render on the identity sheet, never on a source photo,
|
|
35307
|
-
and copy the subject description into the prompt
|
|
35315
|
+
and copy the subject description into the prompt verbatim
|
|
35308
35316
|
|
|
35309
35317
|
Examples:
|
|
35310
35318
|
baker avatars list --status ready --output md
|
|
@@ -36164,7 +36172,7 @@ async function unresolvedAction(css, unresolved) {
|
|
|
36164
36172
|
const { plans } = planFontAdoption(await astroSources(), unresolved);
|
|
36165
36173
|
if (plans.length > 0) {
|
|
36166
36174
|
const names = plans.map((p) => `"${p.family}"`).join(", ");
|
|
36167
|
-
return `Run \`baker brand fonts adopt\` \u2014 ${names} is already self-hosted by ${plans[0]?.files.join(", ")}, so it only needs moving into ${GLOBAL_CSS} to load on every page.
|
|
36175
|
+
return `Run \`baker brand fonts adopt\` \u2014 ${names} is already self-hosted by ${plans[0]?.files.join(", ")}, so it only needs moving into ${GLOBAL_CSS} to load on every page. Don't fetch it: that downloads a different build of the same face.`;
|
|
36168
36176
|
}
|
|
36169
36177
|
const viaFontsource = [...fontsourceFamilies(css)];
|
|
36170
36178
|
const stranded = unresolved.filter((family) => viaFontsource.includes(family.toLowerCase()));
|
|
@@ -38630,7 +38638,7 @@ function emitScreenScene(i, scene, lengths, out, surfaceIngests, nodes, clips) {
|
|
|
38630
38638
|
type: "ingest",
|
|
38631
38639
|
params: {
|
|
38632
38640
|
source: "path",
|
|
38633
|
-
path: `[TODO: supply the
|
|
38641
|
+
path: `[TODO: supply the real screen for "${label}" \u2014 never AI-generate a UI. Capture a clean, text-free screenshot with \`baker images screenshot https://<brand-domain>/<path>\` (image-library skill); spoken/overlay text rides the overlay layer, not the screenshot. Wire it in as a path relative to this canvas file, never an absolute path]`,
|
|
38634
38642
|
expect: "image"
|
|
38635
38643
|
}
|
|
38636
38644
|
});
|
|
@@ -38682,7 +38690,7 @@ function emitGraphicScene(i, scene, lengths, out, surfaceIngests, nodes, clips)
|
|
|
38682
38690
|
type: "ingest",
|
|
38683
38691
|
params: {
|
|
38684
38692
|
source: "path",
|
|
38685
|
-
path: `[TODO: supply the
|
|
38693
|
+
path: `[TODO: supply the real designed graphic for "${label}" \u2014 never AI-generate a designed panel (its typography/wordmarks garble). Rebuild it as brand HTML in video-overlay-composition (the scene's text/logos are already seeded there), export the design from the brand kit, or source stock art; text rides the overlay layer, not this plate. Wire it in as a path relative to this canvas file, never an absolute path]`,
|
|
38686
38694
|
expect: "image"
|
|
38687
38695
|
}
|
|
38688
38696
|
});
|
|
@@ -39765,13 +39773,13 @@ function uiSurfaceStub(blueprint, run, clock) {
|
|
|
39765
39773
|
}) : [];
|
|
39766
39774
|
const isGraphic = scenes.some((s) => (compositeRegionsOf(s) ?? []).some((r) => r.kind === "static_graphic"));
|
|
39767
39775
|
const sourcing = isGraphic ? [
|
|
39768
|
-
" Build it as a
|
|
39776
|
+
" Build it as a real designed panel; never AI-generate its text/typography:",
|
|
39769
39777
|
" hand-build a brand-accurate HTML block in this composition (restyle the seeded",
|
|
39770
39778
|
" overlay text, or `npx hyperframes add <block>` for a ready-made card),",
|
|
39771
39779
|
" \u2014 OR drop the design asset (export it from the brand kit) as panel.png here;",
|
|
39772
39780
|
" then nest it as a timed clip:"
|
|
39773
39781
|
] : [
|
|
39774
|
-
" Build it as a
|
|
39782
|
+
" Build it as a real surface, never AI: capture the live page \u2014",
|
|
39775
39783
|
" baker images screenshot https://<brand-domain>/<path> (image-library skill)",
|
|
39776
39784
|
" \u2014 OR hand-build a brand-accurate HTML screen; then frame it in a phone mockup:",
|
|
39777
39785
|
" npx hyperframes add phone-scroll (writes compositions/phone-scroll.html)",
|
|
@@ -40173,7 +40181,7 @@ function buildModelConstraints() {
|
|
|
40173
40181
|
};
|
|
40174
40182
|
}
|
|
40175
40183
|
return {
|
|
40176
|
-
note: "Switching a clip's video model has cross-node constraints.
|
|
40184
|
+
note: "Switching a clip's video model has cross-node constraints. All video_generate nodes in one canvas must share one aspect_ratio (the composite silently crops otherwise). Each model's `duration` is a hard enum and differs per model \u2014 a scene longer than the model's max must be split. `person_generation` differs (Veo requires \"allow_all\"). `baker canvas validate` gates duration, aspect agreement, per-model params, and a scene-span-vs-model-max advisory before any billed run \u2014 run it after every model edit.",
|
|
40177
40185
|
models
|
|
40178
40186
|
};
|
|
40179
40187
|
}
|
|
@@ -40248,7 +40256,7 @@ function buildMotionBoard(blueprint) {
|
|
|
40248
40256
|
});
|
|
40249
40257
|
}
|
|
40250
40258
|
var VIDEO_GUIDE = [
|
|
40251
|
-
"Scaffolded by `baker canvas scaffold-video` \u2014 a runnable reproduction of your reference video, built like an editing timeline. It is a sequence of clear SHOTS separated at COMPLETE BREAKS (hard cuts): two adjacent presenter shots at a cut are TWO clips, never glued into one take. What stays continuous is the VOICE \u2014 a voiceover narration is ONE read across the b-roll it plays over, and a b-roll CUTAWAY between two on-camera moments leaves the presenter shot continuous with the insert sliced in \u2014 and each person keeps ONE brand voice (all their clips' native audio re-voiced in a single per-speaker pass), so timbre holds across the cuts. A presenter shot is ONE Seedance clip (native lip-sync + audio); a pure-voiceover stretch is one ElevenLabs tts read; a sub-2s flash is a still hold. A single shot too long for one clip splits into takes that share a boundary frame \u2014 the spine drops the duplicated frame (`--seam-dedup head|tail|off`). Every clip gets a CLEAN-PLATE start AND end keyframe (no baked text), RECAST to your dropped reference assets \u2014 Seedance interpolates real in-shot motion between them. Each frame grounds
|
|
40259
|
+
"Scaffolded by `baker canvas scaffold-video` \u2014 a runnable reproduction of your reference video, built like an editing timeline. It is a sequence of clear SHOTS separated at COMPLETE BREAKS (hard cuts): two adjacent presenter shots at a cut are TWO clips, never glued into one take. What stays continuous is the VOICE \u2014 a voiceover narration is ONE read across the b-roll it plays over, and a b-roll CUTAWAY between two on-camera moments leaves the presenter shot continuous with the insert sliced in \u2014 and each person keeps ONE brand voice (all their clips' native audio re-voiced in a single per-speaker pass), so timbre holds across the cuts. A presenter shot is ONE Seedance clip (native lip-sync + audio); a pure-voiceover stretch is one ElevenLabs tts read; a sub-2s flash is a still hold. A single shot too long for one clip splits into takes that share a boundary frame \u2014 the spine drops the duplicated frame (`--seam-dedup head|tail|off`). Every clip gets a CLEAN-PLATE start AND end keyframe (no baked text), RECAST to your dropped reference assets \u2014 Seedance interpolates real in-shot motion between them. Each frame grounds only on its own extracted frame + el_* slots (never another generated frame), so all frames render in PARALLEL (no cross-frame cascade). A SPLIT-SCREEN / PICTURE-IN-PICTURE / KEYED-PRESENTER scene is reproduced as one clip PER REGION, stacked or overlaid (see `metadata.todo.composition`). On-screen text/graphics are a separate HTML overlay layer you paint; audio is the voice + SFX + a ducked music bed, normalized stereo. It is a STARTING POINT, not a locked render: add, delete, reorder, split, merge, or re-time scenes freely \u2014 see `metadata.todo.full_flexibility`.",
|
|
40252
40260
|
"",
|
|
40253
40261
|
"WHAT TO DO NEXT:",
|
|
40254
40262
|
"0. RE-CRAFT THE SCRIPT FIRST (don't clone). This reference already won in-market, but copying a video is much harder than a static: the hook is targeting and may not transfer, and the message must become TRUE for our brand. Work the `metadata.todo.script_recraft` checklist \u2014 for each scene judge its role (hook/body/CTA), decide keep/cut/reorder/replace, and re-author every line for OUR customer's pain + OUR offer. See `references/script-craft.md` (hook/body/CTA framework) and the `meta-ads-playbook` skill. Most of the work lives here.",
|
|
@@ -40289,7 +40297,7 @@ function recraftTextForRole(role, sceneIndex) {
|
|
|
40289
40297
|
return `[RECRAFT HOOK \u2014 the #1 decision, but usually the LIGHTEST move wins: this hook already worked, so default to KEEPING it and building on top (swap only the specifics for ours). REBUILD only when it doesn't transfer \u2014 a claim we lack or a different funnel/awareness stage \u2014 by reaching for its deeper INNER MECHANIC and delivering that truthfully. DIAGNOSE (device + mechanic + stage) \u2192 DECIDE keep/adapt/rebuild \u2192 hold the opener to criteria: ${HOOK_OPENER_CRITERIA}. It lives on s${sceneIndex}_start (first frame) + the scene-${sceneIndex} overlay. See references/hook-craft.md + meta-ads-playbook \xA710/\xA739.]`;
|
|
40290
40298
|
}
|
|
40291
40299
|
if (role === "cta") {
|
|
40292
|
-
return "[RECRAFT CTA \u2014 the close: state what to do (where to go) + what to expect (offer/bundle/discount) for OUR brand; soft for top-of-funnel, hard for bottom.
|
|
40300
|
+
return "[RECRAFT CTA \u2014 the close: state what to do (where to go) + what to expect (offer/bundle/discount) for OUR brand; soft for top-of-funnel, hard for bottom. Don't render the reference's words. See references/script-craft.md.]";
|
|
40293
40301
|
}
|
|
40294
40302
|
return `[RECRAFT: rewrite this ${role} for OUR brand \u2014 true claims only; do NOT render the reference's words. See references/script-craft.md + meta-ads-playbook.]`;
|
|
40295
40303
|
}
|
|
@@ -40372,7 +40380,7 @@ function buildVideoTodo(report, overlayCount, floatingCount, opts, blueprint) {
|
|
|
40372
40380
|
// ALWAYS-ON safety net: the scaffold can only seed what the deconstruct
|
|
40373
40381
|
// cataloged, and it under-detects on-image graphics + sound cues. Never trust
|
|
40374
40382
|
// "none detected" — re-watch the reference and fill the gaps with the right tool.
|
|
40375
|
-
completeness_check: 'The scaffold mirrors the deconstruct\'s catalog, which UNDER-DETECTS \u2014 never trust a 0 count. Re-watch the reference frame-by-frame and add anything missing: (1) ON-IMAGE GRAPHICS not in floating_elements (dollar/coin icons, emojis, checkmarks, rating stars, price tags, arrows, progress bars, app UI) \u2192 source each with `baker images icon "<desc>"` / `baker images sticker` / `baker images gif` / `baker images logo <domain>` and add it as an <img class="ov pos-* " data-start data-dur> in video-overlay-composition/index.html (
|
|
40383
|
+
completeness_check: 'The scaffold mirrors the deconstruct\'s catalog, which UNDER-DETECTS \u2014 never trust a 0 count. Re-watch the reference frame-by-frame and add anything missing: (1) ON-IMAGE GRAPHICS not in floating_elements (dollar/coin icons, emojis, checkmarks, rating stars, price tags, arrows, progress bars, app UI) \u2192 source each with `baker images icon "<desc>"` / `baker images sticker` / `baker images gif` / `baker images logo <domain>` and add it as an <img class="ov pos-* " data-start data-dur> in video-overlay-composition/index.html (never bake graphics into the frame plates). (2) SOUND CUES not in sound_effects (cha-ching/coin, whoosh, ding, pop, notification, keyboard) \u2192 add a `sound_effect` node (eleven_text_to_sound) and wire it onto `audio_mix` at its timestamp. (3) RECURRING people/animals/products/logos/sets with no el_* slot \u2192 add an `ingest` [TODO] slot and reference it from the frames they appear in. (4) Burned-in captions/text not in text_overlays \u2192 add an <img>-free <div class="ov"> in index.html. (5) ONE person playing MULTIPLE personas/wardrobes (skeptic vs believer, before vs after, two outfits) collapsed into a single el_* slot \u2192 split into one el_* slot PER look, each linked as the SAME individual via `same_as` so every outfit has its own reference image but the face/identity stays identical.',
|
|
40376
40384
|
scenes_clamped_to_15s: report.clamped_scenes,
|
|
40377
40385
|
oversize_scenes: report.oversize_scenes.length > 0 ? {
|
|
40378
40386
|
scenes: report.oversize_scenes,
|
|
@@ -42063,9 +42071,9 @@ ${describeRewrites(healed.rewrites)}
|
|
|
42063
42071
|
}) : null;
|
|
42064
42072
|
const hints2 = reviewable ? review === null ? [RENDER_REVIEW_UNAVAILABLE] : review.length === 0 ? ["Reviewed the finished video frame by frame \u2014 nothing to report."] : [
|
|
42065
42073
|
`Reviewed the finished video and found ${review.length} thing${review.length === 1 ? "" : "s"} to fix. Show the user what is wrong before you show them the ad.`,
|
|
42066
|
-
...review.map((f) => `${f.severity === "blocking" ? "
|
|
42074
|
+
...review.map((f) => `${f.severity === "blocking" ? "Must fix" : "Should fix"} \u2014 ${f.what}`),
|
|
42067
42075
|
...review.some((f) => f.scene) ? [
|
|
42068
|
-
`Anything about the
|
|
42076
|
+
`Anything about the mark or the closing card is a composition fix, not a re-render: both are drawn as HTML by the caption composition, so editing it and re-running re-renders only that pass \u2014 the clips are cached and no generation is paid for again. Fix them, then re-run: edit the \`show\` of the scene files named above \u2014 a shot with a person handling equipment is where limbs and objects go wrong, so widen it, move the hands out of frame, or drop the person from that beat. Re-running re-renders only the scenes you edited; everything else comes from the cache (this run: ${result.stats?.cached_nodes ?? 0} of ${result.stats?.total_nodes ?? 0} nodes were cached).`
|
|
42069
42077
|
] : []
|
|
42070
42078
|
] : [];
|
|
42071
42079
|
if (poster) {
|
|
@@ -42969,12 +42977,12 @@ function fail3(code, message) {
|
|
|
42969
42977
|
process.exit(2);
|
|
42970
42978
|
}
|
|
42971
42979
|
function resolveModels(args5) {
|
|
42972
|
-
const
|
|
42980
|
+
const pick = (flag, kind, fallback) => args5[flag] ? String(args5[flag]) : resolveModel(kind, fallback);
|
|
42973
42981
|
return {
|
|
42974
|
-
describeModel:
|
|
42975
|
-
selectModel:
|
|
42976
|
-
layoutModel:
|
|
42977
|
-
genModel:
|
|
42982
|
+
describeModel: pick("describe-model", "image_describe", "~google/gemini-pro-latest"),
|
|
42983
|
+
selectModel: pick("select-model", "text_generate", "~google/gemini-flash-latest"),
|
|
42984
|
+
layoutModel: pick("layout-model", "text_generate", "~google/gemini-flash-latest"),
|
|
42985
|
+
genModel: pick("gen-model", "image_generate", "openai/gpt-image-2")
|
|
42978
42986
|
};
|
|
42979
42987
|
}
|
|
42980
42988
|
var PLATFORM_PLACEMENTS = {
|
|
@@ -44175,7 +44183,7 @@ registerSchema({
|
|
|
44175
44183
|
spec: {
|
|
44176
44184
|
type: "string",
|
|
44177
44185
|
required: true,
|
|
44178
|
-
description: 'Path to the ad spec JSON. Shape: { format?, market?, brand?, cast?, end_card?, voice?, music?, beats: [{ say, show, on_camera?, cast? }] }. Fill `brand` from src/brand/BRAND.md \u2014 `palette` (its hex tokens, most important first) and `logo` (the repo path to the mark) are what make the ad look like the client rather than like stock. `market` is where the ad is
|
|
44186
|
+
description: 'Path to the ad spec JSON. Shape: { format?, market?, brand?, cast?, end_card?, voice?, music?, beats: [{ say, show, on_camera?, cast? }] }. Fill `brand` from src/brand/BRAND.md \u2014 `palette` (its hex tokens, most important first) and `logo` (the repo path to the mark) are what make the ad look like the client rather than like stock. `market` is where the ad is set; omitted, it is inferred from the voice language, and getting it wrong is what fills a Spanish ad with British houses. `say` is one clause ending in its own punctuation \u2014 it becomes a caption card verbatim, so two sentences in one beat produce a card holding both. `show` is the shot brief for that line. Set `on_camera` only when that beat\'s subject talks to camera. A beat\'s `sound` is one sound effect for that shot, and most beats should not have one. Add it only where the picture shows a specific physical event the viewer expects to hear (a drill tightening a bolt, a door closing, rain on glass, a graphic snapping in). On a talking head or a calm lifestyle shot it reads as a stock sting, and one per beat turns a quiet ad into a noisy one. A music bed plus two well-placed effects beats eight. `voiceover: false` makes it a MUSIC-LED ad: nobody speaks, the `say` lines become on-screen text captioned straight from the script, and it needs `music`. `cast` is WHO the ad is about, and an ad with people in it needs one: `{ "avatar": "marta" }` names a cast avatar (`baker avatars list`) and every beat is grounded on that avatar\'s identity sheet with its subject description copied verbatim \u2014 the same face here as in the rest of the company\'s work. Without it each beat invents its own stranger, which is how one 28-second ad came back with five different men playing one customer. `{ "description": "..." }` is the fallback when there is no avatar, and it scaffolds a canvas that asks you to drop a photo before it can run \u2014 so prefer the avatar. A beat sets `cast: false` for a shot they are not in. `end_card` is on by default whenever `brand` is set: the last beat becomes a flat brand plate with the mark and a call to action drawn over it. `{ "cta": "..." }` sets the button copy \u2014 there is no default, so with no `cta` the card carries the mark alone, and a `cta` repeating the closing line is dropped rather than printed twice. `false` keeps the footage.'
|
|
44179
44187
|
},
|
|
44180
44188
|
avatar: {
|
|
44181
44189
|
type: "string",
|
|
@@ -44214,7 +44222,7 @@ function avatarVoiceBrief(avatar) {
|
|
|
44214
44222
|
var scaffoldAdCommand = defineCommand115({
|
|
44215
44223
|
meta: {
|
|
44216
44224
|
name: "scaffold-ad",
|
|
44217
|
-
description: 'Build a captioned vertical ad from a written spec, with no reference video to copy.\n\nA spec is a list of BEATS. One beat = one line the voice says + one shot on screen while it is said. That pairing is what keeps the ad honest: the caption card IS the line, so it can never end mid-sentence, and the picture can never drift from the read.\n\nTwo rules the spec enforces for you, both learned the expensive way:\n \u2022 `say` is
|
|
44225
|
+
description: 'Build a captioned vertical ad from a written spec, with no reference video to copy.\n\nA spec is a list of BEATS. One beat = one line the voice says + one shot on screen while it is said. That pairing is what keeps the ad honest: the caption card IS the line, so it can never end mid-sentence, and the picture can never drift from the read.\n\nTwo rules the spec enforces for you, both learned the expensive way:\n \u2022 `say` is one clause with its own punctuation. Two sentences in a beat is rejected.\n \u2022 Nobody in shot is speaking unless you set `on_camera` on that beat. A person visibly talking under a voice that is not theirs reads as bad dubbing.\n\nExample spec:\n { "beats": [\n { "say": "Mientras t\xFA sigues pagando la luz a precio de oro,", "show": "Aerial over Spanish rooftops at golden hour." },\n { "say": "Haz clic en el enlace y reserva tu estudio gratuito.", "show": "A couple walking home at sunset." } ] }\n\nWho is in it:\n `cast: { avatar: "marta" }` grounds every beat on that avatar\'s face \u2014 cast one with `baker avatars`.\n Without a cast, each beat invents its own person and the ad reads as a stock-footage collage.\n\nHow it ends: with a `brand`, the last beat closes on a flat brand plate carrying the mark and the CTA.\n\nThen: baker canvas run <the canvas it writes>'
|
|
44218
44226
|
},
|
|
44219
44227
|
args: {
|
|
44220
44228
|
spec: { type: "string", required: true, description: "Path to the ad spec JSON" },
|
|
@@ -44400,7 +44408,7 @@ var scaffoldAdCommand = defineCommand115({
|
|
|
44400
44408
|
message: resolvedLogo ? `The brand mark at \`${resolvedLogo}\` does not exist, so this ad has no logo to put on screen.` : `This company has no brand mark in \`${BRAND_DIR}/logos/\`, so an ad cannot carry its logo.`,
|
|
44401
44409
|
// What the lookup against their own domain actually found, so the agent does not
|
|
44402
44410
|
// go looking for the mark somewhere else — which is the loop this replaced.
|
|
44403
|
-
fix: `${fetched?.reason ?? ""}
|
|
44411
|
+
fix: `${fetched?.reason ?? ""} Don't draw one or take one from an icon library: the mark is drawn on every frame and on the closing card, so a stand-in ships an ad wearing the wrong brand.`
|
|
44404
44412
|
}
|
|
44405
44413
|
});
|
|
44406
44414
|
process.exit(1);
|
|
@@ -44581,7 +44589,7 @@ var scaffoldAdCommand = defineCommand115({
|
|
|
44581
44589
|
// getting it wrong is expensive: the pictures cost a fraction of the clips, and
|
|
44582
44590
|
// every defect anyone has caught in a finished ad was visible in them. The run
|
|
44583
44591
|
// stops, the frames are shown, and continuing pays for none of them twice.
|
|
44584
|
-
handle || staged ? `Wrote ${spec.data.beats.length} beats to ${outPath}. Run it with \`baker canvas run ${outPath} --until frames --brief "<what they asked for, their words>"\`,
|
|
44592
|
+
handle || staged ? `Wrote ${spec.data.beats.length} beats to ${outPath}. Run it with \`baker canvas run ${outPath} --until frames --brief "<what they asked for, their words>"\`, show the frames it returns and ask whether to carry on \u2014 then continue with the \`--run-id\` it gives you. This ad carries ${handle ? "a person's face" : "the client's mark"}, and a wrong look costs a whole ad to discover after the clips.` : `Wrote ${spec.data.beats.length} beats to ${outPath}. Run it with \`baker canvas run ${outPath} --brief "<what they asked for, their words>"\`.`,
|
|
44585
44593
|
...autoCast ? [
|
|
44586
44594
|
`Cast \`${autoCast}\` \u2014 the spec described this person in words, and they are one of this company's avatars. Every shot now grounds on their identity sheet and carries their accent and delivery. Write \`"cast": { "avatar": "` + autoCast + '" }` yourself next time; a written description is for someone the company does not have.'
|
|
44587
44595
|
] : [],
|
|
@@ -44623,7 +44631,7 @@ var scaffoldAdCommand = defineCommand115({
|
|
|
44623
44631
|
// ad with no palette and no mark anywhere in 28 seconds.
|
|
44624
44632
|
`This spec has no ${!spec.data.brand?.palette?.length ? "`brand.palette`" : ""}${!spec.data.brand?.palette?.length && !spec.data.brand?.logo ? " and no " : ""}${!spec.data.brand?.logo ? "`brand.logo`" : ""}. Read src/brand/BRAND.md and re-run with them \u2014 a name alone leaves the ad in someone else's clothes.`
|
|
44625
44633
|
],
|
|
44626
|
-
"`brand.palette` colours the closing plate the card sits on; `brand.logo` is the repo path to the mark, and it is
|
|
44634
|
+
"`brand.palette` colours the closing plate the card sits on; `brand.logo` is the repo path to the mark, and it is drawn by the composition \u2014 top-left throughout and large on the closing card \u2014 never generated as a picture, so it cannot come back garbled. Give it whenever the client has one."
|
|
44627
44635
|
]
|
|
44628
44636
|
});
|
|
44629
44637
|
}
|
|
@@ -44631,7 +44639,7 @@ var scaffoldAdCommand = defineCommand115({
|
|
|
44631
44639
|
function shortBeatHint(short, total) {
|
|
44632
44640
|
if (short.length === 0) return [];
|
|
44633
44641
|
return [
|
|
44634
|
-
`Beat${short.length === 1 ? "" : "s"} ${short.join(", ")} of ${total} ${short.length === 1 ? "is" : "are"} a fragment rather than a line \u2014 a few words with a whole shot to themselves. Every beat's picture holds for at least ${SPOKEN_CLIP_DURATION_S}s, so a two-word beat buys six seconds of somebody standing still, and a run of those plays as a slideshow rather than an ad.
|
|
44642
|
+
`Beat${short.length === 1 ? "" : "s"} ${short.join(", ")} of ${total} ${short.length === 1 ? "is" : "are"} a fragment rather than a line \u2014 a few words with a whole shot to themselves. Every beat's picture holds for at least ${SPOKEN_CLIP_DURATION_S}s, so a two-word beat buys six seconds of somebody standing still, and a run of those plays as a slideshow rather than an ad. Don't pad them. Merge them into the beat before or after, so each one carries a whole thought. Edit the spec and re-run this command.`
|
|
44635
44643
|
];
|
|
44636
44644
|
}
|
|
44637
44645
|
async function fetchClientLogo() {
|
|
@@ -45008,18 +45016,18 @@ function parseBudget(raw) {
|
|
|
45008
45016
|
throw new Error(`--budget must be one of ${VIDEO_BUDGETS.join(", ")} (got "${v}")`);
|
|
45009
45017
|
}
|
|
45010
45018
|
function resolveModels2(args5) {
|
|
45011
|
-
const
|
|
45019
|
+
const pick = (flag, kind, fallback) => args5[flag] ? String(args5[flag]) : resolveModel2(kind, fallback);
|
|
45012
45020
|
return {
|
|
45013
45021
|
// Flash by default: ~2-3× faster per call than Pro, which keeps each
|
|
45014
45022
|
// per-scene deconstruct step well inside the action time budget and turns a
|
|
45015
45023
|
// ~9 min run into ~3-4 min. Override with --deconstruct-model
|
|
45016
45024
|
// ~google/gemini-pro-latest for the densest extraction when speed matters less.
|
|
45017
|
-
deconstructModel:
|
|
45018
|
-
selectModel:
|
|
45025
|
+
deconstructModel: pick("deconstruct-model", "video_deconstruct", "~google/gemini-flash-latest"),
|
|
45026
|
+
selectModel: pick("select-model", "text_generate", "~google/gemini-flash-latest"),
|
|
45019
45027
|
// Default to the strongest image model (matches the static-ad scaffold); the
|
|
45020
45028
|
// frame generators need the most faithful text/identity reproduction. Override
|
|
45021
45029
|
// with --image-model for a cheaper/faster pass.
|
|
45022
|
-
imageModel:
|
|
45030
|
+
imageModel: pick("image-model", "image_generate", "openai/gpt-image-2.5-sunburst")
|
|
45023
45031
|
};
|
|
45024
45032
|
}
|
|
45025
45033
|
function hasPhotorealCast(elements) {
|
|
@@ -45651,7 +45659,7 @@ function capabilityHints(surfaces, tools = []) {
|
|
|
45651
45659
|
const immediate = surfaces.filter((surface) => surface.writeMode === "applies-at-publish");
|
|
45652
45660
|
if (immediate.length > 0) {
|
|
45653
45661
|
hints2.push(
|
|
45654
|
-
`REAL AND IMMEDIATE: ${immediate.map((s) => s.label).join(", ")}
|
|
45662
|
+
`REAL AND IMMEDIATE: ${immediate.map((s) => s.label).join(", ")}. Completing this chat changes the user's live setup, so agree the changes before you finish, not after.`
|
|
45655
45663
|
);
|
|
45656
45664
|
}
|
|
45657
45665
|
const blocked = surfaces.filter((surface) => surface.blockers.length > 0);
|
|
@@ -50773,12 +50781,12 @@ function handleError5(err) {
|
|
|
50773
50781
|
...readOnly ? {
|
|
50774
50782
|
fix: {
|
|
50775
50783
|
action: "reconnect",
|
|
50776
|
-
explanation: "The Google Analytics connection is read-only. Ask the user to reconnect Google Analytics \u2014 in the dashboard, Brain \u2192 Integrations \u2192 Tools \u2192 Google Analytics \u2014 which grants the permission to change the property. Reporting (`baker ga4 query`, `baker ga4 audit`) keeps working meanwhile, so carry on with the rest of the job and tell them what you will set up once they have reconnected.
|
|
50784
|
+
explanation: "The Google Analytics connection is read-only. Ask the user to reconnect Google Analytics \u2014 in the dashboard, Brain \u2192 Integrations \u2192 Tools \u2192 Google Analytics \u2014 which grants the permission to change the property. Reporting (`baker ga4 query`, `baker ga4 audit`) keeps working meanwhile, so carry on with the rest of the job and tell them what you will set up once they have reconnected. Don't claim anything was configured."
|
|
50777
50785
|
}
|
|
50778
50786
|
} : err.code === "UNAUTHORIZED" || err.code === "FORBIDDEN" && isNotConnectedError(err.code, err.message) ? {
|
|
50779
50787
|
fix: {
|
|
50780
50788
|
action: "request_connection",
|
|
50781
|
-
explanation: 'Google Analytics is not connected for this company yet, or no property has been picked.
|
|
50789
|
+
explanation: 'Google Analytics is not connected for this company yet, or no property has been picked. Don\'t send the user to Settings \u2014 call the `request_connection` tool with { platform: "google-analytics", reason } and they connect and pick their property from inside the chat. If the `request_connection` call fails, say so plainly and give the exact route: dashboard \u2192 Brain \u2192 Integrations \u2192 Tools \u2192 Google Analytics. Then carry on with the rest of the task.'
|
|
50782
50790
|
}
|
|
50783
50791
|
} : {},
|
|
50784
50792
|
retryable: RETRYABLE_CODES.has(err.code)
|
|
@@ -51651,7 +51659,7 @@ Examples:
|
|
|
51651
51659
|
});
|
|
51652
51660
|
registerSchema({
|
|
51653
51661
|
command: "ga4.audience",
|
|
51654
|
-
description: "Create an audience (a saved group of users, e.g. everyone who started a demo but never finished), rename one, or archive one. Read `baker ga4 config` first to see the audiences that already exist.
|
|
51662
|
+
description: "Create an audience (a saved group of users, e.g. everyone who started a demo but never finished), rename one, or archive one. Read `baker ga4 config` first to see the audiences that already exist. Everything that defines who is in an audience \u2014 the conditions, the membership window \u2014 is frozen the moment it is created and cannot be edited afterwards, so get it right in one go. An audience only reaches Google Ads for retargeting if the property is linked to a Google Ads account.",
|
|
51655
51663
|
args: {
|
|
51656
51664
|
json: { type: "string", description: createJsonDescription("audience"), required: false },
|
|
51657
51665
|
file: { type: "string", description: "Path to a JSON file with the definition", required: false },
|
|
@@ -58452,7 +58460,7 @@ var addCommand = defineCommand172({
|
|
|
58452
58460
|
"This page was already in the library, so nothing was re-studied \u2014 its sections are searchable now.",
|
|
58453
58461
|
`Search it with: baker landing inspiration search --domain ${new URL(data.canonicalUrl).hostname}`
|
|
58454
58462
|
] : [
|
|
58455
|
-
"Studying this page takes a few minutes.
|
|
58463
|
+
"Studying this page takes a few minutes. Don't wait on it \u2014 carry on, and search for it later in the turn or in a later one.",
|
|
58456
58464
|
"Meanwhile, search what is already in the library: baker landing inspiration search '<what you want to see>' --scope all",
|
|
58457
58465
|
"This is saved and being studied now, so it is listed as already applied \u2014 tell the user it is kept whatever they do with this chat.",
|
|
58458
58466
|
// The save is not a promise that the study succeeded. An agent that
|
|
@@ -61798,7 +61806,7 @@ var variantCommand = defineCommand181({
|
|
|
61798
61806
|
change: String(args5.change)
|
|
61799
61807
|
});
|
|
61800
61808
|
const hints2 = [
|
|
61801
|
-
forks.length === 0 ? `MISSING --fork: ${variantSlug2} currently renders exactly ${controlSlug}, so a test between them cannot conclude anything. Re-run with --fork <Component>, or copy the one section your change touches into src/pages/${variantSlug2}/_components/ and repoint that import.` : `Edit
|
|
61809
|
+
forks.length === 0 ? `MISSING --fork: ${variantSlug2} currently renders exactly ${controlSlug}, so a test between them cannot conclude anything. Re-run with --fork <Component>, or copy the one section your change touches into src/pages/${variantSlug2}/_components/ and repoint that import.` : `Edit only src/pages/${variantSlug2}/_components/${forks.join(", ")} \u2014 every other section is shared with ${controlSlug}, and editing a shared one changes both arms at once.`,
|
|
61802
61810
|
`Preview both at http://localhost:4321/${controlSlug}/ and http://localhost:4321/${variantSlug2}/ and check they differ only where you meant. Once it is live, only the first of those two answers \u2014 a variant has no public address of its own, and \`/${controlSlug}/?_bkr_preview=b\` is how anyone looks at it.`,
|
|
61803
61811
|
`Then: baker experiment start --landing ${controlSlug} --variant ${variantSlug2} --because "${String(args5.because)}" --change "${String(args5.change)}". Nothing is split until the session is published \u2014 the person publishing is the review of this page.`
|
|
61804
61812
|
];
|
|
@@ -62115,7 +62123,7 @@ import { defineCommand as defineCommand196 } from "citty";
|
|
|
62115
62123
|
import { defineCommand as defineCommand184 } from "citty";
|
|
62116
62124
|
|
|
62117
62125
|
// src/commands/research/hints.ts
|
|
62118
|
-
var AD_COPY_ROUTE = 'This returns competing
|
|
62126
|
+
var AD_COPY_ROUTE = 'This returns competing domains and their SERP economics \u2014 no ad copy, no headlines, no creative. For the actual copy of a competitor\'s ads: `baker winning-ads advertisers "<brand>"` \u2192 `baker winning-ads search "<brief>" --advertiser-id <id>` \u2192 `baker winning-ads content <adId>` (`primary_text` / `headline` / `cta`, plus the spoken transcript and on-screen text for video). That corpus is Meta and LinkedIn only \u2014 Google SERP ad copy is not available through any Baker command, so do not keep querying for it here.';
|
|
62119
62127
|
function noSerpRowsHints(rowCount2, queryContext) {
|
|
62120
62128
|
if (rowCount2 > 0) {
|
|
62121
62129
|
return [];
|
|
@@ -62286,7 +62294,7 @@ function handleResearchError(err, fixFor) {
|
|
|
62286
62294
|
// src/commands/research/advertisers.ts
|
|
62287
62295
|
registerSchema({
|
|
62288
62296
|
command: "research.advertisers",
|
|
62289
|
-
description: 'Returns a ranked list of
|
|
62297
|
+
description: 'Returns a ranked list of domains competing for one keyword in Google, with avg SERP position, relevance rating, estimated traffic value and visibility \u2014 domain economics, not ad copy. Despite the name it returns no headlines, descriptions or creative of any kind; for a competitor\'s actual ad copy use `baker winning-ads content <adId>` (Meta/LinkedIn only \u2014 Google SERP ad copy is not available anywhere in Baker). Start here: `baker research advertisers "<keyword>" --location <cc> --language <code>` to size up who owns a term. 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.',
|
|
62290
62298
|
args: {
|
|
62291
62299
|
keyword: {
|
|
62292
62300
|
type: "string",
|
|
@@ -62295,12 +62303,12 @@ registerSchema({
|
|
|
62295
62303
|
},
|
|
62296
62304
|
location: {
|
|
62297
62305
|
type: "string",
|
|
62298
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
62306
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. Defaults to us (United States) if omitted \u2014 always set this for non-US markets",
|
|
62299
62307
|
required: false
|
|
62300
62308
|
},
|
|
62301
62309
|
language: {
|
|
62302
62310
|
type: "string",
|
|
62303
|
-
description: "Language code or name (en, es, spanish...).
|
|
62311
|
+
description: "Language code or name (en, es, spanish...). Defaults to en (English) if omitted \u2014 always set this for non-English markets",
|
|
62304
62312
|
required: false
|
|
62305
62313
|
},
|
|
62306
62314
|
limit: { type: "string", description: "Max results (default: 20, max: 100)", required: false },
|
|
@@ -62373,17 +62381,17 @@ Examples:
|
|
|
62373
62381
|
import { defineCommand as defineCommand185 } from "citty";
|
|
62374
62382
|
registerSchema({
|
|
62375
62383
|
command: "research.autocomplete",
|
|
62376
|
-
description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for.
|
|
62384
|
+
description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
62377
62385
|
args: {
|
|
62378
62386
|
keyword: { type: "string", description: "Seed keyword (positional)", required: true },
|
|
62379
62387
|
location: {
|
|
62380
62388
|
type: "string",
|
|
62381
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
62389
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. Defaults to us (United States) if omitted",
|
|
62382
62390
|
required: false
|
|
62383
62391
|
},
|
|
62384
62392
|
language: {
|
|
62385
62393
|
type: "string",
|
|
62386
|
-
description: "Language code or name.
|
|
62394
|
+
description: "Language code or name. Defaults to en (English) if omitted",
|
|
62387
62395
|
required: false
|
|
62388
62396
|
},
|
|
62389
62397
|
limit: { type: "string", description: "Max suggestions (default: 10, max: 20)", required: false },
|
|
@@ -62669,7 +62677,7 @@ Examples:
|
|
|
62669
62677
|
import { defineCommand as defineCommand188 } from "citty";
|
|
62670
62678
|
registerSchema({
|
|
62671
62679
|
command: "research.intent",
|
|
62672
|
-
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate.
|
|
62680
|
+
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
|
|
62673
62681
|
args: {
|
|
62674
62682
|
keywords: {
|
|
62675
62683
|
type: "string",
|
|
@@ -62678,7 +62686,7 @@ registerSchema({
|
|
|
62678
62686
|
},
|
|
62679
62687
|
language: {
|
|
62680
62688
|
type: "string",
|
|
62681
|
-
description: "Language code or name.
|
|
62689
|
+
description: "Language code or name. Defaults to en (English) if omitted \u2014 always set this for non-English keywords",
|
|
62682
62690
|
required: false
|
|
62683
62691
|
},
|
|
62684
62692
|
"no-cache": { type: "boolean", description: "Skip server cache, hit API directly", required: false }
|
|
@@ -62740,18 +62748,18 @@ Examples:
|
|
|
62740
62748
|
import { defineCommand as defineCommand189 } from "citty";
|
|
62741
62749
|
registerSchema({
|
|
62742
62750
|
command: "research.keyword-gap",
|
|
62743
|
-
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities.
|
|
62751
|
+
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. 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.",
|
|
62744
62752
|
args: {
|
|
62745
62753
|
competitor: { type: "string", description: "Competitor domain (positional 1)", required: true },
|
|
62746
62754
|
ours: { type: "string", description: "Your domain (positional 2)", required: true },
|
|
62747
62755
|
location: {
|
|
62748
62756
|
type: "string",
|
|
62749
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
62757
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. Defaults to us (United States); set it for any non-US market.",
|
|
62750
62758
|
required: false
|
|
62751
62759
|
},
|
|
62752
62760
|
language: {
|
|
62753
62761
|
type: "string",
|
|
62754
|
-
description: "Language code or name.
|
|
62762
|
+
description: "Language code or name. Defaults to en (English) if omitted \u2014 always set this for non-English markets",
|
|
62755
62763
|
required: false
|
|
62756
62764
|
},
|
|
62757
62765
|
type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
|
|
@@ -62891,7 +62899,7 @@ function keywordMetricsFields(options) {
|
|
|
62891
62899
|
// src/commands/research/keyword-metrics.ts
|
|
62892
62900
|
registerSchema({
|
|
62893
62901
|
command: "research.keyword-metrics",
|
|
62894
|
-
description: "Search volume, CPC, top-of-page bids and competition for a list of keywords
|
|
62902
|
+
description: "Search volume, CPC, top-of-page bids and competition for a list of keywords you name \u2014 no domain needed. This is the command for sizing a market you have keywords for; the domain-bound ones (keywords-for-site, keyword-gap) answer a different question and should not be used as a workaround for this one. The volume is Google's Keyword Planner figure resold by DataForSEO, so it is not a second opinion on `baker ads google keywords metrics` \u2014 for that, pass --clickstream. 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.",
|
|
62895
62903
|
args: {
|
|
62896
62904
|
keywords: {
|
|
62897
62905
|
type: "string",
|
|
@@ -62900,12 +62908,12 @@ registerSchema({
|
|
|
62900
62908
|
},
|
|
62901
62909
|
location: {
|
|
62902
62910
|
type: "string",
|
|
62903
|
-
description: "Country code (us, mx, br, es...) or DataForSEO location code.
|
|
62911
|
+
description: "Country code (us, mx, br, es...) or DataForSEO location code. Defaults to us (United States) if omitted \u2014 always set this for non-US markets",
|
|
62904
62912
|
required: false
|
|
62905
62913
|
},
|
|
62906
62914
|
language: {
|
|
62907
62915
|
type: "string",
|
|
62908
|
-
description: "Language code or name.
|
|
62916
|
+
description: "Language code or name. Defaults to en (English) if omitted \u2014 always set this for non-English markets",
|
|
62909
62917
|
required: false
|
|
62910
62918
|
},
|
|
62911
62919
|
clickstream: {
|
|
@@ -63006,17 +63014,17 @@ Examples:
|
|
|
63006
63014
|
import { defineCommand as defineCommand191 } from "citty";
|
|
63007
63015
|
registerSchema({
|
|
63008
63016
|
command: "research.keywords-for-site",
|
|
63009
|
-
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only.
|
|
63017
|
+
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. 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.",
|
|
63010
63018
|
args: {
|
|
63011
63019
|
target: { type: "string", description: "Domain or URL to analyze (positional)", required: true },
|
|
63012
63020
|
location: {
|
|
63013
63021
|
type: "string",
|
|
63014
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
63022
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. Defaults to us (United States) if omitted \u2014 always set this for non-US markets",
|
|
63015
63023
|
required: false
|
|
63016
63024
|
},
|
|
63017
63025
|
language: {
|
|
63018
63026
|
type: "string",
|
|
63019
|
-
description: "Language code or name.
|
|
63027
|
+
description: "Language code or name. Defaults to en (English) if omitted \u2014 always set this for non-English markets",
|
|
63020
63028
|
required: false
|
|
63021
63029
|
},
|
|
63022
63030
|
sort: {
|
|
@@ -63199,17 +63207,17 @@ Examples:
|
|
|
63199
63207
|
import { defineCommand as defineCommand194 } from "citty";
|
|
63200
63208
|
registerSchema({
|
|
63201
63209
|
command: "research.relevant-pages",
|
|
63202
|
-
description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic.
|
|
63210
|
+
description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
63203
63211
|
args: {
|
|
63204
63212
|
target: { type: "string", description: "Domain to analyze (positional, e.g. competitor.com)", required: true },
|
|
63205
63213
|
location: {
|
|
63206
63214
|
type: "string",
|
|
63207
|
-
description: "Country code (us, uk, es, de...) or DataForSEO location code.
|
|
63215
|
+
description: "Country code (us, uk, es, de...) or DataForSEO location code. Defaults to us (United States) if omitted",
|
|
63208
63216
|
required: false
|
|
63209
63217
|
},
|
|
63210
63218
|
language: {
|
|
63211
63219
|
type: "string",
|
|
63212
|
-
description: "Language code or name.
|
|
63220
|
+
description: "Language code or name. Defaults to en (English) if omitted",
|
|
63213
63221
|
required: false
|
|
63214
63222
|
},
|
|
63215
63223
|
limit: { type: "string", description: "Max results (default: 20, max: 1000)", required: false },
|
|
@@ -65847,7 +65855,7 @@ function handleError8(err) {
|
|
|
65847
65855
|
...err.code === "UNAUTHORIZED" || err.code === "FORBIDDEN" && isNotConnectedError(err.code, err.message) ? {
|
|
65848
65856
|
fix: {
|
|
65849
65857
|
action: "request_connection",
|
|
65850
|
-
explanation: 'Tag Manager is not connected for this company yet, or no container has been picked.
|
|
65858
|
+
explanation: 'Tag Manager is not connected for this company yet, or no container has been picked. Don\'t send the user to Settings \u2014 call the `request_connection` tool with { platform: "google-tag-manager", reason } and they connect and pick their containers (they can pick more than one) from inside the chat. `request_tag_input` is not the route: that form manages the container snippet on the site, not what runs inside the container, and it cannot pick a container. If the `request_connection` call fails, say so plainly and give the exact route: dashboard \u2192 Brain \u2192 Integrations \u2192 Tools \u2192 Google Tag Manager, where they also pick the container. Then carry on with the rest of the task.'
|
|
65851
65859
|
}
|
|
65852
65860
|
} : {},
|
|
65853
65861
|
retryable: RETRYABLE_CODES2.has(err.code)
|
|
@@ -66361,7 +66369,7 @@ ${configLines.join("\n")}` : header;
|
|
|
66361
66369
|
function tagsListHints() {
|
|
66362
66370
|
return [
|
|
66363
66371
|
"To create, edit or delete a tag, call the `request_tag_input` approval form (tool `mcp__baker_ui__request_tag_input`, server `baker_ui`) \u2014 it is attached to every turn of this chat and collects any secret values itself.",
|
|
66364
|
-
"
|
|
66372
|
+
"Don't conclude the form is unavailable from your tool list: call it, and report what it returns. And never file a tag change as a Task \u2014 a Task hands the user work this chat can stage in one call."
|
|
66365
66373
|
];
|
|
66366
66374
|
}
|
|
66367
66375
|
|
|
@@ -66433,7 +66441,7 @@ var tagsCommand4 = defineCommand222({
|
|
|
66433
66441
|
name: "tags",
|
|
66434
66442
|
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.
|
|
66435
66443
|
|
|
66436
|
-
This command is
|
|
66444
|
+
This command is read-only. Every tag change \u2014 create, edit, or delete \u2014 goes through the request_tag_input tool (baker_ui MCP server): propose one or more changes (each becomes a tab in one approval form), pre-fill the non-secret fields you know, and the user reviews, fills secrets, and approves or skips each. Secret values (accessToken, apiSecret, authorizationToken, apiKey, conversionToken, OAuth connections) never pass through the CLI or the chat.
|
|
66437
66445
|
|
|
66438
66446
|
Refs: \`baker tags list\` prints each tag's ref \u2014 a real tag id, or tag_temp_* for creates staged in this chat. Use these refs as flow side-effect tagIds; they keep resolving after publish.
|
|
66439
66447
|
|
|
@@ -69224,141 +69232,6 @@ function outputFlagForCommand(root, argv) {
|
|
|
69224
69232
|
});
|
|
69225
69233
|
}
|
|
69226
69234
|
|
|
69227
|
-
// src/field-mask.ts
|
|
69228
|
-
var FLAG2 = "--fields";
|
|
69229
|
-
function parseFields(value) {
|
|
69230
|
-
return value.split(",").map((field) => field.trim()).filter((field) => field.length > 0);
|
|
69231
|
-
}
|
|
69232
|
-
function takeFieldsFlag(root, argv) {
|
|
69233
|
-
const end = argv.indexOf("--");
|
|
69234
|
-
const limit = end === -1 ? argv.length : end;
|
|
69235
|
-
const taken = /* @__PURE__ */ new Set();
|
|
69236
|
-
const fields = [];
|
|
69237
|
-
for (let index = 0; index < limit; index++) {
|
|
69238
|
-
const token = argv[index] ?? "";
|
|
69239
|
-
if (token.startsWith(`${FLAG2}=`)) {
|
|
69240
|
-
taken.add(index);
|
|
69241
|
-
fields.push(...parseFields(token.slice(FLAG2.length + 1)));
|
|
69242
|
-
} else if (token === FLAG2) {
|
|
69243
|
-
const value = argv[index + 1];
|
|
69244
|
-
if (value === void 0 || index + 1 >= limit || value.startsWith("-")) {
|
|
69245
|
-
return { argv, fields: null };
|
|
69246
|
-
}
|
|
69247
|
-
taken.add(index).add(index + 1);
|
|
69248
|
-
fields.push(...parseFields(value));
|
|
69249
|
-
index++;
|
|
69250
|
-
}
|
|
69251
|
-
}
|
|
69252
|
-
if (taken.size === 0 || fields.length === 0) {
|
|
69253
|
-
return { argv, fields: null };
|
|
69254
|
-
}
|
|
69255
|
-
const command = commandFor(root, argv);
|
|
69256
|
-
if (!command || declaredArg(command, "fields") || PRINTS_NO_ENVELOPE.has(commandPathOf(root, argv))) {
|
|
69257
|
-
return { argv, fields: null };
|
|
69258
|
-
}
|
|
69259
|
-
return { argv: argv.filter((_, index) => !taken.has(index)), fields };
|
|
69260
|
-
}
|
|
69261
|
-
function isRecord3(value) {
|
|
69262
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
69263
|
-
}
|
|
69264
|
-
function pick(record, fields) {
|
|
69265
|
-
return Object.fromEntries(fields.filter((field) => field in record).map((field) => [field, record[field]]));
|
|
69266
|
-
}
|
|
69267
|
-
function wrappedList(data, fields) {
|
|
69268
|
-
if (fields.some((field) => field in data)) {
|
|
69269
|
-
return null;
|
|
69270
|
-
}
|
|
69271
|
-
const lists = Object.entries(data).filter(
|
|
69272
|
-
([, value]) => Array.isArray(value) && value.length > 0 && value.every((item) => isRecord3(item))
|
|
69273
|
-
);
|
|
69274
|
-
return lists.length === 1 ? lists[0]?.[0] ?? null : null;
|
|
69275
|
-
}
|
|
69276
|
-
function recordsOf(data, fields) {
|
|
69277
|
-
if (Array.isArray(data)) {
|
|
69278
|
-
return data;
|
|
69279
|
-
}
|
|
69280
|
-
if (!isRecord3(data)) {
|
|
69281
|
-
return [];
|
|
69282
|
-
}
|
|
69283
|
-
const list = wrappedList(data, fields);
|
|
69284
|
-
return list === null ? [data] : data[list];
|
|
69285
|
-
}
|
|
69286
|
-
function maskData(data, fields) {
|
|
69287
|
-
const mask = (item) => isRecord3(item) ? pick(item, fields) : item;
|
|
69288
|
-
if (Array.isArray(data)) {
|
|
69289
|
-
return data.map(mask);
|
|
69290
|
-
}
|
|
69291
|
-
if (!isRecord3(data)) {
|
|
69292
|
-
return data;
|
|
69293
|
-
}
|
|
69294
|
-
const list = wrappedList(data, fields);
|
|
69295
|
-
return list === null ? pick(data, fields) : { ...data, [list]: recordsOf(data, fields).map(mask) };
|
|
69296
|
-
}
|
|
69297
|
-
function unmatchedHint(data, fields) {
|
|
69298
|
-
const records = recordsOf(data, fields).filter(isRecord3);
|
|
69299
|
-
if (records.length === 0) {
|
|
69300
|
-
return null;
|
|
69301
|
-
}
|
|
69302
|
-
const carried = new Set(records.flatMap((record) => Object.keys(record)));
|
|
69303
|
-
const unmatched = fields.filter((field) => !carried.has(field));
|
|
69304
|
-
if (unmatched.length === 0) {
|
|
69305
|
-
return null;
|
|
69306
|
-
}
|
|
69307
|
-
return `--fields matched nothing for: ${unmatched.join(", ")}. The keys data carries are: ${[...carried].join(", ")}.`;
|
|
69308
|
-
}
|
|
69309
|
-
function reprint(text2, envelope) {
|
|
69310
|
-
const indent = text2.trimStart().startsWith("{\n") ? 2 : void 0;
|
|
69311
|
-
return `${JSON.stringify(envelope, null, indent)}${text2.endsWith("\n") ? "\n" : ""}`;
|
|
69312
|
-
}
|
|
69313
|
-
function withHint(envelope, hint) {
|
|
69314
|
-
return { ...envelope, hints: [...Array.isArray(envelope.hints) ? envelope.hints : [], hint] };
|
|
69315
|
-
}
|
|
69316
|
-
var NO_DATA_HINT = "--fields was not applied: this result carries no data to narrow, so it is printed whole. Drop --fields on this command.";
|
|
69317
|
-
function maskPrintedEnvelope(text2, fields) {
|
|
69318
|
-
let parsed;
|
|
69319
|
-
try {
|
|
69320
|
-
parsed = JSON.parse(text2);
|
|
69321
|
-
} catch {
|
|
69322
|
-
return null;
|
|
69323
|
-
}
|
|
69324
|
-
if (!isRecord3(parsed) || typeof parsed.ok !== "boolean") {
|
|
69325
|
-
return null;
|
|
69326
|
-
}
|
|
69327
|
-
if (parsed.ok !== true || "dryRun" in parsed) {
|
|
69328
|
-
return text2;
|
|
69329
|
-
}
|
|
69330
|
-
if (!("data" in parsed)) {
|
|
69331
|
-
return reprint(text2, withHint(parsed, NO_DATA_HINT));
|
|
69332
|
-
}
|
|
69333
|
-
const masked = { ...parsed, data: maskData(parsed.data, fields) };
|
|
69334
|
-
const miss = unmatchedHint(parsed.data, fields);
|
|
69335
|
-
return reprint(text2, miss ? withHint(masked, miss) : masked);
|
|
69336
|
-
}
|
|
69337
|
-
function maskWrites(stream, fields) {
|
|
69338
|
-
let applied = false;
|
|
69339
|
-
const write = stream.write.bind(stream);
|
|
69340
|
-
stream.write = (chunk, ...rest) => {
|
|
69341
|
-
const masked = typeof chunk === "string" ? maskPrintedEnvelope(chunk, fields) : null;
|
|
69342
|
-
if (masked === null) {
|
|
69343
|
-
return write(chunk, ...rest);
|
|
69344
|
-
}
|
|
69345
|
-
applied = true;
|
|
69346
|
-
return write(masked, ...rest);
|
|
69347
|
-
};
|
|
69348
|
-
return { sawEnvelope: () => applied };
|
|
69349
|
-
}
|
|
69350
|
-
function installFieldMask(fields, commandPath) {
|
|
69351
|
-
const mask = maskWrites(process.stdout, fields);
|
|
69352
|
-
process.on("exit", () => {
|
|
69353
|
-
if (!mask.sawEnvelope()) {
|
|
69354
|
-
process.stderr.write(
|
|
69355
|
-
`--fields was not applied: \`baker ${commandPath}\` printed no JSON envelope to narrow. Add --output json to get the envelope, or drop --fields.
|
|
69356
|
-
`
|
|
69357
|
-
);
|
|
69358
|
-
}
|
|
69359
|
-
});
|
|
69360
|
-
}
|
|
69361
|
-
|
|
69362
69235
|
// src/version.ts
|
|
69363
69236
|
import { readFileSync as readFileSync21 } from "fs";
|
|
69364
69237
|
function packageJsonUrl() {
|
|
@@ -69385,7 +69258,6 @@ var main = defineCommand248({
|
|
|
69385
69258
|
Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
|
|
69386
69259
|
Chat: Set BAKER_CHAT_ID for action and scheduled-agent commands that stage changes against a chat.
|
|
69387
69260
|
Output: All commands return JSON envelopes: { ok: true, data: ... } or { ok: false, error: { code, message } }.
|
|
69388
|
-
Fields: --fields a,b,c keeps only those keys of each record in data, on every command that prints the envelope.
|
|
69389
69261
|
Formats: --output json works on every command that prints the envelope. --output md|files only where 'baker schema <command>' lists output. (The research commands additionally accept csv and jsonl.)
|
|
69390
69262
|
Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
69391
69263
|
},
|
|
@@ -69425,11 +69297,6 @@ installStreamTaps();
|
|
|
69425
69297
|
logInvocation(process.argv.slice(2));
|
|
69426
69298
|
installExitRecord();
|
|
69427
69299
|
process.argv = [...process.argv.slice(0, 2), ...outputFlagForCommand(main, process.argv.slice(2))];
|
|
69428
|
-
var fieldsFlag = takeFieldsFlag(main, process.argv.slice(2));
|
|
69429
|
-
if (fieldsFlag.fields) {
|
|
69430
|
-
process.argv = [...process.argv.slice(0, 2), ...fieldsFlag.argv];
|
|
69431
|
-
installFieldMask(fieldsFlag.fields, commandPathOf(main, fieldsFlag.argv));
|
|
69432
|
-
}
|
|
69433
69300
|
refuseUnknownFlags(main, process.argv.slice(2));
|
|
69434
69301
|
process.argv = [...process.argv.slice(0, 2), ...cacheFlagForParser(process.argv.slice(2))];
|
|
69435
69302
|
runMain(main);
|