@clipwright/core 0.55.0 → 0.56.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.
Files changed (78) hide show
  1. package/dist/caption-funnel.d.ts +10 -0
  2. package/dist/caption-funnel.js +101 -0
  3. package/dist/caption-funnel.js.map +1 -0
  4. package/dist/contract-dispositions.d.ts +411 -1
  5. package/dist/contract-dispositions.js +6 -1
  6. package/dist/contract-dispositions.js.map +1 -1
  7. package/dist/contracts/v1/workflow-brief.d.ts +2702 -1066
  8. package/dist/contracts/v1/workflow-catalog.d.ts +2714 -1066
  9. package/dist/contracts/v1/workflow-client.d.ts +1280 -440
  10. package/dist/contracts/v1/workflow-execution.d.ts +5 -0
  11. package/dist/contracts/v1/workflow-next.d.ts +1 -0
  12. package/dist/contracts/v1/workflow-plan.d.ts +4174 -1702
  13. package/dist/contracts/v1/workflow-run-read.d.ts +2 -0
  14. package/dist/creator-profile.d.ts +81 -2
  15. package/dist/creator-profile.js +158 -18
  16. package/dist/creator-profile.js.map +1 -1
  17. package/dist/faceless-media-record.js +4 -2
  18. package/dist/faceless-media-record.js.map +1 -1
  19. package/dist/faceless-public.d.ts +1130 -316
  20. package/dist/faceless-public.js +13 -0
  21. package/dist/faceless-public.js.map +1 -1
  22. package/dist/index.d.ts +3 -0
  23. package/dist/index.js +3 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/mcp-ugc-descriptions.js +11 -4
  26. package/dist/mcp-ugc-descriptions.js.map +1 -1
  27. package/dist/parts-pricing.d.ts +2 -0
  28. package/dist/parts-pricing.js +1 -1
  29. package/dist/parts-pricing.js.map +1 -1
  30. package/dist/presenter-matte.d.ts +17 -0
  31. package/dist/presenter-matte.js +29 -0
  32. package/dist/presenter-matte.js.map +1 -0
  33. package/dist/reference-analysis.d.ts +24 -0
  34. package/dist/reference-analysis.js +9 -3
  35. package/dist/reference-analysis.js.map +1 -1
  36. package/dist/reference-display.js +2 -1
  37. package/dist/reference-display.js.map +1 -1
  38. package/dist/reference-kinds.d.ts +2 -2
  39. package/dist/reference-profile.d.ts +48 -0
  40. package/dist/reference-staging.d.ts +8 -0
  41. package/dist/reference-voice-over.d.ts +35 -0
  42. package/dist/reference-voice-over.js +27 -0
  43. package/dist/reference-voice-over.js.map +1 -0
  44. package/dist/resolved-timeline.js +4 -4
  45. package/dist/resolved-timeline.js.map +1 -1
  46. package/dist/runs.d.ts +2 -0
  47. package/dist/skills.d.ts +4697 -2662
  48. package/dist/skills.js +10 -4
  49. package/dist/skills.js.map +1 -1
  50. package/dist/templates/backdrop.d.ts +33 -0
  51. package/dist/templates/backdrop.js +50 -0
  52. package/dist/templates/backdrop.js.map +1 -0
  53. package/dist/templates/comment-cta.d.ts +105 -0
  54. package/dist/templates/comment-cta.js +160 -0
  55. package/dist/templates/comment-cta.js.map +1 -0
  56. package/dist/templates/cover-story.d.ts +16 -0
  57. package/dist/templates/cover-story.js +33 -0
  58. package/dist/templates/cover-story.js.map +1 -0
  59. package/dist/templates/index.d.ts +35 -1
  60. package/dist/templates/index.js +83 -9
  61. package/dist/templates/index.js.map +1 -1
  62. package/dist/templates/series-frame.d.ts +59 -0
  63. package/dist/templates/series-frame.js +121 -0
  64. package/dist/templates/series-frame.js.map +1 -0
  65. package/dist/trend-search.d.ts +3 -2
  66. package/dist/trend-search.js +4 -26
  67. package/dist/trend-search.js.map +1 -1
  68. package/dist/voice-admission.d.ts +1282 -470
  69. package/dist/workflows/methods/faceless-explainer.d.ts +483 -3
  70. package/dist/workflows/methods/kinetic-launch.d.ts +483 -3
  71. package/dist/workflows/methods/product-image-story.d.ts +483 -3
  72. package/dist/workflows/methods/reference-remake.d.ts +483 -3
  73. package/dist/workflows/methods/shared.d.ts +483 -3
  74. package/dist/workflows/methods/ugc-faq-answer.d.ts +483 -3
  75. package/dist/workflows/methods/ugc-product-intro.d.ts +483 -3
  76. package/dist/workflows/methods/website-proof-demo.d.ts +483 -3
  77. package/dist/workflows/reference-remake.d.ts +32 -0
  78. package/package.json +1 -1
