@koda-sl/baker-cli 0.290.2 → 0.292.0-dev.1d5970764

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.
Files changed (28) hide show
  1. package/README.md +74 -3
  2. package/canvas/tiktok-captions-composition/index.html +23 -2
  3. package/dist/{chunk-2IB3IL4K.js → chunk-2IUN3S3E.js} +2 -2
  4. package/dist/{chunk-D3HHUBIL.js → chunk-4YF56EGK.js} +4 -4
  5. package/dist/{chunk-EX2OIOVL.js → chunk-A2VZOTCV.js} +3 -3
  6. package/dist/{chunk-GU7IWEBC.js → chunk-KDTHRRAC.js} +3 -3
  7. package/dist/{chunk-NNQDWCFG.js → chunk-LTXNRRXW.js} +282 -102
  8. package/dist/chunk-LTXNRRXW.js.map +1 -0
  9. package/dist/{chunk-DZUVUGEP.js → chunk-WFWU3CHS.js} +9 -1
  10. package/dist/{chunk-DZUVUGEP.js.map → chunk-WFWU3CHS.js.map} +1 -1
  11. package/dist/cli.js +2835 -1027
  12. package/dist/cli.js.map +1 -1
  13. package/dist/{client-VDCCDEHE.js → client-6KQHCXS2.js} +4 -4
  14. package/dist/engine/index.d.ts +13 -0
  15. package/dist/engine/index.js +3 -3
  16. package/dist/{env-FWMZXMQK.js → env-C7YXL6C6.js} +6 -2
  17. package/dist/{output-4H2RNBXL.js → output-RBM32FKJ.js} +5 -5
  18. package/dist/{shared-UKL36AXT.js → shared-WJIJTWST.js} +6 -6
  19. package/package.json +1 -1
  20. package/dist/chunk-NNQDWCFG.js.map +0 -1
  21. /package/dist/{chunk-2IB3IL4K.js.map → chunk-2IUN3S3E.js.map} +0 -0
  22. /package/dist/{chunk-D3HHUBIL.js.map → chunk-4YF56EGK.js.map} +0 -0
  23. /package/dist/{chunk-EX2OIOVL.js.map → chunk-A2VZOTCV.js.map} +0 -0
  24. /package/dist/{chunk-GU7IWEBC.js.map → chunk-KDTHRRAC.js.map} +0 -0
  25. /package/dist/{client-VDCCDEHE.js.map → client-6KQHCXS2.js.map} +0 -0
  26. /package/dist/{env-FWMZXMQK.js.map → env-C7YXL6C6.js.map} +0 -0
  27. /package/dist/{output-4H2RNBXL.js.map → output-RBM32FKJ.js.map} +0 -0
  28. /package/dist/{shared-UKL36AXT.js.map → shared-WJIJTWST.js.map} +0 -0
package/README.md CHANGED
@@ -2935,7 +2935,7 @@ baker avatars create --name "Marta" --subject "…" \
2935
2935
  --source-image "<imageId1>,<imageId2>" --likeness-confirmed
2936
2936
  ```
2937
2937
 
2938
- Optional: `--handle`, `--speech`, `--motion`, `--setting`, `--voice-id`, `--voice-description`. Returns `{ avatarId, handle, likeness, status }`.
2938
+ Optional: `--handle`, `--speech`, `--motion`, `--setting`, `--accent`. Returns `{ avatarId, handle, likeness, status }`.
2939
2939
 
2940
2940
  #### `baker avatars update <handle>`
2941
2941
 
@@ -2944,7 +2944,7 @@ Edit an avatar. Profile flags are merged over the stored profile, so `--persona`
2944
2944
  ```bash
2945
2945
  baker avatars update marta --wardrobe "charcoal blazer over a white tee"
2946
2946
  baker avatars update marta --subject "woman in her early 50s, silver bob, …" --regenerate-sheet
