@clipwright/core 0.73.0 → 0.74.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/dist/account-actors.d.ts +0 -3
- package/dist/account-actors.js +0 -7
- package/dist/contract-dispositions.d.ts +5 -19
- package/dist/contract-dispositions.js +14 -72
- package/dist/faceless-price.d.ts +0 -5
- package/dist/faceless-price.js +0 -5
- package/dist/faceless-public.d.ts +0 -2
- package/dist/faceless-public.js +0 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/music.d.ts +0 -2
- package/dist/music.js +0 -4
- package/dist/own-agent-price.d.ts +0 -3
- package/dist/own-agent-price.js +0 -3
- package/dist/presenter-engine.d.ts +0 -1
- package/dist/presenter-engine.js +0 -3
- package/dist/presenter-matte.d.ts +0 -2
- package/dist/presenter-matte.js +0 -4
- package/dist/prices.d.ts +5 -5
- package/dist/prices.js +25 -27
- package/dist/scene-bible.d.ts +0 -1
- package/dist/scene-bible.js +0 -7
- package/dist/service-offer.d.ts +11 -0
- package/dist/service-offer.js +6 -0
- package/dist/skills.js +3 -6
- package/dist/templates/comment-cta.d.ts +0 -2
- package/dist/templates/comment-cta.js +0 -4
- package/dist/templates/index.d.ts +3 -3
- package/dist/templates/index.js +7 -17
- package/dist/templates/series-frame.d.ts +0 -2
- package/dist/templates/series-frame.js +0 -4
- package/package.json +1 -1
package/dist/account-actors.d.ts
CHANGED
|
@@ -416,7 +416,6 @@ export type CreateActorDisposition = {
|
|
|
416
416
|
kind: "rejected";
|
|
417
417
|
message: string;
|
|
418
418
|
};
|
|
419
|
-
type CreateActorField = keyof typeof createActorInput.shape;
|
|
420
419
|
export declare const CREATE_ACTOR_FIELD_DISPOSITIONS: {
|
|
421
420
|
readonly description: {
|
|
422
421
|
readonly kind: "implemented";
|
|
@@ -471,8 +470,6 @@ export declare const CREATE_ACTOR_FIELD_DISPOSITIONS: {
|
|
|
471
470
|
readonly provenBy: "admission";
|
|
472
471
|
};
|
|
473
472
|
};
|
|
474
|
-
export declare const ACTOR_VIEWS_DISABLED_MESSAGE = "is not available right now: deriving an actor from an actor is off; create an actor from a description instead";
|
|
475
|
-
export declare function createActorDispositions(viewsEnabled: boolean): Record<CreateActorField, CreateActorDisposition>;
|
|
476
473
|
export declare function createActorRejectedFields(input: Readonly<Record<string, unknown>>, dispositions: Readonly<Record<string, CreateActorDisposition>>): {
|
|
477
474
|
field: string;
|
|
478
475
|
message: string;
|
package/dist/account-actors.js
CHANGED
|
@@ -359,13 +359,6 @@ export const CREATE_ACTOR_FIELD_DISPOSITIONS = {
|
|
|
359
359
|
portrait: { kind: "implemented", provenBy: "egress" },
|
|
360
360
|
max_credits: { kind: "implemented", provenBy: "admission" },
|
|
361
361
|
};
|
|
362
|
-
export const ACTOR_VIEWS_DISABLED_MESSAGE = "is not available right now: deriving an actor from an actor is off; create an actor from a description instead";
|
|
363
|
-
export function createActorDispositions(viewsEnabled) {
|
|
364
|
-
if (viewsEnabled)
|
|
365
|
-
return CREATE_ACTOR_FIELD_DISPOSITIONS;
|
|
366
|
-
const rejected = (field) => ({ kind: "rejected", message: `${field} ${ACTOR_VIEWS_DISABLED_MESSAGE}` });
|
|
367
|
-
return { ...CREATE_ACTOR_FIELD_DISPOSITIONS, ...Object.fromEntries(ACTOR_VIEW_FIELDS.map((field) => [field, rejected(field)])) };
|
|
368
|
-
}
|
|
369
362
|
export function createActorRejectedFields(input, dispositions) {
|
|
370
363
|
return Object.entries(dispositions).flatMap(([field, disposition]) => disposition.kind === "rejected" && input[field] !== undefined ? [{ field, message: disposition.message }] : []);
|
|
371
364
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { makeUgcInputShape } from "./skills.js";
|
|
3
|
+
import { type ServiceOffer } from "./service-offer.js";
|
|
3
4
|
export declare const CONTRACT_VERSION = "2026-10-18";
|
|
4
5
|
export declare const CONTRACT_VERSION_HEADER = "X-Clipwright-Contract";
|
|
5
6
|
export declare const BROLL_UNUSED_WARNING = "broll_policy has no effect on this video: it shows none of your media";
|
|
@@ -249,31 +250,16 @@ export declare const FACELESS_REJECTED_FIELDS: {
|
|
|
249
250
|
};
|
|
250
251
|
export type ContractField = keyof typeof FIELD_DISPOSITIONS;
|
|
251
252
|
export interface ContractFlags {
|
|
252
|
-
|
|
253
|
-
compose: boolean;
|
|
254
|
-
actorGeneration?: boolean;
|
|
255
|
-
longForm?: boolean;
|
|
253
|
+
longForm: boolean;
|
|
256
254
|
outputMarking?: boolean;
|
|
257
|
-
music?: boolean;
|
|
258
|
-
liveShots?: boolean;
|
|
259
|
-
scenes?: boolean;
|
|
260
|
-
motionStyles?: boolean;
|
|
261
255
|
}
|
|
262
|
-
export declare function isMotionStylesEnabled(env?: Record<string, string | undefined>): boolean;
|
|
263
|
-
export declare const MOTION_STYLES_DISABLED_MESSAGE = "motion_style is not available right now; omit motion_style";
|
|
264
|
-
export declare function isScenesEnabled(env?: Record<string, string | undefined>): boolean;
|
|
265
|
-
export declare function isLiveShotsEnabled(env?: Record<string, string | undefined>): boolean;
|
|
266
256
|
export declare const LIVE_SHOTS_DISABLED_MESSAGE = "shots are not available right now; omit shots and product_asset_id";
|
|
267
|
-
export declare function
|
|
268
|
-
export declare function isActorViewsEnabled(env?: Record<string, string | undefined>): boolean;
|
|
269
|
-
export declare function contractFlagsFromEnv(env?: Record<string, string | undefined>): ContractFlags;
|
|
270
|
-
export declare function isLongFormQualificationEnabled(env?: Record<string, string | undefined>): boolean;
|
|
257
|
+
export declare function contractFlagsFor(offer: ServiceOffer): ContractFlags;
|
|
271
258
|
export declare const LONG_FORM_DISABLED_MESSAGE = "long-form qualification is not available right now; pass script without segments or inserts";
|
|
272
259
|
export declare function legacyCaptionWarnings(input: {
|
|
273
260
|
captions?: boolean | undefined;
|
|
274
261
|
caption_style?: string | undefined;
|
|
275
262
|
}): string[];
|
|
276
|
-
export declare const CAPTIONS_COMPOSE_DISABLED_WARNING = "captions were not drawn: composition is not available right now";
|
|
277
263
|
export declare function compositionLayerFields(input: {
|
|
278
264
|
overlays?: unknown;
|
|
279
265
|
layout_windows?: unknown;
|
|
@@ -292,7 +278,7 @@ export declare function compositionLayerFields(input: {
|
|
|
292
278
|
}): string[];
|
|
293
279
|
export declare function compositionLayersNotDrawnWarnings(input: Parameters<typeof compositionLayerFields>[0], reason: string): string[];
|
|
294
280
|
export declare function resolveDispositions(flags: ContractFlags): Record<ContractField, Disposition>;
|
|
295
|
-
export declare const
|
|
281
|
+
export declare const dispositionsFor: (offer: ServiceOffer) => Record<ContractField, Disposition>;
|
|
296
282
|
type RejectedField = {
|
|
297
283
|
[K in ContractField]: (typeof FIELD_DISPOSITIONS)[K]["kind"] extends "rejected" ? K : never;
|
|
298
284
|
}[ContractField];
|
|
@@ -5009,7 +4995,7 @@ export interface RejectedFieldHit {
|
|
|
5009
4995
|
field: ContractField;
|
|
5010
4996
|
message: string;
|
|
5011
4997
|
}
|
|
5012
|
-
export declare function rejectedFields(input: Readonly<Record<string, unknown>>,
|
|
4998
|
+
export declare function rejectedFields(input: Readonly<Record<string, unknown>>, offer?: ServiceOffer): RejectedFieldHit[];
|
|
5013
4999
|
export interface UnknownFieldHit {
|
|
5014
5000
|
field: string;
|
|
5015
5001
|
suggestion?: string | undefined;
|
|
@@ -8,11 +8,10 @@ import { MAX_OVERLAYS, placeWarnings } from "./ugc-layers.js";
|
|
|
8
8
|
import { callWarnings } from "./ugc-call.js";
|
|
9
9
|
import { BROLL_POLICY_DESCRIPTION } from "./broll-policy.js";
|
|
10
10
|
import { mcpDesign } from "./design.js";
|
|
11
|
-
import { isMusicEnabled, MUSIC_DISABLED_MESSAGE } from "./music.js";
|
|
12
11
|
import { MAX_SCENES, SCENES_DISABLED_MESSAGE } from "./ugc-scenes.js";
|
|
13
12
|
import { MOTION_STYLE_UNUSED_WARNING, motionStyleAsked, motionStyleHasCanvas } from "./motion-styles.js";
|
|
14
13
|
import { AD_PAUSE_TRIM_WARNING } from "./ad-pause-trim.js";
|
|
15
|
-
import {
|
|
14
|
+
import { BASE_OFFER } from "./service-offer.js";
|
|
16
15
|
export const CONTRACT_VERSION = "2026-10-18";
|
|
17
16
|
export const CONTRACT_VERSION_HEADER = "X-Clipwright-Contract";
|
|
18
17
|
export const BROLL_UNUSED_WARNING = "broll_policy has no effect on this video: it shows none of your media";
|
|
@@ -111,53 +110,16 @@ export const FACELESS_REJECTED_FIELDS = {
|
|
|
111
110
|
},
|
|
112
111
|
};
|
|
113
112
|
const CONTRACT_FIELDS = Object.keys(makeUgcInputShape);
|
|
114
|
-
export function isMotionStylesEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
115
|
-
return env.CLIPWRIGHT_MOTION_STYLES === "1" && env.CLIPWRIGHT_COMPOSE === "1";
|
|
116
|
-
}
|
|
117
|
-
export const MOTION_STYLES_DISABLED_MESSAGE = "motion_style is not available right now; omit motion_style";
|
|
118
|
-
export function isScenesEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
119
|
-
return env.CLIPWRIGHT_SCENES === "1" && isLongFormQualificationEnabled(env);
|
|
120
|
-
}
|
|
121
|
-
export function isLiveShotsEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
122
|
-
return env.CLIPWRIGHT_LIVE_SHOTS === "1" && isLongFormQualificationEnabled(env);
|
|
123
|
-
}
|
|
124
113
|
export const LIVE_SHOTS_DISABLED_MESSAGE = "shots are not available right now; omit shots and product_asset_id";
|
|
125
|
-
export function isActorGenerationEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
126
|
-
return env.CLIPWRIGHT_ACTOR_GENERATION === "1" && env.CLIPWRIGHT_REMOTE_FETCH === "1";
|
|
127
|
-
}
|
|
128
|
-
export function isActorViewsEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
129
|
-
return env.CLIPWRIGHT_ACTOR_VIEWS === "1" && isActorGenerationEnabled(env);
|
|
130
|
-
}
|
|
131
114
|
const PERSON_WITH_ACTOR_GENERATION = {
|
|
132
115
|
kind: "warned",
|
|
133
116
|
warning: "person is not honored: this request uses the default actor; create a personal actor from the description with create_actor, then pass its actor_id",
|
|
134
117
|
triggersWhen: "present",
|
|
135
118
|
};
|
|
136
|
-
export function
|
|
137
|
-
return {
|
|
138
|
-
remoteFetch: env.CLIPWRIGHT_REMOTE_FETCH === "1",
|
|
139
|
-
compose: env.CLIPWRIGHT_COMPOSE === "1",
|
|
140
|
-
longForm: isLongFormQualificationEnabled(env),
|
|
141
|
-
...(env.CLIPWRIGHT_OUTPUT_MARKING === "1" ? { outputMarking: true } : {}),
|
|
142
|
-
...(isMusicEnabled(env) ? { music: true } : {}),
|
|
143
|
-
...(isLiveShotsEnabled(env) ? { liveShots: true } : {}),
|
|
144
|
-
...(isScenesEnabled(env) ? { scenes: true } : {}),
|
|
145
|
-
...(isMotionStylesEnabled(env) ? { motionStyles: true } : {}),
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
export function isLongFormQualificationEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
149
|
-
return env.CLIPWRIGHT_LONG_FORM_QUALIFICATION === "1" &&
|
|
150
|
-
env.CLIPWRIGHT_COMPOSE === "1" && env.CLIPWRIGHT_REMOTE_FETCH === "1";
|
|
119
|
+
export function contractFlagsFor(offer) {
|
|
120
|
+
return { longForm: offer.longForm, ...(offer.outputMarking ? { outputMarking: true } : {}) };
|
|
151
121
|
}
|
|
152
122
|
export const LONG_FORM_DISABLED_MESSAGE = "long-form qualification is not available right now; pass script without segments or inserts";
|
|
153
|
-
const REMOTE_FETCH_DISABLED = {
|
|
154
|
-
kind: "rejected",
|
|
155
|
-
message: "image is temporarily disabled (remote media fetch is off); omit it to render with the default actor",
|
|
156
|
-
};
|
|
157
|
-
const COMPOSE_DISABLED = {
|
|
158
|
-
kind: "rejected",
|
|
159
|
-
message: "background is not available right now. Request an aspect_ratio close to your image instead",
|
|
160
|
-
};
|
|
161
123
|
export function legacyCaptionWarnings(input) {
|
|
162
124
|
return [
|
|
163
125
|
...(input.captions === true ? ["captions requested but not rendered in this prototype (stage-B)"] : []),
|
|
@@ -165,7 +127,6 @@ export function legacyCaptionWarnings(input) {
|
|
|
165
127
|
? ["caption_style is not honored: captions are not rendered in this prototype (stage-B)"] : []),
|
|
166
128
|
];
|
|
167
129
|
}
|
|
168
|
-
export const CAPTIONS_COMPOSE_DISABLED_WARNING = "captions were not drawn: composition is not available right now";
|
|
169
130
|
export function compositionLayerFields(input) {
|
|
170
131
|
return [
|
|
171
132
|
...(input.overlays !== undefined ? ["overlays"] : []),
|
|
@@ -184,14 +145,11 @@ export function compositionLayersNotDrawnWarnings(input, reason) {
|
|
|
184
145
|
const fields = compositionLayerFields(input);
|
|
185
146
|
return fields.length ? [`${fields.join(", ")} ${fields.length === 1 ? "was" : "were"} not drawn: ${reason}`] : [];
|
|
186
147
|
}
|
|
187
|
-
function longFormReady(flags) {
|
|
188
|
-
return flags.longForm === true && flags.remoteFetch && flags.compose;
|
|
189
|
-
}
|
|
190
148
|
const LONG_FORM_DISABLED = { kind: "rejected", message: LONG_FORM_DISABLED_MESSAGE };
|
|
191
149
|
const TEMPLATES_DISABLED = { kind: "rejected",
|
|
192
150
|
message: "templates are not available right now; omit templates, template_theme and template_sounds" };
|
|
193
151
|
export function resolveDispositions(flags) {
|
|
194
|
-
const longForm =
|
|
152
|
+
const longForm = flags.longForm;
|
|
195
153
|
return {
|
|
196
154
|
...FIELD_DISPOSITIONS,
|
|
197
155
|
segments: longForm ? FIELD_DISPOSITIONS.segments : LONG_FORM_DISABLED,
|
|
@@ -202,36 +160,22 @@ export function resolveDispositions(flags) {
|
|
|
202
160
|
templates: longForm ? FIELD_DISPOSITIONS.templates : TEMPLATES_DISABLED,
|
|
203
161
|
template_theme: longForm ? FIELD_DISPOSITIONS.template_theme : TEMPLATES_DISABLED,
|
|
204
162
|
template_sounds: longForm ? FIELD_DISPOSITIONS.template_sounds : TEMPLATES_DISABLED,
|
|
205
|
-
scenes: longForm
|
|
206
|
-
motion_style: flags.compose && flags.motionStyles === true ? FIELD_DISPOSITIONS.motion_style
|
|
207
|
-
: { kind: "rejected", message: MOTION_STYLES_DISABLED_MESSAGE },
|
|
163
|
+
scenes: longForm ? FIELD_DISPOSITIONS.scenes : { kind: "rejected", message: SCENES_DISABLED_MESSAGE },
|
|
208
164
|
edit_sounds: longForm ? FIELD_DISPOSITIONS.edit_sounds : LONG_FORM_DISABLED,
|
|
209
165
|
call: longForm ? FIELD_DISPOSITIONS.call : LONG_FORM_DISABLED,
|
|
210
166
|
interview: longForm ? FIELD_DISPOSITIONS.interview : LONG_FORM_DISABLED,
|
|
211
167
|
presenter_gaze: longForm ? FIELD_DISPOSITIONS.presenter_gaze : LONG_FORM_DISABLED,
|
|
212
168
|
end_hold_s: longForm ? FIELD_DISPOSITIONS.end_hold_s : LONG_FORM_DISABLED,
|
|
213
|
-
shots: longForm
|
|
214
|
-
product_asset_id: longForm
|
|
215
|
-
|
|
216
|
-
person: flags.actorGeneration === true ? PERSON_WITH_ACTOR_GENERATION : FIELD_DISPOSITIONS.person,
|
|
217
|
-
image: flags.remoteFetch ? FIELD_DISPOSITIONS.image : REMOTE_FETCH_DISABLED,
|
|
218
|
-
actor_id: flags.remoteFetch ? FIELD_DISPOSITIONS.actor_id : {
|
|
219
|
-
kind: "rejected", message: "actor_id is temporarily disabled (remote media fetch is off); omit it to use the default actor",
|
|
220
|
-
},
|
|
221
|
-
actor_gender: flags.remoteFetch ? FIELD_DISPOSITIONS.actor_gender : {
|
|
222
|
-
kind: "rejected", message: "actor_gender is temporarily disabled together with image and actor_id (remote media fetch is off); omit it to use the default actor",
|
|
223
|
-
},
|
|
224
|
-
background: flags.compose ? FIELD_DISPOSITIONS.background : COMPOSE_DISABLED,
|
|
169
|
+
shots: longForm ? FIELD_DISPOSITIONS.shots : { kind: "rejected", message: LIVE_SHOTS_DISABLED_MESSAGE },
|
|
170
|
+
product_asset_id: longForm ? FIELD_DISPOSITIONS.product_asset_id : { kind: "rejected", message: LIVE_SHOTS_DISABLED_MESSAGE },
|
|
171
|
+
person: PERSON_WITH_ACTOR_GENERATION,
|
|
225
172
|
visible_ai_label: flags.outputMarking === true ? FIELD_DISPOSITIONS.visible_ai_label : {
|
|
226
173
|
kind: "rejected", message: "visible_ai_label is not available right now; omit it",
|
|
227
174
|
},
|
|
228
|
-
music: flags.music === true ? FIELD_DISPOSITIONS.music : { kind: "rejected", message: MUSIC_DISABLED_MESSAGE },
|
|
229
175
|
};
|
|
230
176
|
}
|
|
231
|
-
export const
|
|
232
|
-
|
|
233
|
-
actorGeneration: isActorGenerationEnabled(),
|
|
234
|
-
});
|
|
177
|
+
export const dispositionsFor = (offer) => resolveDispositions(contractFlagsFor(offer));
|
|
178
|
+
const WARNING_DISPOSITIONS = dispositionsFor(BASE_OFFER);
|
|
235
179
|
const FIELD_DEFAULTS = Object.fromEntries(CONTRACT_FIELDS.map((field) => {
|
|
236
180
|
const parsed = makeUgcInputShape[field].safeParse(undefined);
|
|
237
181
|
return [field, parsed.success ? parsed.data : undefined];
|
|
@@ -275,19 +219,17 @@ export const mcpUgcInputShape = { ...offeredUgcInputShape, ...compactlyDescribed
|
|
|
275
219
|
interview: mcpUgcInterview.optional(), presenter_gaze: mcpPresenterGaze.optional(), shots: mcpLiveShots.optional(),
|
|
276
220
|
design: mcpDesign.optional().describe("Look of templates, end card, caption highlight; absent: brand kit; not with template_theme. " +
|
|
277
221
|
"look, fonts: from brand_kit; palette #RRGGBB.") };
|
|
278
|
-
export function rejectedFields(input,
|
|
222
|
+
export function rejectedFields(input, offer = BASE_OFFER) {
|
|
223
|
+
const dispositions = dispositionsFor(offer);
|
|
279
224
|
const hits = [];
|
|
280
225
|
for (const field of CONTRACT_FIELDS) {
|
|
281
|
-
const disposition =
|
|
226
|
+
const disposition = dispositions[field];
|
|
282
227
|
if (disposition.kind !== "rejected")
|
|
283
228
|
continue;
|
|
284
229
|
if (input[field] === undefined)
|
|
285
230
|
continue;
|
|
286
231
|
hits.push({ field, message: disposition.message });
|
|
287
232
|
}
|
|
288
|
-
if (!hits.some(hit => hit.field === "templates") && needsPresenterCutout(input.templates) && !isPresenterMatteEnabled(env)) {
|
|
289
|
-
hits.push({ field: "templates", message: PRESENTER_MATTE_DISABLED_MESSAGE });
|
|
290
|
-
}
|
|
291
233
|
return hits;
|
|
292
234
|
}
|
|
293
235
|
const normalizedFieldName = (name) => name.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
@@ -306,7 +248,7 @@ export function unknownFields(raw, fields = CONTRACT_FIELDS) {
|
|
|
306
248
|
export function dispositionWarnings(input) {
|
|
307
249
|
const warnings = [];
|
|
308
250
|
for (const field of CONTRACT_FIELDS) {
|
|
309
|
-
const disposition =
|
|
251
|
+
const disposition = WARNING_DISPOSITIONS[field];
|
|
310
252
|
if (disposition.kind === "stored" && input[field] !== undefined && !carriesCustomerMedia(input)) {
|
|
311
253
|
warnings.push(disposition.warning);
|
|
312
254
|
}
|
package/dist/faceless-price.d.ts
CHANGED
|
@@ -86,14 +86,11 @@ export declare const FACELESS_SHOT_CREDITS_PER_SECOND = 30;
|
|
|
86
86
|
export declare const FACELESS_MAX_SHOTS = 10;
|
|
87
87
|
export declare const FACELESS_SHOT_MAX_SEC = 5;
|
|
88
88
|
export declare const FACELESS_MAX_CAP_USD_MICROS = 10000000;
|
|
89
|
-
export declare const facelessScenesEnabled: (env: Record<string, string | undefined>) => boolean;
|
|
90
89
|
export declare const facelessShotSecondsCeiling: (shots: number) => number;
|
|
91
90
|
export declare function facelessPartsBase(images: number, outputFrames: number): number;
|
|
92
|
-
export declare const facelessExplainerEnabled: (env: Record<string, string | undefined>) => boolean;
|
|
93
91
|
export declare const FACELESS_EXPLAINER_POSE_PICTURES = 9;
|
|
94
92
|
export declare const EXPLAINER_BEAT_CREDITS = 65;
|
|
95
93
|
export declare const EXPLAINER_MAX_AUTHORED_BEATS = 8;
|
|
96
|
-
export declare const explainerBeatsEnabled: (env: Record<string, string | undefined>) => boolean;
|
|
97
94
|
export declare const EXPLAINER_MAX_OBJECT_PICTURES = 12;
|
|
98
95
|
export declare const explainerObjectCeiling: (script: string) => number;
|
|
99
96
|
export declare const EXPLAINER_FILM_CREDITS = 500;
|
|
@@ -128,8 +125,6 @@ export declare const EXPLAINER_TIER_TARIFFS: {
|
|
|
128
125
|
readonly pro: "skill-agent-opus-v1";
|
|
129
126
|
};
|
|
130
127
|
export declare const explainerTierTariff: (tier: ExplainerTier | undefined) => SkillFilmTariff;
|
|
131
|
-
export declare const skillAgentEnabled: (env: Record<string, string | undefined>) => boolean;
|
|
132
|
-
export declare const explainerFilmOffered: (env: Record<string, string | undefined>) => boolean;
|
|
133
128
|
export declare const facelessImageCeilings: (selectedFrames: number) => number[];
|
|
134
129
|
export declare function quoteFaceless(input: {
|
|
135
130
|
outputFrames: number;
|
package/dist/faceless-price.js
CHANGED
|
@@ -57,16 +57,13 @@ export const FACELESS_SHOT_CREDITS_PER_SECOND = 30;
|
|
|
57
57
|
export const FACELESS_MAX_SHOTS = 10;
|
|
58
58
|
export const FACELESS_SHOT_MAX_SEC = 5;
|
|
59
59
|
export const FACELESS_MAX_CAP_USD_MICROS = 10_000_000;
|
|
60
|
-
export const facelessScenesEnabled = (env) => env.CLIPWRIGHT_FACELESS_SCENES === "1";
|
|
61
60
|
export const facelessShotSecondsCeiling = (shots) => shots * FACELESS_SHOT_MAX_SEC;
|
|
62
61
|
export function facelessPartsBase(images, outputFrames) {
|
|
63
62
|
return images * FACELESS_IMAGE_CREDITS + Math.ceil(FACELESS_CREDITS_PER_1500_FRAMES * outputFrames / 1500);
|
|
64
63
|
}
|
|
65
|
-
export const facelessExplainerEnabled = (env) => env.CLIPWRIGHT_FACELESS_EXPLAINER === "1";
|
|
66
64
|
export const FACELESS_EXPLAINER_POSE_PICTURES = 9;
|
|
67
65
|
export const EXPLAINER_BEAT_CREDITS = 65;
|
|
68
66
|
export const EXPLAINER_MAX_AUTHORED_BEATS = 8;
|
|
69
|
-
export const explainerBeatsEnabled = (env) => env.CLIPWRIGHT_EXPLAINER_BEATS === "1";
|
|
70
67
|
export const EXPLAINER_MAX_OBJECT_PICTURES = 12;
|
|
71
68
|
export const explainerObjectCeiling = (script) => Math.min(EXPLAINER_MAX_OBJECT_PICTURES, namedThings(script));
|
|
72
69
|
export const EXPLAINER_FILM_CREDITS = 500;
|
|
@@ -85,8 +82,6 @@ export const explainerFilmCredits = (outputFrames) => skillFilmCredits("skill-ex
|
|
|
85
82
|
export const EXPLAINER_TIERS = ["standard", "pro"];
|
|
86
83
|
export const EXPLAINER_TIER_TARIFFS = { standard: "skill-agent-sonnet-v2", pro: "skill-agent-opus-v1" };
|
|
87
84
|
export const explainerTierTariff = (tier) => EXPLAINER_TIER_TARIFFS[tier ?? "standard"];
|
|
88
|
-
export const skillAgentEnabled = (env) => env.CLIPWRIGHT_SKILL_AGENT === "1";
|
|
89
|
-
export const explainerFilmOffered = (env) => facelessExplainerEnabled(env) && skillAgentEnabled(env);
|
|
90
85
|
export const facelessImageCeilings = (selectedFrames) => [facelessMaxGeneratedImages(selectedFrames, FACELESS_PUBLIC_MAX_GENERATED_IMAGES), FACELESS_EXPLAINER_POSE_PICTURES, 0];
|
|
91
86
|
export function quoteFaceless(input) {
|
|
92
87
|
const outputFrames = z.number().int().min(FACELESS_MIN_OUTPUT_FRAMES).max(2250).parse(input.outputFrames);
|
|
@@ -109,8 +109,6 @@ export declare const facelessActionShot: z.ZodObject<{
|
|
|
109
109
|
}, z.core.$strict>;
|
|
110
110
|
export type FacelessActionShot = z.infer<typeof facelessActionShot>;
|
|
111
111
|
export declare const FACELESS_SHOTS_BRIEF_REFUSAL = "shots need input_mode script: they sit on the narration's words";
|
|
112
|
-
export declare const FACELESS_SHOTS_DISABLED_MESSAGE = "shots are not available on make_faceless right now; omit shots";
|
|
113
|
-
export declare const FACELESS_SCENES_DISABLED_MESSAGE = "scenes are not available on make_faceless right now; omit scenes";
|
|
114
112
|
export declare const makeFacelessInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
115
113
|
duration_seconds: z.ZodNumber;
|
|
116
114
|
style_reference: z.ZodOptional<z.ZodString>;
|
package/dist/faceless-public.js
CHANGED
|
@@ -8,7 +8,6 @@ import { MOTION_STYLE_UNUSED_WARNING, motionStyleAsked, motionStyleHasCanvas, mo
|
|
|
8
8
|
import { MAX_SCENES, sceneRefusals } from "./ugc-scenes.js";
|
|
9
9
|
import { MAX_MOVES, moveRefusals, MOVES_DESCRIPTION, ugcMove } from "./moves.js";
|
|
10
10
|
import { MAX_TEMPLATE_MEDIA, MAX_TEMPLATES, templateRefusals } from "./templates/index.js";
|
|
11
|
-
import { isPresenterMatteEnabled, needsPresenterCutout, PRESENTER_MATTE_DISABLED_MESSAGE } from "./presenter-matte.js";
|
|
12
11
|
import { assetId } from "./asset-identity.js";
|
|
13
12
|
import { FACELESS_REJECTED_FIELDS } from "./contract-dispositions.js";
|
|
14
13
|
import { FACELESS_MAX_OUTPUT_FRAMES, FACELESS_MAX_SELECTED_SECONDS, FACELESS_MAX_SHOTS, FACELESS_MIN_OUTPUT_FRAMES, FACELESS_MIN_SELECTED_SECONDS, EXPLAINER_TIER_TARIFFS, EXPLAINER_TIERS, explainerObjectCeiling, facelessQuote, quoteFaceless } from "./faceless-price.js";
|
|
@@ -160,12 +159,6 @@ function refuseTemplates(input, context) {
|
|
|
160
159
|
for (const { path, message } of templateRefusals({ script: input.script, templates: input.templates, aspect_ratio: "9:16" })) {
|
|
161
160
|
context.addIssue({ code: customIssue, path, message });
|
|
162
161
|
}
|
|
163
|
-
if (isPresenterMatteEnabled())
|
|
164
|
-
return;
|
|
165
|
-
input.templates.forEach((item, index) => {
|
|
166
|
-
if (needsPresenterCutout([item]))
|
|
167
|
-
context.addIssue({ code: customIssue, path: ["templates", index, "kind"], message: PRESENTER_MATTE_DISABLED_MESSAGE });
|
|
168
|
-
});
|
|
169
162
|
}
|
|
170
163
|
export const facelessActionShot = z.strictObject({
|
|
171
164
|
id: z.string().trim().min(1).max(64),
|
|
@@ -175,8 +168,6 @@ export const facelessActionShot = z.strictObject({
|
|
|
175
168
|
asset_id: assetId.optional(),
|
|
176
169
|
});
|
|
177
170
|
export const FACELESS_SHOTS_BRIEF_REFUSAL = "shots need input_mode script: they sit on the narration's words";
|
|
178
|
-
export const FACELESS_SHOTS_DISABLED_MESSAGE = "shots are not available on make_faceless right now; omit shots";
|
|
179
|
-
export const FACELESS_SCENES_DISABLED_MESSAGE = "scenes are not available on make_faceless right now; omit scenes";
|
|
180
171
|
const scriptShape = { ...common,
|
|
181
172
|
input_mode: z.literal("script"),
|
|
182
173
|
script: z.string().trim().min(1).max(10_000),
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/music.d.ts
CHANGED
|
@@ -10,6 +10,4 @@ export declare const musicRequest: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.
|
|
|
10
10
|
}, z.core.$strict>]>;
|
|
11
11
|
export type MusicRequest = z.infer<typeof musicRequest>;
|
|
12
12
|
export declare function musicLine(credits?: number): PartsLine;
|
|
13
|
-
export declare function isMusicEnabled(env?: Record<string, string | undefined>): boolean;
|
|
14
|
-
export declare const MUSIC_DISABLED_MESSAGE = "music is not available right now; omit it";
|
|
15
13
|
export declare function musicNotAddedWarning(reason: string): string;
|
package/dist/music.js
CHANGED
|
@@ -16,10 +16,6 @@ export const musicRequest = z.union([
|
|
|
16
16
|
export function musicLine(credits = MUSIC_BED_CREDITS) {
|
|
17
17
|
return { label: "music", unit: "track", quantity: 1, unit_credits: credits, credits };
|
|
18
18
|
}
|
|
19
|
-
export function isMusicEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
20
|
-
return env.CLIPWRIGHT_MUSIC === "1";
|
|
21
|
-
}
|
|
22
|
-
export const MUSIC_DISABLED_MESSAGE = "music is not available right now; omit it";
|
|
23
19
|
export function musicNotAddedWarning(reason) {
|
|
24
20
|
return `music was not added: ${reason}; it was not charged`;
|
|
25
21
|
}
|
|
@@ -73,9 +73,6 @@ export type OwnAgentTerms = z.infer<typeof ownAgentTerms>;
|
|
|
73
73
|
export declare const ownAgentTermsNow: (options?: {
|
|
74
74
|
sprites?: boolean;
|
|
75
75
|
}) => OwnAgentTerms;
|
|
76
|
-
export declare const isOwnAgentEnabled: (env: Readonly<Record<string, string | undefined>>) => boolean;
|
|
77
|
-
export declare const isFilmHeadEnabled: (env: Readonly<Record<string, string | undefined>>) => boolean;
|
|
78
|
-
export declare const isHeroSpritesEnabled: (env: Readonly<Record<string, string | undefined>>) => boolean;
|
|
79
76
|
export declare function ownFilmRenderCredits(s: number, terms?: OwnAgentTerms, music?: boolean): number;
|
|
80
77
|
export declare const ownVoiceCredits: (s: number, terms?: OwnAgentTerms) => number;
|
|
81
78
|
export declare function ownStillsCredits(n: number, terms?: OwnAgentTerms, free?: number): number;
|
package/dist/own-agent-price.js
CHANGED
|
@@ -75,9 +75,6 @@ export const ownAgentTermsNow = (options = {}) => ({ tariff: OWN_AGENT_TARIFF, s
|
|
|
75
75
|
picture_check_credits: OWN_TAKE_CHECK_PICTURE_CREDITS, picture_check_long_credits: OWN_TAKE_CHECK_PICTURE_LONG_CREDITS, free_stills: OWN_FREE_STILLS, free_stills_window_hours: OWN_FREE_STILLS_WINDOW_HOURS, cut_credits: OWN_CUT_CREDITS, cut_included_seconds: OWN_CUT_INCLUDED_SECONDS,
|
|
76
76
|
cut_extra_second_credits: OWN_CUT_EXTRA_SECOND_CREDITS, cut_bed_credits: OWN_CUT_BED_CREDITS,
|
|
77
77
|
cut_take_sound_credits_per_second: OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, cut_music_credits: MUSIC_BED_CREDITS });
|
|
78
|
-
export const isOwnAgentEnabled = (env) => env.CLIPWRIGHT_OWN_AGENT === "1";
|
|
79
|
-
export const isFilmHeadEnabled = (env) => env.CLIPWRIGHT_FILM_HEAD === "1";
|
|
80
|
-
export const isHeroSpritesEnabled = (env) => env.CLIPWRIGHT_HERO_SPRITES === "1";
|
|
81
78
|
const seconds = (s, max, what) => {
|
|
82
79
|
if (!Number.isFinite(s) || s <= 0 || s > max)
|
|
83
80
|
throw new Error(`${what} of ${s} s is outside 0–${max} s`);
|
|
@@ -3,7 +3,6 @@ export declare const PRESENTER_ENGINE_OF: Readonly<Record<PresenterEngineChoice,
|
|
|
3
3
|
export declare const AVATAR6_LEAD_SEC = 0.6;
|
|
4
4
|
export declare const TURBO_UNIT_MAX_SEC = 42;
|
|
5
5
|
export declare const TURBO_UNIT_MAX_ESTIMATE_SEC = 36;
|
|
6
|
-
export declare function isHeygenAvatar6Enabled(env?: Record<string, string | undefined>): boolean;
|
|
7
6
|
export interface PresenterEngineFacts {
|
|
8
7
|
source: {
|
|
9
8
|
width: number;
|
package/dist/presenter-engine.js
CHANGED
|
@@ -5,9 +5,6 @@ export const PRESENTER_ENGINE_OF = Object.freeze({
|
|
|
5
5
|
export const AVATAR6_LEAD_SEC = 0.6;
|
|
6
6
|
export const TURBO_UNIT_MAX_SEC = 42;
|
|
7
7
|
export const TURBO_UNIT_MAX_ESTIMATE_SEC = 36;
|
|
8
|
-
export function isHeygenAvatar6Enabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
9
|
-
return env.CLIPWRIGHT_HEYGEN_AVATAR6 === "1";
|
|
10
|
-
}
|
|
11
8
|
const AVATAR6_FORMATS = ["9:16"];
|
|
12
9
|
const AS_IV = "so it renders on avatar_iv (HeyGen Avatar IV) at its price";
|
|
13
10
|
export function resolvePresenterEngine(input, aspectRatio, enabled, facts) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { PartsLine } from "./parts-pricing.js";
|
|
2
|
-
export declare function isPresenterMatteEnabled(env?: Record<string, string | undefined>): boolean;
|
|
3
2
|
declare const CUTOUT_LABELS: {
|
|
4
3
|
readonly cover_story: "cover story, presenter in front";
|
|
5
4
|
readonly backdrop: "backdrop, presenter in front";
|
|
6
5
|
};
|
|
7
6
|
export declare const CUTOUT_TEMPLATE_KINDS: readonly (keyof typeof CUTOUT_LABELS)[];
|
|
8
|
-
export declare const PRESENTER_MATTE_DISABLED_MESSAGE = "cover_story and backdrop are not available right now; use another template kind";
|
|
9
7
|
export declare function needsPresenterCutout(templates: unknown): boolean;
|
|
10
8
|
export declare function cutoutTemplateLines(templates: unknown): PartsLine[];
|
|
11
9
|
export declare function pictureCutoutMissingWarning(id: string, photo?: boolean): string;
|
package/dist/presenter-matte.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export function isPresenterMatteEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
2
|
-
return env.CLIPWRIGHT_PRESENTER_MATTE === "1";
|
|
3
|
-
}
|
|
4
1
|
const CUTOUT_LABELS = { cover_story: "cover story, presenter in front", backdrop: "backdrop, presenter in front" };
|
|
5
2
|
export const CUTOUT_TEMPLATE_KINDS = Object.keys(CUTOUT_LABELS);
|
|
6
|
-
export const PRESENTER_MATTE_DISABLED_MESSAGE = "cover_story and backdrop are not available right now; use another template kind";
|
|
7
3
|
const cutoutKindOf = (item) => (typeof item === "object" && item !== null
|
|
8
4
|
? CUTOUT_TEMPLATE_KINDS.find(kind => kind === item.kind) : undefined);
|
|
9
5
|
export function needsPresenterCutout(templates) {
|
package/dist/prices.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { ServiceOffer } from "./service-offer.js";
|
|
2
3
|
export declare const PRICES_PATH = "/v1/public/prices";
|
|
3
4
|
export declare const PRICE_UNITS: readonly ["call", "second", "face_second", "image", "clip", "clip_second", "still", "scene", "track"];
|
|
4
5
|
export type PriceUnit = (typeof PRICE_UNITS)[number];
|
|
@@ -97,9 +98,8 @@ export interface DiyModesSold {
|
|
|
97
98
|
readonly faceless: boolean;
|
|
98
99
|
}
|
|
99
100
|
export declare const NO_DIY_MODES: DiyModesSold;
|
|
100
|
-
export declare const diyPriceEntries: (diy: DiyModesSold
|
|
101
|
-
export declare function priceListFor(
|
|
102
|
-
export declare const PRICE_LIST: readonly PriceEntry[];
|
|
101
|
+
export declare const diyPriceEntries: (diy: DiyModesSold) => PriceEntry[];
|
|
102
|
+
export declare function priceListFor(offer: ServiceOffer, diy?: DiyModesSold): readonly PriceEntry[];
|
|
103
103
|
export declare const priceText: (entry: PriceEntry) => string;
|
|
104
|
-
export declare function priceLine(tool: string, list
|
|
105
|
-
export declare const withPriceLine: (tool: string, description: string, list
|
|
104
|
+
export declare function priceLine(tool: string, list: readonly PriceEntry[]): string | null;
|
|
105
|
+
export declare const withPriceLine: (tool: string, description: string, list: readonly PriceEntry[]) => string;
|
package/dist/prices.js
CHANGED
|
@@ -3,17 +3,16 @@ import { ACTOR_PORTRAIT_ASPECT, ACTOR_UNIT_CREDITS, ACTOR_VIEW_PORTRAIT_CREDITS
|
|
|
3
3
|
import { CANDIDATE_CHARGE_TEXT } from "./edit-candidate.js";
|
|
4
4
|
import { EDIT_RENDER_PRICE, EDIT_UNIT_PRICES, EDIT_ZERO_UNIT_PRICE } from "./edit-billing.js";
|
|
5
5
|
import { REVISION_CHARGE_TEXT } from "./edit-revision.js";
|
|
6
|
-
import { FACELESS_CREDITS_PER_1500_FRAMES, FACELESS_IMAGE_CREDITS, FACELESS_MAX_SELECTED_SECONDS, FACELESS_MIN_BASE_CREDITS, FACELESS_MIN_SELECTED_SECONDS, FACELESS_OPENER_CREDITS, FACELESS_SHOT_CREDITS_PER_SECOND,
|
|
6
|
+
import { FACELESS_CREDITS_PER_1500_FRAMES, FACELESS_IMAGE_CREDITS, FACELESS_MAX_SELECTED_SECONDS, FACELESS_MIN_BASE_CREDITS, FACELESS_MIN_SELECTED_SECONDS, FACELESS_OPENER_CREDITS, FACELESS_SHOT_CREDITS_PER_SECOND, quoteFaceless, EXPLAINER_FILM_INCLUDED_SECONDS, EXPLAINER_TIER_TARIFFS, EXPLAINER_TIERS, FACELESS_EXPLAINER_POSE_PICTURES, SKILL_FILM_TARIFFS, } from "./faceless-price.js";
|
|
7
7
|
import { PRESENTER_ENGINES, SHOT_ENGINES } from "./face-billing.js";
|
|
8
8
|
import { listGenerationModels } from "./generations.js";
|
|
9
9
|
import { PARTS_DURATION_TARIFF, PARTS_FACE_TARIFF, PRESENTER_CREDITS_PER_SECOND, PRESENTER_ENGINE_LABELS, SCENE_CREDITS, SHOT_CREDITS_PER_SECOND, SHOT_ENGINE_LABELS } from "./parts-pricing.js";
|
|
10
|
-
import { isHeygenAvatar6Enabled } from "./presenter-engine.js";
|
|
11
10
|
import { UPSCALE_CAPABILITIES, UPSCALE_QUOTE_PATH, UPSCALE_RUN_PATH } from "./upscale.js";
|
|
12
11
|
import { REFERENCE_ANALYSIS_CREDITS, REFERENCE_DATA_CREDITS } from "./reference-analysis.js";
|
|
13
12
|
import { CREATOR_PROFILE_CREDITS, CREATOR_PROFILE_VIDEOS } from "./creator-profile.js";
|
|
14
13
|
import { TREND_FREE_PAGES_PER_DAY, TREND_FREE_SEARCHES_PER_MONTH, TREND_PAGE_PAID_CREDITS, TREND_PAGE_WINDOW_SECONDS, TREND_SEARCH_CREDITS, TREND_SEARCH_MAX_PAGES, TREND_SEARCH_REELS, } from "./trend-search.js";
|
|
15
|
-
import { FILM_MUSIC_BED_CREDITS,
|
|
16
|
-
import { HERO_RUNS_PER_HOUR,
|
|
14
|
+
import { FILM_MUSIC_BED_CREDITS, MUSIC_BED_CREDITS } from "./music.js";
|
|
15
|
+
import { HERO_RUNS_PER_HOUR, OWN_FILM_EXTRA_SECOND_CREDITS, OWN_FILM_INCLUDED_SECONDS, OWN_FILM_RENDER_CREDITS, OWN_HERO_POSE_CREDITS, OWN_HERO_POSES, OWN_HERO_FREE_POSES_PER_DAY, OWN_HERO_FREE_POSES_WINDOW_HOURS, OWN_FREE_STILLS, OWN_FREE_STILLS_WINDOW_HOURS, OWN_STILL_CREDITS, OWN_STILLS_MAX_PER_CALL, OWN_VOICE_CREDITS_PER_SECOND, OWN_EDIT_CREDITS, OWN_EDIT_MAX_SECONDS, OWN_TAKE_CHECK_CREDITS, OWN_CUT_BED_CREDITS, OWN_CUT_CREDITS, OWN_CUT_EXTRA_SECOND_CREDITS, OWN_CUT_INCLUDED_SECONDS, OWN_CUT_MAX_NEW_SOUNDS, OWN_CUT_MAX_SECONDS, OWN_CUT_MIN_SECONDS, OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, OWN_TAKE_CHECK_PICTURE_CREDITS, OWN_TAKE_CHECK_PICTURE_LONG_CREDITS, OWN_TAKE_FRAMES_MAX, TAKE_PICTURE_SHORT_TIER_SECONDS, OWN_HERO_HEAD_CREDITS, OWN_HERO_MAX_SPRITES, OWN_HERO_SPRITE_CREDITS, OWN_HERO_TALKING_POSES, ownAgentTermsNow, ownHeroCredits } from "./own-agent-price.js";
|
|
17
16
|
import { CUT_PREVIEW_MAX_STILLS } from "./film-cut.js";
|
|
18
17
|
export const PRICES_PATH = "/v1/public/prices";
|
|
19
18
|
export const PRICE_UNITS = ["call", "second", "face_second", "image", "clip", "clip_second", "still", "scene", "track"];
|
|
@@ -133,13 +132,13 @@ function upscaleEntries() {
|
|
|
133
132
|
];
|
|
134
133
|
}
|
|
135
134
|
export const NO_DIY_MODES = Object.freeze({ ad: false, faceless: false });
|
|
136
|
-
const adDiyPrices = (
|
|
135
|
+
const adDiyPrices = () => [
|
|
137
136
|
paid({ tool: "render_edit", route: "POST /v1/film-edits", quote_tool: "quote_edit",
|
|
138
137
|
lines: [{ label: `the cut, up to ${OWN_EDIT_MAX_SECONDS} s`, unit: "call", credits: OWN_EDIT_CREDITS },
|
|
139
|
-
|
|
138
|
+
{ label: "music made for the cut", unit: "track", credits: MUSIC_BED_CREDITS }],
|
|
140
139
|
notes: `One cut of your own clips with your voice and captions, up to ${OWN_EDIT_MAX_SECONDS} s, vertical 720p. Charged only for a ` +
|
|
141
140
|
"delivered cut; an edit that fails costs nothing." +
|
|
142
|
-
|
|
141
|
+
" A library music bed is free; music made for the cut is charged only when the delivered cut carries it." }),
|
|
143
142
|
paid({ tool: "check_take", route: "POST /v1/take-checks", quote_tool: "quote_take_check", unit: "call", credits: OWN_TAKE_CHECK_CREDITS,
|
|
144
143
|
notes: "One of your clips judged frame by frame against the prompt it was made with: each defect with its seconds and how to repair " +
|
|
145
144
|
"it, and the clean windows. Charged only for a delivered verdict; a check that delivers no verdict costs nothing." }),
|
|
@@ -171,12 +170,14 @@ const facelessDiyPrices = () => [
|
|
|
171
170
|
notes: `Up to ${CUT_PREVIEW_MAX_STILLS} frames of your checked cut sheet as the video draws them, on the words you name. The first ` +
|
|
172
171
|
`${OWN_FREE_STILLS} preview stills of an account in any ${OWN_FREE_STILLS_WINDOW_HOURS} h are free; a preview that fails costs nothing.` }),
|
|
173
172
|
];
|
|
174
|
-
export const diyPriceEntries = (diy
|
|
175
|
-
...(diy.ad ? adDiyPrices(
|
|
173
|
+
export const diyPriceEntries = (diy) => [
|
|
174
|
+
...(diy.ad ? adDiyPrices() : []),
|
|
176
175
|
...(diy.faceless ? facelessDiyPrices() : []),
|
|
177
176
|
...(diy.ad || diy.faceless ? [TAKE_FRAMES_PRICE] : []),
|
|
178
177
|
];
|
|
179
|
-
function buildPriceList(
|
|
178
|
+
function buildPriceList(offer, diy) {
|
|
179
|
+
const liveShots = offer.longForm, scenes = offer.longForm;
|
|
180
|
+
const { explainerFilm: explainer, ownAgent, heygenAvatar6: avatar6, heroSprites, filmHead } = offer;
|
|
180
181
|
const unit = EDIT_UNIT_PRICES;
|
|
181
182
|
const parts = PARTS_FACE_TARIFF;
|
|
182
183
|
const shotRates = parts.shotCreditsPerSecond ?? SHOT_CREDITS_PER_SECOND;
|
|
@@ -189,14 +190,14 @@ function buildPriceList(liveShots, scenes, facelessShots = false, facelessScenes
|
|
|
189
190
|
{ label: "production (voice and render)", unit: "second", credits: parts.productionCreditsPerSecond },
|
|
190
191
|
{ label: "live avatar on a call", unit: "still", credits: parts.liveAvatarStillCredits },
|
|
191
192
|
...(scenes ? [{ label: "scene made for the video", unit: "scene", credits: SCENE_CREDITS }] : []),
|
|
192
|
-
|
|
193
|
+
{ label: "music under the voice", unit: "track", credits: MUSIC_BED_CREDITS }],
|
|
193
194
|
notes: "Short and long videos alike. Presenter seconds are the seconds a presenter take fills, covered by an insert, overlay, " +
|
|
194
195
|
"window or template or not, counted once over the video and rounded up; the engine that renders each take sets its rate " +
|
|
195
196
|
(engine === "heygen" ? "(today every take renders on HeyGen). " : "(no take renders on OmniHuman today). ") +
|
|
196
197
|
"Production seconds are every second of the finished video. A live avatar is charged per call still in the video." +
|
|
197
198
|
(liveShots ? " A live shot's seconds take its own line in place of the presenter's; talking shots stay on the presenter line." : "") +
|
|
198
199
|
(scenes ? " A scene made for the video is charged only when it is drawn in the delivered video." : "") +
|
|
199
|
-
|
|
200
|
+
" Music is added only when you ask for it and charged only when the delivered video carries it." })),
|
|
200
201
|
...(avatar6 ? [paid({ tool: "make_ugc", route: "POST /v1/skills/make_ugc/run", variant: "HeyGen Avatar 6 Turbo presenter",
|
|
201
202
|
quote_tool: "quote_ugc", minimum_credits: PARTS_DURATION_TARIFF.minimumCredits,
|
|
202
203
|
lines: [{ label: PRESENTER_ENGINE_LABELS.heygen_avatar6_turbo, unit: "face_second", credits: PRESENTER_CREDITS_PER_SECOND.heygen_avatar6_turbo },
|
|
@@ -229,15 +230,15 @@ function buildPriceList(liveShots, scenes, facelessShots = false, facelessScenes
|
|
|
229
230
|
lines: [{ label: "generated picture", unit: "image", credits: FACELESS_IMAGE_CREDITS },
|
|
230
231
|
{ label: "opening clip", unit: "clip", credits: FACELESS_OPENER_CREDITS },
|
|
231
232
|
{ label: "production (story, voice and render)", unit: "second", credits: FACELESS_CREDITS_PER_1500_FRAMES / 60 },
|
|
232
|
-
|
|
233
|
-
...(
|
|
234
|
-
|
|
233
|
+
{ label: "action shot", unit: "clip_second", credits: FACELESS_SHOT_CREDITS_PER_SECOND },
|
|
234
|
+
...(scenes ? [{ label: "scene made for the video", unit: "scene", credits: SCENE_CREDITS }] : []),
|
|
235
|
+
{ label: "music under the voice", unit: "track", credits: MUSIC_BED_CREDITS }],
|
|
235
236
|
minimum_credits: FACELESS_MIN_BASE_CREDITS,
|
|
236
237
|
notes: `Pictures we generated for the delivered video and its seconds, never above the selected length. The quote is the most a ` +
|
|
237
238
|
`selection is charged, every picture it may generate: ${facelessAt(FACELESS_MIN_SELECTED_SECONDS)} for ` +
|
|
238
239
|
`${FACELESS_MIN_SELECTED_SECONDS} s, ${facelessAt(FACELESS_MAX_SELECTED_SECONDS)} for ${FACELESS_MAX_SELECTED_SECONDS} s. ` +
|
|
239
240
|
"Captions do not change the price." +
|
|
240
|
-
|
|
241
|
+
" Music is added only when you ask for it and charged only when the delivered video carries it." }),
|
|
241
242
|
...(explainer ? EXPLAINER_TIERS.map(tier => paid({ tool: "make_faceless", route: "POST /v1/skills/make_faceless/run", quote_tool: "quote_faceless",
|
|
242
243
|
variant: `explainer ${tier}`,
|
|
243
244
|
lines: [{ label: `film up to ${EXPLAINER_FILM_INCLUDED_SECONDS} s`, unit: "call", credits: SKILL_FILM_TARIFFS[EXPLAINER_TIER_TARIFFS[tier]].filmCredits },
|
|
@@ -257,9 +258,9 @@ function buildPriceList(liveShots, scenes, facelessShots = false, facelessScenes
|
|
|
257
258
|
paid({ tool: "render_film", route: "POST /v1/film-renders", quote_tool: "quote_render",
|
|
258
259
|
lines: [{ label: `film up to ${OWN_FILM_INCLUDED_SECONDS} s`, unit: "call", credits: OWN_FILM_RENDER_CREDITS },
|
|
259
260
|
{ label: `each second over ${OWN_FILM_INCLUDED_SECONDS} s`, unit: "second", credits: OWN_FILM_EXTRA_SECOND_CREDITS },
|
|
260
|
-
|
|
261
|
+
{ label: "music made for the film", unit: "track", credits: FILM_MUSIC_BED_CREDITS }],
|
|
261
262
|
notes: "Charged only for a delivered film, by its length; a render that fails costs nothing." +
|
|
262
|
-
|
|
263
|
+
" A library music bed is free; music made for the film is charged only when the delivered film carries it." }),
|
|
263
264
|
paid({ tool: "make_film_hero", route: "POST /v1/film-heroes", quote_tool: "quote_film_hero",
|
|
264
265
|
lines: [{ label: null, unit: "image", credits: OWN_HERO_POSE_CREDITS },
|
|
265
266
|
...(heroSprites ? [{ label: "talking sprite", unit: "image", credits: OWN_HERO_SPRITE_CREDITS }] : [])],
|
|
@@ -278,7 +279,7 @@ function buildPriceList(liveShots, scenes, facelessShots = false, facelessScenes
|
|
|
278
279
|
notes: "head true with your photo or your actor's picture: the head drawn as a cartoon that talks, blinks and changes its look, saved " +
|
|
279
280
|
"as a mascot a film's actor wears. One price per head, charged only when the head is saved with all its pictures; a head that " +
|
|
280
281
|
"fails costs nothing." })] : []),
|
|
281
|
-
...diyPriceEntries(diy
|
|
282
|
+
...diyPriceEntries(diy),
|
|
282
283
|
] : []),
|
|
283
284
|
paid({ tool: "revise_run", route: "POST /v1/runs/{id}/revisions", quote_tool: "quote_revision",
|
|
284
285
|
formula: `each shot generated anew: picture ${unit.picture}, clip ${unit.clip}, clip with a new picture ${unit.clip_with_new_picture}; ` +
|
|
@@ -305,12 +306,9 @@ function buildPriceList(liveShots, scenes, facelessShots = false, facelessScenes
|
|
|
305
306
|
lines: [{ label: null, unit: "call", credits: 0 }], formula: null, minimum_credits: null, quote_tool: null, notes: null })),
|
|
306
307
|
];
|
|
307
308
|
}
|
|
308
|
-
export function priceListFor(
|
|
309
|
-
|
|
310
|
-
const liveShots = env.CLIPWRIGHT_LIVE_SHOTS === "1" && longForm, scenes = env.CLIPWRIGHT_SCENES === "1" && longForm;
|
|
311
|
-
return Object.freeze(pricesResponse.parse({ prices: buildPriceList(liveShots, scenes, env.CLIPWRIGHT_FACELESS_SHOTS === "1", scenes && facelessScenesEnabled(env), isMusicEnabled(env), explainerFilmOffered(env), isOwnAgentEnabled(env), isHeygenAvatar6Enabled(env), diy, isHeroSpritesEnabled(env), isFilmHeadEnabled(env)) }).prices);
|
|
309
|
+
export function priceListFor(offer, diy = NO_DIY_MODES) {
|
|
310
|
+
return Object.freeze(pricesResponse.parse({ prices: buildPriceList(offer, diy) }).prices);
|
|
312
311
|
}
|
|
313
|
-
export const PRICE_LIST = priceListFor(typeof process === "undefined" ? {} : process.env);
|
|
314
312
|
const UNIT_TEXT = {
|
|
315
313
|
call: "call", second: "second of video", face_second: "second the presenter is in the video, covered or not", image: "image", clip: "clip",
|
|
316
314
|
clip_second: "second of clip", still: "call still in the video", scene: "scene drawn in the video", track: "music track in the video",
|
|
@@ -319,7 +317,7 @@ const LISTED_PRICES = 4;
|
|
|
319
317
|
export const priceText = (entry) => entry.lines.length === 0 ? entry.formula ?? "" :
|
|
320
318
|
entry.lines.map(lineText).join(" plus ") + (entry.minimum_credits === null ? "" : `, at least ${entry.minimum_credits}`);
|
|
321
319
|
const lineText = (line) => `${line.label === null ? "" : `${line.label} `}${line.credits} credits per ${UNIT_TEXT[line.unit]}`;
|
|
322
|
-
export function priceLine(tool, list
|
|
320
|
+
export function priceLine(tool, list) {
|
|
323
321
|
const entries = list.filter((entry) => entry.tool === tool && isPaidEntry(entry));
|
|
324
322
|
const [first] = entries;
|
|
325
323
|
if (first === undefined)
|
|
@@ -337,9 +335,9 @@ export function priceLine(tool, list = PRICE_LIST) {
|
|
|
337
335
|
: entries.map((entry) => `${entry.variant === null ? "" : `${entry.variant}: `}${priceText(entry)}`).join("; ");
|
|
338
336
|
return `Price: ${text}. Quote first with ${first.quote_tool}.`;
|
|
339
337
|
}
|
|
340
|
-
export const withPriceLine = (tool, description, list
|
|
338
|
+
export const withPriceLine = (tool, description, list) => {
|
|
341
339
|
const line = priceLine(tool, list);
|
|
342
340
|
if (line === null)
|
|
343
|
-
throw new Error(`${tool} has no price in
|
|
341
|
+
throw new Error(`${tool} has no price in the list`);
|
|
344
342
|
return `${description} ${line}`;
|
|
345
343
|
};
|
package/dist/scene-bible.d.ts
CHANGED
|
@@ -46,4 +46,3 @@ export type RunSpeech = z.infer<typeof runSpeech>;
|
|
|
46
46
|
export declare const speechActions: z.ZodArray<z.ZodString>;
|
|
47
47
|
export declare function speechActionsOf(storedInput: unknown): ReadonlySet<string>;
|
|
48
48
|
export declare function runSpeechOf(storedInput: unknown): RunSpeech | undefined;
|
|
49
|
-
export declare function listedAccounts(raw: string | undefined): "all" | ReadonlySet<string> | null;
|
package/dist/scene-bible.js
CHANGED
|
@@ -56,10 +56,3 @@ export function runSpeechOf(storedInput) {
|
|
|
56
56
|
const parsed = runSpeech.safeParse(storedInput.speech);
|
|
57
57
|
return parsed.success ? parsed.data : undefined;
|
|
58
58
|
}
|
|
59
|
-
export function listedAccounts(raw) {
|
|
60
|
-
const value = raw?.trim();
|
|
61
|
-
if (value === "1")
|
|
62
|
-
return "all";
|
|
63
|
-
const ids = (value ?? "").split(",").map(id => id.trim()).filter(id => /^acc_[A-Za-z0-9_-]+$/.test(id));
|
|
64
|
-
return ids.length ? new Set(ids) : null;
|
|
65
|
-
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ServiceOffer {
|
|
2
|
+
readonly longForm: boolean;
|
|
3
|
+
readonly explainerFilm: boolean;
|
|
4
|
+
readonly ownAgent: boolean;
|
|
5
|
+
readonly heygenAvatar6: boolean;
|
|
6
|
+
readonly filmHead: boolean;
|
|
7
|
+
readonly heroSprites: boolean;
|
|
8
|
+
readonly outputMarking: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const BASE_OFFER: ServiceOffer;
|
|
11
|
+
export declare const FULL_OFFER: ServiceOffer;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const BASE_OFFER = Object.freeze({
|
|
2
|
+
longForm: false, explainerFilm: false, ownAgent: false, heygenAvatar6: false, filmHead: false, heroSprites: false, outputMarking: false,
|
|
3
|
+
});
|
|
4
|
+
export const FULL_OFFER = Object.freeze({
|
|
5
|
+
longForm: true, explainerFilm: true, ownAgent: true, heygenAvatar6: true, filmHead: true, heroSprites: true, outputMarking: false,
|
|
6
|
+
});
|
package/dist/skills.js
CHANGED
|
@@ -2,8 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { ASSET_KINDS, ASSET_MEDIA_TYPES, assetId } from "./asset-identity.js";
|
|
3
3
|
import { longFormQuoteSchema } from "./long-form-pricing.js";
|
|
4
4
|
import { partsLineSchema } from "./parts-pricing.js";
|
|
5
|
-
import {
|
|
6
|
-
import { explainerFilmOffered } from "./faceless-price.js";
|
|
5
|
+
import { MUSIC_DESCRIPTION, musicRequest, ONE_LINE_TEXT } from "./music.js";
|
|
7
6
|
import { MAX_SCENES, SCENE_BRIEF_MAX_CHARS, SCENE_TEXT_MAX_CHARS, sceneRefusals, SCENES_DESCRIPTION } from "./ugc-scenes.js";
|
|
8
7
|
import { MAX_MOVES, moveRefusals, MOVES_DESCRIPTION, ugcMove } from "./moves.js";
|
|
9
8
|
import { RESOLVED_TIMELINE_MAX_SLOTS } from "./long-form-profile.js";
|
|
@@ -147,9 +146,7 @@ export const MAKE_UGC_DESCRIPTION = "Start generation of a lip-synced UGC video.
|
|
|
147
146
|
export const MAKE_UGC_AGENT_PROTOCOL = "Returns a run_id at once; poll get_run with its poll.arguments until 'succeeded' (video_url) or 'failed'. A 'failed' run " +
|
|
148
147
|
"whose video is still being made can go back to 'queued' and succeed later, named in warnings[]. attempt=2,3,… starts a " +
|
|
149
148
|
"NEW run for the same input. For a video like a reference reel, use analyze_reference, then plan_reference_remake with its analysis_id.";
|
|
150
|
-
const MUSIC_STOP =
|
|
151
|
-
"price from the quote; it is off unless asked." : "";
|
|
152
|
-
const EXPLAINER_SOLD = explainerFilmOffered(typeof process === "undefined" ? {} : process.env);
|
|
149
|
+
const MUSIC_STOP = " Music: ask whether the user wants music under the voice, and show its price from the quote; it is off unless asked.";
|
|
153
150
|
const OWN_WAY = "you write the film yourself, starting with get_film_guide, paid by part (voice, hero poses, stills, render), " +
|
|
154
151
|
"each part quoted before it is made";
|
|
155
152
|
function explainerOffer(ownAgent, sold) {
|
|
@@ -170,7 +167,7 @@ export const AD_GUIDE_INSTRUCTION = " Before you write an ad's devices and live
|
|
|
170
167
|
"ugc for make_ugc.";
|
|
171
168
|
export const FACELESS_DIY_INSTRUCTION = "For a faceless story, list, own-pictures or cartoon video, offer two ways: make_faceless, or you " +
|
|
172
169
|
"write the script and storyboard with get_film_guide in that format, create_cut, check_cut, quote_cut and render_cut, each part quoted first.";
|
|
173
|
-
export const mcpServerInstructions = ({ ownAgent, explainer, adGuide, facelessDiy }) => serverInstructions(explainerOffer(ownAgent, explainer
|
|
170
|
+
export const mcpServerInstructions = ({ ownAgent, explainer, adGuide, facelessDiy }) => serverInstructions(explainerOffer(ownAgent, explainer === true), adGuide === true, facelessDiy === true);
|
|
174
171
|
const serverInstructions = (offer, adGuide, facelessDiy = false) => "Clipwright makes short presenter (UGC) videos, faceless narrated videos, single images and clips. It renders " +
|
|
175
172
|
"them on its servers and returns the MP4 or image file; it publishes nothing anywhere.\n\n" +
|
|
176
173
|
"tools/list says each tool and field in short. describe_tool answers a tool's full guidance, or one field's, free: read it " +
|
|
@@ -24,8 +24,6 @@ export declare const CTA_LABELS: {
|
|
|
24
24
|
readonly follow: "Follow";
|
|
25
25
|
readonly following: "Following";
|
|
26
26
|
};
|
|
27
|
-
export declare function isCommentCtaEnabled(env?: Record<string, string | undefined>): boolean;
|
|
28
|
-
export declare const COMMENT_CTA_DISABLED_MESSAGE = "comment_cta is not available right now; use another template kind";
|
|
29
27
|
declare const data: z.ZodObject<{
|
|
30
28
|
title: z.ZodString;
|
|
31
29
|
accent: z.ZodOptional<z.ZodString>;
|
|
@@ -10,10 +10,6 @@ export const CTA_FUNNEL = { typeDelay: 6, letter: 3, send: 6, arrive: 8, tap: 18
|
|
|
10
10
|
export const CTA_LINE_GAP = 10;
|
|
11
11
|
export const CTA_LABELS = { comment: "Add a comment…", follow: "Follow", following: "Following" };
|
|
12
12
|
const LATIN_LANGUAGES = ["en", "pl", "vi"];
|
|
13
|
-
export function isCommentCtaEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
14
|
-
return env.CLIPWRIGHT_COMMENT_CTA === "1";
|
|
15
|
-
}
|
|
16
|
-
export const COMMENT_CTA_DISABLED_MESSAGE = "comment_cta is not available right now; use another template kind";
|
|
17
13
|
const line = z.object({
|
|
18
14
|
text: z.string().min(1).max(32),
|
|
19
15
|
accent: z.string().min(1).max(24).optional(),
|
|
@@ -44,7 +44,7 @@ export interface TemplateKind<D extends z.ZodObject = z.ZodObject> {
|
|
|
44
44
|
}
|
|
45
45
|
export declare const TEMPLATE_KINDS: readonly TemplateKind[];
|
|
46
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", "cover_story", "series_frame", "comment_cta", "backdrop"];
|
|
47
|
-
export declare function offeredTemplateKinds(
|
|
47
|
+
export declare function offeredTemplateKinds(kinds?: readonly TemplateKind[]): readonly TemplateKind[];
|
|
48
48
|
export declare const TEMPLATE_KIND_HISTORY: readonly TemplateKind[];
|
|
49
49
|
export declare function templateKindAt(kind: string, version: number | undefined, kinds?: readonly TemplateKind[], history?: readonly TemplateKind[]): TemplateKind;
|
|
50
50
|
export { TEMPLATE_SIZES } from "./size.js";
|
|
@@ -72,8 +72,8 @@ export { RACE_EMS, raceEms } from "./race.js";
|
|
|
72
72
|
export { HAND_MARKS, HAND_TITLE_EMS } from "./hand-title.js";
|
|
73
73
|
export { WORD_FILL_EMS } from "./word-fill.js";
|
|
74
74
|
export { BACKDROP_NOTES_STYLES, BACKDROP_PICTURE_STYLES, BACKDROP_STYLES, type BackdropStyle } from "./backdrop.js";
|
|
75
|
-
export {
|
|
76
|
-
export {
|
|
75
|
+
export { SERIES_ASPECT, SERIES_ITEM_FLOOR_SEC, SERIES_ITEM_LOOKS, SERIES_ITEMS, SERIES_LOOP_FRAMES, SERIES_MAX_FRAMES, SERIES_ONE_COLUMN_MAX, seriesFitWarnings, seriesFrameMoments, seriesLeastFrames } from "./series-frame.js";
|
|
76
|
+
export { commentCtaActLines, commentCtaMoments, commentCtaSchedule, CTA_ASPECT, CTA_FUNNEL, CTA_ITEMS, CTA_LABELS, CTA_LINE_GAP, CTA_LINES, CTA_LOOP_FRAMES } from "./comment-cta.js";
|
|
77
77
|
export { templateMedia, type TemplateSlot } from "./slot.js";
|
|
78
78
|
export declare function templateFieldValues(data: unknown, field: string): {
|
|
79
79
|
path: (string | number)[];
|
package/dist/templates/index.js
CHANGED
|
@@ -9,7 +9,6 @@ import { checklist } from "./checklist.js";
|
|
|
9
9
|
import { compare, compareV1, compareV2 } from "./compare.js";
|
|
10
10
|
import { backdrop } from "./backdrop.js";
|
|
11
11
|
import { coverStory } from "./cover-story.js";
|
|
12
|
-
import { isPresenterMatteEnabled } from "../presenter-matte.js";
|
|
13
12
|
import { endCard } from "./end-card.js";
|
|
14
13
|
import { lowerThird, lowerThirdV1 } from "./lower-third.js";
|
|
15
14
|
import { notification, notificationV1 } from "./notification.js";
|
|
@@ -21,8 +20,8 @@ import { handTitle } from "./hand-title.js";
|
|
|
21
20
|
import { race } from "./race.js";
|
|
22
21
|
import { CANVAS_FPS } from "../media-timebase.js";
|
|
23
22
|
import { estimateWordsPerSecond, PAUSE_TRIM_PACE_FACTOR } from "../pacing.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
23
|
+
import { SERIES_MAX_FRAMES, seriesFrame } from "./series-frame.js";
|
|
24
|
+
import { commentCta } from "./comment-cta.js";
|
|
26
25
|
import { progress } from "./progress.js";
|
|
27
26
|
import { quote } from "./quote.js";
|
|
28
27
|
import { rating } from "./rating.js";
|
|
@@ -43,12 +42,8 @@ export const TEMPLATE_KINDS = [tag, lowerThird, endCard, titleCard, quote, stat,
|
|
|
43
42
|
export const TEMPLATE_KIND_IDS = ["tag", "lower_third", "end_card", "title_card", "quote", "stat", "callout", "checklist", "phone_call", "compare",
|
|
44
43
|
"notification", "progress", "rating", "chat_window", "video_grid", "word_title", "phone_screen", "terminal", "pointer_chips", "chart", "race",
|
|
45
44
|
"hand_title", "word_fill", "cover_story", "series_frame", "comment_cta", "backdrop"];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
comment_cta: { on: isCommentCtaEnabled, off: COMMENT_CTA_DISABLED_MESSAGE },
|
|
49
|
-
};
|
|
50
|
-
export function offeredTemplateKinds(env, kinds = TEMPLATE_KINDS) {
|
|
51
|
-
return kinds.filter(kind => (SWITCHED_KINDS[kind.kind]?.on(env) ?? true) && (!kind.cutout || isPresenterMatteEnabled(env)));
|
|
45
|
+
export function offeredTemplateKinds(kinds = TEMPLATE_KINDS) {
|
|
46
|
+
return kinds;
|
|
52
47
|
}
|
|
53
48
|
export const TEMPLATE_KIND_HISTORY = [{ ...phoneCall, kindVersion: 1 },
|
|
54
49
|
...[chatWindowV1, notificationV1, terminalV1, lowerThirdV1, compareV1, compareV2]];
|
|
@@ -88,8 +83,8 @@ export { RACE_EMS, raceEms } from "./race.js";
|
|
|
88
83
|
export { HAND_MARKS, HAND_TITLE_EMS } from "./hand-title.js";
|
|
89
84
|
export { WORD_FILL_EMS } from "./word-fill.js";
|
|
90
85
|
export { BACKDROP_NOTES_STYLES, BACKDROP_PICTURE_STYLES, BACKDROP_STYLES } from "./backdrop.js";
|
|
91
|
-
export {
|
|
92
|
-
export {
|
|
86
|
+
export { SERIES_ASPECT, SERIES_ITEM_FLOOR_SEC, SERIES_ITEM_LOOKS, SERIES_ITEMS, SERIES_LOOP_FRAMES, SERIES_MAX_FRAMES, SERIES_ONE_COLUMN_MAX, seriesFitWarnings, seriesFrameMoments, seriesLeastFrames } from "./series-frame.js";
|
|
87
|
+
export { commentCtaActLines, commentCtaMoments, commentCtaSchedule, CTA_ASPECT, CTA_FUNNEL, CTA_ITEMS, CTA_LABELS, CTA_LINE_GAP, CTA_LINES, CTA_LOOP_FRAMES } from "./comment-cta.js";
|
|
93
88
|
export { templateMedia } from "./slot.js";
|
|
94
89
|
export function templateFieldValues(data, field) {
|
|
95
90
|
const walk = (value, keys, path) => {
|
|
@@ -436,12 +431,7 @@ export function templateRefusals(input, kinds = TEMPLATE_KINDS) {
|
|
|
436
431
|
used.set(item.id, "templates");
|
|
437
432
|
const kind = kinds.find(entry => entry.kind === item.kind);
|
|
438
433
|
if (!kind) {
|
|
439
|
-
refusals.push({ path: at("kind"), message: `unknown template kind "${item.kind}": use one of ${offeredTemplateKinds(
|
|
440
|
-
continue;
|
|
441
|
-
}
|
|
442
|
-
const switched = SWITCHED_KINDS[kind.kind];
|
|
443
|
-
if (switched && !switched.on()) {
|
|
444
|
-
refusals.push({ path: at("kind"), message: switched.off });
|
|
434
|
+
refusals.push({ path: at("kind"), message: `unknown template kind "${item.kind}": use one of ${offeredTemplateKinds(kinds).map(entry => entry.kind).join(", ")}` });
|
|
445
435
|
continue;
|
|
446
436
|
}
|
|
447
437
|
if (kind.aspects && (input.aspect_ratio === undefined ? input.image !== undefined : !kind.aspects.includes(input.aspect_ratio))) {
|
|
@@ -14,8 +14,6 @@ export declare const SERIES_ITEM_FLOOR_SEC: {
|
|
|
14
14
|
export declare const SERIES_LOOP_FRAMES = 10;
|
|
15
15
|
export declare const SERIES_MAX_FRAMES: number;
|
|
16
16
|
export declare const SERIES_ASPECT = "9:16";
|
|
17
|
-
export declare function isSeriesFrameEnabled(env?: Record<string, string | undefined>): boolean;
|
|
18
|
-
export declare const SERIES_FRAME_DISABLED_MESSAGE = "series_frame is not available right now; use another template kind";
|
|
19
17
|
declare const data: z.ZodObject<{
|
|
20
18
|
title: z.ZodString;
|
|
21
19
|
accent: z.ZodOptional<z.ZodString>;
|
|
@@ -12,10 +12,6 @@ export const SERIES_ITEM_FLOOR_SEC = { ui: 2.4, other: 1.2, least: 0.8 };
|
|
|
12
12
|
export const SERIES_LOOP_FRAMES = 10;
|
|
13
13
|
export const SERIES_MAX_FRAMES = Math.round(SERIES_ITEMS.max * SERIES_ITEM_FLOOR_SEC.ui * CANVAS_FPS) + SERIES_LOOP_FRAMES;
|
|
14
14
|
export const SERIES_ASPECT = "9:16";
|
|
15
|
-
export function isSeriesFrameEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
16
|
-
return env.CLIPWRIGHT_SERIES_FRAME === "1";
|
|
17
|
-
}
|
|
18
|
-
export const SERIES_FRAME_DISABLED_MESSAGE = "series_frame is not available right now; use another template kind";
|
|
19
15
|
const item = z.object({
|
|
20
16
|
name: z.string().min(1).max(24),
|
|
21
17
|
clip: templateMedia.optional(),
|