@koda-sl/baker-cli 0.452.0-dev.63867ce0e → 0.455.0-dev.0e869aae7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6600,7 +6600,7 @@ With `--slug`, `data.variantChoice` (`runId`, `option`, `sha256`) says which var
6600
6600
  Record what the person said about one version in a chat: an approval, or a rejection with reasons and their own words. It is stored like the Approve / Not this one buttons, as the verdict of the person who wrote the chat's latest message (`recordedFor: "sender"`), or of the chat itself when nobody has written in it (`"chat"`). One verdict per person per version or option: a later one replaces theirs. Must run from a chat.
6601
6601
 
6602
6602
  ```bash
6603
- baker creatives feedback record --slug spring-offer --run r_01K… --verdict rejected \
6603
+ baker creatives feedback record --slug spring-offer --verdict rejected \
6604
6604
  --reasons text_mistakes,weak_hook --note "the price is 49 not 59"
6605
6605
  baker creatives feedback record --slug spring-offer --run r_01K… --option 2 --verdict approved
6606
6606
  ```
@@ -6608,7 +6608,7 @@ baker creatives feedback record --slug spring-offer --run r_01K… --option 2 --
6608
6608
  | Flag | Effect |
6609
6609
  |---|---|
6610
6610
  | `--slug <slug>` | Required. The creative (`src/creatives/<slug>/`). |
6611
- | `--run <r_…>` | Required. The version. |
6611
+ | `--run <r_…>` | The version. Left out, the one the creative shows now (its last render in this workspace). |
6612
6612
  | `--verdict approved\|rejected` | Required. |
6613
6613
  | `--option <o>` | One option of a version that made several: its label, its number (`2`) or its slot. |
6614
6614
  | `--reasons <a,b>` | Comma-separated: `text_mistakes`, `logo_or_brand_wrong`, `weak_hook`, `wrong_message`, `looks_fake`, `not_our_style`, `voice_or_sound`, `pacing`, `other`. The two video reasons: `voice_or_sound` (the voiceover, music or mix) and `pacing` (too slow, too fast, the hook lands late). A rejection needs reasons or a note. |
@@ -6621,7 +6621,7 @@ After a rejection, `hints[]` restates what to change, starting from that version
6621
6621
  Choose the version of a creative to keep, or only some of its options, the way choosing it in Baker does: the creative shows that version as the chosen one, and the choice records the chat sender's approval (`source: "selection"`). Naming options replaces the earlier pick. It does not add the image to the library; that is `baker creatives publish`, which, given `--run-id`, also counts as choosing that version.
6622
6622
 
6623
6623
  ```bash
6624
- baker creatives select --slug spring-offer --run r_01K…
6624
+ baker creatives select --slug spring-offer # the version it shows now
6625
6625
  baker creatives select --slug spring-offer --run r_01K… --options "beach,2"
6626
6626
  ```
6627
6627
 
@@ -6754,13 +6754,19 @@ var Viewer = z7.object({
6754
6754
  /** Who will see the ad, in the words a marketer would use. */
6755
6755
  who: z7.string().trim().min(1),
6756
6756
  market: Market.optional(),
6757
- /** What they already know about the brand and the offer. */
6758
- knows: z7.string().optional(),
6757
+ /** What they already know about the brand and the offer; a list (as _definition.md keeps it) reads as one line. */
6758
+ knows: z7.preprocess((v) => Array.isArray(v) ? v.map(String).join("; ") || void 0 : v, z7.string().optional()),
6759
6759
  temperature: z7.enum(["cold", "warm", "hot"]).optional(),
6760
6760
  /** Where they meet it (feed, Stories, Reels). */
6761
6761
  placement: z7.string().optional()
6762
6762
  }).strict();