2947
- baker avatars update marta --new-handle marta-founder --voice-id <voiceId>
2947
+ baker avatars update marta --new-handle marta-founder --accent "Spanish from Spain, Madrid accent"
2948
2948
  ```
2949
2949
 
2950
2950
  #### `baker avatars delete <handle>`
@@ -3636,6 +3636,7 @@ Reach for it when you are relaying the **client's** own words. When you are writ
3636
3636
 
3637
3637
  ```bash
3638
3638
  baker studio animate "slow push in, model turns to camera and smiles" --image j57abc123def456ghi789
3639
+ baker studio animate "she looks to camera and says: \"Hola, soy Elena\"" --avatar elena --quality 720p --aspect-ratio 9:16
3639
3640
  baker studio animate "handheld drift right, steam rising from the cup" \
3640
3641
  --image ./out/hero.png --duration 6 --quality 1080p
3641
3642
  baker studio animate "product rotates once on a turntable" --image j57abc…,j57def… --from references
@@ -3785,6 +3786,65 @@ baker canvas set-prompt my-canvas.json s0_start --text "Close-up, flushed and br
3785
3786
  baker canvas set-prompt my-canvas.json s0_start --text-file ./hook-frame.txt
3786
3787
  ```
3787
3788
 
3789
+ #### The brand, the ending and the cast are drawn, not generated
3790
+
3791
+ `baker canvas scaffold-ad` renders everything with a known, fixed appearance locally,
3792
+ because a video model garbles a wordmark every time:
3793
+
3794
+ - **`brand.logo`** — the repo path to the mark. It is copied into the overlay composition
3795
+ and drawn as a real `<img>`: small top-left for the whole ad, large on the closing card.
3796
+ - **`end_card`** — on by default whenever the spec carries a brand. The last beat's PICTURE
3797
+ becomes a flat brand colour plate (rendered by ffmpeg, not generated), with the mark and
3798
+ the call to action over it. `end_card: false` keeps the footage; `end_card: { cta }` sets
3799
+ the words on the button, which otherwise default to the last line of the script.
3800
+ - **The brand fills itself.** When the spec leaves `brand.logo` or `brand.palette` empty,
3801
+ they are read from the workspace — `src/brand/BRAND.md` for the colours (in document
3802
+ order, page-furniture whites and blacks dropped) and `src/brand/logos/` for the mark
3803
+ (vector first, plain mark over a mono/white/icon variant). Pass them yourself only when
3804
+ the ad needs something other than the client's default.
3805
+ - **The spoken language is read off the script** when the spec does not declare it, so a
3806
+ Spanish ad is cast from Spanish voices without anyone having to say so.
3807
+ - **`sound`** (per beat) — one sound effect for that shot, rendered by ElevenLabs
3808
+ alongside the music bed. Most beats should not have one: it belongs where the picture
3809
+ shows a specific physical event (a drill, a door, rain on glass), not on a talking head
3810
+ or a calm lifestyle shot. A bed plus two well-placed effects beats eight.
3811
+ - **A real brand mark is required.** `scaffold-ad` refuses to build without one in
3812
+ `src/brand/logos/` (SVG or PNG): the mark is drawn on every frame and on the closing
3813
+ card, so a stand-in ships an ad wearing the wrong brand.
3814
+ - **An avatar with no pinned voice cannot speak on camera.** Their lines would be read by
3815
+ a separately cast voice, which is dubbing and looks like it.
3816
+ - **`voiceover: false`** — a music-led ad. No voice, no transcription: the `say` lines
3817
+ become on-screen text and are captioned straight from the script, so the words are
3818
+ exact. Give it `music` too.
3819
+ - **`--avatar <handle>`** — the same flag as on `studio generate` / `studio animate`, and the way to cast a person into an ad. Overrides `cast.avatar` in the spec.
3820
+ - **`cast.avatar`** — the handle of a cast Avatar (`baker avatars list`). The ad grounds
3821
+ every beat they appear in on that avatar's identity sheet and copies its subject
3822
+ description verbatim, so the ad shows the same face as the rest of the company's work.
3823
+ This is the whole journey: `baker avatars create` → `cast.avatar` in the spec → render.
3824
+ - **`cast.description`** — a person described in words, when there is no avatar.
3825
+
3826
+ Each of these also removes a generation: the closing beat costs no image and no clip.
3827
+
3828
+ #### The finished video is reviewed
3829
+
3830
+ When a run's output is a video, `baker canvas run` samples twelve frames across it and
3831
+ looks at them before reporting success. It reports, never blocks — the clips are already
3832
+ paid for by the time it runs — and the findings come back as `review` and `hints`:
3833
+
3834
+ - **Per frame:** anything that could not physically happen, or shows a job being done
3835
+ incorrectly, plus objects floating unattached in shot. Malformed hands and limbs are
3836
+ rolled up into one finding across the whole render rather than repeated per frame.
3837
+ - **Across the reel:** whether the cast stays the same people, whether a brand mark is
3838
+ visible anywhere, and whether the last frames close the ad or simply stop.
3839
+
3840
+ Each per-frame finding names the **scene file** that produced that second, so a defect is
3841
+ an edit rather than a hunt — and re-running re-renders only the scenes you changed.
3842
+
3843
+ It needs `GEMINI_API_KEY` (the Runtime receives it automatically). Without one the run
3844
+ says the video was **not** reviewed rather than reporting it clean, and a frame that
3845
+ could not be read is reported as unchecked for the same reason.
3846
+
3847
+
3788
3848
  > Scaffolded canvases use **workspace-relative** composition/asset paths and are validated
3789
3849
  > against the engine's hyperframe pre-render gate at `validate` time, so a broken overlay
3790
3850
  > (or a moved/renamed workspace) is caught before any billed clip. The scaffold also adds
@@ -5970,7 +6030,18 @@ This CLI is designed for AI agent consumption. Key patterns:
5970
6030
 
5971
6031
  - **0.217.0**: new family `baker avatars list|get|create|update|delete`, plus `--avatar <handle>` on `baker studio generate` and `baker studio animate` — company-scoped reusable presenters, typed from the shared `@baker/api` avatars contract. `--avatar` is the way to cast one: it grounds the render on the identity sheet, reuses the subject description verbatim, and records the avatar on the batch. Passing the sheet through `--reference` instead does none of those and leaves the batch unattributed, so the avatar can never show what it has appeared in; the route refuses a handle that is not `ready`, because generating a stranger is worse than an error. `get` returns the sheet URL and that description; every command's `hints` carry the next move (still building → re-check with `get`; changed `--subject` without `--regenerate-sheet` → the sheet is stale). `create` refuses `--source-image` without `--likeness-confirmed` and returns an `error.fix` telling the agent to ask the user for that permission, since only they can give it; an unknown handle returns an `error.fix` pointing at `baker avatars list`. Profile flags on `update` merge over the stored profile instead of replacing it.
5972
6032
 
5973
- ## Publishing
6033
+ - **0.250.1**: `--avatar <handle>` on `baker studio generate` and `baker studio animate` never worked. Both were declared in `registerSchema` and read at the call site, but neither was in the command's own citty `args` — and citty does not reject an undeclared flag, it keeps it and sets it to `true`. So `--avatar elena` reached the route as `avatar: true` with `elena` dropped as a stray positional, and the body schema (`z.string()`) refused it. Documented since 0.217.0, broken since 0.217.0: casting an avatar into a render was not possible from the CLI at all, which is why a clip of a named presenter came back with neither the identity sheet nor the voice. Both flags are now declared. A new test in `command-reference-integrity` compares every registered schema against the args of the command that parses it, so the two cannot drift again — it found a third case on the way, `actions status`, whose schema advertised a `--refs` flag for what the command actually takes as positionals.
6034
+ - **0.251.0**: `--accent` on `baker avatars create|update` — the region an avatar's voice comes from, e.g. `"Spanish from Spain, Madrid accent"`. Its own field rather than a sentence inside `--speech`, because that is where it went to die: asked for "pace, register, accent", the agent wrote *"clear Spanish accent"* for a Madrid presenter, the video model read that as no accent, and the clip came out sounding like nowhere. A place can be checked; an adjective cannot. It reaches the render through `buildDeliveryDirection` as its own `ACCENT:` instruction, and `thinProfileHint` now names it first among the missing fields since it is the only one that fails silently — a clip with no accent still looks finished.
6035
+ - **0.252.0**: avatar voices removed. `--voice-id` / `--voice-description` are gone from `baker avatars create|update`, and an avatar no longer holds a voice at all — every clip is voiced by the video model as it renders, directed by the profile's `--accent`. The picker they replaced offered a voice, played its preview, and then shipped a clip that did not sound like it: the re-voice was speech-to-speech, which replaces timbre and keeps pronunciation, so the accent the user picked could never survive. Three other routes were built and judged on video before removing it — TTS + lip-sync (mouth), audio-driven avatar models (picture), and Seedance 2.5 driven by audio (refuses AI faces). Reasoning and the re-open condition: `docs/adr/0005-an-avatar-is-a-face-not-a-voice.md`.
6036
+ - **0.253.0**: the pre-render gate runs `hyperframes check` — lint, runtime, layout, motion and contrast in one browser session, sampled at transition seams — instead of the static `lint` + `inspect` pair, falling back to them when the installed binary predates `check`. The browser half is signal the parser could never produce: measured on HyperFrames' own `warm-grain` example, lint/runtime/layout/motion all reported `ok: true` while the composition rendered an almost entirely blank ten-second video, the only trace being six `GSAP target #a-roll not found` warnings — a tween pointed at an element that does not exist, so nothing it animates ever appears. Baker promotes that warning to blocking, alongside `sweep_static` ("the timeline never advanced", i.e. a still image billed as a video). Warnings are grouped by code with a count (one run returned 62, 53 of them identical) and the highest-value findings carry advice on what to do rather than only what was seen. Requires `hyperframes@0.8.17` in the sandbox, bumped from 0.7.5 in the same change. Reasoning: `docs/adr/0007-the-render-gate-runs-in-a-browser.md`.
6037
+ - **0.254.0**: the nested-composition smoke test now looks at the frames instead of trusting the exit code — exiting 0 is what a blank render does too. `hyperframes snapshot --describe` sends the captured frames to Gemini and writes back what is actually in them, and the credential Studio already uses for Gemini and Omni (`GOOGLE_GENERATIVE_AI_API_KEY`) is the `GEMINI_API_KEY` it reads; the backend now ships it to the sandbox by omission, so a deployment without one keeps the plain smoke test. Verified against a real render: the pass reported "the image is completely empty" and named the single visible element without being told what to look for. Frame verdicts are condensed into the node log, one line per frame — a file the agent would have to know to open is a file it does not read.
6038
+ - **0.263.0**: shot briefs refuse the frame that contradicts its own caption, and the vision pass reads the numbers back. Observed verbatim: a phone screen reading "$215.40 SAVED THIS MONTH" under a caption reading "Save over £900 a year" — wrong currency, and a figure that contradicts the claim it sits beneath, since 215.40 a month is 2,584 a year. The model invents a number whenever a screen or document is in shot, so the frames no longer carry legible text at all: the caption track is where an ad's numbers live. Same brief also pins each object's real-world FORM after a phone rendered with a second screen on its back, and names the market's currency for anything unavoidably visible. The frame-vision question now reads out every number and word inside the picture and says whether it contradicts the caption — the defect only exists between the two, so neither alone can see it.
6039
+ - **0.262.0**: `scaffold-ad` carries the brand. The spec takes `brand.palette` (hex tokens) and `brand.logo` (repo path to the mark), and emits them as the `style.palette` and `branding` the engine already reads to colour its brand plate and CTA. The palette dresses the plate and the type and is deliberately kept OUT of the shot briefs — hex in a frame prompt makes the model paint the whole scene that colour, which reads as a filter. Also takes `market`, since an ad that does not say where it is set is an ad the model sets wherever it likes.
6040
+ - **0.261.0**: four defects that reached a finished ad, fixed in `scaffold-ad` where they originate. Frames render on **`openai/gpt-image-2`**, pinned rather than inheriting the catalogue default (Gemini Flash — right for cheap high-volume work, wrong for the opening still a five-second clip is built from). Every shot brief now states the MARKET, inferred from the voice language when unstated: an ad for Spain came back full of British houses because nothing said where it was. Every shot brief also rules out the impossible — paper and screens are opaque, objects are at real-world scale — after a bill rendered with the text from its reverse showing through, and a solar panel five metres tall. And beat durations snap to lengths the video model can actually render: free-form durations were rounded down per clip, so 11 beats summed to 27.0s of picture against a 31.4s timeline and the 4.4s difference rendered as a black tail. The read rate was re-measured off a real Spanish ad (81 words in 26.48s = 3.06 w/s); the old 2.6 over-predicted every beat by 18%.
6041
+ - **0.260.0**: burned-in captions break where the script punctuates instead of every N words. The karaoke composition sliced the transcript into fixed groups, and a word count knows nothing about the sentence it is cutting — an ad the engine rendered showed cards reading "OTRA VEZ, EN" and "TU CASA GENERA", half-thoughts ending on a preposition. A card now closes when the clause does; the word count stays as a ceiling so a long clause is still split, and a linking word ("de", "al", "y") never ends a card because it belongs to what follows. Same rule the pre-render gate already checked for, now enforced where the cards are actually built.
6042
+ - **0.259.0**: `baker canvas scaffold-ad` is listed in `baker canvas --help` with a description, and the three video routes are separated in the skill. It had a usage line and no description row, so an agent reading help saw two scaffolders explained and a bare name — and three runs from the same prompt took three different wrong paths: hand-directing the flow, reproducing a competitor ad found via `winning-ads`, and hand-authoring a canvas. The routes now state their own boundary: `scaffold-ad` is the default for a new ad, `scaffold-video` only reproduces a video the USER supplied, and `video-flow.md` opens by saying so rather than calling itself the default eleven times.
6043
+ - **0.257.0**: the frame-vision pass now asks whether what is on screen could physically happen, not just whether the frame is empty. The defect that motivated it was a generated shot of a solar panel roughly five metres tall being lifted onto a roof by one person — well lit, on brief, perfectly legible, and impossible. That is what reads loudest as "AI-generated", and the previous question could not see it: nothing was missing, something present was the wrong size. Asked the new question, the pass called the rejected shot *"physically implausible due to the immense weight and surface area"* and the replacement *"consistent with what two people could reasonably maneuver"* — the same verdict a person reached, unprompted.
6044
+ - **0.256.0**: the pre-render gate reports caption cards that end mid-clause. The first cut of this check asked for consistency and got it the wrong way round — stripping terminal punctuation makes the cards agree and leaves them wrong, because "En solo nueve días tu casa" is not a line anyone wrote, it is a sentence halved by a word count. Captions split where the script punctuates; each card is then a clause carrying its own mark, grammatical, and consistent as a by-product. The last card is exempt, since a CTA legitimately ends bare. Reported, never rewritten — the copy belongs to whoever wrote it.
5974
6045
 