@@ -0,0 +1,160 @@
1
+ import { z } from "zod";
2
+ import { frameCanvasOf } from "../ugc-layers.js";
3
+ import { centredArea, fillingStep, templateSize } from "./size.js";
4
+ import { templateMedia } from "./slot.js";
5
+ export const CTA_LINES = { min: 2, max: 6 };
6
+ export const CTA_ITEMS = { min: 3, max: 17 };
7
+ /** The one format the page is drawn in. */
8
+ export const CTA_ASPECT = "9:16";
9
+ /** Frames the page takes to dissolve into the video's first frame when it loops. */
10
+ export const CTA_LOOP_FRAMES = 10;
11
+ /** The funnel's own pace, in frames at 25 fps: the code word starts typing after the first line enters, one letter at a time, is sent, then the
12
+ * message arrives, the follow button pops and is tapped, and the tap settles. */
13
+ export const CTA_FUNNEL = { typeDelay: 6, letter: 3, send: 6, arrive: 8, tap: 18, settle: 12 };
14
+ /** The least gap between two lines of the header, so each builds its words before the next replaces it. */
15
+ export const CTA_LINE_GAP = 10;
16
+ /** The labels a viewer's app shows, in English when absent. */
17
+ export const CTA_LABELS = { comment: "Add a comment…", follow: "Follow", following: "Following" };
18
+ /** Script languages whose letters are Latin: the English labels may stand in them, as their own words. */
19
+ const LATIN_LANGUAGES = ["en", "pl", "vi"];
20
+ /** On only where the flag says so; off, a comment_cta template is refused before any reserve. */
21
+ export function isCommentCtaEnabled(env = typeof process === "undefined" ? {} : process.env) {
22
+ return env.CLIPWRIGHT_COMMENT_CTA === "1";
23
+ }
24
+ export const COMMENT_CTA_DISABLED_MESSAGE = "comment_cta is not available right now; use another template kind";
25
+ const line = z.object({
26
+ text: z.string().min(1).max(32),
27
+ accent: z.string().min(1).max(24).optional(),
28
+ act: z.enum(["dm", "follow"]).optional(),
29
+ at: z.string().min(1).max(200).optional(),
30
+ }).strict();
31
+ const data = z.object({
32
+ title: z.string().min(1).max(40),
33
+ accent: z.string().min(1).max(24).optional(),
34
+ list_title: z.string().min(1).max(32),
35
+ items: z.array(z.string().min(1).max(24)).min(CTA_ITEMS.min).max(CTA_ITEMS.max),
36
+ code: z.string().min(1).max(16),
37
+ handle: z.string().min(1).max(30),
38
+ dm: z.string().min(1).max(40),
39
+ lines: z.array(line).min(CTA_LINES.min).max(CTA_LINES.max),
40
+ avatar: templateMedia.optional(),
41
+ labels: z.object({ comment: z.string().min(1).max(24).optional(), follow: z.string().min(1).max(12).optional(),
42
+ following: z.string().min(1).max(12).optional() }).strict().optional(),
43
+ loop: z.boolean().optional(),
44
+ size: templateSize,
45
+ }).strict().superRefine((value, context) => {
46
+ const issue = (path, message) => context.addIssue({ code: z.ZodIssueCode.custom, path, message });
47
+ if (value.accent !== undefined && !value.title.includes(value.accent))
48
+ issue(["accent"], "accent names words of the title, as written there");
49
+ value.lines.forEach((entry, index) => {
50
+ if (entry.accent !== undefined && !entry.text.includes(entry.accent))
51
+ issue(["lines", index, "accent"], "accent names words of the line, as written there");
52
+ });
53
+ for (const act of ["dm", "follow"]) {
54
+ const named = value.lines.flatMap((entry, index) => (entry.act === act ? [index] : []));
55
+ if (named.length > 1)
56
+ issue(["lines", named[1], "act"], `act ${act} names one line`);
57
+ }
58
+ const dm = value.lines.findIndex(entry => entry.act === "dm"), follow = value.lines.findIndex(entry => entry.act === "follow");
59
+ if (dm >= 0 && follow >= 0 && follow < dm)
60
+ issue(["lines", follow, "act"], "the follow comes after the message: put act follow on the dm line or a later one");
61
+ });
62
+ /** The lines the message and the follow arrive on: the ones that name them, else the middle line and the last. */
63
+ export function commentCtaActLines(lines) {
64
+ const follow = lines.findIndex(entry => entry.act === "follow"), dm = lines.findIndex(entry => entry.act === "dm");
65
+ const followLine = follow >= 0 ? follow : lines.length - 1;
66
+ return { dm: dm >= 0 ? dm : Math.min(Math.floor(lines.length / 2), followLine), follow: followLine };
67
+ }
68
+ /** The funnel's frames from the template's start, from the lines' frames: typing, its end, the send, the message, the follow and its tap. */
69
+ export function commentCtaSchedule(moments, code, acts) {
70
+ const type = moments[0] + CTA_FUNNEL.typeDelay, typed = type + Array.from(code).length * CTA_FUNNEL.letter, sent = typed + CTA_FUNNEL.send;
71
+ const dm = Math.max(moments[acts.dm], sent + CTA_FUNNEL.arrive), follow = Math.max(moments[acts.follow], dm + CTA_FUNNEL.arrive);
72
+ return { type, typed, sent, dm, follow, tap: follow + CTA_FUNNEL.tap };
73
+ }
74
+ const seconds = (frames, fps) => `${(frames / fps).toFixed(1)} s`;
75
+ /** Each line's first frame from the template's start: the first on frame 0, a quoted line on its words, the rest spread evenly before the
76
+ * follow's tap; a line keeps `CTA_LINE_GAP` after the one before, and what that moves or what the funnel loses is named. */
77
+ export function commentCtaMoments(value, beats, duration, fps, id) {
78
+ const count = value.lines.length, warnings = [], room = duration - (value.loop ? CTA_LOOP_FRAMES : 0);
79
+ const spread = Math.max(0, room - CTA_FUNNEL.tap - CTA_FUNNEL.settle);
80
+ const anchors = Array.from({ length: count + 1 }, (_, index) => (index === 0 ? 0 : index === count ? spread : beats[index]));
81
+ const targets = [0];
82
+ for (let from = 0; from < count;) {
83
+ let to = from + 1;
84
+ while (to < count && anchors[to] === undefined)
85
+ to++;
86
+ const start = targets[from], end = Math.max(start, anchors[to]);
87
+ for (let at = from + 1; at < to; at++)
88
+ targets[at] = Math.round(start + ((end - start) * (at - from)) / (to - from));
89
+ if (to < count)
90
+ targets[to] = anchors[to];
91
+ from = to;
92
+ }
93
+ const moments = [];
94
+ for (const [index, target] of targets.entries()) {
95
+ const earliest = index === 0 ? 0 : moments[index - 1] + CTA_LINE_GAP;
96
+ moments.push(Math.max(target, earliest));
97
+ if (target < earliest && beats[index] !== undefined) {
98
+ warnings.push(`template "${id}" lines.${index}.at "${value.lines[index].at}" is spoken too close after the line before it: the line starts ` +
99
+ `${seconds(earliest - target, fps)} later`);
100
+ }
101
+ }
102
+ const { tap } = commentCtaSchedule(moments, value.code, commentCtaActLines(value.lines)), need = tap + CTA_FUNNEL.settle;
103
+ if (need > room) {
104
+ warnings.push(`template "${id}": the call to action has ${seconds(room, fps)} and its comment, message and follow need ${seconds(need, fps)}, ` +
105
+ `so ${tap >= room ? "the follow button is not tapped on screen" : "the tap on the follow button is cut short"}`);
106
+ }
107
+ return { moments, warnings };
108
+ }
109
+ /** Why the data cannot stand in this run, beyond its schema: labels the script's language needs, a loop that would not end the video. */
110
+ export function commentCtaRefusals(value, context) {
111
+ const refusals = [];
112
+ if (!LATIN_LANGUAGES.includes(context.language)) {
113
+ const missing = Object.keys(CTA_LABELS).filter(key => value.labels?.[key] === undefined);
114
+ if (missing.length)
115
+ refusals.push({ path: ["labels"], message: `comment_cta labels ${missing.join(", ")} are needed in the script's language: ` +
116
+ "the comment field and the follow button would read English otherwise" });
117
+ }
118
+ if (value.loop && !context.endsScript)
119
+ refusals.push({ path: ["loop"], message: "comment_cta loop ends the video on its first frame: " +
120
+ "the template must cover the script's last words, or drop loop" });
121
+ return refusals;
122
+ }
123
+ /** A full-frame comment funnel: the title, the avatar, a header line built word by word, the full list's card, the code word typed and sent,
124
+ * the handle's message, a follow button tapped; optionally ending on the video's first frame so it loops. */
125
+ export const commentCta = {
126
+ kind: "comment_cta",
127
+ kindVersion: 1,
128
+ description: "a full-frame closing call to action in 9:16 that acts out a comment-keyword funnel: the title and an avatar (the avatar image, " +
129
+ "else the handle's initial) over a card with the full list (list_title, 3–17 items, ticked); a header line of 2–6 lines, each building " +
130
+ "word by word on its at quote (the rest spread evenly), the accent words marked; a comment field types code letter by letter and sends it " +
131
+ "with a tick; the handle's message dm arrives on the line with act dm (else the middle line), and a follow pill with the avatar pops on " +
132
+ "the line with act follow (else the last) and is tapped to following; labels set the field's hint and the button's two words, needed when " +
133
+ "the script is not in Latin letters (English otherwise); loop true dissolves the last frames into the video's first frame, so the video " +
134
+ "loops, and needs the template to cover the script's last words",
135
+ placements: ["full"],
136
+ aspects: [CTA_ASPECT],
137
+ data,
138
+ text: { title: 40, accent: 24, list_title: 32, items: 24, code: 16, handle: 30, dm: 40, "lines.text": 32, "lines.accent": 24,
139
+ "labels.comment": 24, "labels.follow": 12, "labels.following": 12 },
140
+ quotes: ["lines.at"],
141
+ spreads: "lines",
142
+ firstBeatAtStart: true,
143
+ fillsFrame: true,
144
+ slots: { avatar: { type: "image", cover: 1 } },
145
+ timing: (value, beats, duration, fps, id) => commentCtaMoments(value, beats, duration, fps, id),
146
+ check: (value, context) => commentCtaRefusals(value, context),
147
+ hidesCaptions: () => true,
148
+ onInserts: false,
149
+ // The page fills the frame at medium; small draws it a quarter smaller on the theme's ground.
150
+ rect: (value, aspectRatio) => {
151
+ const canvas = frameCanvasOf(aspectRatio), step = fillingStep(value.size);
152
+ return centredArea(canvas, step * canvas.width, step * canvas.height);
153
+ },
154
+ sample: { title: "5 AI tools for faster edits", accent: "AI tools", list_title: "5 AI tools", items: ["Auto captions", "Orbit intro", "Chat edits",
155
+ "Phone preview", "Timeline view"], code: "TOOLS", handle: "studio.daily", dm: "sent you the full list",
156
+ lines: [{ text: "Comment \"TOOLS\"", accent: "TOOLS", at: "comment" }, { text: "and I'll send", at: "send" },
157
+ { text: "the full list", accent: "list", act: "dm", at: "list" }, { text: "Don't forget to follow", accent: "follow", act: "follow", at: "follow" }],
158
+ avatar: { asset_id: `ast_${"7".repeat(32)}` }, labels: { comment: "Add a comment…", follow: "Follow", following: "Following" }, loop: true },
159
+ };
160
+ //# sourceMappingURL=comment-cta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-cta.js","sourceRoot":"","sources":["../../src/templates/comment-cta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAW,CAAC;AACrD,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG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odString>;
7
+ cover_line: z.ZodString;
8
+ size: z.ZodOptional<z.ZodEnum<{
9
+ large: "large";
10
+ medium: "medium";
11
+ small: "small";
12
+ }>>;
13
+ }, z.core.$strict>;
14
+ /** A magazine cover over the whole frame, its masthead behind the presenter's head (#1428): the presenter is cut out and stands in front. */
15
+ export declare const coverStory: TemplateKind<typeof data>;
16
+ export {};
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ import { frameCanvasOf } from "../ugc-layers.js";
3
+ import { centredArea, fillingStep, templateSize } from "./size.js";
4
+ const data = z.object({
5
+ masthead: z.string().min(1).max(10).regex(/^\S+$/u, "masthead is one word, without spaces"),
6
+ issue: z.string().min(1).max(28).optional(),
7
+ number: z.string().min(1).max(4).optional(),
8
+ cover_line: z.string().min(1).max(32),
9
+ size: templateSize,
10
+ }).strict();
11
+ /** A magazine cover over the whole frame, its masthead behind the presenter's head (#1428): the presenter is cut out and stands in front. */
12
+ export const coverStory = {
13
+ kind: "cover_story",
14
+ kindVersion: 1,
15
+ description: "a magazine cover filling the frame: the presenter stands in front of a huge masthead word, with an issue line, a big " +
16
+ "number and a cover line around them; it drops in over its first 10 frames; on a plain script run (no inserts, overlays, layout_windows, " +
17
+ "framing, call, interview or shots); free",
18
+ placements: ["full"],
19
+ data,
20
+ text: { masthead: 10, issue: 28, number: 4, cover_line: 32 },
21
+ slots: {},
22
+ cutout: true,
23
+ fillsFrame: true,
24
+ hidesCaptions: () => true,
25
+ onInserts: false,
26
+ // The type's area: the whole frame, a quarter smaller at small; the presenter is drawn over the whole frame at every size.
27
+ rect: (value, aspectRatio) => {
28
+ const canvas = frameCanvasOf(aspectRatio), step = fillingStep(value.size);
29
+ return centredArea(canvas, step * canvas.width, step * canvas.height);
30
+ },
31
+ sample: { masthead: "FOCUS", issue: "ISSUE 17 · NOVEMBER", number: "17", cover_line: "ONE HABIT, NO EDITOR" },
32
+ };
33
+ //# sourceMappingURL=cover-story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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E,IAAI;IAChB,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI;IACzB,SAAS,EAAE,KAAK;IAChB,2HAA2H;IAC3H,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QAC3B,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1E,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,sBAAsB,EAAE;CAC9G,CAAC"}
@@ -27,8 +27,27 @@ export interface TemplateKind<D extends z.ZodObject = z.ZodObject> {
27
27
  firstBeatAtStart?: true;
28
28
  /** It fills the frame at medium, so large draws as medium, and says so (#1128). */
29
29
  fillsFrame?: true;
30
+ /** A full frame the presenter stands in front of, cut out of the take, instead of one that hides them (#1428). */
31
+ cutout?: true;
30
32
  /** Media fields, each `{ asset_id }`, and what each takes; they pin as `<id>.<slot>` (A1). */
31
33
  slots: Readonly<Record<string, TemplateSlot>>;
34
+ /** The most media it pins, where a slot sits in each element of a list; absent is one per slot. */
35
+ maxMedia?: number;
36
+ /** The formats it is drawn in; absent is every format. */
37
+ aspects?: readonly string[];
38
+ /** Its own beat frames from each beat's spoken frame (none for a beat without a quote) and its span, with what they move. */
39
+ timing?(data: z.infer<D>, beats: readonly (number | undefined)[], duration: number, fps: number, id: string): {
40
+ moments: number[];
41
+ warnings: string[];
42
+ };
43
+ /** Refusals its data earns in this run beyond its schema: the script's language, whether it covers the script's last words. */
44
+ check?(data: z.infer<D>, context: {
45
+ language: string;
46
+ endsScript: boolean;
47
+ }): {
48
+ path: (string | number)[];
49
+ message: string;
50
+ }[];
32
51
  /** Whether captions are hidden while it shows: it sits in the caption spot. */
33
52
  hidesCaptions(data: z.infer<D>): boolean;
34
53
  /** Drawn on full-frame insert frames too; other over-presenter kinds step aside there. */
@@ -43,7 +62,10 @@ export interface TemplateKind<D extends z.ZodObject = z.ZodObject> {
43
62
  sample: z.infer<D>;
44
63
  }
45
64
  export declare const TEMPLATE_KINDS: readonly TemplateKind[];
46
- export declare const TEMPLATE_KIND_IDS: readonly ["tag", "lower_third", "end_card", "title_card", "quote", "stat", "callout", "checklist", "phone_call", "compare", "notification", "progress", "rating", "chat_window", "video_grid", "word_title", "phone_screen", "terminal", "pointer_chips", "chart", "race", "hand_title", "word_fill"];
65
+ export declare const TEMPLATE_KIND_IDS: readonly ["tag", "lower_third", "end_card", "title_card", "quote", "stat", "callout", "checklist", "phone_call", "compare", "notification", "progress", "rating", "chat_window", "video_grid", "word_title", "phone_screen", "terminal", "pointer_chips", "chart", "race", "hand_title", "word_fill", "cover_story", "series_frame", "comment_cta", "backdrop"];
66
+ /** The kinds a request may name today: every kind whose switch is on, and a kind that cuts the presenter out only while that is on (#1428).
67
+ * The catalog, the tool's kind list and admission read it. */
68
+ export declare function offeredTemplateKinds(env?: Record<string, string | undefined>, kinds?: readonly TemplateKind[]): readonly TemplateKind[];
47
69
  /** Earlier versions of kinds a frozen timeline may still name, each with its own footprint (A8, #819). The phone's version 2 (#857 S5) and the
48
70
  * five kinds' version 2 (#1119) only add optional fields, and compare's version 3 (#1159) one reveal, so earlier versions keep their geometry. */
49
71
  export declare const TEMPLATE_KIND_HISTORY: readonly TemplateKind[];
@@ -73,6 +95,9 @@ export { CHART_EMS, CHART_TYPES, chartEms } from "./chart.js";
73
95
  export { RACE_EMS, raceEms } from "./race.js";
74
96
  export { HAND_MARKS, HAND_TITLE_EMS } from "./hand-title.js";
75
97
  export { WORD_FILL_EMS } from "./word-fill.js";
98
+ export { BACKDROP_NOTES_STYLES, BACKDROP_PICTURE_STYLES, BACKDROP_STYLES, type BackdropStyle } from "./backdrop.js";
99
+ export { isSeriesFrameEnabled, SERIES_ASPECT, SERIES_FRAME_DISABLED_MESSAGE, SERIES_ITEM_FLOOR_SEC, SERIES_ITEM_LOOKS, SERIES_ITEMS, SERIES_LOOP_FRAMES, SERIES_ONE_COLUMN_MAX, seriesFrameMoments } from "./series-frame.js";
100
+ export { COMMENT_CTA_DISABLED_MESSAGE, commentCtaActLines, commentCtaMoments, commentCtaSchedule, CTA_ASPECT, CTA_FUNNEL, CTA_ITEMS, CTA_LABELS, CTA_LINE_GAP, CTA_LINES, CTA_LOOP_FRAMES, isCommentCtaEnabled } from "./comment-cta.js";
76
101
  export { templateMedia, type TemplateSlot } from "./slot.js";
77
102
  /** Every value at a dotted path of a kind's data, one per element where the path crosses or ends in a list, with its own path; an absent last
78
103
  * field is listed, a path through an absent object or list lists nothing. */
@@ -114,6 +139,9 @@ export declare function templateMoments(kind: TemplateKind, data: unknown, token
114
139
  moments: number[];
115
140
  warnings: string[];
116
141
  };
142
+ /** The most moments and pins one frozen template holds: the largest any kind, current or in a frozen timeline's history, admits (#1425 T6). */
143
+ export declare const MAX_MOMENTS_PER_TEMPLATE: number;
144
+ export declare const MAX_MEDIA_PER_TEMPLATE: number;
117
145
  /** The most pins a run's templates take: each template's slots. */
118
146
  export declare const MAX_TEMPLATE_MEDIA: number;
119
147
  /** Every way a kind draws: each placement with its sample, then each value of each enum field over the sample at its first placement;
@@ -132,6 +160,7 @@ export declare function templateMediaOf(templates: readonly {
132
160
  index: number;
133
161
  id: string;
134
162
  slot: string;
163
+ path?: string;
135
164
  asset_id: string;
136
165
  media_type: "image" | "video";
137
166
  cover?: number | undefined;
@@ -187,6 +216,7 @@ export interface TemplateCheckInput {
187
216
  script?: string | undefined;
188
217
  segments?: unknown;
189
218
  aspect_ratio?: string | undefined;
219
+ image?: unknown;
190
220
  presenter_framing?: PresenterFraming | undefined;
191
221
  actor_id?: string | undefined;
192
222
  inserts?: readonly (AnchoredItem & {
@@ -210,6 +240,10 @@ export interface TemplateCheckInput {
210
240
  caption_position?: LayerCheckInput["caption_position"];
211
241
  caption_place?: LayerCheckInput["caption_place"];
212
242
  presenter_place?: LayerCheckInput["presenter_place"];
243
+ framing?: unknown;
244
+ interview?: unknown;
245
+ presenter_gaze?: unknown;
246
+ end_hold_s?: unknown;
213
247
  }
214
248
  /** Every refusal of `templates`, `template_theme` and `template_sounds` against the run, named by path; empty when they render (D4, D5, D6, D8, D10, A5, A6). */
215
249
  export declare function templateRefusals(input: TemplateCheckInput, kinds?: readonly TemplateKind[]): LayerRefusal[];
@@ -7,6 +7,9 @@ import { callout } from "./callout.js";
7
7
  import { chatWindow, chatWindowV1 } from "./chat-window.js";
8
8
  import { checklist } from "./checklist.js";
9
9
  import { compare, compareV1, compareV2 } from "./compare.js";
10
+ import { backdrop } from "./backdrop.js";
11
+ import { coverStory } from "./cover-story.js";
12
+ import { isPresenterMatteEnabled } from "../presenter-matte.js";
10
13
  import { endCard } from "./end-card.js";
11
14
  import { lowerThird, lowerThirdV1 } from "./lower-third.js";
12
15
  import { notification, notificationV1 } from "./notification.js";
@@ -16,6 +19,8 @@ import { pointerChips } from "./pointer-chips.js";
16
19
  import { chart } from "./chart.js";
17
20
  import { handTitle } from "./hand-title.js";
18
21
  import { race } from "./race.js";
22
+ import { isSeriesFrameEnabled, SERIES_FRAME_DISABLED_MESSAGE, seriesFrame } from "./series-frame.js";
23
+ import { COMMENT_CTA_DISABLED_MESSAGE, commentCta, isCommentCtaEnabled } from "./comment-cta.js";
19
24
  import { progress } from "./progress.js";
20
25
  import { quote } from "./quote.js";
21
26
  import { rating } from "./rating.js";
@@ -32,10 +37,21 @@ export const TEMPLATE_PLACEMENTS = ["over", "full"];
32
37
  export const MAX_TEMPLATES = 40;
33
38
  export { contrastRatio, DEFAULT_TEMPLATE_PRESET, TEMPLATE_MIN_CONTRAST, TEMPLATE_PRESET_SURFACES, TEMPLATE_PRESETS, templateAccentRefusal, templateTheme } from "./theme.js";
34
39
  export const TEMPLATE_KINDS = [tag, lowerThird, endCard, titleCard, quote, stat, callout, checklist, phoneCall, compare,
35
- notification, progress, rating, chatWindow, videoGrid, wordTitle, phoneScreen, terminal, pointerChips, chart, race, handTitle, wordFill];
40
+ notification, progress, rating, chatWindow, videoGrid, wordTitle, phoneScreen, terminal, pointerChips, chart, race, handTitle, wordFill,
41
+ coverStory, seriesFrame, commentCta, backdrop];
36
42
  export const TEMPLATE_KIND_IDS = ["tag", "lower_third", "end_card", "title_card", "quote", "stat", "callout", "checklist", "phone_call", "compare",
37
43
  "notification", "progress", "rating", "chat_window", "video_grid", "word_title", "phone_screen", "terminal", "pointer_chips", "chart", "race",
38
- "hand_title", "word_fill"];
44
+ "hand_title", "word_fill", "cover_story", "series_frame", "comment_cta", "backdrop"];
45
+ /** Kinds behind a switch, each with the reason it is refused while off. */
46
+ const SWITCHED_KINDS = {
47
+ series_frame: { on: isSeriesFrameEnabled, off: SERIES_FRAME_DISABLED_MESSAGE },
48
+ comment_cta: { on: isCommentCtaEnabled, off: COMMENT_CTA_DISABLED_MESSAGE },
49
+ };
50
+ /** The kinds a request may name today: every kind whose switch is on, and a kind that cuts the presenter out only while that is on (#1428).
51
+ * The catalog, the tool's kind list and admission read it. */
52
+ export function offeredTemplateKinds(env, kinds = TEMPLATE_KINDS) {
53
+ return kinds.filter(kind => (SWITCHED_KINDS[kind.kind]?.on(env) ?? true) && (!kind.cutout || isPresenterMatteEnabled(env)));
54
+ }
39
55
  /** Earlier versions of kinds a frozen timeline may still name, each with its own footprint (A8, #819). The phone's version 2 (#857 S5) and the
40
56
  * five kinds' version 2 (#1119) only add optional fields, and compare's version 3 (#1159) one reveal, so earlier versions keep their geometry. */
