@koda-sl/baker-cli 0.111.0-dev.94fd3a2a1 → 0.111.0-dev.b43dfb4db

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
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-26K7V346.js";
13
13
 
14
14
  // src/cli.ts
15
- import { defineCommand as defineCommand156, runMain } from "citty";
15
+ import { defineCommand as defineCommand157, 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(),
@@ -12649,7 +12650,7 @@ function roleForType(type) {
12649
12650
  return "the showcased product; keep this exact product identity. Ignore any caption text printed on this reference.";
12650
12651
  case "person":
12651
12652
  case "animal":
12652
- return "the hero subject; keep this identity AND the expression the blueprint specifies. Ignore any caption text printed on this reference.";
12653
+ 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.";
12653
12654
  default:
12654
12655
  return "an identity-bearing element; reproduce it faithfully from this reference. Ignore any caption text printed on it.";
12655
12656
  }
@@ -12657,7 +12658,9 @@ function roleForType(type) {
12657
12658
  function todoPath(el, label) {
12658
12659
  const desc = el.description ? ` \u2014 ${el.description}` : "";
12659
12660
  const expr = el.expression ? `, with a ${el.expression} expression` : "";
12660
- return `[TODO: drop a real image for ${label} (${el.type})${desc}${expr}]`;
12661
+ const t = el.type.toLowerCase();
12662
+ 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" : "";
12663
+ return `[TODO: drop a real image for ${label} (${el.type})${desc}${expr}${lock}]`;
12661
12664
  }
12662
12665
  function aspectRatio(blueprint, opts) {
12663
12666
  const requested = opts.aspectRatio ?? blueprint.meta?.estimated_aspect_ratio;
@@ -12772,7 +12775,7 @@ function resolveModel(kind, preferred) {
12772
12775
  const ids = Object.keys(MODEL_REGISTRY[kind]);
12773
12776
  return ids.includes(preferred) ? preferred : ids[0] ?? preferred;
12774
12777
  }
12775
- 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";
12778
+ 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`;
12776
12779
  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.";
12777
12780
  var LAYOUT_PROMPT = `AD BLUEPRINT (from image_describe):
12778
12781
  {{blueprint}}
@@ -12794,7 +12797,20 @@ Return a JSON object describing the GLOBAL LAYOUT of the frame precisely enough
12794
12797
 
12795
12798
  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.`;
12796
12799
  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.';
12797
- 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.';
12800
+ var SELECT_PROMPT = `AD BLUEPRINT (from image_describe):
12801
+ {{blueprint}}
12802
+
12803
+ 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:
12804
+ - the brand logo/wordmark (from brands_logos with function_in_image = advertiser_brand) -> type "logo"
12805
+ - 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"
12806
+ - a showcased/hero product or package (a foreground entry in subjects that the ad is selling) -> type "product"
12807
+ - 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"
12808
+ - 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"
12809
+ (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.)
12810
+
12811
+ DROP background extras, decorative props, generic scenery, and anything small or incidental. Keep at most ~6. If there are none, return an empty list.
12812
+
12813
+ 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.`;
12798
12814
  async function loadAssetText(ref, label) {
12799
12815
  const r = ref;
12800
12816
  if (typeof r?.path === "string") return readFile3(r.path, "utf8");
@@ -19727,11 +19743,162 @@ Paid transforms (run on the Convex backend, cost-tracked):
19727
19743
  }
19728
19744
  });
19729
19745
 
19746
+ // src/commands/mcp/index.ts
19747
+ import { defineCommand as defineCommand125 } from "citty";
19748
+ var SCOPES = ["user", "company", "org"];
19749
+ function parseScope(raw) {
19750
+ const scope = raw === void 0 ? "company" : String(raw);
19751
+ if (!SCOPES.includes(scope)) {
19752
+ throw new ApiError("VALIDATION_ERROR", `Invalid --scope "${scope}". Use user | company | org.`);
19753
+ }
19754
+ return scope;
19755
+ }
19756
+ function actingUserId() {
19757
+ return getEnv().BAKER_ACTING_USER_ID;
19758
+ }
19759
+ function parseHeaders(raw) {
19760
+ const list = raw === void 0 ? [] : Array.isArray(raw) ? raw : [raw];
19761
+ const headers = {};
19762
+ for (const entry of list) {
19763
+ const text = String(entry);
19764
+ const sep = text.indexOf(":") >= 0 && (text.indexOf(":") < text.indexOf("=") || text.indexOf("=") < 0) ? ":" : "=";
19765
+ const at = text.indexOf(sep);
19766
+ if (at <= 0) {
19767
+ throw new ApiError("VALIDATION_ERROR", `Invalid header "${text}". Use "Key: Value".`);
19768
+ }
19769
+ headers[text.slice(0, at).trim()] = text.slice(at + 1).trim();
19770
+ }
19771
+ return Object.keys(headers).length > 0 ? headers : void 0;
19772
+ }
19773
+ function fail3(err) {
19774
+ if (err instanceof ApiError) {
19775
+ writeJson({ ok: false, error: { code: err.code, message: err.message } });
19776
+ process.exit(1);
19777
+ }
19778
+ writeJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
19779
+ process.exit(1);
19780
+ }
19781
+ registerSchema({
19782
+ command: "mcp.list",
19783
+ description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
19784
+ args: {}
19785
+ });
19786
+ var listCommand4 = defineCommand125({
19787
+ meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
19788
+ run: async () => {
19789
+ try {
19790
+ const user = actingUserId();
19791
+ const data = await apiGet(
19792
+ "/api/mcp/custom",
19793
+ user ? { actingUserId: user } : void 0
19794
+ );
19795
+ writeJson({ ok: true, data: data.servers });
19796
+ } catch (err) {
19797
+ fail3(err);
19798
+ }
19799
+ }
19800
+ });
19801
+ registerSchema({
19802
+ command: "mcp.add",
19803
+ 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).",
19804
+ args: {
19805
+ name: { type: "string", description: "Server name \u2192 tools appear as mcp__<name>__*", required: true },
19806
+ url: { type: "string", description: "HTTPS MCP endpoint", required: true },
19807
+ scope: { type: "string", description: "user | company | org (default company)", required: false },
19808
+ header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
19809
+ }
19810
+ });
19811
+ var addCommand = defineCommand125({
19812
+ meta: {
19813
+ name: "add",
19814
+ description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
19815
+
19816
+ 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).
19817
+
19818
+ Examples:
19819
+ baker mcp add --name weather --url https://mcp.example.com/mcp
19820
+ baker mcp add --name acme --url https://acme.dev/mcp --header "Authorization: Bearer sk-\u2026"
19821
+ baker mcp add --name mine --url https://my.dev/mcp --scope user`
19822
+ },
19823
+ args: {
19824
+ name: { type: "string", description: "Server name (mcp__<name>__*)", required: true },
19825
+ url: { type: "string", description: "HTTPS MCP endpoint", required: true },
19826
+ scope: { type: "string", description: "user | company | org (default company)", required: false },
19827
+ header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
19828
+ },
19829
+ run: async ({ args }) => {
19830
+ try {
19831
+ const scope = parseScope(args.scope);
19832
+ const user = actingUserId();
19833
+ const headers = parseHeaders(args.header);
19834
+ const data = await apiPost("/api/mcp/custom", {
19835
+ name: args.name,
19836
+ url: args.url,
19837
+ scope,
19838
+ ...user ? { actingUserId: user } : {},
19839
+ ...headers ? { headers } : {}
19840
+ });
19841
+ writeJson({ ok: true, data });
19842
+ } catch (err) {
19843
+ fail3(err);
19844
+ }
19845
+ }
19846
+ });
19847
+ registerSchema({
19848
+ command: "mcp.remove",
19849
+ description: "Remove a company custom MCP server by name.",
19850
+ args: { name: { type: "string", description: "Server name to remove", required: true } }
19851
+ });
19852
+ var removeCommand3 = defineCommand125({
19853
+ meta: {
19854
+ name: "remove",
19855
+ description: `Remove a company custom MCP server by name.
19856
+
19857
+ Example:
19858
+ baker mcp remove --name weather`
19859
+ },
19860
+ args: { name: { type: "string", description: "Server name to remove", required: true } },
19861
+ run: async ({ args }) => {
19862
+ try {
19863
+ const user = actingUserId();
19864
+ const data = await apiPost("/api/mcp/custom/remove", {
19865
+ name: args.name,
19866
+ ...user ? { actingUserId: user } : {}
19867
+ });
19868
+ writeJson({ ok: true, data });
19869
+ } catch (err) {
19870
+ fail3(err);
19871
+ }
19872
+ }
19873
+ });
19874
+ var mcpCommand = defineCommand125({
19875
+ meta: {
19876
+ name: "mcp",
19877
+ description: `Custom MCP servers for this company \u2014 point the agent at any HTTPS MCP endpoint.
19878
+
19879
+ Tools from a registered server appear as mcp__<name>__* on the next message.
19880
+ Managed here are **company-scoped** servers; user- and org-scoped servers are managed in the dashboard.
19881
+
19882
+ Start here:
19883
+ baker mcp list
19884
+
19885
+ Examples:
19886
+ baker mcp add --name weather --url https://mcp.example.com/mcp
19887
+ baker mcp add --name acme --url https://acme.dev/mcp --header "Authorization: Bearer sk-\u2026"
19888
+ baker mcp remove --name weather`
19889
+ },
19890
+ subCommands: {
19891
+ list: listCommand4,
19892
+ add: addCommand,
19893
+ remove: removeCommand3
19894
+ }
19895
+ });
19896
+
19730
19897
  // src/commands/research/index.ts