5975
6046
  ### Auto-publish (CI)
5976
6047
 
@@ -35,6 +35,10 @@
35
35
 
36
36
  .caption-group {
37
37
  position: absolute;
38
+ /* Absolutely positioned with no width, a card sizes to its content and
39
+ runs off the 1080px frame rather than wrapping. Matches the container's
40
+ 60px gutters, so a long clause becomes two lines instead of an overflow. */
41
+ max-width: 960px;
38
42
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
39
43
  font-size: {{font_size}}px;
40
44
  font-weight: 900;
@@ -80,10 +84,27 @@
80
84
  const container = document.getElementById('captions');
81
85
  const tl = gsap.timeline({ paused: true });
82
86
 
87
+ // A card closes where the SCRIPT closes, not on a word count. Slicing every
88
+ // N words gave cards reading "OTRA VEZ, EN" — half a thought ending on a
89
+ // preposition. The count stays as a ceiling (a long clause still has to be
90
+ // split), and a linking word never ends a card: it belongs to what follows.
91
+ const CLOSES = /[.,;:!?\u2026]$/;
92
+ const CARRIES_ON = new Set([
93
+ 'de','del','al','a','en','y','e','o','u','que','la','el','los','las','un','una',
94
+ 'con','por','para','su','tu','mi','más','mas','the','of','to','and','in','for','your',
95
+ ]);
96
+ const carriesOn = (w) => CARRIES_ON.has(String(w.text || '').replace(/[.,;:!?\u2026]$/, '').toLowerCase());
97
+
83
98
  const groups = [];
84
- for (let i = 0; i < transcript.length; i += WORDS_PER_GROUP) {
85
- groups.push(transcript.slice(i, i + WORDS_PER_GROUP));
99
+ let current = [];
100
+ for (const word of transcript) {
101
+ current.push(word);
102
+ const last = current[current.length - 1];
103
+ const closes = CLOSES.test(String(last.text || '')) ||
104
+ (current.length >= WORDS_PER_GROUP && !carriesOn(last));
105
+ if (closes) { groups.push(current); current = []; }
86
106
  }
107
+ if (current.length > 0) groups.push(current);
87
108
 
88
109
  groups.forEach((group, gi) => {
89
110
  const el = document.createElement('div');
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  debugLogSetting
3
- } from "./chunk-DZUVUGEP.js";
3
+ } from "./chunk-WFWU3CHS.js";
4
4
 
5
5
  // src/debugLog.ts
6
6
  import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
@@ -150,4 +150,4 @@ export {
150
150
  readBodyForLog,
151
151
  installStreamTaps
152
152
  };
153
- //# sourceMappingURL=chunk-2IB3IL4K.js.map
153
+ //# sourceMappingURL=chunk-2IUN3S3E.js.map
@@ -2,13 +2,13 @@ import {
2
2
  handleConnectionError,
3
3
  needsConnectionFix,
4
4
  writeAdsJson
5
- } from "./chunk-EX2OIOVL.js";
5
+ } from "./chunk-A2VZOTCV.js";
6
6
  import {
7
7
  ApiError
8
- } from "./chunk-GU7IWEBC.js";
8
+ } from "./chunk-KDTHRRAC.js";
9
9
  import {
10
10
  getEnv
11
- } from "./chunk-DZUVUGEP.js";
11
+ } from "./chunk-WFWU3CHS.js";
12
12
 
