@clipwright/core 0.57.0 → 0.59.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 +8 -1
- package/dist/account-actors.js +4 -1
- package/dist/account-actors.js.map +1 -1
- package/dist/account.d.ts +21 -0
- package/dist/account.js +14 -0
- package/dist/account.js.map +1 -1
- package/dist/actors.d.ts +18 -0
- package/dist/actors.js +17 -1
- package/dist/actors.js.map +1 -1
- package/dist/ad-guide.d.ts +6 -0
- package/dist/ad-guide.js +7 -0
- package/dist/ad-guide.js.map +1 -0
- package/dist/api-failure.d.ts +12 -1
- package/dist/api-failure.js +19 -1
- package/dist/api-failure.js.map +1 -1
- package/dist/assets.js +2 -2
- package/dist/assets.js.map +1 -1
- package/dist/billing-terms.d.ts +2 -0
- package/dist/contract-dispositions.d.ts +54 -1
- package/dist/contract-dispositions.js +17 -2
- package/dist/contract-dispositions.js.map +1 -1
- package/dist/contracts/v1/workflow-brief.d.ts +104 -0
- package/dist/contracts/v1/workflow-catalog.d.ts +104 -0
- package/dist/contracts/v1/workflow-client.d.ts +53 -0
- package/dist/contracts/v1/workflow-execution.d.ts +162 -0
- package/dist/contracts/v1/workflow-execution.js +2 -1
- package/dist/contracts/v1/workflow-execution.js.map +1 -1
- package/dist/contracts/v1/workflow-next.d.ts +80 -0
- package/dist/contracts/v1/workflow-plan.d.ts +156 -0
- package/dist/contracts/v1/workflow-run-read.d.ts +7 -0
- package/dist/contracts/v1/workflow-run-read.js +4 -1
- package/dist/contracts/v1/workflow-run-read.js.map +1 -1
- package/dist/creator-profile.d.ts +1 -0
- package/dist/creator-profile.js +2 -0
- package/dist/creator-profile.js.map +1 -1
- package/dist/edit-candidate.d.ts +2 -0
- package/dist/edit-candidate.js +2 -0
- package/dist/edit-candidate.js.map +1 -1
- package/dist/edit-revision.d.ts +2 -0
- package/dist/edit-revision.js +3 -2
- package/dist/edit-revision.js.map +1 -1
- package/dist/edit-shots.d.ts +83 -0
- package/dist/edit-shots.js +14 -1
- package/dist/edit-shots.js.map +1 -1
- package/dist/endpoint-notes.js +7 -5
- package/dist/endpoint-notes.js.map +1 -1
- package/dist/endpoints.js +3 -0
- package/dist/endpoints.js.map +1 -1
- package/dist/errors.d.ts +15 -1
- package/dist/errors.js +28 -0
- package/dist/errors.js.map +1 -1
- package/dist/face-billing.d.ts +27 -3
- package/dist/face-billing.js +15 -3
- package/dist/face-billing.js.map +1 -1
- package/dist/faceless-public-plan.d.ts +4 -0
- package/dist/faceless-public-plan.js +7 -3
- package/dist/faceless-public-plan.js.map +1 -1
- package/dist/faceless-public.d.ts +159 -0
- package/dist/faceless-public.js +24 -4
- package/dist/faceless-public.js.map +1 -1
- package/dist/generations.d.ts +18 -3
- package/dist/generations.js +71 -29
- package/dist/generations.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/live-shot-kinds.d.ts +64 -0
- package/dist/live-shot-kinds.js +114 -0
- package/dist/live-shot-kinds.js.map +1 -1
- package/dist/max-credits.d.ts +3 -0
- package/dist/max-credits.js +6 -0
- package/dist/max-credits.js.map +1 -0
- package/dist/mcp-ugc-descriptions.js +3 -2
- package/dist/mcp-ugc-descriptions.js.map +1 -1
- package/dist/openapi.js +1 -0
- package/dist/openapi.js.map +1 -1
- package/dist/own-agent-runs.d.ts +4 -0
- package/dist/own-agent-runs.js +5 -0
- package/dist/own-agent-runs.js.map +1 -1
- package/dist/parts-pricing.d.ts +9 -2
- package/dist/parts-pricing.js +13 -4
- package/dist/parts-pricing.js.map +1 -1
- package/dist/prices.js +9 -9
- package/dist/prices.js.map +1 -1
- package/dist/reference-analysis.d.ts +1 -0
- package/dist/reference-analysis.js +2 -0
- package/dist/reference-analysis.js.map +1 -1
- package/dist/resolved-timeline.d.ts +4 -0
- package/dist/resolved-timeline.js +5 -2
- package/dist/resolved-timeline.js.map +1 -1
- package/dist/run-static-warnings.js +2 -0
- package/dist/run-static-warnings.js.map +1 -1
- package/dist/runs.d.ts +2 -0
- package/dist/scene-bible.d.ts +49 -0
- package/dist/scene-bible.js +71 -0
- package/dist/scene-bible.js.map +1 -0
- package/dist/scene-proposal.d.ts +82 -0
- package/dist/scene-proposal.js +59 -0
- package/dist/scene-proposal.js.map +1 -0
- package/dist/skills.d.ts +4499 -106
- package/dist/skills.js +108 -34
- package/dist/skills.js.map +1 -1
- package/dist/templates/index.js +3 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/trend-niches.d.ts +1 -0
- package/dist/trend-niches.js +9 -4
- package/dist/trend-niches.js.map +1 -1
- package/dist/trend-search.d.ts +10 -5
- package/dist/trend-search.js +23 -11
- package/dist/trend-search.js.map +1 -1
- package/dist/voice-admission.d.ts +52 -0
- package/dist/workflows/methods/faceless-explainer.d.ts +43 -0
- package/dist/workflows/methods/faceless-explainer.js +2 -2
- package/dist/workflows/methods/faceless-explainer.js.map +1 -1
- package/dist/workflows/methods/kinetic-launch.d.ts +86 -0
- package/dist/workflows/methods/kinetic-launch.js +2 -2
- package/dist/workflows/methods/product-image-story.d.ts +43 -0
- package/dist/workflows/methods/product-image-story.js +1 -1
- package/dist/workflows/methods/reference-remake.d.ts +43 -0
- package/dist/workflows/methods/reference-remake.js +1 -1
- package/dist/workflows/methods/shared.d.ts +48 -2
- package/dist/workflows/methods/shared.js +2 -1
- package/dist/workflows/methods/shared.js.map +1 -1
- package/dist/workflows/methods/ugc-faq-answer.d.ts +43 -0
- package/dist/workflows/methods/ugc-faq-answer.js +1 -1
- package/dist/workflows/methods/ugc-product-intro.d.ts +43 -0
- package/dist/workflows/methods/ugc-product-intro.js +1 -1
- package/dist/workflows/methods/website-proof-demo.d.ts +86 -0
- package/dist/workflows/methods/website-proof-demo.js +2 -2
- package/dist/workflows/validate.js +12 -7
- package/dist/workflows/validate.js.map +1 -1
- package/package.json +1 -1
package/dist/skills.js
CHANGED
|
@@ -8,13 +8,16 @@ import { MAX_SCENES, SCENE_BRIEF_MAX_CHARS, SCENE_TEXT_MAX_CHARS, sceneRefusals,
|
|
|
8
8
|
import { MAX_MOVES, moveRefusals, MOVES_DESCRIPTION, ugcMove } from "./moves.js";
|
|
9
9
|
import { RESOLVED_TIMELINE_MAX_SLOTS } from "./long-form-profile.js";
|
|
10
10
|
import { brollPolicy } from "./broll-policy.js";
|
|
11
|
+
import { maxCreditsField } from "./max-credits.js";
|
|
11
12
|
import { design, resolvedDesign } from "./design.js";
|
|
12
13
|
import { MAX_MOTION_STYLE_SPANS, MOTION_STYLE_CHOICES, MOTION_STYLE_DESCRIPTION, motionStyleRefusals } from "./motion-styles.js";
|
|
13
|
-
import { LIVE_SHOT_FRAMINGS, LIVE_SHOT_KINDS, LIVE_SHOT_PRODUCT_PLACEMENTS, LIVE_SHOT_TRANSITIONS, liveShotCastKey, liveShotProductPlacement, liveShotSetupKey, MAX_SHOT_CAST } from "./live-shot-kinds.js";
|
|
14
|
+
import { LIVE_SHOT_FRAMINGS, LIVE_SHOT_KINDS, LIVE_SHOT_PRODUCT_PLACEMENTS, LIVE_SHOT_TRANSITIONS, liveShotCastKey, liveShotProductPlacement, liveShotSetupKey, MAX_SHOT_CAST, TALKING_ACTION_VOICE_OVER, talkingPose } from "./live-shot-kinds.js";
|
|
14
15
|
import { countWords } from "./pacing.js";
|
|
15
16
|
import { pauseTrim, VOICE_PACE_MAX, VOICE_PACE_MIN } from "./reference-voice.js";
|
|
16
17
|
import { AD_PAUSE_TRIM } from "./ad-pause-trim.js";
|
|
17
18
|
import { generationShot, negationIn, shotIssues } from "./generation-shot.js";
|
|
19
|
+
import { SCENE_DESCRIPTION, sceneBible, sceneDirectionMark, shotStart } from "./scene-bible.js";
|
|
20
|
+
import { proposeField, sceneProposal, sceneProposalAccept } from "./scene-proposal.js";
|
|
18
21
|
import { lexicalTokens, quoteOccurrences } from "./semantic-inserts.js";
|
|
19
22
|
import { frameCanvasOf, FULL_FRAME_TRANSITIONS, INSERT_FITS, INSERT_MOTIONS, INSERT_RETIMES, INSERT_STAGE_ENTRANCES, INSERT_TRANSITIONS, LAYER_ENTERS, LAYER_EXITS, layerRefusals, LAYOUT_WINDOW_KINDS, MAX_ENTER_OFFSET_S, MAX_LAYOUT_WINDOWS, MAX_OVERLAYS, OVERLAY_POSITIONS, PRESENTER_FRAMINGS, SPLIT_MEDIA_SHARE, SPLIT_MEDIA_SIDES } from "./ugc-layers.js";
|
|
20
23
|
import { FRAMING_SIZES, FRAMING_TRANSITIONS, framingRefusals, MAX_FRAMING } from "./ugc-framing.js";
|
|
@@ -193,9 +196,12 @@ function explainerOffer(ownAgent, sold) {
|
|
|
193
196
|
"off, passed as character_details; reuse one only when the user asks or the brand has its own. A delivered explainer keeps " +
|
|
194
197
|
"its hero as a mascot (list_assets with mascot true); its id as mascot_id gives the same hero again with no pose pictures made or charged.";
|
|
195
198
|
}
|
|
196
|
-
/** The
|
|
197
|
-
export const
|
|
198
|
-
|
|
199
|
+
/** The line a server that lists get_ad_guide adds after the make_ugc ad advice (#1539 P3). */
|
|
200
|
+
export const AD_GUIDE_INSTRUCTION = " Before you write an ad's devices and live shots, read get_ad_guide (free).";
|
|
201
|
+
/** The text for a server with the film tools listed or not; `explainer` is whether the API sells the format, this environment's flag when omitted; */
|
|
202
|
+
/** `adGuide` whether it lists get_ad_guide. */
|
|
203
|
+
export const mcpServerInstructions = ({ ownAgent, explainer, adGuide }) => serverInstructions(explainerOffer(ownAgent, explainer ?? EXPLAINER_SOLD), adGuide === true);
|
|
204
|
+
const serverInstructions = (offer, adGuide) => "Clipwright makes short presenter (UGC) videos, faceless narrated videos, single images and silent clips. It renders " +
|
|
199
205
|
"them on its servers and returns the MP4 or image file; it publishes nothing anywhere.\n\n" +
|
|
200
206
|
"tools/list says each tool and field in short. describe_tool answers a tool's full guidance, or one field's, free: read it " +
|
|
201
207
|
"before the first use of a tool or field, such as quote_ugc templates.\n\n" +
|
|
@@ -220,7 +226,11 @@ const serverInstructions = (offer) => "Clipwright makes short presenter (UGC) vi
|
|
|
220
226
|
"assets[].anchor or line_edits. 4. Only the revision the user accepted is approved " +
|
|
221
227
|
"with approve_workflow_plan, then quoted and run. For an ad made with make_ugc directly, pass pause_trim " +
|
|
222
228
|
"{sentence_end_s: 0.15, comma_s: 0.08} and offer a live shot of the actor on its hook (shots: acting, framed wide or full) with its price " +
|
|
223
|
-
|
|
229
|
+
`from quote_ugc.${adGuide ? AD_GUIDE_INSTRUCTION : ""} When a quote_ugc or quote_faceless answer carries a ready scene proposal, show the user its scene and each option with ` +
|
|
230
|
+
"its credits, say which ones would make the video better, and let the user pick; then pass proposal { id, accept } to make_ugc or " +
|
|
231
|
+
"make_faceless with the body unchanged. " +
|
|
232
|
+
"One still being written: quote again after the seconds it names. Its free additions need no ask; to keep your own scene, pass scene instead. " +
|
|
233
|
+
"plan_reference_remake adds live shots where the reference presenter moves; show them on the quote, and drop them if the " +
|
|
224
234
|
`user declines. If the user declines the brief, go on as asked.${offer}\n\n` +
|
|
225
235
|
"Compose the visuals from our catalogue, in a remake and in a direct video alike. Before you compile or quote, read list_moves " +
|
|
226
236
|
"and pick moves by meaning: one for the hook, one for each line of proof (a number, a list, a review) and one for the call to action. " +
|
|
@@ -235,7 +245,8 @@ const serverInstructions = (offer) => "Clipwright makes short presenter (UGC) vi
|
|
|
235
245
|
"a human face can present: make it an actor with create_actor from that picture. An animal or object mascot appears " +
|
|
236
246
|
"in inserts under the narration.\n\n" +
|
|
237
247
|
`Before a paid presenter video the user makes ${MUSIC_STOP ? "four" : "three"} choices. Presenter: show two or three actors from list_actors with ` +
|
|
238
|
-
"their previews, or the user's own actors.
|
|
248
|
+
"their previews, or the user's own actors. When the script speaks as a woman or a man, pick a matching actor from list_actors before " +
|
|
249
|
+
"quote_ugc: with none, the presenter is the default man. Voice: play the preview_url of two or three voices from list_voices, or " +
|
|
239
250
|
"give the links if the client cannot play them. Hook: write five to ten opening lines and let the user pick one to " +
|
|
240
251
|
`three.${MUSIC_STOP} Recommend one option at each stop, but do not pick for the user; skip a stop only when the user already ` +
|
|
241
252
|
"answered it or explicitly left the choice to you. If the user wants captions, recommend a style that reads on a " +
|
|
@@ -552,15 +563,18 @@ export const PRESENTER_GAZE_DESCRIPTION = "Where the presenter looks on these wo
|
|
|
552
563
|
/** The slim MCP gaze list: the server checks each item strictly. */
|
|
553
564
|
export const mcpPresenterGaze = z.array(z.record(z.string(), z.unknown())).min(1).max(MAX_PRESENTER_GAZE)
|
|
554
565
|
.describe(`[{ anchor: { quote }, cover_words?, gaze: camera|left|right }]. ${PRESENTER_GAZE_DESCRIPTION}`);
|
|
555
|
-
export { CAST_INSERT_ID, castSlotOf, LIVE_SHOT_FRAMINGS, LIVE_SHOT_KINDS, LIVE_SHOT_PRODUCT_PLACEMENTS, LIVE_SHOT_TRANSITIONS, liveShotCastKey, liveShotProductPlacement, liveShotSetupKey, MAX_SHOT_CAST } from "./live-shot-kinds.js";
|
|
566
|
+
export { CAST_INSERT_ID, castSlotOf, fetchedProductWarnings, fetchesProduct, liveShotFetchesProduct, LIVE_SHOT_FRAMINGS, LIVE_SHOT_KINDS, LIVE_SHOT_PRODUCT_PLACEMENTS, LIVE_SHOT_TRANSITIONS, liveShotCastKey, liveShotProductPlacement, liveShotSetupKey, lipsyncMotionMarked, lipsyncMotionShot, MAX_SHOT_CAST, omniShotIds, omniShotsMarked, productSheetMarked, TALKING_ACTION_VOICE_OVER, talkingActionVoiceOver, handsInsertShots, voiceOverShotWarnings, talkingPose } from "./live-shot-kinds.js";
|
|
556
567
|
/** The most presenter takes one video renders (#1192); a live shot is at least one of them. */
|
|
557
568
|
export const MAX_PRESENTER_TAKES = 16;
|
|
558
569
|
export const MAX_LIVE_SHOTS = MAX_PRESENTER_TAKES;
|
|
570
|
+
/** A shot drawn from a picture of its own place: every talking_action and action shot, and a talking shot with a pose (#1536). */
|
|
571
|
+
const drawnInSetup = (shot) => shot.kind !== "talking" || talkingPose(shot);
|
|
559
572
|
/** One setup still per setup (#1146): the acting shots drawn in one place name one product placement, or none, so the product never moves. */
|
|
560
|
-
|
|
573
|
+
/** A shot that names no product takes its setup's placement (`settleShotProducts`), so only named placements can disagree. */
|
|
574
|
+
function sameProductPerSetup(shots, talkingPoses) {
|
|
561
575
|
const placements = new Map();
|
|
562
576
|
for (const shot of shots) {
|
|
563
|
-
if (shot.kind
|
|
577
|
+
if (!(talkingPoses ? drawnInSetup(shot) : shot.kind !== "talking") || shot.product === undefined)
|
|
564
578
|
continue;
|
|
565
579
|
const setup = liveShotSetupKey(shot);
|
|
566
580
|
const placement = liveShotProductPlacement(shot) ?? "none";
|
|
@@ -570,6 +584,31 @@ function sameProductPerSetup(shots) {
|
|
|
570
584
|
}
|
|
571
585
|
return true;
|
|
572
586
|
}
|
|
587
|
+
/** Shots of one setup share one picture: a talking_action, action or posed talking shot that names no product takes the placement another */
|
|
588
|
+
/** shot of its setup names, and warnings[] names it (rule 3). Disagreeing placements are left to the schema's refusal. */
|
|
589
|
+
export function settleShotProducts(shots) {
|
|
590
|
+
const named = new Map();
|
|
591
|
+
for (const shot of shots) {
|
|
592
|
+
if (!drawnInSetup(shot) || shot.product === undefined)
|
|
593
|
+
continue;
|
|
594
|
+
const setup = liveShotSetupKey(shot);
|
|
595
|
+
if (!named.has(setup))
|
|
596
|
+
named.set(setup, { placement: liveShotProductPlacement(shot) ?? "none", from: shot.id });
|
|
597
|
+
}
|
|
598
|
+
const filled = new Map();
|
|
599
|
+
const settled = shots.map(shot => {
|
|
600
|
+
const source = !drawnInSetup(shot) || shot.product !== undefined ? undefined : named.get(liveShotSetupKey(shot));
|
|
601
|
+
if (source === undefined || source.placement === "none")
|
|
602
|
+
return shot;
|
|
603
|
+
const { placement } = source;
|
|
604
|
+
filled.set(source.from, { placement, ids: [...filled.get(source.from)?.ids ?? [], shot.id] });
|
|
605
|
+
return { ...shot, product: { placement } };
|
|
606
|
+
});
|
|
607
|
+
const warnings = [...filled].map(([from, { placement, ids }]) => `${ids.length === 1 ? "shot" : "shots"} ${ids.map(id => `"${id}"`).join(", ")}: ` +
|
|
608
|
+
`no product placement was given, so the product is shown ${placement === "hand" ? "in the actor's hand" : "beside the actor"} there, as in ` +
|
|
609
|
+
`shot "${from}" of the same setup; give a shot its own setup to show it otherwise`);
|
|
610
|
+
return { shots: settled, warnings };
|
|
611
|
+
}
|
|
573
612
|
/** Shots of one setup start from one picture, so the people in it are the same: one cast, or none, per setup (#1192). */
|
|
574
613
|
function sameCastPerSetup(shots) {
|
|
575
614
|
const casts = new Map();
|
|
@@ -583,6 +622,8 @@ function sameCastPerSetup(shots) {
|
|
|
583
622
|
}
|
|
584
623
|
return true;
|
|
585
624
|
}
|
|
625
|
+
/** The catalogue actor `actor_gender` picks without image or actor_id: each gender's first in list_actors. */
|
|
626
|
+
export const ACTOR_FOR_GENDER = { female: "actor_anna", male: "actor_alex" };
|
|
586
627
|
export const MAX_LIVE_SHOT_TEXT = 2000;
|
|
587
628
|
export const MAX_CAST_ROLE = 200;
|
|
588
629
|
/** A person beside the actor in a live shot (#1192): their picture, who they are, and what they do in this shot. */
|
|
@@ -591,7 +632,8 @@ export const ugcLiveShotCastMember = z.strictObject({
|
|
|
591
632
|
role: z.string().trim().min(1).max(MAX_CAST_ROLE).describe("Who they are in the scene, such as the customer or the friend."),
|
|
592
633
|
action: z.string().trim().min(1).max(MAX_LIVE_SHOT_TEXT).optional().describe("What they do in this shot; omitted, they stay in the scene."),
|
|
593
634
|
});
|
|
594
|
-
|
|
635
|
+
/** The live shot's fields. Their public texts stay as before the ad epic (#1539): it ships behind an account list until one switch at its end. */
|
|
636
|
+
const ugcLiveShotFields = {
|
|
595
637
|
id: insertId.describe("Unique across shots."),
|
|
596
638
|
kind: z.enum(LIVE_SHOT_KINDS).describe("talking: the actor speaks to the lens with natural gestures; talking_action: speaks the words while " +
|
|
597
639
|
"doing the action; action: does the action without speaking while the words play as voice-over."),
|
|
@@ -607,8 +649,9 @@ export const ugcLiveShot = z.strictObject({
|
|
|
607
649
|
"further back, the same face and pose; omitted keeps the actor view's framing."),
|
|
608
650
|
product: z.union([z.boolean(), z.strictObject({ placement: z.enum(LIVE_SHOT_PRODUCT_PLACEMENTS) })]).optional()
|
|
609
651
|
.describe("talking_action and action: the product image (product_asset_id) in the actor's hand or beside them; true is the hand. Shots of " +
|
|
610
|
-
"one setup show it in one place
|
|
611
|
-
"(create_actor with from_actor_id and holding)."),
|
|
652
|
+
"one setup show it in one place: a shot of the setup that names none takes the placement another names, with a warning. For the product in every presenter " +
|
|
653
|
+
"second, use an actor view holding it (create_actor with from_actor_id and holding)."),
|
|
654
|
+
start: shotStart.optional(),
|
|
612
655
|
cast: z.array(ugcLiveShotCastMember).min(1).max(MAX_SHOT_CAST)
|
|
613
656
|
.refine(cast => new Set(cast.map(person => person.asset_id)).size === cast.length, { message: "each cast picture appears once in a shot" })
|
|
614
657
|
.optional().describe(`talking_action and action: up to ${MAX_SHOT_CAST} more people in the shot, each from their own picture, with a role and ` +
|
|
@@ -618,8 +661,11 @@ export const ugcLiveShot = z.strictObject({
|
|
|
618
661
|
"template_sounds false keeps them silent. None at the video's own start or end."),
|
|
619
662
|
shot: generationShot.optional().describe("action only: the clip as a shot, second by second, in place of action alone; its beats run from 0 to " +
|
|
620
663
|
"the last beat's to_s and are stretched to the take's own length."),
|
|
621
|
-
}
|
|
664
|
+
};
|
|
665
|
+
/** A shot's own checks. Without talking poses (#1536) a talking shot refuses setup, start and product, in the order and words as before. */
|
|
666
|
+
const liveShotChecks = (talkingPoses) => (shot, context) => {
|
|
622
667
|
const custom = z.ZodIssueCode.custom;
|
|
668
|
+
const talkingOnly = !talkingPoses && shot.kind === "talking";
|
|
623
669
|
if (shot.kind !== "talking" && shot.action === undefined)
|
|
624
670
|
context.addIssue({ code: custom, path: ["action"], message: `${shot.kind} needs action` });
|
|
625
671
|
if (shot.shot !== undefined && shot.kind !== "action")
|
|
@@ -635,21 +681,26 @@ export const ugcLiveShot = z.strictObject({
|
|
|
635
681
|
context.addIssue({ code: custom, path: ["cast", at, "action"], message: `"${word}" describes what is absent; describe what is visible instead` });
|
|
636
682
|
});
|
|
637
683
|
}
|
|
638
|
-
if (
|
|
684
|
+
if (talkingOnly && shot.setup !== undefined)
|
|
639
685
|
context.addIssue({ code: custom, path: ["setup"], message: "setup works on talking_action and action shots" });
|
|
640
686
|
if (shot.kind === "talking" && shot.framing !== undefined)
|
|
641
687
|
context.addIssue({ code: custom, path: ["framing"], message: "framing works on talking_action and action shots" });
|
|
642
|
-
if (
|
|
688
|
+
if (talkingOnly && shot.start !== undefined)
|
|
689
|
+
context.addIssue({ code: custom, path: ["start"], message: "start works on talking_action and action shots" });
|
|
690
|
+
if (talkingOnly && shot.product !== undefined)
|
|
643
691
|
context.addIssue({ code: custom, path: ["product"], message: "a talking shot shows no product; use talking_action, or an actor view holding it (create_actor holding)" });
|
|
644
692
|
if (shot.kind === "talking" && shot.cast !== undefined)
|
|
645
693
|
context.addIssue({ code: custom, path: ["cast"], message: "a talking shot shows the actor alone; use talking_action or action for a cast" });
|
|
646
|
-
}
|
|
694
|
+
};
|
|
695
|
+
export const ugcLiveShot = z.strictObject(ugcLiveShotFields).superRefine(liveShotChecks(true));
|
|
696
|
+
/** The shot as accounts outside the ad epic's list send it (#1539): a talking shot has no pose. */
|
|
697
|
+
const ugcLiveShotWithoutPoses = z.strictObject(ugcLiveShotFields).superRefine(liveShotChecks(false));
|
|
647
698
|
export const LIVE_SHOTS_DESCRIPTION = "Live shots of the actor on some words of script: talking, talking_action (speaks while acting) or action " +
|
|
648
699
|
"(acts while the words play as voice-over). Shots may not overlap; words outside them are the presenter's usual take. Needs a 9:16 frame " +
|
|
649
700
|
"and long-form qualification on the server; each kind has its own presenter-second price in list_prices.";
|
|
650
701
|
/** The slim MCP shot list: the server checks each item strictly. */
|
|
651
702
|
export const mcpLiveShots = z.array(z.record(z.string(), z.unknown())).min(1).max(MAX_LIVE_SHOTS)
|
|
652
|
-
.describe(`[{ id, kind: talking|talking_action|action, anchor: { quote }, cover_words?, action?, setup?, framing?: wide|full, product?: { placement: hand|beside }, cast?: [{ asset_id, role, action? }], transition?: cut|flash|light_leak|whoosh, shot?: as generate_video shot (action only) }]. ${LIVE_SHOTS_DESCRIPTION}`);
|
|
703
|
+
.describe(`[{ id, kind: talking|talking_action|action, anchor: { quote }, cover_words?, action?, setup?, framing?: wide|full, product?: { placement: hand|beside }, start?, cast?: [{ asset_id, role, action? }], transition?: cut|flash|light_leak|whoosh, shot?: as generate_video shot (action only) }]. ${LIVE_SHOTS_DESCRIPTION}`);
|
|
653
704
|
/** What admission pins for an `asset_id` insert; the run reads this key and checks this hash, never the asset row.
|
|
654
705
|
* Server-only: it lives at the top of the stored input, and a public body naming it is refused as an unknown field. */
|
|
655
706
|
export const pinnedInsertAsset = z.object({
|
|
@@ -677,6 +728,15 @@ export const MAX_SEGMENTS = 20;
|
|
|
677
728
|
export const MAX_INSERTS = Math.floor((RESOLVED_TIMELINE_MAX_SLOTS - 1) / 2);
|
|
678
729
|
export const MAX_NARRATED_ACTOR_SHOTS = MAX_PRESENTER_TAKES;
|
|
679
730
|
export const actorId = z.string().regex(/^actor_[a-z0-9][a-z0-9_-]{0,63}$/);
|
|
731
|
+
/** The shots field; without talking poses (#1536) its product check and words are as before them. */
|
|
732
|
+
const liveShotsField = (shot, talkingPoses) => z.array(shot).min(1).max(MAX_LIVE_SHOTS)
|
|
733
|
+
.refine(shots => new Set(shots.map(one => one.id)).size === shots.length, { message: "shot IDs must be unique" })
|
|
734
|
+
.refine(shots => sameProductPerSetup(shots, talkingPoses), { message: `${talkingPoses ? "talking_action, action and posed talking shots"
|
|
735
|
+
: "talking_action and action shots"} of one setup share one picture, so they show the product ` +
|
|
736
|
+
"the same way: name one product placement for them (a shot that names none takes it), or give them different setups" })
|
|
737
|
+
.refine(shots => sameCastPerSetup(shots), { message: "talking_action and action shots of one setup share one picture, so they show the same " +
|
|
738
|
+
"people: give them the same cast (asset_id and role, in one order) or none, or give them different setups" })
|
|
739
|
+
.optional().describe(LIVE_SHOTS_DESCRIPTION);
|
|
680
740
|
export const makeUgcInputShape = {
|
|
681
741
|
// Exactly one of `script | segments` must be present, enforced by `.refine` below;
|
|
682
742
|
// JSON Schema cannot express that via `required[]`, so the description says it.
|
|
@@ -721,14 +781,11 @@ export const makeUgcInputShape = {
|
|
|
721
781
|
"the presenter answers the rest on screen and holds still while the off-screen speaker talks. Needs script and long-form " +
|
|
722
782
|
"qualification on the server; the presenter's held frames add production seconds, not presenter seconds."),
|
|
723
783
|
presenter_gaze: z.array(ugcPresenterGaze).min(1).max(MAX_PRESENTER_GAZE).optional().describe(PRESENTER_GAZE_DESCRIPTION),
|
|
724
|
-
shots:
|
|
725
|
-
.refine(shots => new Set(shots.map(shot => shot.id)).size === shots.length, { message: "shot IDs must be unique" })
|
|
726
|
-
.refine(shots => sameProductPerSetup(shots), { message: "talking_action and action shots of one setup share one picture, so they show the product " +
|
|
727
|
-
"the same way: give them one product placement (or none), or give them different setups" })
|
|
728
|
-
.refine(shots => sameCastPerSetup(shots), { message: "talking_action and action shots of one setup share one picture, so they show the same " +
|
|
729
|
-
"people: give them the same cast (asset_id and role, in one order) or none, or give them different setups" })
|
|
730
|
-
.optional().describe(LIVE_SHOTS_DESCRIPTION),
|
|
784
|
+
shots: liveShotsField(ugcLiveShot, true),
|
|
731
785
|
product_asset_id: assetId.optional().describe("The product image (ast_…) that shots with product show."),
|
|
786
|
+
scene: sceneBible.optional().describe(SCENE_DESCRIPTION),
|
|
787
|
+
proposal: sceneProposalAccept.optional(),
|
|
788
|
+
propose: proposeField,
|
|
732
789
|
person: z.string().min(1).max(2000).optional(),
|
|
733
790
|
actor_id: actorId
|
|
734
791
|
.optional()
|
|
@@ -754,10 +811,11 @@ export const makeUgcInputShape = {
|
|
|
754
811
|
actor_gender: z
|
|
755
812
|
.enum(["female", "male"])
|
|
756
813
|
.optional()
|
|
757
|
-
.describe(
|
|
814
|
+
.describe(`female | male. Without image: picks that gender's catalogue actor (female: ${ACTOR_FOR_GENDER.female}, male: ${ACTOR_FOR_GENDER.male}) as if ` +
|
|
815
|
+
"actor_id were passed, named in warnings[]; list_actors offers others. With image: the gender of the face in it, picking the default voice of that " +
|
|
758
816
|
`gender (female: sarah, male: george; on ${GOOGLE_TTS_MODEL}: ${MODEL_DEFAULT_VOICE_BY_GENDER.female} and ` +
|
|
759
|
-
`${MODEL_DEFAULT_VOICE_BY_GENDER.male}). Refused with actor_id (its gender is known) and
|
|
760
|
-
"
|
|
817
|
+
`${MODEL_DEFAULT_VOICE_BY_GENDER.male}). Refused with actor_id (its gender is known) and with person. ` +
|
|
818
|
+
"An explicit voice or voice_id wins over the voice it picks, with a warning."),
|
|
761
819
|
character: z.string().regex(/^char_[a-zA-Z0-9]+$/).optional(),
|
|
762
820
|
name: z.string().max(100).optional(),
|
|
763
821
|
broll_url: z.string().url().max(MAX_URL_LENGTH).optional(),
|
|
@@ -801,7 +859,7 @@ export const makeUgcInputShape = {
|
|
|
801
859
|
.optional()
|
|
802
860
|
.describe(`Voice name from list_voices. Curated presets: ${VOICE_PRESET_NAMES.join(" | ")}. ` +
|
|
803
861
|
"The API refuses a name list_voices does not return, before any charge. Omitted means the default voice for the actor's gender: the " +
|
|
804
|
-
"gender of actor_id
|
|
862
|
+
"gender of actor_id or actor_gender, or george for the default actor and for image " +
|
|
805
863
|
"without actor_gender. " +
|
|
806
864
|
`${MODEL_VOICE_MODEL} speaks only its own voices (kind model_voice in list_voices, such as ` +
|
|
807
865
|
`${MODEL_DEFAULT_VOICE_BY_GENDER.female}): naming one selects that model, and a voice is refused with a ` +
|
|
@@ -850,14 +908,15 @@ export const makeUgcInputShape = {
|
|
|
850
908
|
/** How to fill a frame the clip does not cover. No `.default()`: absence means no layout */
|
|
851
909
|
/** is needed. `contain` fits whole, `white` pads white, `blur` fills with the blurred frame. */
|
|
852
910
|
background: z.enum(["white", "blur", "contain"]).optional(),
|
|
911
|
+
max_credits: maxCreditsField,
|
|
853
912
|
};
|
|
854
913
|
/** Agent retry parameter: the attempt NUMBER. Kept apart from `makeUgcInputShape` because it */
|
|
855
914
|
/** is a skill input (the `:N` idempotency-key suffix in the SDK), not a render parameter. */
|
|
856
915
|
export const agentRetryShape = { attempt: z.number().int().min(1).optional() };
|
|
857
916
|
// Shared REST/MCP/SDK schema: actor_id, person and image are mutually exclusive.
|
|
858
917
|
// The registry rejects character; person is accepted with a warning.
|
|
859
|
-
|
|
860
|
-
.object(
|
|
918
|
+
const refinedUgcInput = (shape) => z
|
|
919
|
+
.object(shape)
|
|
861
920
|
// Exactly one of script | segments: with neither there is nothing to render; with
|
|
862
921
|
// both, silently picking one would be a silent substitution.
|
|
863
922
|
.refine((v) => (v.script === undefined) !== (v.segments === undefined), {
|
|
@@ -980,9 +1039,9 @@ export const makeUgcInput = z
|
|
|
980
1039
|
path: ["actor_gender"],
|
|
981
1040
|
message: "actor_gender cannot be combined with actor_id: the saved actor's gender is already known; omit actor_gender",
|
|
982
1041
|
})
|
|
983
|
-
.refine((v) => v.actor_gender === undefined || v.
|
|
1042
|
+
.refine((v) => v.actor_gender === undefined || v.person === undefined, {
|
|
984
1043
|
path: ["actor_gender"],
|
|
985
|
-
message: "actor_gender
|
|
1044
|
+
message: "actor_gender is not combined with person: omit person, and actor_gender alone picks a list_actors actor of that gender",
|
|
986
1045
|
})
|
|
987
1046
|
// List-wide limits and per-role required fields are checked here.
|
|
988
1047
|
// Image type, duration and motion are checked by ugcSegment.
|
|
@@ -1008,6 +1067,9 @@ export const makeUgcInput = z
|
|
|
1008
1067
|
.refine((v) => v.segments !== undefined || countWords(v.script ?? "") >= 1, {
|
|
1009
1068
|
message: "script has 0 speakable words",
|
|
1010
1069
|
});
|
|
1070
|
+
export const makeUgcInput = refinedUgcInput(makeUgcInputShape);
|
|
1071
|
+
/** make_ugc for an account outside the ad epic's list (#1539): talking shots without poses (#1536), refused in the words they were before. */
|
|
1072
|
+
export const makeUgcInputWithoutTalkingPoses = refinedUgcInput({ ...makeUgcInputShape, shots: liveShotsField(ugcLiveShotWithoutPoses, false) });
|
|
1011
1073
|
/** Why the run's model refuses the text: the cap on the whole of it, then each spoken unit */
|
|
1012
1074
|
/** left with no words. The model is read from the joined text, as the run reads it. */
|
|
1013
1075
|
function speechTextRefusal(input) {
|
|
@@ -1066,8 +1128,8 @@ export function speechModelRefusals(input) {
|
|
|
1066
1128
|
}
|
|
1067
1129
|
/** API input: the server's `voiceRefusal` checks the voice name and `voiceIdRefusal` a raw id. The catalog is not */
|
|
1068
1130
|
/** imported here, since clients read this barrel; the server uses `@clipwright/core/voice-admission`. */
|
|
1069
|
-
export function serverUgcInputWith(voiceRefusal, voiceIdRefusal = () => undefined) {
|
|
1070
|
-
return
|
|
1131
|
+
export function serverUgcInputWith(voiceRefusal, voiceIdRefusal = () => undefined, base = makeUgcInput) {
|
|
1132
|
+
return base
|
|
1071
1133
|
.refine((v) => v.voice === undefined || voiceRefusal(v.voice) === undefined, {
|
|
1072
1134
|
path: ["voice"],
|
|
1073
1135
|
error: (issue) => voiceRefusal(issue.input.voice),
|
|
@@ -1115,6 +1177,16 @@ export const storedUgcInput = z.object({
|
|
|
1115
1177
|
design_source: z.literal("brand_kit").optional(),
|
|
1116
1178
|
/** Set when `pause_trim` is the ad-style default pinned at admission, not the call's own (#1136). */
|
|
1117
1179
|
pause_trim_source: z.literal("ad_default").optional(),
|
|
1180
|
+
/** Set when admission froze the scene director for the run's live shots (#1491). */
|
|
1181
|
+
scene_direction: sceneDirectionMark.optional(),
|
|
1182
|
+
/** Set when the run's talking_action shots follow the hands-insert rule (#1521); absent, they all speak as admitted before. */
|
|
1183
|
+
talking_action_take: z.literal(TALKING_ACTION_VOICE_OVER).optional(),
|
|
1184
|
+
/** Set when the run's edited first frames take the product from one product sheet (#1536 S2); absent, they take the photo. */
|
|
1185
|
+
product_sheet: z.literal(true).optional(),
|
|
1186
|
+
/** Set when the run's posed talking and talking_action takes lip-sync from their first frame with a motion prompt (#1543). */
|
|
1187
|
+
lipsync_motion: z.literal(true).optional(),
|
|
1188
|
+
/** Set when the run's action shots and hands inserts are drawn on Gemini Omni 1.2 and priced at its second (#1535). */
|
|
1189
|
+
omni_shots: z.literal(true).optional(),
|
|
1118
1190
|
});
|
|
1119
1191
|
/** Whether a run takes the narrated long-form path: one script with inserts, overlays, layout windows, framing, a call, an interview or gaze. */
|
|
1120
1192
|
export function isNarratedUgcInput(input) {
|
|
@@ -1195,5 +1267,7 @@ export const quoteResponse = z.object({
|
|
|
1195
1267
|
tts_model: z.string().min(1),
|
|
1196
1268
|
/** The design DNA the run draws in and where it came from (#1122); absent when the run names none and the account saved no kit. */
|
|
1197
1269
|
design: resolvedDesign.extend({ source: z.enum(["request", "brand_kit"]) }).optional(),
|
|
1270
|
+
/** The scene the quote proposes and its options with their prices (#1491); absent where the quote proposes none. */
|
|
1271
|
+
scene_proposal: sceneProposal.optional(),
|
|
1198
1272
|
});
|
|
1199
1273
|
//# sourceMappingURL=skills.js.map
|