@cliangdev/conductor 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/claude/agents/conductor-marketing-art-director.md +2 -1
- package/assets/claude/skills/conductor-marketing-create/SKILL.md +12 -2
- package/assets/claude/skills/conductor-marketing-create/references/capabilities.md +9 -2
- package/assets/claude/skills/conductor-marketing-create/references/direct.md +39 -6
- package/assets/claude/skills/conductor-marketing-create/references/platform-specs.md +15 -4
- package/assets/claude/skills/conductor-marketing-create/references/shotlist-template.md +2 -2
- package/assets/claude/skills/conductor-marketing-create/references/slideshow-formats.md +2 -1
- package/assets/claude/skills/conductor-marketing-create/references/team-run.md +3 -3
- package/assets/cli-manifest.json +4 -4
- package/dist/creative/assertions.js +30 -3
- package/dist/creative/frame.js +2 -2
- package/dist/creative/job/media.mjs +2 -2
- package/dist/creative/job/render.mjs +3 -0
- package/dist/creative/placements.js +2 -2
- package/dist/creative/placements.json +3 -3
- package/dist/creative/render.js +20 -8
- package/dist/lib/creative-render.d.ts +14 -1
- package/dist/lib/creative-render.d.ts.map +1 -1
- package/dist/lib/creative-render.js +3 -1
- package/dist/lib/creative-render.js.map +1 -1
- package/dist/lib/safe-zone/check.d.ts +31 -0
- package/dist/lib/safe-zone/check.d.ts.map +1 -0
- package/dist/lib/safe-zone/check.js +267 -0
- package/dist/lib/safe-zone/check.js.map +1 -0
- package/dist/lib/safe-zone/frames.d.ts +35 -0
- package/dist/lib/safe-zone/frames.d.ts.map +1 -0
- package/dist/lib/safe-zone/frames.js +132 -0
- package/dist/lib/safe-zone/frames.js.map +1 -0
- package/dist/lib/safe-zone/ocr.d.ts +42 -0
- package/dist/lib/safe-zone/ocr.d.ts.map +1 -0
- package/dist/lib/safe-zone/ocr.js +139 -0
- package/dist/lib/safe-zone/ocr.js.map +1 -0
- package/dist/lib/safe-zone/overlay.d.ts +59 -0
- package/dist/lib/safe-zone/overlay.d.ts.map +1 -0
- package/dist/lib/safe-zone/overlay.js +283 -0
- package/dist/lib/safe-zone/overlay.js.map +1 -0
- package/dist/lib/safe-zone/zones.d.ts +46 -0
- package/dist/lib/safe-zone/zones.d.ts.map +1 -0
- package/dist/lib/safe-zone/zones.js +84 -0
- package/dist/lib/safe-zone/zones.js.map +1 -0
- package/dist/lib/slideshow/compose.d.ts +2 -0
- package/dist/lib/slideshow/compose.d.ts.map +1 -1
- package/dist/lib/slideshow/compose.js +1 -1
- package/dist/lib/slideshow/compose.js.map +1 -1
- package/dist/lib/slideshow/css.d.ts +2 -0
- package/dist/lib/slideshow/css.d.ts.map +1 -1
- package/dist/lib/slideshow/css.js +9 -5
- package/dist/lib/slideshow/css.js.map +1 -1
- package/dist/lib/slideshow/html.d.ts +12 -3
- package/dist/lib/slideshow/html.d.ts.map +1 -1
- package/dist/lib/slideshow/html.js +16 -10
- package/dist/lib/slideshow/html.js.map +1 -1
- package/dist/lib/slideshow/spec-transport.d.ts.map +1 -1
- package/dist/lib/slideshow/spec-transport.js +4 -2
- package/dist/lib/slideshow/spec-transport.js.map +1 -1
- package/dist/lib/slideshow/spec.d.ts +8 -0
- package/dist/lib/slideshow/spec.d.ts.map +1 -1
- package/dist/lib/slideshow/spec.js +6 -0
- package/dist/lib/slideshow/spec.js.map +1 -1
- package/dist/lib/slideshow-pacing.d.ts +46 -0
- package/dist/lib/slideshow-pacing.d.ts.map +1 -0
- package/dist/lib/slideshow-pacing.js +98 -0
- package/dist/lib/slideshow-pacing.js.map +1 -0
- package/dist/mcp/index.d.ts +437 -6
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +24 -10
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools/creative-drafts.d.ts +16 -2
- package/dist/mcp/tools/creative-drafts.d.ts.map +1 -1
- package/dist/mcp/tools/creative-drafts.js +237 -31
- package/dist/mcp/tools/creative-drafts.js.map +1 -1
- package/dist/mcp/tools/creatives.d.ts +12 -3
- package/dist/mcp/tools/creatives.d.ts.map +1 -1
- package/dist/mcp/tools/creatives.js +235 -17
- package/dist/mcp/tools/creatives.js.map +1 -1
- package/dist/mcp/tools/safe-zone-pixels.d.ts +165 -0
- package/dist/mcp/tools/safe-zone-pixels.d.ts.map +1 -0
- package/dist/mcp/tools/safe-zone-pixels.js +300 -0
- package/dist/mcp/tools/safe-zone-pixels.js.map +1 -0
- package/dist/mcp/tools/slideshow-render.d.ts.map +1 -1
- package/dist/mcp/tools/slideshow-render.js +3 -1
- package/dist/mcp/tools/slideshow-render.js.map +1 -1
- package/package.json +4 -2
|
@@ -23,7 +23,8 @@ send to the draft renderer, so it has to be valid on the first try.
|
|
|
23
23
|
|
|
24
24
|
Follow the shot-list template: shot list table (time, visual, on-screen text, VO or audio, asset),
|
|
25
25
|
safe zones, sound, and the mapping to the Creative's fields. Keep text out of the platform's UI
|
|
26
|
-
(
|
|
26
|
+
(9:16 at 1080x1920: text at y >= 290, above y=1490, out of the right 15% column; see
|
|
27
|
+
`references/platform-specs.md`). For a `FILM` idea, include capture settings and
|
|
27
28
|
the ready-to-paste text. Pick the layout per
|
|
28
29
|
`references/layout-guide.md`: `bleed` by default when 9:16 is enabled, `card` when the photo must stay
|
|
29
30
|
readable or a face would sit under the copy. Never `stacked` or `split` when 9:16 is enabled. Build the
|
|
@@ -74,14 +74,24 @@ Automated checks are real but incomplete. These are the ones worth looking for b
|
|
|
74
74
|
check, because none of them read pixels for meaning. Open and look at every photo.
|
|
75
75
|
- **A generated image depicting a product, result or claim that is not real** (a made-up app screen,
|
|
76
76
|
a before/after, an invented package) passes every check. Only looking catches it.
|
|
77
|
-
- **
|
|
78
|
-
|
|
77
|
+
- **Finished images and clips are pixels the layout engine did not place.** CAROUSEL slides, CLIP
|
|
78
|
+
media and anything rendered outside Conductor (HTML, ffmpeg, Veo or another generator) can carry
|
|
79
|
+
text under the platform UI. `preview_creative_draft` now reads their text with OCR in the UI zones
|
|
80
|
+
and returns `safeZoneText` checks, but OCR misses stylised or low-contrast text, so still look at
|
|
81
|
+
slide 1 and the first frames of each video on the UI overlay sheet. At 1080x1920: nothing above
|
|
82
|
+
y=290, nothing below y=1490 (keep long-caption posts above about y=1250), nothing in the right 15%
|
|
83
|
+
column (see `references/platform-specs.md`). A `safeZoneUnchecked` check means OCR could not run
|
|
84
|
+
and it did NOT look: check by eye. `checks: []` means it looked and found nothing.
|
|
85
|
+
- **A structurally valid render is not necessarily a good one.** The layout checks cover spill, the
|
|
86
|
+
top and bottom safe zones, fonts and contrast, never whether the headline reads at a glance or the copy sits on a face. The
|
|
79
87
|
design critique exists for this gap.
|
|
80
88
|
- **A Brand Kit with no copy rules, or no accent-phrase requirement, never fails a save on that
|
|
81
89
|
account.** That is permissive by design, which makes the model the only check on brand voice until
|
|
82
90
|
someone configures rules.
|
|
83
91
|
- **A draft is not a saved Creative.** A Creative or media id does not exist until
|
|
84
92
|
`commit_creative_draft` runs; do not hand a draft's folder to `attach_creative_to_post` or a Post.
|
|
93
|
+
`attach_creative_to_post` also refuses a Creative whose finished pixels have a blocking safe-zone
|
|
94
|
+
error; fix the media, and use `ignoreSafeZone: true` only when the person has looked and accepts it.
|
|
85
95
|
- **A stale write is refused, not overwritten.** `update_creative` requires the current `version`; a
|
|
86
96
|
409 names the conflict. Reread with `get_creative` and reapply, do not retry blind.
|
|
87
97
|
- **Rejected copy stays rejected.** Copy rules with ids starting `banned-` are lines or visuals the
|
|
@@ -28,9 +28,16 @@ needs changing until it fits.
|
|
|
28
28
|
when the slides already exist as image files or library media. Slides are ordered per placement
|
|
29
29
|
(`slides`, with `default` as the fallback) and each must match its placement's aspect. Reels,
|
|
30
30
|
Stories and YouTube cannot take its photos. With a library music track (`audio.source` `track`)
|
|
31
|
-
it also gets a 9:16 slideshow video (`slideshow.slideDurations`, 1 to 10 s per slide
|
|
32
|
-
then 2.5 s; `zoom` default on), because no platform accepts a chosen track on photos. Each
|
|
31
|
+
it also gets a 9:16 slideshow video (`slideshow.slideDurations`, 1 to 10 s per slide; `zoom` default on), because no platform accepts a chosen track on photos. Each
|
|
33
32
|
destination then sends the photos (silent) or that video (`carouselAs`: `photos` or `video`).
|
|
33
|
+
Pacing: always pass `slideshow.slideDurations` explicitly, per slide `clamp(2.4 + 0.14 x words, 3.0,
|
|
34
|
+
4.8)` s from the words on that slide, plus 0.5 s for slide 1 and 0.5 s for an app-screen or chart
|
|
35
|
+
slide. The 0.5 s cross-fade comes out of each slide's time. Write each `slideAltText` entry as a
|
|
36
|
+
description ending in `Text: "first line" / "second line"` (the words on the slide, exactly, lines
|
|
37
|
+
separated by " / "; `Text: none` when there are none): the tool times each slide from these words
|
|
38
|
+
(and screen readers get the on-slide text), and when `slideDurations` is omitted it computes the
|
|
39
|
+
same formula itself (from the `Text:` part, or OCR). With no text at all the default is 3.5 s for
|
|
40
|
+
slide 1 and 3.0 s for the rest. Say the total length when showing the draft.
|
|
34
41
|
|
|
35
42
|
- **Slideshow** (organic posts): native-looking slides made locally by `compose_slideshow` (photo with
|
|
36
43
|
text, app screenshot with callouts, Notes page, chat, photo grid, stacked before/after, tier list,
|
|
@@ -296,8 +296,16 @@ Not every video needs the brand layout above — a finished clip (a demo recordi
|
|
|
296
296
|
something a person or another tool already produced) can go up as-is. That's a CLIP Creative: no
|
|
297
297
|
photo, headline or layout, just the video.
|
|
298
298
|
|
|
299
|
-
A CLIP has no artwork to render,
|
|
300
|
-
|
|
299
|
+
A CLIP has no brand artwork to render, but `preview_creative_draft({kind: "CLIP", clipPath})` (or
|
|
300
|
+
`clipPaths` per placement) checks the finished video without uploading anything: it samples frames
|
|
301
|
+
every 0.5 s and at each scene cut, reads their text with OCR, returns the safe-zone `checks` and an
|
|
302
|
+
overlay sheet (see "Safe zones in finished pixels" below). Open the video itself and check it with the
|
|
303
|
+
person before uploading.
|
|
304
|
+
|
|
305
|
+
If you made the clip outside Conductor (ffmpeg, Veo or another generator, burned-in captions), lay
|
|
306
|
+
its text inside the safe zone before upload (numbers in `references/platform-specs.md`) and do not
|
|
307
|
+
rely on the preview check alone. Self-check: export frame 1 and the first frame after each cut, and
|
|
308
|
+
confirm every line of text starts below y=290.
|
|
301
309
|
|
|
302
310
|
1. Check `list_creative_media({kind: "VIDEO"})` for a clip already in the project before uploading a
|
|
303
311
|
new one. A new one goes through `upload_creative_media` (local path or URL) — same provenance
|
|
@@ -311,7 +319,7 @@ itself and check it with the person before uploading.
|
|
|
311
319
|
nothing renders in a browser). With `audio` (below) it encodes a new MP4 on this machine with
|
|
312
320
|
ffmpeg instead.
|
|
313
321
|
4. `preview_creative` — returns a small poster sheet across placements instead of the STILL contact
|
|
314
|
-
sheet, plus each placement's duration. Still worth a look: a poster is one frame, not the whole
|
|
322
|
+
sheet, plus each placement's duration, and runs the same safe-zone check on a saved 9:16 CLIP. Still worth a look: a poster is one frame, not the whole
|
|
315
323
|
cut, so open the actual video before calling a rough or misframed clip done.
|
|
316
324
|
5. `attach_creative_to_post`, same as any other Creative.
|
|
317
325
|
|
|
@@ -327,6 +335,10 @@ broadly.
|
|
|
327
335
|
|
|
328
336
|
## Finished images (carousel or single still)
|
|
329
337
|
|
|
338
|
+
When you render the slides yourself (HTML, Playwright, ffmpeg or any generator), lay the text inside
|
|
339
|
+
the safe zone before upload (numbers in `references/platform-specs.md`) and do not rely on the preview
|
|
340
|
+
check alone. Self-check: export slide 1 and confirm every line of text starts below y=290.
|
|
341
|
+
|
|
330
342
|
Slides made by `compose_slideshow` take this same CAROUSEL route: pass its `slidePaths` to
|
|
331
343
|
`preview_creative_draft` (see `references/slideshow-formats.md`).
|
|
332
344
|
|
|
@@ -356,10 +368,18 @@ thing).
|
|
|
356
368
|
library (see "Music" below) also renders a 9:16 slideshow MP4 here: `preview_creative_draft`
|
|
357
369
|
returns it as `slideshowVideoPath` beside the contact sheet, so watch it with the person, not
|
|
358
370
|
just the sheet. `slideshow: {slideDurations, zoom}` sets the pace (one entry per 9x16 slide, 1 to
|
|
359
|
-
10 s
|
|
360
|
-
|
|
371
|
+
10 s) and the slow push-in (default on). Always pass `slideDurations` explicitly, per slide
|
|
372
|
+
`clamp(2.4 + 0.14 x words, 3.0, 4.8)` s from the words on that slide, plus 0.5 s for slide 1 and
|
|
373
|
+
0.5 s for an app-screen or chart slide. The 0.5 s cross-fade comes out of each slide's time, so
|
|
374
|
+
the total is the sum minus 0.5 s per cut. The tool computes the same formula itself when
|
|
375
|
+
`slideDurations` is omitted (from the `Text:` part of `slideAltText`, or OCR); with no text it
|
|
376
|
+
falls back to 3.5 s for the first slide and 3.0 s for the rest, so 20 slides run about 51 s.
|
|
377
|
+
Say the total length when showing the draft, and keep it short.
|
|
361
378
|
4. Alt text: `slideAltText` has one entry per slide, in order (or a single Creative `altText`); readiness
|
|
362
|
-
blocks without it.
|
|
379
|
+
blocks without it. Each entry describes the picture, then ends with `Text: "first line" / "second
|
|
380
|
+
line"`, quoting the words on the slide exactly (lines separated by " / "); write `Text: none` for
|
|
381
|
+
a slide with no words. The tool times each slide from these words, and screen readers get the
|
|
382
|
+
on-slide text. Slides are never rewritten, so check them for burned-in text, logos and claims
|
|
363
383
|
and approve with `photoChecked: true`.
|
|
364
384
|
5. `get_creative` for `readiness` (slides, caption, altText, photoChecked block going READY), then
|
|
365
385
|
`attach_creative_to_post` (it renders first if needed). The mapping: Instagram feed gets `4x5`
|
|
@@ -410,6 +430,19 @@ destination rewards video over an image.
|
|
|
410
430
|
|
|
411
431
|
A reel or other vertical placement takes exactly one video, same as a CLIP.
|
|
412
432
|
|
|
433
|
+
## Safe zones in finished pixels
|
|
434
|
+
|
|
435
|
+
The layout engine places text for STILL and MOTION Creatives, and checks it. Finished images and
|
|
436
|
+
clips (CAROUSEL slides, CLIP media, anything rendered outside Conductor) are pixels it did not place,
|
|
437
|
+
so `preview_creative_draft` reads their text with OCR in the UI zones instead and reports
|
|
438
|
+
`safeZoneText` checks (slide index or `atSeconds`, the box, the text, which platform's UI covers it).
|
|
439
|
+
It also returns an overlay sheet with Instagram and TikTok chrome drawn over the frames: `uiOverlay`
|
|
440
|
+
is `instagram | tiktok | both | none`, inlined by default for 9:16 CAROUSEL and CLIP (the TikTok
|
|
441
|
+
sheet is written to disk and its path returned). Look at it. OCR misses stylised or low-contrast
|
|
442
|
+
text, and a `safeZoneUnchecked` check means OCR could not run and nothing was checked. A blocking
|
|
443
|
+
error (text in the top zone on slide 1 or in the first 3 s) fails `passed`, and
|
|
444
|
+
`attach_creative_to_post` refuses the Creative unless `ignoreSafeZone: true`.
|
|
445
|
+
|
|
413
446
|
## Video from a still (generated clip)
|
|
414
447
|
|
|
415
448
|
Only when the person asks for animation, motion, real movement or a video hook. Never offer it
|
|
@@ -18,10 +18,21 @@ ranking signals without notice, and the brief's own platform list always wins.
|
|
|
18
18
|
|
|
19
19
|
## Safe zone (9:16, 1080x1920)
|
|
20
20
|
|
|
21
|
-
Use
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
Use one zone for every 9:16 surface: Reels, TikTok, Shorts, Stories and slideshow videos. Keep text
|
|
22
|
+
and faces inside this box:
|
|
23
|
+
|
|
24
|
+
| Zone | At 1080x1920 | Share | What covers it |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| Top | text at y >= 290 | about 15% | Reels header (about 260 px measured on iOS), TikTok tabs and search |
|
|
27
|
+
| Bottom | text above y=1490 (430 px reserved) | about 22% | caption, username, music row |
|
|
28
|
+
| Right | nothing right of x=918 between y=576 and y=1632 | right 15% (140 to 162 px) | like, comment and share column |
|
|
29
|
+
|
|
30
|
+
Long captions and hashtags grow upward, so on a post with a long caption keep text above about
|
|
31
|
+
y=1250 (the bottom ~35%). That leaves a central band of roughly 1000 px for the hook, headline and
|
|
32
|
+
CTA. Shorts' channel and title strip takes comparable space (check current platform guidance). The
|
|
33
|
+
layout engine reserves the top 290 px on `9x16` and `story` and checks it; for finished images and
|
|
34
|
+
clips, `preview_creative_draft` reads their text with OCR and its overlay sheet shows the platform UI
|
|
35
|
+
on top of the frames.
|
|
25
36
|
|
|
26
37
|
## Platforms
|
|
27
38
|
|
|
@@ -13,8 +13,8 @@ the Creative's own fields.
|
|
|
13
13
|
| 0-3s | ... | ... | ... | <media id, "to film", or none> |
|
|
14
14
|
|
|
15
15
|
## Safe zones
|
|
16
|
-
-
|
|
17
|
-
platform
|
|
16
|
+
- At 1080x1920 keep text at y >= 290 and above y=1490 (above about y=1250 when the caption is long),
|
|
17
|
+
and out of the right 15% column (9:16; numbers in `references/platform-specs.md`).
|
|
18
18
|
- Headline and CTA sit in the middle band. Nothing on a face.
|
|
19
19
|
|
|
20
20
|
## Sound
|
|
@@ -90,7 +90,8 @@ detail, and none may state a fact the brief does not support.
|
|
|
90
90
|
- Every card reads like a person posted it (`voice.md`): a speaker, one real detail, no template
|
|
91
91
|
frames, never a description of the photo.
|
|
92
92
|
- Keep text between about y 16 and y 75 (percent of the 9:16 frame). That survives the 4:5 Instagram
|
|
93
|
-
cut and the platform UI (top bar, bottom caption, right button column).
|
|
93
|
+
cut and the platform UI (top bar, bottom caption, right button column). In pixels the top limit is
|
|
94
|
+
y=290 of 1920 (15.1%), which y 16 (307 px) clears.
|
|
94
95
|
- The first text of every slide needs `y`.
|
|
95
96
|
- Read the composer's `checks`; an `error` severity blocks the preview.
|
|
96
97
|
|
|
@@ -345,7 +345,7 @@ any placement is fixed now, not shown.
|
|
|
345
345
|
(layers: native, then the kit, then the spec's own top-level `style`, then the inline `style`); keep the
|
|
346
346
|
result's `style`. Then
|
|
347
347
|
`preview_creative_draft({kind: "CAROUSEL", brandKitId: <run.json brandKitId, the Creative's brand kit>, slidePaths, slideStyle: style, caption, slideAltText})` with the returned `slidePaths` (`9x16` for TikTok, `4x5` for Instagram),
|
|
348
|
-
the caption from `publish-pack.json` and the alt text from `direction.md`. Record the preview's
|
|
348
|
+
the caption from `publish-pack.json` and the alt text from `direction.md`. Each `slideAltText` entry describes the picture, then ends with `Text: "first line" / "second line"`, quoting the words on the slide exactly (lines separated by " / "), or `Text: none` for a slide with no words; the tool times each slide from these words (and screen readers get the on-slide text). Pass `slideshow.slideDurations` computed per `references/capabilities.md`. Record the preview's
|
|
349
349
|
`draftDir` as `drafts.final`.
|
|
350
350
|
**Music:** a slideshow or clip with music uses `audio` on the Creative, and a track from
|
|
351
351
|
`context/media.json` (`kind: "AUDIO"`, unblocked) is reused before any new file. A new music file
|
|
@@ -359,8 +359,8 @@ any placement is fixed now, not shown.
|
|
|
359
359
|
`references/design-critique.md` (the slideshow criteria for a slideshow, the STILL criteria
|
|
360
360
|
otherwise; any criterion below 3 is fixed before anyone sees it). For a STILL: does the headline read at a
|
|
361
361
|
glance, does the accent phrase fall on the words that carry the meaning, is copy on a face, are
|
|
362
|
-
the safe zones clear. For a slideshow: does slide 1 stop the scroll, is the text inside y 16 to 75,
|
|
363
|
-
is the screenshot real, and is there no logo, badge or offer. Also read the result's `checks`/`passed`: while any blocking check fails,
|
|
362
|
+
the safe zones clear. For a slideshow: does slide 1 stop the scroll, is the text inside y 16 to 75 (and that holds for burned-in captions in CLIP videos too),
|
|
363
|
+
is the screenshot real, and is there no logo, badge or offer. Look at the UI overlay sheet the preview returns (`uiOverlay`), not just the clean frames. Also read the result's `checks`/`passed`: while any blocking check fails,
|
|
364
364
|
fix it (`layoutOverrides` for photo height, `typeOverrides` for text size, a shorter body) and
|
|
365
365
|
re-preview **before** showing anything, and never offer Approve & upload while one still fails.
|
|
366
366
|
Revise at most twice beyond that; if it is still wrong, show it honestly and say what is off.
|
package/assets/cli-manifest.json
CHANGED
|
@@ -971,7 +971,7 @@
|
|
|
971
971
|
},
|
|
972
972
|
{
|
|
973
973
|
"name": "render_creative",
|
|
974
|
-
"description": "Render a Creative locally to upload-ready frames (JPEG per placement; MP4 for MOTION, a CAROUSEL with a track, or a CLIP with new audio, encoded with ffmpeg here), or a contact sheet with previewOnly. Runs synchronously and returns the render id, state and frame URLs.",
|
|
974
|
+
"description": "Render a Creative locally to upload-ready frames (JPEG per placement; MP4 for MOTION, a CAROUSEL with a track, or a CLIP with new audio, encoded with ffmpeg here), or a contact sheet with previewOnly. Runs synchronously and returns the render id, state and frame URLs. A CAROUSEL or CLIP with a 9x16 placement also reports checks for text under the platform UI (reported only, never blocking).",
|
|
975
975
|
"category": "marketing",
|
|
976
976
|
"requiredParams": [
|
|
977
977
|
"creativeId"
|
|
@@ -979,7 +979,7 @@
|
|
|
979
979
|
},
|
|
980
980
|
{
|
|
981
981
|
"name": "preview_creative",
|
|
982
|
-
"description": "Look at a Creative: returns its latest contact sheet as an image, rendering a fresh preview first if none exists yet.",
|
|
982
|
+
"description": "Look at a Creative: returns its latest contact sheet as an image, rendering a fresh preview first if none exists yet. A saved CAROUSEL or CLIP with a 9x16 placement is also checked for text under the platform UI (checks, passed) and gets Instagram/TikTok UI overlay sheets on disk.",
|
|
983
983
|
"category": "marketing",
|
|
984
984
|
"requiredParams": [
|
|
985
985
|
"creativeId"
|
|
@@ -1026,7 +1026,7 @@
|
|
|
1026
1026
|
},
|
|
1027
1027
|
{
|
|
1028
1028
|
"name": "preview_creative_draft",
|
|
1029
|
-
"description": "Look at a Creative before anything is saved: renders a draft locally from the create_creative fields plus local files (photoPath, clipPath, audioPath) and returns the contact sheet as an image; a CAROUSEL with a track also renders its slideshow MP4 and returns the path. Never writes to Conductor; commit only after the person approves.",
|
|
1029
|
+
"description": "Look at a Creative before anything is saved: renders a draft locally from the create_creative fields plus local files (photoPath, clipPath, audioPath) and returns the contact sheet as an image; a CAROUSEL with a track also renders its slideshow MP4 and returns the path, timing each slide from its text when slideDurations is omitted. Finished 9:16 slides and CLIP videos (clipPath or clipPaths, no commit) are checked for text under the platform UI (checks, passed) and shown with the Instagram UI drawn over them (overlaySheets, uiOverlay). Never writes to Conductor; commit only after the person approves.",
|
|
1030
1030
|
"category": "marketing"
|
|
1031
1031
|
},
|
|
1032
1032
|
{
|
|
@@ -1039,7 +1039,7 @@
|
|
|
1039
1039
|
},
|
|
1040
1040
|
{
|
|
1041
1041
|
"name": "attach_creative_to_post",
|
|
1042
|
-
"description": "Attach a Creative's rendered frames to a Post as its media, placement to platform, for every destination without its own custom media. A CAROUSEL with a track is sent per target as photos or its slideshow video (carouselAs). Call get_post_status (postId) to verify.",
|
|
1042
|
+
"description": "Attach a Creative's rendered frames to a Post as its media, placement to platform, for every destination without its own custom media. A CAROUSEL with a track is sent per target as photos or its slideshow video (carouselAs). A CAROUSEL or CLIP with text under the platform UI is refused (SAFE_ZONE_TEXT) unless ignoreSafeZone is true. Call get_post_status (postId) to verify.",
|
|
1043
1043
|
"category": "marketing",
|
|
1044
1044
|
"requiredParams": [
|
|
1045
1045
|
"creativeId",
|
|
@@ -77,8 +77,9 @@ export function spillDetect(boardRect, nodes) {
|
|
|
77
77
|
/** Copy intruding on the placement's reserved bottom safe zone (where a
|
|
78
78
|
* platform's own UI — Instagram's story CTA, TikTok's caption — sits).
|
|
79
79
|
* Mirrors render.js's own `fits()` bottom check exactly, so fitting and this
|
|
80
|
-
* safety net can never disagree.
|
|
81
|
-
*
|
|
80
|
+
* safety net can never disagree. The top zone is checked by
|
|
81
|
+
* `safeZoneTopIntrusion` below; the right column is not asserted (copy boxes
|
|
82
|
+
* span the full padded width, so a box test would always trip). */
|
|
82
83
|
export function safeZoneIntrusion(boardRect, nodes, safe) {
|
|
83
84
|
const issues = [];
|
|
84
85
|
const bottom = (safe && safe.bottom) || 0;
|
|
@@ -90,6 +91,29 @@ export function safeZoneIntrusion(boardRect, nodes, safe) {
|
|
|
90
91
|
return issues;
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
/** Text intruding on the placement's reserved top safe zone (Instagram's Reels
|
|
95
|
+
* header, TikTok's tabs and search): headline, body and CTA starting inside it.
|
|
96
|
+
* The lockup (logo) is not text and is never checked. `ratio` names the
|
|
97
|
+
* placement in the message. `severity: 'warning'` reports the findings as
|
|
98
|
+
* warnings (saved Creatives that rendered before the zone grew must keep
|
|
99
|
+
* rendering). Returns `{ errors, warnings }` message arrays. Mirrors
|
|
100
|
+
* render.js's `fits()` top check. */
|
|
101
|
+
export function safeZoneTopIntrusion(boardRect, nodes, safe, ratio, severity = 'error') {
|
|
102
|
+
const out = { errors: [], warnings: [] };
|
|
103
|
+
const top = (safe && safe.top) || 0;
|
|
104
|
+
if (!top) return out;
|
|
105
|
+
const h = Math.round(boardRect.bottom - boardRect.top);
|
|
106
|
+
const w = Math.round(boardRect.right - boardRect.left);
|
|
107
|
+
for (const { name, rect } of nodes) {
|
|
108
|
+
if (String(name).includes('cc-lockup')) continue;
|
|
109
|
+
const over = boardRect.top + top - rect.top;
|
|
110
|
+
if (over <= 1) continue;
|
|
111
|
+
const msg = `${name} starts ${Math.round(over)}px inside the top safe zone of ${ratio || 'this placement'} (platform UI covers y < ${top}); move it below y=${top} at ${w || 1080}x${h || 1920}`;
|
|
112
|
+
(severity === 'warning' ? out.warnings : out.errors).push(msg);
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
|
|
93
117
|
/** Pure: what a render requires on the board, from the resolved ad and the brand kit it renders with —
|
|
94
118
|
* `{ photo, lockup, headline }`. A photo is required when the ad has a photo URL (a clip-only background
|
|
95
119
|
* does not need one); a lockup when the kit has a mark or a wordmark (a kit without logos renders none,
|
|
@@ -136,7 +160,7 @@ function sameRgb(a, b) {
|
|
|
136
160
|
* to renderBoard; `expect` (optional, see expectedElements) names the elements the spec requires, so a
|
|
137
161
|
* missing one fails. An empty `errors` array means the frame is safe to ship; `warnings` are non-fatal
|
|
138
162
|
* (e.g. a soft, upscaled photo, or a body line the layout drops at this placement). */
|
|
139
|
-
export async function runAssertions(board, placement, brand, { outputScale = 2, expect = null } = {}) {
|
|
163
|
+
export async function runAssertions(board, placement, brand, { outputScale = 2, expect = null, safeTopSeverity = 'warning' } = {}) {
|
|
140
164
|
const errors = [];
|
|
141
165
|
const warnings = [];
|
|
142
166
|
// The same findings with a stable `rule` id each, for callers (the draft preview) that report them
|
|
@@ -164,6 +188,9 @@ export async function runAssertions(board, placement, brand, { outputScale = 2,
|
|
|
164
188
|
};
|
|
165
189
|
const intrusion = safeZoneIntrusion(br, nodes, safe);
|
|
166
190
|
if (intrusion.length) fail('safeZone', `safe-zone intrusion: ${intrusion.join('; ')}`);
|
|
191
|
+
const topZone = safeZoneTopIntrusion(br, nodes, safe, board.dataset.ratio, safeTopSeverity === 'error' ? 'error' : 'warning');
|
|
192
|
+
if (topZone.errors.length) fail('safeZone', `safe-zone intrusion: ${topZone.errors.join('; ')}`);
|
|
193
|
+
if (topZone.warnings.length) warn('safeZone', `safe-zone intrusion: ${topZone.warnings.join('; ')}`);
|
|
167
194
|
|
|
168
195
|
if (brand && brand.fontFamily) {
|
|
169
196
|
const headlineEl = board.querySelector('.cc-headline');
|
package/dist/creative/frame.js
CHANGED
|
@@ -105,13 +105,13 @@ async function main() {
|
|
|
105
105
|
return true;
|
|
106
106
|
};
|
|
107
107
|
// A motion frame is captured at 1x (video), so the photo only needs to cover the placement itself.
|
|
108
|
-
window.__assertBoard = async () => runAssertions(board, placement, spec.brand || {}, { outputScale: 1, expect });
|
|
108
|
+
window.__assertBoard = async () => runAssertions(board, placement, spec.brand || {}, { outputScale: 1, expect, safeTopSeverity: spec.safeTopSeverity });
|
|
109
109
|
|
|
110
110
|
finish({ ok: true, width: placement.w, height: placement.h });
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
const { errors, warnings, checks, width, height } = await runAssertions(board, placement, spec.brand || {}, { expect });
|
|
114
|
+
const { errors, warnings, checks, width, height } = await runAssertions(board, placement, spec.brand || {}, { expect, safeTopSeverity: spec.safeTopSeverity });
|
|
115
115
|
finish({ ok: errors.length === 0, errors, warnings, checks, width, height });
|
|
116
116
|
} catch (err) {
|
|
117
117
|
finish({ ok: false, error: String((err && err.message) || err) });
|
|
@@ -122,11 +122,11 @@ const COLOR_TAGS = ['-color_range', 'tv', '-colorspace', 'bt709', '-color_primar
|
|
|
122
122
|
const VIDEO_ENCODE = ['-c:v', 'libx264', '-preset', 'veryfast', '-crf', '20', '-pix_fmt', 'yuv420p'];
|
|
123
123
|
const AUDIO_ENCODE = ['-c:a', 'aac', '-b:a', '128k', '-ar', '48000', '-ac', '2'];
|
|
124
124
|
|
|
125
|
-
/** Per-slide durations resolved against the slide count: given values win; defaults are 3.
|
|
125
|
+
/** Per-slide durations resolved against the slide count: given values win; defaults are 3.5 s first, 3.0 s after. */
|
|
126
126
|
export function resolveSlideDurations(slideDurations, count) {
|
|
127
127
|
return Array.from({ length: count }, (_, i) => {
|
|
128
128
|
const d = slideDurations && slideDurations[i];
|
|
129
|
-
return d != null ? d : (i === 0 ? 3.
|
|
129
|
+
return d != null ? d : (i === 0 ? 3.5 : 3.0);
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -148,6 +148,7 @@ async function renderMotionPlacement({ browser, origin, spec, placementKey, ffmp
|
|
|
148
148
|
}, {
|
|
149
149
|
creative: spec.creative,
|
|
150
150
|
brand: spec.brand,
|
|
151
|
+
safeTopSeverity: spec.safeTopSeverity,
|
|
151
152
|
placementKey,
|
|
152
153
|
motion: spec.creative.motion,
|
|
153
154
|
time: 0,
|
|
@@ -425,6 +426,7 @@ async function checkFrame({ browser, origin, spec, frame, fps, log }) {
|
|
|
425
426
|
}, {
|
|
426
427
|
creative: spec.creative,
|
|
427
428
|
brand: spec.brand,
|
|
429
|
+
safeTopSeverity: spec.safeTopSeverity,
|
|
428
430
|
placementKey: frame.placementKey,
|
|
429
431
|
sequenceIndex: frame.index,
|
|
430
432
|
...(isMotion ? { motion, time: 0, clipStartSec: spec.creative.clipStartSec } : {}),
|
|
@@ -556,6 +558,7 @@ export async function run({ transport, packageRoot = PACKAGE_ROOT, browserFactor
|
|
|
556
558
|
}, {
|
|
557
559
|
creative: spec.creative,
|
|
558
560
|
brand: spec.brand,
|
|
561
|
+
safeTopSeverity: spec.safeTopSeverity,
|
|
559
562
|
placementKey: frame.placementKey,
|
|
560
563
|
sequenceIndex: frame.index,
|
|
561
564
|
placementKeys: spec.placements,
|
|
@@ -19,7 +19,7 @@ export const placements = {
|
|
|
19
19
|
label: '9:16 TikTok and Reels',
|
|
20
20
|
platform: 'tiktok',
|
|
21
21
|
default: true,
|
|
22
|
-
safe: { top:
|
|
22
|
+
safe: { top: 290, bottom: 430, right: 162 },
|
|
23
23
|
fit: { max: 132, min: 54, lines: 4 },
|
|
24
24
|
badgeHeight: 108,
|
|
25
25
|
scale: {
|
|
@@ -110,7 +110,7 @@ export const placements = {
|
|
|
110
110
|
label: '9:16 Instagram and Facebook Stories',
|
|
111
111
|
platform: 'story',
|
|
112
112
|
default: false,
|
|
113
|
-
safe: { top:
|
|
113
|
+
safe: { top: 290, bottom: 350, right: 170 },
|
|
114
114
|
fit: { max: 132, min: 54, lines: 4 },
|
|
115
115
|
badgeHeight: 108,
|
|
116
116
|
scale: {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"platform": "tiktok",
|
|
7
7
|
"default": true,
|
|
8
8
|
"safe": {
|
|
9
|
-
"top":
|
|
9
|
+
"top": 290,
|
|
10
10
|
"bottom": 430,
|
|
11
|
-
"right":
|
|
11
|
+
"right": 162
|
|
12
12
|
},
|
|
13
13
|
"fit": {
|
|
14
14
|
"max": 132,
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"platform": "story",
|
|
122
122
|
"default": false,
|
|
123
123
|
"safe": {
|
|
124
|
-
"top":
|
|
124
|
+
"top": 290,
|
|
125
125
|
"bottom": 350,
|
|
126
126
|
"right": 170
|
|
127
127
|
},
|
package/dist/creative/render.js
CHANGED
|
@@ -328,21 +328,30 @@ function applyType(board, size, leading, tracking) {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/* True when nothing in the panel crosses the artboard's edges or intrudes on
|
|
331
|
-
* the placement's bottom safe zone
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
|
|
331
|
+
* the placement's bottom safe zone, and (when `clearTop`) the headline, body
|
|
332
|
+
* and CTA start below the top safe zone. The lockup is never held to the top
|
|
333
|
+
* zone (the zone is about text). These are the same tests a headless exporter
|
|
334
|
+
* would run before writing a PNG, so fitting and that safety net cannot
|
|
335
|
+
* disagree. */
|
|
336
|
+
function fits(board, clearTop) {
|
|
335
337
|
const br = board.getBoundingClientRect();
|
|
336
338
|
const safeBottom = Number(board.dataset.safeBottom) || 0;
|
|
339
|
+
const safeTop = clearTop ? Number(board.dataset.safeTop) || 0 : 0;
|
|
337
340
|
for (const n of board.querySelectorAll('.cc-headline, .cc-body, .cc-cta, .cc-lockup')) {
|
|
338
341
|
const r = n.getBoundingClientRect();
|
|
339
342
|
if (r.top < br.top - 1 || r.right > br.right + 1) return false;
|
|
343
|
+
if (safeTop && !n.classList.contains('cc-lockup') && r.top < br.top + safeTop - 1) return false;
|
|
340
344
|
if (r.bottom > br.bottom - safeBottom + 1) return false;
|
|
341
345
|
}
|
|
342
346
|
return true;
|
|
343
347
|
}
|
|
344
348
|
|
|
345
349
|
/* Steps the headline down from the placement's max until the board fits.
|
|
350
|
+
* Prefers the largest size that fits AND clears the top safe zone; when no
|
|
351
|
+
* size does (a top-anchored layout, where shrinking never moves the start),
|
|
352
|
+
* falls back to the largest size that merely fits, exactly as before the top
|
|
353
|
+
* zone existed. One algorithm for every caller (frame, sheet, saved render),
|
|
354
|
+
* so what is checked is what is shown and shipped.
|
|
346
355
|
* Must run AFTER the board is in the document (a detached element measures
|
|
347
356
|
* zero) and AFTER document.fonts.ready (or it measures the fallback face).
|
|
348
357
|
* Steps rather than binary-searches because `text-wrap: balance` makes height
|
|
@@ -352,10 +361,13 @@ export function fitBoard(board, placements) {
|
|
|
352
361
|
if (board.dataset.autofit !== 'true') return;
|
|
353
362
|
const { max, min, lines } = placements[board.dataset.ratio].fit;
|
|
354
363
|
const headline = board.querySelector('.cc-headline');
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
364
|
+
const hasTopZone = (Number(board.dataset.safeTop) || 0) > 0;
|
|
365
|
+
for (const clearTop of hasTopZone ? [true, false] : [false]) {
|
|
366
|
+
for (let size = max; size >= min; size -= 2) {
|
|
367
|
+
applyType(board, size);
|
|
368
|
+
const used = Math.round(headline.getBoundingClientRect().height / (size * leadingFor(size)));
|
|
369
|
+
if (used <= lines && fits(board, clearTop)) return size;
|
|
370
|
+
}
|
|
359
371
|
}
|
|
360
372
|
applyType(board, min);
|
|
361
373
|
return min;
|
|
@@ -63,9 +63,22 @@ export interface DraftManifestFrame {
|
|
|
63
63
|
export interface DraftCheck {
|
|
64
64
|
placementKey: string;
|
|
65
65
|
index?: number;
|
|
66
|
-
/** spill | safeZone | contrast | font | image | accent | size | photoResolution | render */
|
|
66
|
+
/** spill | safeZone | safeZoneText | safeZoneUnchecked | contrast | font | image | accent | size | photoResolution | render */
|
|
67
67
|
rule: string;
|
|
68
68
|
message: string;
|
|
69
|
+
/** safeZoneText on a video: when the text first appears, in seconds. */
|
|
70
|
+
atSeconds?: number;
|
|
71
|
+
/** safeZoneText: where the text was read, in the image's pixels. */
|
|
72
|
+
box?: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
w: number;
|
|
76
|
+
h: number;
|
|
77
|
+
};
|
|
78
|
+
/** safeZoneText: the text that was read. */
|
|
79
|
+
text?: string;
|
|
80
|
+
/** safeZoneText: the platform UI that covers it. */
|
|
81
|
+
platforms?: string[];
|
|
69
82
|
/** An "error" would fail the full render of that placement; a "warning" would only be reported. */
|
|
70
83
|
severity: 'error' | 'warning';
|
|
71
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creative-render.d.ts","sourceRoot":"","sources":["../../src/lib/creative-render.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAU9C,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,GAAG,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iB,CAAC,CA6C5B"}
|
|
@@ -127,7 +127,9 @@ export async function renderCreative(params, config, log = () => { }) {
|
|
|
127
127
|
* `previewOnly` needs ffmpeg, resolved the same way {@link renderCreative} resolves it.
|
|
128
128
|
*/
|
|
129
129
|
export async function renderDraft(params, log = () => { }) {
|
|
130
|
-
const {
|
|
130
|
+
const { localFiles, outDir } = params;
|
|
131
|
+
// A draft preview is where the top safe zone is enforced as an error; a saved Creative's render only warns.
|
|
132
|
+
const spec = { ...params.spec, safeTopSeverity: 'error' };
|
|
131
133
|
let ffmpegPath;
|
|
132
134
|
const draftAudio = spec.creative?.audio;
|
|
133
135
|
if ((spec.creative?.kind === 'MOTION' || isAudioVideoRender(spec.creative?.kind, draftAudio)) && !spec.previewOnly) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creative-render.js","sourceRoot":"","sources":["../../src/lib/creative-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D;6DAC6D;AAC7D,MAAM,UAAU,GAAG,EAAE,CAAA;AAsErB;gFACgF;AAChF,SAAS,MAAM;IACb,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACpD,OAAO,IAAI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AAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,CAAC,CAAkB,CAAA;IAC/F,CAAC;IAAC,MAAM,CAAC;QACP,QAAQ,GAAG,SAAS,CAAA;IACtB,CAAC;IACD,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,QAAQ,EAAE,KAAK,IAAI,0BAA0B,EAAE,QAAQ,EAAE,CAAA;IACrH,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,uDAAuD,EAAE,CAAA;IACnG,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { DraftCheck } from '../creative-render.js';
|
|
2
|
+
import { type OcrEngine } from './ocr.js';
|
|
3
|
+
import { type SampledFrame } from './frames.js';
|
|
4
|
+
/** The single warning returned when OCR could not run. */
|
|
5
|
+
export declare function uncheckedCheck(placementKey: string, reason: string): DraftCheck;
|
|
6
|
+
export interface SlideCheckOptions {
|
|
7
|
+
placementKey?: string;
|
|
8
|
+
/** When the slideshow zooms (Ken Burns), boxes are pushed outward from the centre by this factor. */
|
|
9
|
+
zoom?: {
|
|
10
|
+
maxScale: number;
|
|
11
|
+
};
|
|
12
|
+
engine?: OcrEngine;
|
|
13
|
+
}
|
|
14
|
+
/** Checks finished slide images (9:16 only) for text in the platform UI zones. Top on slide 1 is an error. */
|
|
15
|
+
export declare function checkSlideImages(slides: Array<{
|
|
16
|
+
path: string;
|
|
17
|
+
index: number;
|
|
18
|
+
}>, options?: SlideCheckOptions): Promise<DraftCheck[]>;
|
|
19
|
+
export interface VideoCheckOptions {
|
|
20
|
+
placementKey?: string;
|
|
21
|
+
engine?: OcrEngine;
|
|
22
|
+
sampler?: (videoPath: string) => Promise<SampledFrame[]>;
|
|
23
|
+
}
|
|
24
|
+
/** Samples a video and reports text in the UI zones: one check per zone per run of frames showing the same text. */
|
|
25
|
+
export declare function checkVideoFrames(videoPath: string, options?: VideoCheckOptions): Promise<DraftCheck[]>;
|
|
26
|
+
/** Whole-image OCR: how many words and lines of text a slide carries (used by pacing). */
|
|
27
|
+
export declare function ocrSlideWordCount(path: string, engine?: OcrEngine): Promise<{
|
|
28
|
+
words: number;
|
|
29
|
+
lines: number;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/lib/safe-zone/check.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAoC,KAAK,SAAS,EAA8B,MAAM,UAAU,CAAA;AACvG,OAAO,EAAqB,KAAK,YAAY,EAAsB,MAAM,aAAa,CAAA;AA8FtF,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAS/E;AAkBD,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,qGAAqG;IACrG,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3B,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED,8GAA8G;AAC9G,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAwC7I;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,E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