@koda-sl/baker-cli 0.110.1 → 0.111.0-dev.4a58faec8

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/dist/cli.js CHANGED
@@ -9,10 +9,10 @@ import {
9
9
  defaultRegistry,
10
10
  generateCatalog,
11
11
  validateCanvasDeep
12
- } from "./chunk-3JVYU72O.js";
12
+ } from "./chunk-26K7V346.js";
13
13
 
14
14
  // src/cli.ts
15
- import { defineCommand as defineCommand154, runMain } from "citty";
15
+ import { defineCommand as defineCommand155, runMain } from "citty";
16
16
 
17
17
  // src/commands/actions/index.ts
18
18
  import { defineCommand as defineCommand18 } from "citty";
@@ -31,6 +31,7 @@ function getEnv() {
31
31
  BAKER_API_KEY: z.string().startsWith("bk_", "API key must start with 'bk_'"),
32
32
  BAKER_API_URL: z.url("BAKER_API_URL must be a valid URL"),
33
33
  BAKER_CHAT_ID: z.string().optional(),
34
+ BAKER_ACTING_USER_ID: z.string().optional(),
34
35
  BAKER_GOOGLE_ADS_CUSTOMER_ID: z.string().regex(/^\d{10}$/).optional(),
35
36
  BAKER_GA4_PROPERTY_ID: z.string().optional(),
36
37
  BAKER_GSC_SITE_URL: z.string().optional(),
@@ -11278,7 +11279,7 @@ function roleForType(type) {
11278
11279
  return "the showcased product; keep this exact product identity. Ignore any caption text printed on this reference.";
11279
11280
  case "person":
11280
11281
  case "animal":
11281
- return "the hero subject; keep this identity AND the expression the blueprint specifies. Ignore any caption text printed on this reference.";
11282
+ return "the emotional hero \u2014 the face/muzzle/eyes the viewer locks onto and exactly where AI artifacts (malformed mouths, teeth, foam, extra fingers) betray a fake. It MUST be grounded in this real reference, never invented from prose. Keep this identity AND the expression the blueprint specifies. Ignore any caption text printed on this reference.";
11282
11283
  default:
11283
11284
  return "an identity-bearing element; reproduce it faithfully from this reference. Ignore any caption text printed on it.";
11284
11285
  }
@@ -11286,7 +11287,9 @@ function roleForType(type) {
11286
11287
  function todoPath(el, label) {
11287
11288
  const desc = el.description ? ` \u2014 ${el.description}` : "";
11288
11289
  const expr = el.expression ? `, with a ${el.expression} expression` : "";
11289
- return `[TODO: drop a real image for ${label} (${el.type})${desc}${expr}]`;
11290
+ const t = el.type.toLowerCase();
11291
+ const lock = t === "person" || t === "animal" ? " \u2014 REQUIRED: this is the emotional hero; ground it in a real reference (image-library / video-library / Pinterest), do not delete this slot and free-generate" : "";
11292
+ return `[TODO: drop a real image for ${label} (${el.type})${desc}${expr}${lock}]`;
11290
11293
  }
11291
11294
  function aspectRatio(blueprint, opts) {
11292
11295
  const requested = opts.aspectRatio ?? blueprint.meta?.estimated_aspect_ratio;
@@ -11401,7 +11404,7 @@ function resolveModel(kind, preferred) {
11401
11404
  const ids = Object.keys(MODEL_REGISTRY[kind]);
11402
11405
  return ids.includes(preferred) ? preferred : ids[0] ?? preferred;
11403
11406
  }
11404
- var DESCRIBE_FOCUS = "the GLOBAL LAYOUT GEOMETRY above all \u2014 the column/row grid, each region's approximate bounds as a percentage of frame width and height, any panel SPLITS and their proportions (e.g. a left column split into a ~60% top photo and a ~20% bottom price box), what occupies every region, and for EVERY text block its string verbatim, relative size (x_large | large | medium | small), weight, case, color, and alignment \u2014 including small bottom-corner fine print. Also: the EXPRESSION and emotion of every person/animal (capture exaggerated or AI-edited faces), the ad_intent (what feeling it engineers and how), per-color brand_ownership (which colors are the advertiser's brand vs borrowed-functional like a red comparison column), logos by brand, and all visible text verbatim";
11407
+ var DESCRIBE_FOCUS = `the GLOBAL LAYOUT GEOMETRY above all \u2014 the column/row grid, each region's approximate bounds as a percentage of frame width and height, any panel SPLITS and their proportions (e.g. a left column split into a ~60% top photo and a ~20% bottom price box), what occupies every region, and for EVERY text block its string verbatim, relative size (x_large | large | medium | small), weight, case, color, and alignment \u2014 including small bottom-corner fine print. Also: the EXPRESSION and emotion of every person/animal (capture exaggerated or AI-edited faces), the ad_intent (what feeling it engineers and how), per-color brand_ownership (which colors are the advertiser's brand vs borrowed-functional like a red comparison column), logos by brand, and all visible text verbatim. CRITICAL \u2014 name the WINNING MECHANISM(S): the special sauce, the specific thing that makes THIS ad a candidate winner rather than a generic ad. A great ad is rarely great by accident, and the mechanism is invisible unless named, so a faithful rewrite quietly discards it. It may be VERBAL (a rhyme, pun, alliteration, rhythm/meter, repetition, antithesis, double meaning), VISUAL (an unexpected crop or scale, a visual gag or pun, a striking juxtaposition, a pattern interrupt, an exaggerated/AI-edited expression, a before/after or comparison, bold negative space, a surprising focal point), or STRUCTURAL (an unusual hook, order, or reveal). Record each as a \`winning_mechanisms\` array of { kind: verbal|visual|structural, device, why_it_works } (e.g. { kind: verbal, device: "rhyme \u2014 'today' / 'go away'", why_it_works: "memorable, playful, reframes cost as relief" }) so a rewrite can rebuild the SAUCE for our brand instead of adapting only the surface and losing what made it convert`;
11405
11408
  var LAYOUT_SYSTEM = "You convert an advertisement's JSON blueprint into a precise, structured LAYOUT MAP of the frame \u2014 the spatial grid a designer would rebuild it from. Be exhaustive and quantitative: every region, its bounds as a percentage of the frame, and every text block with its relative size. Output ONLY a JSON object, no prose.";
11406
11409
  var LAYOUT_PROMPT = `AD BLUEPRINT (from image_describe):
11407
11410
  {{blueprint}}
@@ -11423,7 +11426,20 @@ Return a JSON object describing the GLOBAL LAYOUT of the frame precisely enough
11423
11426
 
11424
11427
  Use the blueprint's positions, sizes, text_content, and colors. Estimate the percentages and split proportions as accurately as you can (e.g. a column split 60/20 with a 20% gap). Cover EVERY visible element \u2014 photos, text boxes, badges, background shapes, and small corner text \u2014 top-to-bottom, left-to-right. Output ONLY the JSON object.`;
11425
11428
  var SELECT_SYSTEM = 'You identify the MAIN, identity-critical visual elements of an advertisement from its JSON blueprint \u2014 the things a faithful reproduction must supply as REAL reference images instead of letting a model invent them. Output ONLY a JSON object of the form { "elements": [ ... ] }, no prose.';
11426
- var SELECT_PROMPT = 'AD BLUEPRINT (from image_describe):\n{{blueprint}}\n\nFrom this blueprint, list ONLY the elements that are prominent, important, and identity-bearing \u2014 the ones a reproduction must ground in a real asset:\n- the brand logo/wordmark (from brands_logos with function_in_image = advertiser_brand) -> type "logo"\n- trust/rating/certification/app-store/review badges (brands_logos with function_in_image = trust_badge | review_platform | certification_or_seal | app_store_badge | payment_method) -> type "badge"\n- a showcased/hero product or package (a foreground entry in subjects that the ad is selling) -> type "product"\n- a foreground person whose identity matters (from people) -> type "person"\n- a foreground animal/character with a specific expression (from subjects) -> type "animal"\n\nDROP background extras, decorative props, generic scenery, and anything small or incidental. Keep at most ~6. If there are none, return an empty list.\n\nFor each kept element return: { "type": one of logo|product|person|animal|badge, "label": a short UPPER_SNAKE_CASE name (e.g. LOGO, PRODUCT, HERO_DOG, TRUSTPILOT), "description": a concrete reusable description to source/shoot the real asset (include the exact expression for a living subject), "expression": the facial expression for a living subject or null, "reason": why it is identity-critical, "locator": the blueprint entry this element came from as { "collection": one of "subjects" | "people" | "brands_logos", "index": its 0-based position in that array } (people -> people; logos/badges -> brands_logos; products/animals/objects -> subjects). Output ONLY the JSON object.';
11429
+ var SELECT_PROMPT = `AD BLUEPRINT (from image_describe):
11430
+ {{blueprint}}
11431
+
11432
+ From this blueprint, list ONLY the elements that are prominent, important, and identity-bearing \u2014 the ones a reproduction must ground in a real asset:
11433
+ - the brand logo/wordmark (from brands_logos with function_in_image = advertiser_brand) -> type "logo"
11434
+ - trust/rating/certification/app-store/review badges (brands_logos with function_in_image = trust_badge | review_platform | certification_or_seal | app_store_badge | payment_method) -> type "badge"
11435
+ - a showcased/hero product or package (a foreground entry in subjects that the ad is selling) -> type "product"
11436
+ - a foreground person (from people) \u2014 keep it when its identity matters OR it is the emotional/hero focal point of the ad, even a generic one with no brand identity -> type "person"
11437
+ - a foreground animal/character (from subjects) \u2014 keep it when it carries a specific expression OR it is the emotional/hero focal point, even a generic one -> type "animal"
11438
+ (For both: a free-generated face, muzzle, hands, or teeth reads as AI and grows artifacts \u2014 malformed mouths, extra fingers, foam \u2014 so the emotional hero needs the STRONGEST real grounding, not the weakest; "it's just a generic dog/person" is never a reason to drop it.)
11439
+
11440
+ DROP background extras, decorative props, generic scenery, and anything small or incidental. Keep at most ~6. If there are none, return an empty list.
11441
+
11442
+ For each kept element return: { "type": one of logo|product|person|animal|badge, "label": a short UPPER_SNAKE_CASE name (e.g. LOGO, PRODUCT, HERO_DOG, TRUSTPILOT), "description": a concrete reusable description to source/shoot the real asset (include the exact expression for a living subject, and its castable attributes \u2014 breed/species for an animal, apparent age band, apparent origin/ethnicity, and wardrobe/setting for a person \u2014 so it can be recast to fit OUR audience/market), "expression": the facial expression for a living subject or null, "reason": why it is identity-critical, "locator": the blueprint entry this element came from as { "collection": one of "subjects" | "people" | "brands_logos", "index": its 0-based position in that array } (people -> people; logos/badges -> brands_logos; products/animals/objects -> subjects). Output ONLY the JSON object.`;
11427
11443
  async function loadAssetText(ref, label) {
11428
11444
  const r = ref;
11429
11445
  if (typeof r?.path === "string") return readFile3(r.path, "utf8");
@@ -18356,11 +18372,162 @@ Paid transforms (run on the Convex backend, cost-tracked):
18356
18372
  }
18357
18373
  });
18358
18374
 
18375
+ // src/commands/mcp/index.ts
18376
+ import { defineCommand as defineCommand123 } from "citty";
18377
+ var SCOPES = ["user", "company", "org"];
18378
+ function parseScope(raw) {
18379
+ const scope = raw === void 0 ? "company" : String(raw);
18380
+ if (!SCOPES.includes(scope)) {
18381
+ throw new ApiError("VALIDATION_ERROR", `Invalid --scope "${scope}". Use user | company | org.`);
18382
+ }
18383
+ return scope;
18384
+ }
18385
+ function actingUserId() {
18386
+ return getEnv().BAKER_ACTING_USER_ID;
18387
+ }
18388
+ function parseHeaders(raw) {
18389
+ const list = raw === void 0 ? [] : Array.isArray(raw) ? raw : [raw];
18390
+ const headers = {};
18391
+ for (const entry of list) {
18392
+ const text = String(entry);
18393
+ const sep = text.indexOf(":") >= 0 && (text.indexOf(":") < text.indexOf("=") || text.indexOf("=") < 0) ? ":" : "=";
18394
+ const at = text.indexOf(sep);
18395
+ if (at <= 0) {
18396
+ throw new ApiError("VALIDATION_ERROR", `Invalid header "${text}". Use "Key: Value".`);
18397
+ }
18398
+ headers[text.slice(0, at).trim()] = text.slice(at + 1).trim();
18399
+ }
18400
+ return Object.keys(headers).length > 0 ? headers : void 0;
18401
+ }
18402
+ function fail3(err) {
18403
+ if (err instanceof ApiError) {
18404
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
18405
+ process.exit(1);
18406
+ }
18407
+ writeJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
18408
+ process.exit(1);
18409
+ }
18410
+ registerSchema({
18411
+ command: "mcp.list",
18412
+ description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
18413
+ args: {}
18414
+ });
18415
+ var listCommand4 = defineCommand123({
18416
+ meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
18417
+ run: async () => {
18418
+ try {
18419
+ const user = actingUserId();
18420
+ const data = await apiGet(
18421
+ "/api/mcp/custom",
18422
+ user ? { actingUserId: user } : void 0
18423
+ );
18424
+ writeJson({ ok: true, data: data.servers });
18425
+ } catch (err) {
18426
+ fail3(err);
18427
+ }
18428
+ }
18429
+ });
18430
+ registerSchema({
18431
+ command: "mcp.add",
18432
+ description: "Register a custom MCP server. Tools appear as mcp__<name>__* on the next message. URL must be HTTPS. Scope: company (default, all chats) | org (org admin key) | user (only the current sender).",
18433
+ args: {
18434
+ name: { type: "string", description: "Server name \u2192 tools appear as mcp__<name>__*", required: true },
18435
+ url: { type: "string", description: "HTTPS MCP endpoint", required: true },
18436
+ scope: { type: "string", description: "user | company | org (default company)", required: false },
18437
+ header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
18438
+ }
18439
+ });
18440
+ var addCommand = defineCommand123({
18441
+ meta: {
18442
+ name: "add",
18443
+ description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
18444
+
18445
+ Scope: company (default \u2014 every chat in the company) | org (all companies in the org; needs an admin key) | user (only the current message sender).
18446
+
18447
+ Examples:
18448
+ baker mcp add --name weather --url https://mcp.example.com/mcp
18449
+ baker mcp add --name acme --url https://acme.dev/mcp --header "Authorization: Bearer sk-\u2026"
18450
+ baker mcp add --name mine --url https://my.dev/mcp --scope user`
18451
+ },
18452
+ args: {
18453
+ name: { type: "string", description: "Server name (mcp__<name>__*)", required: true },
18454
+ url: { type: "string", description: "HTTPS MCP endpoint", required: true },
18455
+ scope: { type: "string", description: "user | company | org (default company)", required: false },
18456
+ header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
18457
+ },
18458
+ run: async ({ args }) => {
18459
+ try {
18460
+ const scope = parseScope(args.scope);
18461
+ const user = actingUserId();
18462
+ const headers = parseHeaders(args.header);
18463
+ const data = await apiPost("/api/mcp/custom", {
18464
+ name: args.name,
18465
+ url: args.url,
18466
+ scope,
18467
+ ...user ? { actingUserId: user } : {},
18468
+ ...headers ? { headers } : {}
18469
+ });
18470
+ writeJson({ ok: true, data });
18471
+ } catch (err) {
18472
+ fail3(err);
18473
+ }
18474
+ }
18475
+ });
18476
+ registerSchema({
18477
+ command: "mcp.remove",
18478
+ description: "Remove a company custom MCP server by name.",
18479
+ args: { name: { type: "string", description: "Server name to remove", required: true } }
18480
+ });
18481
+ var removeCommand3 = defineCommand123({
18482
+ meta: {
18483
+ name: "remove",
18484
+ description: `Remove a company custom MCP server by name.
18485
+
18486
+ Example:
18487
+ baker mcp remove --name weather`
18488
+ },
18489
+ args: { name: { type: "string", description: "Server name to remove", required: true } },
18490
+ run: async ({ args }) => {
18491
+ try {
18492
+ const user = actingUserId();
18493
+ const data = await apiPost("/api/mcp/custom/remove", {
18494
+ name: args.name,
18495
+ ...user ? { actingUserId: user } : {}
18496
+ });
18497
+ writeJson({ ok: true, data });
18498
+ } catch (err) {
18499
+ fail3(err);
18500
+ }
18501
+ }
18502
+ });
18503
+ var mcpCommand = defineCommand123({
18504
+ meta: {
18505
+ name: "mcp",
18506
+ description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
18507
+
18508
+ Tools from a registered server appear as mcp__<name>__* on the next message.
18509
+ Managed here are **company-scoped** servers; user- and org-scoped servers are managed in the dashboard.
18510
+
18511
+ Start here:
18512
+ baker mcp list
18513
+
18514
+ Examples:
18515
+ baker mcp add --name weather --url https://mcp.example.com/mcp
18516
+ baker mcp add --name acme --url https://acme.dev/mcp --header "Authorization: Bearer sk-\u2026"
18517
+ baker mcp remove --name weather`
18518
+ },
18519
+ subCommands: {
18520
+ list: listCommand4,
18521
+ add: addCommand,
18522
+ remove: removeCommand3
18523
+ }
18524
+ });
18525
+
18359
18526
  // src/commands/research/index.ts
18360
- import { defineCommand as defineCommand133 } from "citty";
18527
+ import { defineCommand as defineCommand134 } from "citty";
18361
18528
 
18362
18529
  // src/commands/research/advertisers.ts
18363
- import { defineCommand as defineCommand123 } from "citty";
18530
+ import { defineCommand as defineCommand124 } from "citty";
18364
18531
 
18365
18532
  // src/commands/research/output.ts
18366
18533
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -18473,7 +18640,7 @@ var FIELDS3 = {
18473
18640
  etv: "Estimated traffic value (USD)",
18474
18641
  visibility: "SERP visibility score (0-1)"
18475
18642
  };
18476
- var advertisersCommand = defineCommand123({
18643
+ var advertisersCommand = defineCommand124({
18477
18644
  meta: {
18478
18645
  name: "advertisers",
18479
18646
  description: `Find domains competing for a keyword in Google SERPs.
@@ -18520,7 +18687,7 @@ Examples:
18520
18687
  });
18521
18688
 
18522
18689
  // src/commands/research/autocomplete.ts
18523
- import { defineCommand as defineCommand124 } from "citty";
18690
+ import { defineCommand as defineCommand125 } from "citty";
18524
18691
  registerSchema({
18525
18692
  command: "research.autocomplete",
18526
18693
  description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -18543,7 +18710,7 @@ registerSchema({
18543
18710
  var FIELDS4 = {
18544
18711
  suggestion: "Autocomplete suggestion from Google"
18545
18712
  };
18546
- var autocompleteCommand = defineCommand124({
18713
+ var autocompleteCommand = defineCommand125({
18547
18714
  meta: {
18548
18715
  name: "autocomplete",
18549
18716
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -18589,7 +18756,7 @@ Examples:
18589
18756
  });
18590
18757
 
18591
18758
  // src/commands/research/countries.ts
18592
- import { defineCommand as defineCommand125 } from "citty";
18759
+ import { defineCommand as defineCommand126 } from "citty";
18593
18760
  registerSchema({
18594
18761
  command: "research.countries",
18595
18762
  description: "List all supported country codes for --location flag in research commands.",
@@ -18646,7 +18813,7 @@ var FIELDS5 = {
18646
18813
  code: "Country code to pass as --location",
18647
18814
  name: "Country name"
18648
18815
  };
18649
- var countriesCommand = defineCommand125({
18816
+ var countriesCommand = defineCommand126({
18650
18817
  meta: {
18651
18818
  name: "countries",
18652
18819
  description: "List all supported country codes for --location flag."
@@ -18657,7 +18824,7 @@ var countriesCommand = defineCommand125({
18657
18824
  });
18658
18825
 
18659
18826
  // src/commands/research/intent.ts
18660
- import { defineCommand as defineCommand126 } from "citty";
18827
+ import { defineCommand as defineCommand127 } from "citty";
18661
18828
  registerSchema({
18662
18829
  command: "research.intent",
18663
18830
  description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
@@ -18680,7 +18847,7 @@ var FIELDS6 = {
18680
18847
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
18681
18848
  probability: "Confidence score 0.0-1.0"
18682
18849
  };
18683
- var intentCommand = defineCommand126({
18850
+ var intentCommand = defineCommand127({
18684
18851
  meta: {
18685
18852
  name: "intent",
18686
18853
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -18728,7 +18895,7 @@ Examples:
18728
18895
  });
18729
18896
 
18730
18897
  // src/commands/research/keyword-gap.ts
18731
- import { defineCommand as defineCommand127 } from "citty";
18898
+ import { defineCommand as defineCommand128 } from "citty";
18732
18899
  registerSchema({
18733
18900
  command: "research.keyword-gap",
18734
18901
  description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -18757,7 +18924,7 @@ var FIELDS7 = {
18757
18924
  cpc: "Cost per click USD",
18758
18925
  their_position: "Competitor's ranking position"
18759
18926
  };
18760
- var keywordGapCommand = defineCommand127({
18927
+ var keywordGapCommand = defineCommand128({
18761
18928
  meta: {
18762
18929
  name: "keyword-gap",
18763
18930
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -18831,7 +18998,7 @@ Examples:
18831
18998
  });
18832
18999
 
18833
19000
  // src/commands/research/keywords-for-site.ts
18834
- import { defineCommand as defineCommand128 } from "citty";
19001
+ import { defineCommand as defineCommand129 } from "citty";
18835
19002
  registerSchema({
18836
19003
  command: "research.keywords-for-site",
18837
19004
  description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
@@ -18864,7 +19031,7 @@ var FIELDS8 = {
18864
19031
  competition: "LOW, MEDIUM, or HIGH",
18865
19032
  competition_index: "Competition score 0-100"
18866
19033
  };
18867
- var keywordsForSiteCommand = defineCommand128({
19034
+ var keywordsForSiteCommand = defineCommand129({
18868
19035
  meta: {
18869
19036
  name: "keywords-for-site",
18870
19037
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -18917,7 +19084,7 @@ Examples:
18917
19084
  });
18918
19085
 
18919
19086
  // src/commands/research/languages.ts
18920
- import { defineCommand as defineCommand129 } from "citty";
19087
+ import { defineCommand as defineCommand130 } from "citty";
18921
19088
  registerSchema({
18922
19089
  command: "research.languages",
18923
19090
  description: "List all supported language codes for --language flag in research commands.",
@@ -18947,7 +19114,7 @@ var FIELDS9 = {
18947
19114
  code: "Language code to pass as --language",
18948
19115
  name: "Language name (also accepted by --language)"
18949
19116
  };
18950
- var languagesCommand2 = defineCommand129({
19117
+ var languagesCommand2 = defineCommand130({
18951
19118
  meta: {
18952
19119
  name: "languages",
18953
19120
  description: "List all supported language codes for --language flag."
@@ -18958,7 +19125,7 @@ var languagesCommand2 = defineCommand129({
18958
19125
  });
18959
19126
 
18960
19127
  // src/commands/research/lighthouse.ts
18961
- import { defineCommand as defineCommand130 } from "citty";
19128
+ import { defineCommand as defineCommand131 } from "citty";
18962
19129
  registerSchema({
18963
19130
  command: "research.lighthouse",
18964
19131
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -18977,7 +19144,7 @@ var FIELDS10 = {
18977
19144
  speed_index_ms: "Speed Index in ms (good: < 3400)",
18978
19145
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
18979
19146
  };
18980
- var lighthouseCommand = defineCommand130({
19147
+ var lighthouseCommand = defineCommand131({
18981
19148
  meta: {
18982
19149
  name: "lighthouse",
18983
19150
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -19015,7 +19182,7 @@ Examples:
19015
19182
  });
19016
19183
 
19017
19184
  // src/commands/research/relevant-pages.ts
19018
- import { defineCommand as defineCommand131 } from "citty";
19185
+ import { defineCommand as defineCommand132 } from "citty";
19019
19186
  registerSchema({
19020
19187
  command: "research.relevant-pages",
19021
19188
  description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
@@ -19041,7 +19208,7 @@ var FIELDS11 = {
19041
19208
  keywords: "Total organic keywords the page ranks for",
19042
19209
  top_10: "Keywords in positions 1-10"
19043
19210
  };
19044
- var relevantPagesCommand = defineCommand131({
19211
+ var relevantPagesCommand = defineCommand132({
19045
19212
  meta: {
19046
19213
  name: "relevant-pages",
19047
19214
  description: `Get the top pages of a competitor domain with traffic data.
@@ -19087,7 +19254,7 @@ Examples:
19087
19254
  });
19088
19255
 
19089
19256
  // src/commands/research/web.ts
19090
- import { defineCommand as defineCommand132 } from "citty";
19257
+ import { defineCommand as defineCommand133 } from "citty";
19091
19258
  registerSchema({
19092
19259
  command: "research.web",
19093
19260
  description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
@@ -19138,7 +19305,7 @@ async function runDeepResearch(question) {
19138
19305
  }
19139
19306
  throw new Error("Deep research timed out");
19140
19307
  }
19141
- var webCommand = defineCommand132({
19308
+ var webCommand = defineCommand133({
19142
19309
  meta: {
19143
19310
  name: "web",
19144
19311
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -19198,7 +19365,7 @@ Examples:
19198
19365
  });
19199
19366
 
19200
19367
  // src/commands/research/index.ts
19201
- var researchCommand = defineCommand133({
19368
+ var researchCommand = defineCommand134({
19202
19369
  meta: {
19203
19370
  name: "research",
19204
19371
  description: `Competitive intelligence and AI-powered research commands.
@@ -19238,10 +19405,10 @@ Examples:
19238
19405
  });
19239
19406
 
19240
19407
  // src/commands/scheduled-actions/index.ts
19241
- import { defineCommand as defineCommand140 } from "citty";
19408
+ import { defineCommand as defineCommand141 } from "citty";
19242
19409
 
19243
19410
  // src/commands/scheduled-actions/create.ts
19244
- import { defineCommand as defineCommand134 } from "citty";
19411
+ import { defineCommand as defineCommand135 } from "citty";
19245
19412
 
19246
19413
  // src/commands/scheduled-actions/shared.ts
19247
19414
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -19356,7 +19523,7 @@ registerSchema({
19356
19523
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
19357
19524
  }
19358
19525
  });
19359
- var createCommand2 = defineCommand134({
19526
+ var createCommand2 = defineCommand135({
19360
19527
  meta: {
19361
19528
  name: "create",
19362
19529
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -19405,7 +19572,7 @@ var createCommand2 = defineCommand134({
19405
19572
  });
19406
19573
 
19407
19574
  // src/commands/scheduled-actions/delete.ts
19408
- import { defineCommand as defineCommand135 } from "citty";
19575
+ import { defineCommand as defineCommand136 } from "citty";
19409
19576
  registerSchema({
19410
19577
  command: "scheduled-actions.delete",
19411
19578
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -19413,7 +19580,7 @@ registerSchema({
19413
19580
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
19414
19581
  }
19415
19582
  });
19416
- var deleteCommand2 = defineCommand135({
19583
+ var deleteCommand2 = defineCommand136({
19417
19584
  meta: {
19418
19585
  name: "delete",
19419
19586
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -19442,7 +19609,7 @@ var deleteCommand2 = defineCommand135({
19442
19609
  });
19443
19610
 
19444
19611
  // src/commands/scheduled-actions/get.ts
19445
- import { defineCommand as defineCommand136 } from "citty";
19612
+ import { defineCommand as defineCommand137 } from "citty";
19446
19613
  registerSchema({
19447
19614
  command: "scheduled-actions.get",
19448
19615
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -19450,7 +19617,7 @@ registerSchema({
19450
19617
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
19451
19618
  }
19452
19619
  });
19453
- var getCommand3 = defineCommand136({
19620
+ var getCommand3 = defineCommand137({
19454
19621
  meta: {
19455
19622
  name: "get",
19456
19623
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -19487,13 +19654,13 @@ var getCommand3 = defineCommand136({
19487
19654
  });
19488
19655
 
19489
19656
  // src/commands/scheduled-actions/list.ts
19490
- import { defineCommand as defineCommand137 } from "citty";
19657
+ import { defineCommand as defineCommand138 } from "citty";
19491
19658
  registerSchema({
19492
19659
  command: "scheduled-actions.list",
19493
19660
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
19494
19661
  args: {}
19495
19662
  });
19496
- var listCommand4 = defineCommand137({
19663
+ var listCommand5 = defineCommand138({
19497
19664
  meta: {
19498
19665
  name: "list",
19499
19666
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -19514,7 +19681,7 @@ var listCommand4 = defineCommand137({
19514
19681
  });
19515
19682
 
19516
19683
  // src/commands/scheduled-actions/trigger.ts
19517
- import { defineCommand as defineCommand138 } from "citty";
19684
+ import { defineCommand as defineCommand139 } from "citty";
19518
19685
  registerSchema({
19519
19686
  command: "scheduled-actions.trigger",
19520
19687
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -19522,7 +19689,7 @@ registerSchema({
19522
19689
  id: { type: "string", description: "Published scheduled action ID", required: true }
19523
19690
  }
19524
19691
  });
19525
- var triggerCommand = defineCommand138({
19692
+ var triggerCommand = defineCommand139({
19526
19693
  meta: {
19527
19694
  name: "trigger",
19528
19695
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -19559,7 +19726,7 @@ var triggerCommand = defineCommand138({
19559
19726
  });
19560
19727
 
19561
19728
  // src/commands/scheduled-actions/update.ts
19562
- import { defineCommand as defineCommand139 } from "citty";
19729
+ import { defineCommand as defineCommand140 } from "citty";
19563
19730
  registerSchema({
19564
19731
  command: "scheduled-actions.update",
19565
19732
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -19584,7 +19751,7 @@ registerSchema({
19584
19751
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
19585
19752
  }
19586
19753
  });
19587
- var updateCommand2 = defineCommand139({
19754
+ var updateCommand2 = defineCommand140({
19588
19755
  meta: {
19589
19756
  name: "update",
19590
19757
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -19655,7 +19822,7 @@ var updateCommand2 = defineCommand139({
19655
19822
  });
19656
19823
 
19657
19824
  // src/commands/scheduled-actions/index.ts
19658
- var scheduledActionsCommand = defineCommand140({
19825
+ var scheduledActionsCommand = defineCommand141({
19659
19826
  meta: {
19660
19827
  name: "scheduled-actions",
19661
19828
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -19671,7 +19838,7 @@ Examples:
19671
19838
  baker scheduled-actions trigger <id>`
19672
19839
  },
19673
19840
  subCommands: {
19674
- list: listCommand4,
19841
+ list: listCommand5,
19675
19842
  get: getCommand3,
19676
19843
  create: createCommand2,
19677
19844
  update: updateCommand2,
@@ -19681,8 +19848,8 @@ Examples:
19681
19848
  });
19682
19849
 
19683
19850
  // src/commands/schema.ts
19684
- import { defineCommand as defineCommand141 } from "citty";
19685
- var schemaCommand = defineCommand141({
19851
+ import { defineCommand as defineCommand142 } from "citty";
19852
+ var schemaCommand = defineCommand142({
19686
19853
  meta: {
19687
19854
  name: "schema",
19688
19855
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -19718,10 +19885,10 @@ var schemaCommand = defineCommand141({
19718
19885
  });
19719
19886
 
19720
19887
  // src/commands/testimonials/index.ts
19721
- import { defineCommand as defineCommand145 } from "citty";
19888
+ import { defineCommand as defineCommand146 } from "citty";
19722
19889
 
19723
19890
  // src/commands/testimonials/get.ts
19724
- import { defineCommand as defineCommand142 } from "citty";
19891
+ import { defineCommand as defineCommand143 } from "citty";
19725
19892
  registerSchema({
19726
19893
  command: "testimonials.get",
19727
19894
  description: "Get a single testimonial by ID",
@@ -19729,7 +19896,7 @@ registerSchema({
19729
19896
  id: { type: "string", description: "Testimonial ID", required: true }
19730
19897
  }
19731
19898
  });
19732
- var getCommand4 = defineCommand142({
19899
+ var getCommand4 = defineCommand143({
19733
19900
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
19734
19901
  args: {
19735
19902
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -19766,7 +19933,7 @@ var getCommand4 = defineCommand142({
19766
19933
  });
19767
19934
 
19768
19935
  // src/commands/testimonials/list.ts
19769
- import { defineCommand as defineCommand143 } from "citty";
19936
+ import { defineCommand as defineCommand144 } from "citty";
19770
19937
  registerSchema({
19771
19938
  command: "testimonials.list",
19772
19939
  description: "List testimonials with optional filters.",
@@ -19796,7 +19963,7 @@ registerSchema({
19796
19963
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
19797
19964
  }
19798
19965
  });
19799
- var listCommand5 = defineCommand143({
19966
+ var listCommand6 = defineCommand144({
19800
19967
  meta: {
19801
19968
  name: "list",
19802
19969
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -19845,7 +20012,7 @@ var listCommand5 = defineCommand143({
19845
20012
  });
19846
20013
 
19847
20014
  // src/commands/testimonials/search.ts
19848
- import { defineCommand as defineCommand144 } from "citty";
20015
+ import { defineCommand as defineCommand145 } from "citty";
19849
20016
  registerSchema({
19850
20017
  command: "testimonials.search",
19851
20018
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -19876,7 +20043,7 @@ registerSchema({
19876
20043
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
19877
20044
  }
19878
20045
  });
19879
- var searchCommand2 = defineCommand144({
20046
+ var searchCommand2 = defineCommand145({
19880
20047
  meta: {
19881
20048
  name: "search",
19882
20049
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -19950,7 +20117,7 @@ var searchCommand2 = defineCommand144({
19950
20117
  var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
19951
20118
 
19952
20119
  // src/commands/testimonials/index.ts
19953
- var testimonialsCommand = defineCommand145({
20120
+ var testimonialsCommand = defineCommand146({
19954
20121
  meta: {
19955
20122
  name: "testimonials",
19956
20123
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -19965,16 +20132,16 @@ Examples:
19965
20132
  subCommands: {
19966
20133
  get: getCommand4,
19967
20134
  search: searchCommand2,
19968
- list: listCommand5,
20135
+ list: listCommand6,
19969
20136
  tags: tagsCommand3
19970
20137
  }
19971
20138
  });
19972
20139
 
19973
20140
  // src/commands/videos/index.ts
19974
- import { defineCommand as defineCommand150 } from "citty";
20141
+ import { defineCommand as defineCommand151 } from "citty";
19975
20142
 
19976
20143
  // src/commands/videos/delete.ts
19977
- import { defineCommand as defineCommand146 } from "citty";
20144
+ import { defineCommand as defineCommand147 } from "citty";
19978
20145
  registerSchema({
19979
20146
  command: "videos.delete",
19980
20147
  description: "Delete a video by ID",
@@ -19988,7 +20155,7 @@ registerSchema({
19988
20155
  }
19989
20156
  }
19990
20157
  });
19991
- var deleteCommand3 = defineCommand146({
20158
+ var deleteCommand3 = defineCommand147({
19992
20159
  meta: {
19993
20160
  name: "delete",
19994
20161
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -20029,7 +20196,7 @@ var deleteCommand3 = defineCommand146({
20029
20196
  });
20030
20197
 
20031
20198
  // src/commands/videos/get.ts
20032
- import { defineCommand as defineCommand147 } from "citty";
20199
+ import { defineCommand as defineCommand148 } from "citty";
20033
20200
  registerSchema({
20034
20201
  command: "videos.get",
20035
20202
  description: "Get a single video by ID",
@@ -20037,7 +20204,7 @@ registerSchema({
20037
20204
  id: { type: "string", description: "Video ID", required: true }
20038
20205
  }
20039
20206
  });
20040
- var getCommand5 = defineCommand147({
20207
+ var getCommand5 = defineCommand148({
20041
20208
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
20042
20209
  args: {
20043
20210
  id: { type: "positional", description: "Video ID", required: false },
@@ -20074,7 +20241,7 @@ var getCommand5 = defineCommand147({
20074
20241
  });
20075
20242
 
20076
20243
  // src/commands/videos/search.ts
20077
- import { defineCommand as defineCommand148 } from "citty";
20244
+ import { defineCommand as defineCommand149 } from "citty";
20078
20245
  registerSchema({
20079
20246
  command: "videos.search",
20080
20247
  description: "Search videos by text query. Only returns ready videos.",
@@ -20084,7 +20251,7 @@ registerSchema({
20084
20251
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
20085
20252
  }
20086
20253
  });
20087
- var searchCommand3 = defineCommand148({
20254
+ var searchCommand3 = defineCommand149({
20088
20255
  meta: {
20089
20256
  name: "search",
20090
20257
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -20136,7 +20303,7 @@ var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
20136
20303
  // src/commands/videos/upload.ts
20137
20304
  import { readFile as readFile12, stat as stat3 } from "fs/promises";
20138
20305
  import { extname as extname3 } from "path";
20139
- import { defineCommand as defineCommand149 } from "citty";
20306
+ import { defineCommand as defineCommand150 } from "citty";
20140
20307
  var MIME_MAP = {
20141
20308
  ".mp4": "video/mp4",
20142
20309
  ".mov": "video/quicktime",
@@ -20170,7 +20337,7 @@ function detectContentType(filePath) {
20170
20337
  }
20171
20338
  return mime;
20172
20339
  }
20173
- var uploadCommand2 = defineCommand149({
20340
+ var uploadCommand2 = defineCommand150({
20174
20341
  meta: {
20175
20342
  name: "upload",
20176
20343
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -20224,7 +20391,7 @@ var uploadCommand2 = defineCommand149({
20224
20391
  });
20225
20392
 
20226
20393
  // src/commands/videos/index.ts
20227
- var videosCommand = defineCommand150({
20394
+ var videosCommand = defineCommand151({
20228
20395
  meta: {
20229
20396
  name: "videos",
20230
20397
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -20247,10 +20414,10 @@ Examples:
20247
20414
  });
20248
20415
 
20249
20416
  // src/commands/winning-ads/index.ts
20250
- import { defineCommand as defineCommand153 } from "citty";
20417
+ import { defineCommand as defineCommand154 } from "citty";
20251
20418
 
20252
20419
  // src/commands/winning-ads/advertisers.ts
20253
- import { defineCommand as defineCommand151 } from "citty";
20420
+ import { defineCommand as defineCommand152 } from "citty";
20254
20421
  registerSchema({
20255
20422
  command: "winning-ads.advertisers",
20256
20423
  description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
@@ -20263,7 +20430,7 @@ registerSchema({
20263
20430
  function identity(record) {
20264
20431
  return record;
20265
20432
  }
20266
- var advertisersCommand2 = defineCommand151({
20433
+ var advertisersCommand2 = defineCommand152({
20267
20434
  meta: {
20268
20435
  name: "advertisers",
20269
20436
  description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
@@ -20314,7 +20481,7 @@ var advertisersCommand2 = defineCommand151({
20314
20481
  });
20315
20482
 
20316
20483
  // src/commands/winning-ads/search.ts
20317
- import { defineCommand as defineCommand152 } from "citty";
20484
+ import { defineCommand as defineCommand153 } from "citty";
20318
20485
  registerSchema({
20319
20486
  command: "winning-ads.search",
20320
20487
  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.",
@@ -20422,7 +20589,7 @@ function buildSearchBody(args) {
20422
20589
  }
20423
20590
  return body;
20424
20591
  }
20425
- var searchCommand4 = defineCommand152({
20592
+ var searchCommand4 = defineCommand153({
20426
20593
  meta: {
20427
20594
  name: "search",
20428
20595
  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"
@@ -20534,7 +20701,7 @@ var searchCommand4 = defineCommand152({
20534
20701
  });
20535
20702
 
20536
20703
  // src/commands/winning-ads/index.ts
20537
- var winningAdsCommand = defineCommand153({
20704
+ var winningAdsCommand = defineCommand154({
20538
20705
  meta: {
20539
20706
  name: "winning-ads",
20540
20707
  description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
@@ -20574,7 +20741,7 @@ function getCliVersion() {
20574
20741
  }
20575
20742
 
20576
20743
  // src/cli.ts
20577
- var main = defineCommand154({
20744
+ var main = defineCommand155({
20578
20745
  meta: {
20579
20746
  name: "baker",
20580
20747
  version: getCliVersion(),
@@ -20599,6 +20766,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
20599
20766
  testimonials: testimonialsCommand,
20600
20767
  canvas: canvasCommand,
20601
20768
  "winning-ads": winningAdsCommand,
20769
+ mcp: mcpCommand,
20602
20770
  schema: schemaCommand
20603
20771
  }
20604
20772
  });