19731
- import { defineCommand as defineCommand135 } from "citty";
19898
+ import { defineCommand as defineCommand136 } from "citty";
19732
19899
 
19733
19900
  // src/commands/research/advertisers.ts
19734
- import { defineCommand as defineCommand125 } from "citty";
19901
+ import { defineCommand as defineCommand126 } from "citty";
19735
19902
 
19736
19903
  // src/commands/research/output.ts
19737
19904
  var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
@@ -19844,7 +20011,7 @@ var FIELDS3 = {
19844
20011
  etv: "Estimated traffic value (USD)",
19845
20012
  visibility: "SERP visibility score (0-1)"
19846
20013
  };
19847
- var advertisersCommand = defineCommand125({
20014
+ var advertisersCommand = defineCommand126({
19848
20015
  meta: {
19849
20016
  name: "advertisers",
19850
20017
  description: `Find domains competing for a keyword in Google SERPs.
@@ -19891,7 +20058,7 @@ Examples:
19891
20058
  });
19892
20059
 
19893
20060
  // src/commands/research/autocomplete.ts
19894
- import { defineCommand as defineCommand126 } from "citty";
20061
+ import { defineCommand as defineCommand127 } from "citty";
19895
20062
  registerSchema({
19896
20063
  command: "research.autocomplete",
19897
20064
  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).",
@@ -19914,7 +20081,7 @@ registerSchema({
19914
20081
  var FIELDS4 = {
19915
20082
  suggestion: "Autocomplete suggestion from Google"
19916
20083
  };
19917
- var autocompleteCommand = defineCommand126({
20084
+ var autocompleteCommand = defineCommand127({
19918
20085
  meta: {
19919
20086
  name: "autocomplete",
19920
20087
  description: `Get Google Autocomplete suggestions for keyword expansion.
@@ -19960,7 +20127,7 @@ Examples:
19960
20127
  });
19961
20128
 
19962
20129
  // src/commands/research/countries.ts
19963
- import { defineCommand as defineCommand127 } from "citty";
20130
+ import { defineCommand as defineCommand128 } from "citty";
19964
20131
  registerSchema({
19965
20132
  command: "research.countries",
19966
20133
  description: "List all supported country codes for --location flag in research commands.",
@@ -20017,7 +20184,7 @@ var FIELDS5 = {
20017
20184
  code: "Country code to pass as --location",
20018
20185
  name: "Country name"
20019
20186
  };
20020
- var countriesCommand = defineCommand127({
20187
+ var countriesCommand = defineCommand128({
20021
20188
  meta: {
20022
20189
  name: "countries",
20023
20190
  description: "List all supported country codes for --location flag."
@@ -20028,7 +20195,7 @@ var countriesCommand = defineCommand127({
20028
20195
  });
20029
20196
 
20030
20197
  // src/commands/research/intent.ts
20031
- import { defineCommand as defineCommand128 } from "citty";
20198
+ import { defineCommand as defineCommand129 } from "citty";
20032
20199
  registerSchema({
20033
20200
  command: "research.intent",
20034
20201
  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.",
@@ -20051,7 +20218,7 @@ var FIELDS6 = {
20051
20218
  intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
20052
20219
  probability: "Confidence score 0.0-1.0"
20053
20220
  };
20054
- var intentCommand = defineCommand128({
20221
+ var intentCommand = defineCommand129({
20055
20222
  meta: {
20056
20223
  name: "intent",
20057
20224
  description: `Classify Google Search intent for keywords. Returns intent type and confidence.
@@ -20099,7 +20266,7 @@ Examples:
20099
20266
  });
20100
20267
 
20101
20268
  // src/commands/research/keyword-gap.ts
20102
- import { defineCommand as defineCommand129 } from "citty";
20269
+ import { defineCommand as defineCommand130 } from "citty";
20103
20270
  registerSchema({
20104
20271
  command: "research.keyword-gap",
20105
20272
  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.",
@@ -20128,7 +20295,7 @@ var FIELDS7 = {
20128
20295
  cpc: "Cost per click USD",
20129
20296
  their_position: "Competitor's ranking position"
20130
20297
  };
20131
- var keywordGapCommand = defineCommand129({
20298
+ var keywordGapCommand = defineCommand130({
20132
20299
  meta: {
20133
20300
  name: "keyword-gap",
20134
20301
  description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
@@ -20202,7 +20369,7 @@ Examples:
20202
20369
  });
20203
20370
 
20204
20371
  // src/commands/research/keywords-for-site.ts
20205
- import { defineCommand as defineCommand130 } from "citty";
20372
+ import { defineCommand as defineCommand131 } from "citty";
20206
20373
  registerSchema({
20207
20374
  command: "research.keywords-for-site",
20208
20375
  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.",
@@ -20235,7 +20402,7 @@ var FIELDS8 = {
20235
20402
  competition: "LOW, MEDIUM, or HIGH",
20236
20403
  competition_index: "Competition score 0-100"
20237
20404
  };
20238
- var keywordsForSiteCommand = defineCommand130({
20405
+ var keywordsForSiteCommand = defineCommand131({
20239
20406
  meta: {
20240
20407
  name: "keywords-for-site",
20241
20408
  description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
@@ -20288,7 +20455,7 @@ Examples:
20288
20455
  });
20289
20456
 
20290
20457
  // src/commands/research/languages.ts
20291
- import { defineCommand as defineCommand131 } from "citty";
20458
+ import { defineCommand as defineCommand132 } from "citty";
20292
20459
  registerSchema({
20293
20460
  command: "research.languages",
20294
20461
  description: "List all supported language codes for --language flag in research commands.",
@@ -20318,7 +20485,7 @@ var FIELDS9 = {
20318
20485
  code: "Language code to pass as --language",
20319
20486
  name: "Language name (also accepted by --language)"
20320
20487
  };
20321
- var languagesCommand2 = defineCommand131({
20488
+ var languagesCommand2 = defineCommand132({
20322
20489
  meta: {
20323
20490
  name: "languages",
20324
20491
  description: "List all supported language codes for --language flag."
@@ -20329,7 +20496,7 @@ var languagesCommand2 = defineCommand131({
20329
20496
  });
20330
20497
 
20331
20498
  // src/commands/research/lighthouse.ts
20332
- import { defineCommand as defineCommand132 } from "citty";
20499
+ import { defineCommand as defineCommand133 } from "citty";
20333
20500
  registerSchema({
20334
20501
  command: "research.lighthouse",
20335
20502
  description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
@@ -20348,7 +20515,7 @@ var FIELDS10 = {
20348
20515
  speed_index_ms: "Speed Index in ms (good: < 3400)",
20349
20516
  interactive_ms: "Time to Interactive in ms (good: < 3800)"
20350
20517
  };
20351
- var lighthouseCommand = defineCommand132({
20518
+ var lighthouseCommand = defineCommand133({
20352
20519
  meta: {
20353
20520
  name: "lighthouse",
20354
20521
  description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
@@ -20386,7 +20553,7 @@ Examples:
20386
20553
  });
20387
20554
 
20388
20555
  // src/commands/research/relevant-pages.ts
20389
- import { defineCommand as defineCommand133 } from "citty";
20556
+ import { defineCommand as defineCommand134 } from "citty";
20390
20557
  registerSchema({
20391
20558
  command: "research.relevant-pages",
20392
20559
  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).",
@@ -20412,7 +20579,7 @@ var FIELDS11 = {
20412
20579
  keywords: "Total organic keywords the page ranks for",
20413
20580
  top_10: "Keywords in positions 1-10"
20414
20581
  };
20415
- var relevantPagesCommand = defineCommand133({
20582
+ var relevantPagesCommand = defineCommand134({
20416
20583
  meta: {
20417
20584
  name: "relevant-pages",
20418
20585
  description: `Get the top pages of a competitor domain with traffic data.
@@ -20458,7 +20625,7 @@ Examples:
20458
20625
  });
20459
20626
 
20460
20627
  // src/commands/research/web.ts
20461
- import { defineCommand as defineCommand134 } from "citty";
20628
+ import { defineCommand as defineCommand135 } from "citty";
20462
20629
  registerSchema({
20463
20630
  command: "research.web",
20464
20631
  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).",
@@ -20509,7 +20676,7 @@ async function runDeepResearch(question) {
20509
20676
  }
20510
20677
  throw new Error("Deep research timed out");
20511
20678
  }
20512
- var webCommand = defineCommand134({
20679
+ var webCommand = defineCommand135({
20513
20680
  meta: {
20514
20681
  name: "web",
20515
20682
  description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
@@ -20569,7 +20736,7 @@ Examples:
20569
20736
  });
20570
20737
 
20571
20738
  // src/commands/research/index.ts
20572
- var researchCommand = defineCommand135({
20739
+ var researchCommand = defineCommand136({
20573
20740
  meta: {
20574
20741
  name: "research",
20575
20742
  description: `Competitive intelligence and AI-powered research commands.
@@ -20609,10 +20776,10 @@ Examples:
20609
20776
  });
20610
20777
 
20611
20778
  // src/commands/scheduled-actions/index.ts
20612
- import { defineCommand as defineCommand142 } from "citty";
20779
+ import { defineCommand as defineCommand143 } from "citty";
20613
20780
 
20614
20781
  // src/commands/scheduled-actions/create.ts
20615
- import { defineCommand as defineCommand136 } from "citty";
20782
+ import { defineCommand as defineCommand137 } from "citty";
20616
20783
 
20617
20784
  // src/commands/scheduled-actions/shared.ts
20618
20785
  var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
@@ -20727,7 +20894,7 @@ registerSchema({
20727
20894
  prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
20728
20895
  }
20729
20896
  });
20730
- var createCommand2 = defineCommand136({
20897
+ var createCommand2 = defineCommand137({
20731
20898
  meta: {
20732
20899
  name: "create",
20733
20900
  description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
@@ -20776,7 +20943,7 @@ var createCommand2 = defineCommand136({
20776
20943
  });
20777
20944
 
20778
20945
  // src/commands/scheduled-actions/delete.ts
20779
- import { defineCommand as defineCommand137 } from "citty";
20946
+ import { defineCommand as defineCommand138 } from "citty";
20780
20947
  registerSchema({
20781
20948
  command: "scheduled-actions.delete",
20782
20949
  description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
@@ -20784,7 +20951,7 @@ registerSchema({
20784
20951
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
20785
20952
  }
20786
20953
  });
20787
- var deleteCommand2 = defineCommand137({
20954
+ var deleteCommand2 = defineCommand138({
20788
20955
  meta: {
20789
20956
  name: "delete",
20790
20957
  description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
@@ -20813,7 +20980,7 @@ var deleteCommand2 = defineCommand137({
20813
20980
  });
20814
20981
 
20815
20982
  // src/commands/scheduled-actions/get.ts
20816
- import { defineCommand as defineCommand138 } from "citty";
20983
+ import { defineCommand as defineCommand139 } from "citty";
20817
20984
  registerSchema({
20818
20985
  command: "scheduled-actions.get",
20819
20986
  description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
@@ -20821,7 +20988,7 @@ registerSchema({
20821
20988
  id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
20822
20989
  }
20823
20990
  });
20824
- var getCommand3 = defineCommand138({
20991
+ var getCommand3 = defineCommand139({
20825
20992
  meta: {
20826
20993
  name: "get",
20827
20994
  description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
@@ -20858,13 +21025,13 @@ var getCommand3 = defineCommand138({
20858
21025
  });
20859
21026
 
20860
21027
  // src/commands/scheduled-actions/list.ts
20861
- import { defineCommand as defineCommand139 } from "citty";
21028
+ import { defineCommand as defineCommand140 } from "citty";
20862
21029
  registerSchema({
20863
21030
  command: "scheduled-actions.list",
20864
21031
  description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
20865
21032
  args: {}
20866
21033
  });
20867
- var listCommand4 = defineCommand139({
21034
+ var listCommand5 = defineCommand140({
20868
21035
  meta: {
20869
21036
  name: "list",
20870
21037
  description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
@@ -20885,7 +21052,7 @@ var listCommand4 = defineCommand139({
20885
21052
  });
20886
21053
 
20887
21054
  // src/commands/scheduled-actions/trigger.ts
20888
- import { defineCommand as defineCommand140 } from "citty";
21055
+ import { defineCommand as defineCommand141 } from "citty";
20889
21056
  registerSchema({
20890
21057
  command: "scheduled-actions.trigger",
20891
21058
  description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
@@ -20893,7 +21060,7 @@ registerSchema({
20893
21060
  id: { type: "string", description: "Published scheduled action ID", required: true }
20894
21061
  }
20895
21062
  });
20896
- var triggerCommand = defineCommand140({
21063
+ var triggerCommand = defineCommand141({
20897
21064
  meta: {
20898
21065
  name: "trigger",
20899
21066
  description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
@@ -20930,7 +21097,7 @@ var triggerCommand = defineCommand140({
20930
21097
  });
20931
21098
 
20932
21099
  // src/commands/scheduled-actions/update.ts
20933
- import { defineCommand as defineCommand141 } from "citty";
21100
+ import { defineCommand as defineCommand142 } from "citty";
20934
21101
  registerSchema({
20935
21102
  command: "scheduled-actions.update",
20936
21103
  description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
@@ -20955,7 +21122,7 @@ registerSchema({
20955
21122
  prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
20956
21123
  }
20957
21124
  });
20958
- var updateCommand2 = defineCommand141({
21125
+ var updateCommand2 = defineCommand142({
20959
21126
  meta: {
20960
21127
  name: "update",
20961
21128
  description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
@@ -21026,7 +21193,7 @@ var updateCommand2 = defineCommand141({
21026
21193
  });
21027
21194
 
21028
21195
  // src/commands/scheduled-actions/index.ts
21029
- var scheduledActionsCommand = defineCommand142({
21196
+ var scheduledActionsCommand = defineCommand143({
21030
21197
  meta: {
21031
21198
  name: "scheduled-actions",
21032
21199
  description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
@@ -21042,7 +21209,7 @@ Examples:
21042
21209
  baker scheduled-actions trigger <id>`
21043
21210
  },
21044
21211
  subCommands: {
21045
- list: listCommand4,
21212
+ list: listCommand5,
21046
21213
  get: getCommand3,
21047
21214
  create: createCommand2,
21048
21215
  update: updateCommand2,
@@ -21052,8 +21219,8 @@ Examples:
21052
21219
  });
21053
21220
 
21054
21221
  // src/commands/schema.ts
21055
- import { defineCommand as defineCommand143 } from "citty";
21056
- var schemaCommand = defineCommand143({
21222
+ import { defineCommand as defineCommand144 } from "citty";
21223
+ var schemaCommand = defineCommand144({
21057
21224
  meta: {
21058
21225
  name: "schema",
21059
21226
  description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
@@ -21089,10 +21256,10 @@ var schemaCommand = defineCommand143({
21089
21256
  });
21090
21257
 
21091
21258
  // src/commands/testimonials/index.ts
21092
- import { defineCommand as defineCommand147 } from "citty";
21259
+ import { defineCommand as defineCommand148 } from "citty";
21093
21260
 
21094
21261
  // src/commands/testimonials/get.ts
21095
- import { defineCommand as defineCommand144 } from "citty";
21262
+ import { defineCommand as defineCommand145 } from "citty";
21096
21263
  registerSchema({
21097
21264
  command: "testimonials.get",
21098
21265
  description: "Get a single testimonial by ID",
@@ -21100,7 +21267,7 @@ registerSchema({
21100
21267
  id: { type: "string", description: "Testimonial ID", required: true }
21101
21268
  }
21102
21269
  });
21103
- var getCommand4 = defineCommand144({
21270
+ var getCommand4 = defineCommand145({
21104
21271
  meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
21105
21272
  args: {
21106
21273
  id: { type: "positional", description: "Testimonial ID", required: false },
@@ -21137,7 +21304,7 @@ var getCommand4 = defineCommand144({
21137
21304
  });
21138
21305
 
21139
21306
  // src/commands/testimonials/list.ts
21140
- import { defineCommand as defineCommand145 } from "citty";
21307
+ import { defineCommand as defineCommand146 } from "citty";
21141
21308
  registerSchema({
21142
21309
  command: "testimonials.list",
21143
21310
  description: "List testimonials with optional filters.",
@@ -21167,7 +21334,7 @@ registerSchema({
21167
21334
  limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
21168
21335
  }
21169
21336
  });
21170
- var listCommand5 = defineCommand145({
21337
+ var listCommand6 = defineCommand146({
21171
21338
  meta: {
21172
21339
  name: "list",
21173
21340
  description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
@@ -21216,7 +21383,7 @@ var listCommand5 = defineCommand145({
21216
21383
  });
21217
21384
 
21218
21385
  // src/commands/testimonials/search.ts
21219
- import { defineCommand as defineCommand146 } from "citty";
21386
+ import { defineCommand as defineCommand147 } from "citty";
21220
21387
  registerSchema({
21221
21388
  command: "testimonials.search",
21222
21389
  description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
@@ -21247,7 +21414,7 @@ registerSchema({
21247
21414
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
21248
21415
  }
21249
21416
  });
21250
- var searchCommand2 = defineCommand146({
21417
+ var searchCommand2 = defineCommand147({
21251
21418
  meta: {
21252
21419
  name: "search",
21253
21420
  description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
@@ -21321,7 +21488,7 @@ var searchCommand2 = defineCommand146({
21321
21488
  var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
21322
21489
 
21323
21490
  // src/commands/testimonials/index.ts
21324
- var testimonialsCommand = defineCommand147({
21491
+ var testimonialsCommand = defineCommand148({
21325
21492
  meta: {
21326
21493
  name: "testimonials",
21327
21494
  description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
@@ -21336,16 +21503,16 @@ Examples:
21336
21503
  subCommands: {
21337
21504
  get: getCommand4,
21338
21505
  search: searchCommand2,
21339
- list: listCommand5,
21506
+ list: listCommand6,
21340
21507
  tags: tagsCommand3
21341
21508
  }
21342
21509
  });
21343
21510
 
21344
21511
  // src/commands/videos/index.ts
21345
- import { defineCommand as defineCommand152 } from "citty";
21512
+ import { defineCommand as defineCommand153 } from "citty";
21346
21513
 
21347
21514
  // src/commands/videos/delete.ts
21348
- import { defineCommand as defineCommand148 } from "citty";
21515
+ import { defineCommand as defineCommand149 } from "citty";
21349
21516
  registerSchema({
21350
21517
  command: "videos.delete",
21351
21518
  description: "Delete a video by ID",
@@ -21359,7 +21526,7 @@ registerSchema({
21359
21526
  }
21360
21527
  }
21361
21528
  });
21362
- var deleteCommand3 = defineCommand148({
21529
+ var deleteCommand3 = defineCommand149({
21363
21530
  meta: {
21364
21531
  name: "delete",
21365
21532
  description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
@@ -21400,7 +21567,7 @@ var deleteCommand3 = defineCommand148({
21400
21567
  });
21401
21568
 
21402
21569
  // src/commands/videos/get.ts
21403
- import { defineCommand as defineCommand149 } from "citty";
21570
+ import { defineCommand as defineCommand150 } from "citty";
21404
21571
  registerSchema({
21405
21572
  command: "videos.get",
21406
21573
  description: "Get a single video by ID",
@@ -21408,7 +21575,7 @@ registerSchema({
21408
21575
  id: { type: "string", description: "Video ID", required: true }
21409
21576
  }
21410
21577
  });
21411
- var getCommand5 = defineCommand149({
21578
+ var getCommand5 = defineCommand150({
21412
21579
  meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
21413
21580
  args: {
21414
21581
  id: { type: "positional", description: "Video ID", required: false },
@@ -21445,7 +21612,7 @@ var getCommand5 = defineCommand149({
21445
21612
  });
21446
21613
 
21447
21614
  // src/commands/videos/search.ts
21448
- import { defineCommand as defineCommand150 } from "citty";
21615
+ import { defineCommand as defineCommand151 } from "citty";
21449
21616
  registerSchema({
21450
21617
  command: "videos.search",
21451
21618
  description: "Search videos by text query. Only returns ready videos.",
@@ -21455,7 +21622,7 @@ registerSchema({
21455
21622
  tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
21456
21623
  }
21457
21624
  });
21458
- var searchCommand3 = defineCommand150({
21625
+ var searchCommand3 = defineCommand151({
21459
21626
  meta: {
21460
21627
  name: "search",
21461
21628
  description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
@@ -21507,7 +21674,7 @@ var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
21507
21674
  // src/commands/videos/upload.ts
21508
21675
  import { readFile as readFile12, stat as stat3 } from "fs/promises";
21509
21676
  import { extname as extname3 } from "path";
21510
- import { defineCommand as defineCommand151 } from "citty";
21677
+ import { defineCommand as defineCommand152 } from "citty";
21511
21678
  var MIME_MAP = {
21512
21679
  ".mp4": "video/mp4",
21513
21680
  ".mov": "video/quicktime",
@@ -21541,7 +21708,7 @@ function detectContentType(filePath) {
21541
21708
  }
21542
21709
  return mime;
21543
21710
  }
21544
- var uploadCommand2 = defineCommand151({
21711
+ var uploadCommand2 = defineCommand152({
21545
21712
  meta: {
21546
21713
  name: "upload",
21547
21714
  description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
@@ -21595,7 +21762,7 @@ var uploadCommand2 = defineCommand151({
21595
21762
  });
21596
21763
 
21597
21764
  // src/commands/videos/index.ts
21598
- var videosCommand = defineCommand152({
21765
+ var videosCommand = defineCommand153({
21599
21766
  meta: {
21600
21767
  name: "videos",
21601
21768
  description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
@@ -21618,10 +21785,10 @@ Examples:
21618
21785
  });
21619
21786
 
21620
21787
  // src/commands/winning-ads/index.ts
21621
- import { defineCommand as defineCommand155 } from "citty";
21788
+ import { defineCommand as defineCommand156 } from "citty";
21622
21789
 
21623
21790
  // src/commands/winning-ads/advertisers.ts
21624
- import { defineCommand as defineCommand153 } from "citty";
21791
+ import { defineCommand as defineCommand154 } from "citty";
21625
21792
  registerSchema({
21626
21793
  command: "winning-ads.advertisers",
21627
21794
  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).",
@@ -21634,7 +21801,7 @@ registerSchema({
21634
21801
  function identity(record) {
21635
21802
  return record;
21636
21803
  }
21637
- var advertisersCommand2 = defineCommand153({
21804
+ var advertisersCommand2 = defineCommand154({
21638
21805
  meta: {
21639
21806
  name: "advertisers",
21640
21807
  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'
@@ -21685,7 +21852,7 @@ var advertisersCommand2 = defineCommand153({
21685
21852
  });
21686
21853
 
21687
21854
  // src/commands/winning-ads/search.ts
21688
- import { defineCommand as defineCommand154 } from "citty";
21855
+ import { defineCommand as defineCommand155 } from "citty";
21689
21856
  registerSchema({
21690
21857
  command: "winning-ads.search",
21691
21858
  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.",
@@ -21793,7 +21960,7 @@ function buildSearchBody(args) {
21793
21960
  }
21794
21961
  return body;
21795
21962
  }
21796
- var searchCommand4 = defineCommand154({
21963
+ var searchCommand4 = defineCommand155({
21797
21964
  meta: {
21798
21965
  name: "search",
21799
21966
  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"
@@ -21905,7 +22072,7 @@ var searchCommand4 = defineCommand154({
21905
22072
  });
21906
22073
 
21907
22074
  // src/commands/winning-ads/index.ts
21908
- var winningAdsCommand = defineCommand155({
22075
+ var winningAdsCommand = defineCommand156({
21909
22076
  meta: {
21910
22077
  name: "winning-ads",
21911
22078
  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.
@@ -21945,7 +22112,7 @@ function getCliVersion() {
21945
22112
  }
21946
22113
 
21947
22114
  // src/cli.ts
21948
- var main = defineCommand156({
22115
+ var main = defineCommand157({
21949
22116
  meta: {
21950
22117
  name: "baker",
21951
22118
  version: getCliVersion(),
@@ -21970,6 +22137,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
21970
22137
  testimonials: testimonialsCommand,
21971
22138
  canvas: canvasCommand,
21972
22139
  "winning-ads": winningAdsCommand,
22140
+ mcp: mcpCommand,
21973
22141
  schema: schemaCommand
21974
22142
  }
21975
22143
  });