6763
- var Scene = z7.object({
6763
+ var withoutFormatName = (v) => {
6764
+ if (!v || typeof v !== "object" || Array.isArray(v) || typeof v.concept !== "string")
6765
+ return v;
6766
+ const { concept: _format, ...scene } = v;
6767
+ return scene;
6768
+ };
6769
+ var SceneFields = z7.object({
6764
6770
  description: z7.string().trim().min(1),
6765
6771
  /** A photograph, a designed graphic, or an illustration. */
6766
6772
  look: z7.enum(["photo", "designed", "illustration"]),
@@ -6770,6 +6776,7 @@ var Scene = z7.object({
6770
6776
  /** How the frame is arranged, by what fills each part of it. */
6771
6777
  layout: z7.string().optional()
6772
6778
  }).strict();
6779
+ var Scene = z7.preprocess(withoutFormatName, SceneFields);
6773
6780
  var Brand = z7.object({
6774
6781
  name: z7.string().optional(),
6775
6782
  /** The words the brand's logo prints (its wordmark), so a check reads them as the logo, never as copy. */
@@ -6847,7 +6854,10 @@ var AdSpecSchema = z7.object({
6847
6854
  /** An optional note on direction for this concept. */
6848
6855
  direction: z7.string().optional(),
6849
6856
  /** The device the ad is built on, and why it works on a stranger. Judged, never drawn. */
6850
- mechanism: z7.array(Mechanism).default([]),
6857
+ mechanism: z7.preprocess(
6858
+ (v) => v && typeof v === "object" && !Array.isArray(v) ? [v] : v,
6859
+ z7.array(Mechanism).default([])
6860
+ ),
6851
6861
  /** Why the reference won and what this ad keeps of it (schema /3). */
6852
6862
  concept: Concept.optional(),
6853
6863
  /**
@@ -15892,6 +15902,7 @@ var EDGE_WORD = [
15892
15902
  ["right", /\bright\b/i]
15893
15903
  ];
15894
15904
  var clearanceTo = (b, edge) => edge === "top" ? b.y0 : edge === "bottom" ? 1 - b.y1 : edge === "left" ? b.x0 : 1 - b.x1;
15905
+ var BUTTON_PAD = 0.7;
15895
15906
  function corroborateEdgeClaims(findings, boxesByFormat, lines) {
15896
15907
  const buttons = lines.filter((l) => /^(cta|button|call_to_action)$/.test(roleKey2(l.role)));
15897
15908
  return findings.map((f) => {
@@ -15902,7 +15913,8 @@ function corroborateEdgeClaims(findings, boxesByFormat, lines) {
15902
15913
  const element = claimedBoxes(f.what, boxes, buttons);
15903
15914
  if (element.length === 0) return f;
15904
15915
  const named = claimedEdges(f.what);
15905
- const atEdge = element.some((b) => named.some((edge) => clearanceTo(b, edge) <= AT_EDGE));
15916
+ const pad = BUTTON.test(f.what) && !LOGO_CLAIM.test(f.what) ? BUTTON_PAD : 0;
15917
+ const atEdge = element.some((b) => named.some((edge) => clearanceTo(b, edge) - pad * (b.y1 - b.y0) <= AT_EDGE));
15906
15918
  return atEdge ? f : { ...f, severity: "warning" };
15907
15919
  });
15908
15920
  }
@@ -15910,9 +15922,11 @@ function claimedEdges(what) {
15910
15922
  const edges = EDGE_WORD.filter(([, word]) => word.test(what)).map(([edge]) => edge);
15911
15923
  return edges.length > 0 ? edges : ["top", "bottom", "left", "right"];
15912
15924
  }
15925
+ var LOGO_CLAIM = /\b(?:logos?|wordmark|mark)\b/i;
15926
+ var BUTTON = /\b(button|cta|call[- ]to[- ]action)\b/i;
15913
15927
  function claimedBoxes(what, boxes, buttons) {
15914
- if (/\b(?:logos?|wordmark|mark)\b/i.test(what)) return boxes.filter((b) => b.kind === "logo");
15915
- if (/\b(button|cta|call[- ]to[- ]action)\b/i.test(what)) return buttons.flatMap((l) => boxesOfLine(l, boxes));
15928
+ if (LOGO_CLAIM.test(what)) return boxes.filter((b) => b.kind === "logo");
15929
+ if (BUTTON.test(what)) return buttons.flatMap((l) => boxesOfLine(l, boxes));
15916
15930
  return ABOUT_COPY.test(what) ? boxes.filter((b) => b.kind === "text") : [];
15917
15931
  }
15918
15932
  async function bytesOf(source) {
@@ -16043,7 +16057,7 @@ function everySizeChecks(opts) {
16043
16057
  };
16044
16058
  }
16045
16059
  async function confirmBlocking(findings, stills, formats, ask2) {
16046
- const claims = findings.filter((f) => f.severity === "blocking");
16060
+ const claims = findings.filter((f) => f.severity === "blocking" && !CLIPPED.test(f.what));
16047
16061
  if (claims.length === 0 || stills.length === 0) return [...findings];
16048
16062
  const prompt = [
16049
16063
  `These are the finished sizes of one ad, in order: ${formats.map((f, i) => `Image ${i + 1} is the ${f}`).join("; ")}.`,
@@ -18721,4 +18735,4 @@ export {
18721
18735
  defaultRegistry,
18722
18736
  createEngineFromEnv
18723
18737
  };
18724
- //# sourceMappingURL=chunk-Q2ZO6I47.js.map
18738
+ //# sourceMappingURL=chunk-EIFW4274.js.map