13
13
  // src/commands/ads/meta/shared.ts
14
14
  var DAY_MS = 864e5;
@@ -108,4 +108,4 @@ export {
108
108
  csvOrJson,
109
109
  resolveEffectiveStatus
110
110
  };
111
- //# sourceMappingURL=chunk-D3HHUBIL.js.map
111
+ //# sourceMappingURL=chunk-4YF56EGK.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ApiError,
3
3
  apiGet
4
- } from "./chunk-GU7IWEBC.js";
4
+ } from "./chunk-KDTHRRAC.js";
5
5
  import {
6
6
  getEnv
7
- } from "./chunk-DZUVUGEP.js";
7
+ } from "./chunk-WFWU3CHS.js";
8
8
 
9
9
  // src/error-handler.ts
10
10
  var REQUEST_CONNECTION_PLATFORM = {
@@ -294,4 +294,4 @@ export {
294
294
  writeAdsOutput,
295
295
  resolveCustomerId
296
296
  };
297
- //# sourceMappingURL=chunk-EX2OIOVL.js.map
297
+ //# sourceMappingURL=chunk-A2VZOTCV.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  debugLogHttp,
3
3
  readBodyForLog
4
- } from "./chunk-2IB3IL4K.js";
4
+ } from "./chunk-2IUN3S3E.js";
5
5
  import {
6
6
  getEnv
7
- } from "./chunk-DZUVUGEP.js";
7
+ } from "./chunk-WFWU3CHS.js";
8
8
 
9
9
  // src/client.ts
10
10
  var MAX_RATE_LIMIT_RETRIES = 3;
@@ -205,4 +205,4 @@ export {
205
205
  apiGet,
206
206
  apiPost
207
207
  };
208
- //# sourceMappingURL=chunk-GU7IWEBC.js.map
208
+ //# sourceMappingURL=chunk-KDTHRRAC.js.map