41
57
  export const TEMPLATE_KIND_HISTORY = [{ ...phoneCall, kindVersion: 1 },
@@ -76,6 +92,9 @@ export { CHART_EMS, CHART_TYPES, chartEms } from "./chart.js";
76
92
  export { RACE_EMS, raceEms } from "./race.js";
77
93
  export { HAND_MARKS, HAND_TITLE_EMS } from "./hand-title.js";
78
94
  export { WORD_FILL_EMS } from "./word-fill.js";
95
+ export { BACKDROP_NOTES_STYLES, BACKDROP_PICTURE_STYLES, BACKDROP_STYLES } from "./backdrop.js";
96
+ export { isSeriesFrameEnabled, SERIES_ASPECT, SERIES_FRAME_DISABLED_MESSAGE, SERIES_ITEM_FLOOR_SEC, SERIES_ITEM_LOOKS, SERIES_ITEMS, SERIES_LOOP_FRAMES, SERIES_ONE_COLUMN_MAX, seriesFrameMoments } from "./series-frame.js";
97
+ export { COMMENT_CTA_DISABLED_MESSAGE, commentCtaActLines, commentCtaMoments, commentCtaSchedule, CTA_ASPECT, CTA_FUNNEL, CTA_ITEMS, CTA_LABELS, CTA_LINE_GAP, CTA_LINES, CTA_LOOP_FRAMES, isCommentCtaEnabled } from "./comment-cta.js";
79
98
  export { templateMedia } from "./slot.js";
80
99
  /** Every value at a dotted path of a kind's data, one per element where the path crosses or ends in a list, with its own path; an absent last
81
100
  * field is listed, a path through an absent object or list lists nothing. */
@@ -146,6 +165,13 @@ export const TEMPLATE_BEAT_GAP = 6;
146
165
  export function templateMoments(kind, data, tokens, range, words, fps, span, id = "template") {
147
166
  const lexical = words.filter(word => !/^\p{P}+$/u.test(word.word)), duration = span.endFrame - span.startFrame;
148
167
  const beats = templateMomentWords(kind, data, tokens, range), from = kind.beatsFrom ?? TEMPLATE_ENTER_FRAMES + 1, warnings = [];
168
+ if (kind.timing) {
169
+ for (const beat of beats)
170
+ if (beat.refusal)
171
+ throw new Error(`template beat ${beat.path.join(".")} ${beat.refusal}`);
172
+ return kind.timing(data, beats.map(beat => (beat.word === undefined ? undefined
173
+ : Math.max(0, Math.round(lexical[beat.word].startSec * fps) - span.startFrame))), duration, fps, id);
174
+ }
149
175
  let before;
150
176
  const moments = beats.map((beat, index) => {
151
177
  if (beat.refusal)
@@ -170,8 +196,35 @@ export function templateMoments(kind, data, tokens, range, words, fps, span, id
170
196
  });
171
197
  return { moments, warnings };
172
198
  }
199
+ /** The most values a dotted path of a kind's data holds: each list it crosses or ends in multiplies by its most elements. */
200
+ function mostValuesAt(schema, keys) {
201
+ const def = schema._zod.def;
202
+ if (def.type === "optional")
203
+ return mostValuesAt(def.innerType, keys);
204
+ if (def.type === "array") {
205
+ const { maxItems } = z.toJSONSchema(schema, { unrepresentable: "any" });
206
+ if (maxItems === undefined)
207
+ throw new Error(`a template list has no most length (${keys.join(".")})`);
208
+ return maxItems * mostValuesAt(def.element, keys);
209
+ }
210
+ if (!keys.length)
211
+ return 1;
212
+ const [key, ...rest] = keys, inner = def.type === "object" ? schema.shape[key] : undefined;
213
+ if (!inner)
214
+ throw new Error(`a template quote names no field ${keys.join(".")}`);
215
+ return mostValuesAt(inner, rest);
216
+ }
217
+ /** The most beats a kind freezes, as `templateMomentWords` lists them: every value of its quotes, or each element of its spread list. */
218
+ function mostBeatsOf(kind) {
219
+ const at = (field) => mostValuesAt(kind.data, field.split("."));
220
+ return Math.max(kind.spreads ? at(kind.spreads) : 0, (kind.quotes ?? []).reduce((sum, field) => sum + at(field), 0));
221
+ }
222
+ const FROZEN_KINDS = [...TEMPLATE_KINDS, ...TEMPLATE_KIND_HISTORY];
223
+ /** The most moments and pins one frozen template holds: the largest any kind, current or in a frozen timeline's history, admits (#1425 T6). */
224
+ export const MAX_MOMENTS_PER_TEMPLATE = Math.max(1, ...FROZEN_KINDS.map(mostBeatsOf));
225
+ export const MAX_MEDIA_PER_TEMPLATE = Math.max(1, ...FROZEN_KINDS.map(kind => kind.maxMedia ?? Object.keys(kind.slots).length));
173
226
  /** The most pins a run's templates take: each template's slots. */
174
- export const MAX_TEMPLATE_MEDIA = MAX_TEMPLATES * Math.max(...TEMPLATE_KINDS.map(kind => Object.keys(kind.slots).length));
227
+ export const MAX_TEMPLATE_MEDIA = MAX_TEMPLATES * MAX_MEDIA_PER_TEMPLATE;
175
228
  /** Every way a kind draws: each placement with its sample, then each value of each enum field over the sample at its first placement;
176
229
  * the composition declares motion phases for each, and the media test checks them. */
177
230
  export function templateVariants(kind) {
@@ -185,10 +238,12 @@ export function templateVariants(kind) {
185
238
  }
186
239
  /** Every media slot the templates fill, in item then slot order: what admission pins and every source walker reads (#778 S3a(ii)). */
187
240
  export function templateMediaOf(templates) {
188
- return (templates ?? []).flatMap((item, index) => Object.entries(TEMPLATE_KINDS.find(kind => kind.kind === item.kind)?.slots ?? {}).flatMap(([slot, takes]) => {
189
- const media = item.data[slot];
190
- return typeof media?.asset_id === "string" ? [{ index, id: item.id, slot, asset_id: media.asset_id, media_type: takes.type, cover: takes.cover }] : [];
191
- }));
241
+ // A slot inside each element of a list (`items.clip`) pins once per element, as `items_0_clip`: a slot name has no dots (A1).
242
+ return (templates ?? []).flatMap((item, index) => Object.entries(TEMPLATE_KINDS.find(kind => kind.kind === item.kind)?.slots ?? {}).flatMap(([slot, takes]) => templateFieldValues(item.data, slot).flatMap(({ path, value }) => {
243
+ const media = value;
244
+ return typeof media?.asset_id === "string" ? [{ index, id: item.id, slot: path.join("_"), ...(path.length > 1 ? { path: path.join(".") } : {}),
245
+ asset_id: media.asset_id, media_type: takes.type, cover: takes.cover }] : [];
246
+ })));
192
247
  }
193
248
  const RANGES = (pairs) => pairs.flatMap((value, index) => (index % 2 ? [] : [[value, pairs[index + 1]]]));
194
249
  /** Latin letters every face draws: ASCII, Latin-1 and Latin Extended-A/B; Vietnamese adds its own block. */
@@ -310,7 +365,7 @@ export function templateDataText(kind) {
310
365
  return Object.entries(kind.data.shape).map(([key, schema]) => catalogField(kind, key, schema)).join(", ");
311
366
  }
312
367
  /** The `templates` description: the gate, the text rules and one catalog line per kind, all from the registry. */
313
- export function templateCatalogText(kinds = TEMPLATE_KINDS) {
368
+ export function templateCatalogText(kinds = offeredTemplateKinds()) {
314
369
  return "Graphic templates, each { id, kind, anchor, cover_words?, placement?, transition?, data }. On any script run. Templates never " +
315
370
  "change the price: every run is billed by its parts as list_prices states them, and a presenter a template covers is still " +
316
371
  "presenter time. Ids are unique across inserts, overlays, layout_windows " +
@@ -321,6 +376,7 @@ export function templateCatalogText(kinds = TEMPLATE_KINDS) {
321
376
  "is spread evenly. A beat spoken before its template has entered moves just after the enter, with a warning. A template that meets the caption band hides captions while it shows; one elsewhere, such as a small one at the top, " +
322
377
  "leaves them. A full-frame template also hides the presenter, overlays " +
323
378
  "and over-presenter templates while it shows, never meets a wipe or zoom insert, and the covered presenter is billed. " +
379
+ kinds.filter(kind => kind.cutout).map(kind => `A ${kind.kind} keeps the presenter in front of it, drawn as a full frame otherwise. `).join("") +
324
380
  `At most ${MAX_OVERLAYS_AT_ONCE} overlays and over-presenter templates show at once, on footprints that do not ` +
325
381
  "overlap. template_theme sets the look of them all. Kinds: " +
326
382
  kinds.map(kind => `${kind.kind} (${kind.placements.join("|")}): ${kind.description}; data ${templateDataText(kind)}`).join(". ") + ".";
@@ -329,6 +385,8 @@ const overlaps = (a, b) => a.startWord < b.coverWord && b.startWord < a.coverWor
329
385
  const meets = (a, b) => a.coverWord === b.startWord || b.coverWord === a.startWord;
330
386
  const coveredBy = (range, cover) => Array.from({ length: range.coverWord - range.startWord }, (_, offset) => range.startWord + offset).every(word => cover.some(other => word >= other.startWord && word < other.coverWord));
331
387
  const MOVING = new Set(["wipe", "zoom"]);
388
+ /** The fields that make a run more than one plain take: a kind that cuts the presenter out of the take draws on a plain take only (#1428). */
389
+ const MORE_THAN_A_TAKE = ["inserts", "overlays", "layout_windows", "framing", "call", "interview", "presenter_gaze", "end_hold_s", "shots"];
332
390
  /** Every refusal of `templates`, `template_theme` and `template_sounds` against the run, named by path; empty when they render (D4, D5, D6, D8, D10, A5, A6). */
333
391
  export function templateRefusals(input, kinds = TEMPLATE_KINDS) {
334
392
  if (input.templates === undefined) {
@@ -386,9 +444,19 @@ export function templateRefusals(input, kinds = TEMPLATE_KINDS) {
386
444
  used.set(item.id, "templates");
387
445
  const kind = kinds.find(entry => entry.kind === item.kind);
388
446
  if (!kind) {
389
- refusals.push({ path: at("kind"), message: `unknown template kind "${item.kind}": use one of ${kinds.map(entry => entry.kind).join(", ")}` });
447
+ refusals.push({ path: at("kind"), message: `unknown template kind "${item.kind}": use one of ${offeredTemplateKinds(undefined, kinds).map(entry => entry.kind).join(", ")}` });
390
448
  continue;
391
449
  }
450
+ const switched = SWITCHED_KINDS[kind.kind];
451
+ if (switched && !switched.on()) {
452
+ refusals.push({ path: at("kind"), message: switched.off });
453
+ continue;
454
+ }
455
+ // A kind drawn in one format is refused in any other before money, never moved to it (rule 4); with an image the format follows the image.
456
+ if (kind.aspects && (input.aspect_ratio === undefined ? input.image !== undefined : !kind.aspects.includes(input.aspect_ratio))) {
457
+ refusals.push({ path: input.aspect_ratio === undefined ? at("kind") : ["aspect_ratio"], message: `${kind.kind} is drawn in ${kind.aspects.join(" or ")} only: ` +
458
+ `pass aspect_ratio ${kind.aspects[0]}${input.aspect_ratio === undefined ? " with image" : ""}, or use another template kind` });
459
+ }
392
460
  const parsed = kind.data.safeParse(item.data);
393
461
  if (!parsed.success) {
394
462
  for (const issue of parsed.error.issues)
@@ -396,6 +464,9 @@ export function templateRefusals(input, kinds = TEMPLATE_KINDS) {
396
464
  continue;
397
465
  }
398
466
  const placement = item.placement ?? kind.placements[0];
467
+ const beyond = kind.cutout ? MORE_THAN_A_TAKE.filter(field => input[field] !== undefined) : [];
468
+ if (beyond.length)
469
+ refusals.push({ path: at("kind"), message: `${item.kind} takes a plain script run, without ${beyond.join(", ")}` });
399
470
  if (!kind.placements.includes(placement))
400
471
  refusals.push({ path: at("placement"), message: `${item.kind} takes placement ${kind.placements.join(" or ")}, not ${placement}` });
401
472
  if (item.transition !== undefined && placement !== "full")
@@ -411,6 +482,9 @@ export function templateRefusals(input, kinds = TEMPLATE_KINDS) {
411
482
  refusals.push({ path: at("anchor"), message: `template "${item.id}": ${range}` });
412
483
  continue;
413
484
  }
485
+ for (const why of kind.check?.(parsed.data, { language, endsScript: range.coverWord >= tokens.length }) ?? []) {
486
+ refusals.push({ path: at("data", ...why.path), message: why.message });
487
+ }
414
488
  const beats = templateMomentWords(kind, parsed.data, tokens, range);
415
489
  for (const beat of beats)
416
490
  if (beat.refusal)