@clipwright/core 0.72.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/ad-guide.js +3 -2
- package/dist/ads.js +2 -3
- package/dist/api-failure.d.ts +1 -4
- package/dist/api-failure.js +6 -16
- package/dist/assets.d.ts +6 -0
- package/dist/billing-terms.d.ts +12 -0
- package/dist/contract-dispositions.d.ts +23 -19
- package/dist/contract-dispositions.js +16 -72
- package/dist/contracts/v1/workflow-brief.d.ts +10 -0
- package/dist/contracts/v1/workflow-catalog.d.ts +10 -0
- package/dist/contracts/v1/workflow-client.d.ts +5 -0
- package/dist/contracts/v1/workflow-execution.d.ts +16 -0
- package/dist/contracts/v1/workflow-plan.d.ts +15 -0
- package/dist/contracts/v1/workflow-run-read.d.ts +11 -0
- package/dist/cuts.js +2 -2
- package/dist/edit-music.js +5 -5
- package/dist/endpoint-notes.js +2 -0
- package/dist/endpoints.js +3 -0
- package/dist/errors.d.ts +2 -29
- package/dist/errors.js +2 -13
- package/dist/face-billing.d.ts +11 -1
- package/dist/face-billing.js +5 -2
- package/dist/faceless-price.d.ts +0 -4
- package/dist/faceless-price.js +0 -4
- package/dist/faceless-public.d.ts +29 -3
- package/dist/faceless-public.js +12 -33
- package/dist/film-cut.d.ts +0 -4
- package/dist/film-cut.js +2 -4
- package/dist/film-drafts.d.ts +11 -0
- package/dist/film-drafts.js +8 -0
- package/dist/film-guide.d.ts +10 -49
- package/dist/film-guide.js +37 -3
- package/dist/generations-output.d.ts +5 -0
- package/dist/generations-output.js +2 -0
- package/dist/generations.d.ts +25 -0
- package/dist/generations.js +3 -1
- package/dist/idempotency.d.ts +1 -0
- package/dist/idempotency.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/mascots.d.ts +110 -1
- package/dist/mascots.js +38 -1
- package/dist/mcp-ugc-descriptions.d.ts +1 -1
- package/dist/mcp-ugc-descriptions.js +1 -1
- package/dist/music.d.ts +1 -2
- package/dist/music.js +1 -4
- package/dist/openapi.js +13 -8
- package/dist/own-agent-price.d.ts +18 -4
- package/dist/own-agent-price.js +37 -9
- package/dist/own-agent-runs.d.ts +77 -23
- package/dist/own-agent-runs.js +26 -12
- package/dist/parts-pricing.d.ts +14 -5
- package/dist/parts-pricing.js +27 -14
- package/dist/presenter-engine.d.ts +16 -0
- package/dist/presenter-engine.js +32 -0
- package/dist/presenter-matte.d.ts +0 -2
- package/dist/presenter-matte.js +0 -4
- package/dist/prices.d.ts +10 -6
- package/dist/prices.js +76 -32
- package/dist/reference-analysis.d.ts +47 -0
- package/dist/reference-analysis.js +7 -0
- package/dist/reference-display.js +3 -0
- package/dist/reference-film-kit.d.ts +43 -0
- package/dist/reference-film-kit.js +22 -0
- package/dist/render-backend.d.ts +1 -0
- package/dist/runs.d.ts +12 -0
- 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/skill-theme-explainer.js +3 -1
- package/dist/skill-theme.js +5 -0
- package/dist/skills.d.ts +58 -1
- package/dist/skills.js +70 -36
- 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/dist/upscale.d.ts +120 -0
- package/dist/upscale.js +116 -0
- package/dist/voice-admission.d.ts +14 -0
- package/dist/voice-admission.js +9 -0
- package/dist/voice-listing.js +1 -1
- package/dist/voices.d.ts +1 -0
- package/dist/workflows/methods/faceless-explainer.d.ts +2 -0
- package/dist/workflows/methods/kinetic-launch.d.ts +4 -0
- package/dist/workflows/methods/product-image-story.d.ts +2 -0
- package/dist/workflows/methods/reference-remake.d.ts +2 -0
- package/dist/workflows/methods/shared.d.ts +2 -0
- package/dist/workflows/methods/ugc-faq-answer.d.ts +2 -0
- package/dist/workflows/methods/ugc-product-intro.d.ts +2 -0
- package/dist/workflows/methods/website-proof-demo.d.ts +4 -0
- package/package.json +1 -1
package/dist/music.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { PartsLine } from "./parts-pricing.js";
|
|
3
3
|
export declare const MUSIC_BED_CREDITS = 60;
|
|
4
|
+
export declare const FILM_MUSIC_BED_CREDITS = 20;
|
|
4
5
|
export declare const MUSIC_MOOD_MAX_CHARS = 400;
|
|
5
6
|
export declare const MUSIC_DESCRIPTION: string;
|
|
6
7
|
export declare const ONE_LINE_TEXT: RegExp;
|
|
@@ -9,6 +10,4 @@ export declare const musicRequest: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.
|
|
|
9
10
|
}, z.core.$strict>]>;
|
|
10
11
|
export type MusicRequest = z.infer<typeof musicRequest>;
|
|
11
12
|
export declare function musicLine(credits?: number): PartsLine;
|
|
12
|
-
export declare function isMusicEnabled(env?: Record<string, string | undefined>): boolean;
|
|
13
|
-
export declare const MUSIC_DISABLED_MESSAGE = "music is not available right now; omit it";
|
|
14
13
|
export declare function musicNotAddedWarning(reason: string): string;
|
package/dist/music.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export const MUSIC_BED_CREDITS = 60;
|
|
3
|
+
export const FILM_MUSIC_BED_CREDITS = 20;
|
|
3
4
|
export const MUSIC_MOOD_MAX_CHARS = 400;
|
|
4
5
|
export const MUSIC_DESCRIPTION = "Background music under the voice, made for this video by AI; it may carry an invisible watermark; off unless " +
|
|
5
6
|
'you ask. "auto" takes the mood from the ' +
|
|
@@ -15,10 +16,6 @@ export const musicRequest = z.union([
|
|
|
15
16
|
export function musicLine(credits = MUSIC_BED_CREDITS) {
|
|
16
17
|
return { label: "music", unit: "track", quantity: 1, unit_credits: credits, credits };
|
|
17
18
|
}
|
|
18
|
-
export function isMusicEnabled(env = typeof process === "undefined" ? {} : process.env) {
|
|
19
|
-
return env.CLIPWRIGHT_MUSIC === "1";
|
|
20
|
-
}
|
|
21
|
-
export const MUSIC_DISABLED_MESSAGE = "music is not available right now; omit it";
|
|
22
19
|
export function musicNotAddedWarning(reason) {
|
|
23
20
|
return `music was not added: ${reason}; it was not charged`;
|
|
24
21
|
}
|
package/dist/openapi.js
CHANGED
|
@@ -25,6 +25,7 @@ import { API_ENDPOINTS, endpointLabel } from "./endpoints.js";
|
|
|
25
25
|
import { facelessQuoteResponse } from "./faceless-public.js";
|
|
26
26
|
import { feedbackRequest, feedbackResponse } from "./feedback.js";
|
|
27
27
|
import { generateImageRequest, generateVideoRequest, generationModels, generationQuote } from "./generations.js";
|
|
28
|
+
import { upscaleQuote, upscaleRequest } from "./upscale.js";
|
|
28
29
|
import { pricesResponse } from "./prices.js";
|
|
29
30
|
import { PUBLIC_API_BASE_URL, PUBLIC_APP_BASE_URL } from "./public-endpoints.js";
|
|
30
31
|
import { healthResponse, publicSkillsResponse } from "./public-responses.js";
|
|
@@ -175,14 +176,14 @@ export const OPENAPI_ROUTES = {
|
|
|
175
176
|
"POST /v1/take-checks/quote": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
176
177
|
"POST /v1/take-checks": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
177
178
|
"GET /v1/film-runs/{id}": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
178
|
-
"POST /v1/film-cuts/check": { exposure: "excluded", reason: "
|
|
179
|
-
"POST /v1/film-cuts/quote": { exposure: "excluded", reason: "
|
|
180
|
-
"POST /v1/film-cuts": { exposure: "excluded", reason: "
|
|
181
|
-
"POST /v1/cut-previews/quote": { exposure: "excluded", reason: "
|
|
182
|
-
"POST /v1/cut-previews": { exposure: "excluded", reason: "
|
|
183
|
-
"POST /v1/cuts": { exposure: "excluded", reason: "
|
|
184
|
-
"POST /v1/cuts/{id}": { exposure: "excluded", reason: "
|
|
185
|
-
"GET /v1/cuts/{id}": { exposure: "excluded", reason: "
|
|
179
|
+
"POST /v1/film-cuts/check": { exposure: "excluded", reason: "Offered through MCP (check_cut)." },
|
|
180
|
+
"POST /v1/film-cuts/quote": { exposure: "excluded", reason: "Offered through MCP (quote_cut, render_cut)." },
|
|
181
|
+
"POST /v1/film-cuts": { exposure: "excluded", reason: "Offered through MCP (quote_cut, render_cut)." },
|
|
182
|
+
"POST /v1/cut-previews/quote": { exposure: "excluded", reason: "Offered through MCP (quote_cut_preview, preview_cut)." },
|
|
183
|
+
"POST /v1/cut-previews": { exposure: "excluded", reason: "Offered through MCP (quote_cut_preview, preview_cut)." },
|
|
184
|
+
"POST /v1/cuts": { exposure: "excluded", reason: "Offered through MCP (create_cut, get_cut, update_cut)." },
|
|
185
|
+
"POST /v1/cuts/{id}": { exposure: "excluded", reason: "Offered through MCP (create_cut, get_cut, update_cut)." },
|
|
186
|
+
"GET /v1/cuts/{id}": { exposure: "excluded", reason: "Offered through MCP (create_cut, get_cut, update_cut)." },
|
|
186
187
|
"GET /v1/film-guide": { exposure: "excluded", reason: "Not offered yet: the film guide joins the contract when its mode launches (#1356)." },
|
|
187
188
|
"GET /v1/film-kit": { exposure: "excluded", reason: "Not offered yet: the film kit joins the contract when its mode launches (#1356)." },
|
|
188
189
|
"GET /v1/ad-guide": { exposure: "excluded", reason: "Not offered yet: the ad guide joins the contract when it opens to every account (#1539)." },
|
|
@@ -220,6 +221,10 @@ export const OPENAPI_ROUTES = {
|
|
|
220
221
|
body: named("GenerateVideoRequest", generateVideoRequest), responses: { 200: named("GenerationQuote", generationQuote) } },
|
|
221
222
|
"POST /v1/skills/generate_video/run": { exposure: "public", operationId: "generateVideo", tag: "Skills",
|
|
222
223
|
body: named("GenerateVideoRequest", generateVideoRequest), responses: { 202: Run, 200: Run } },
|
|
224
|
+
"POST /v1/skills/upscale/quote": { exposure: "public", operationId: "quoteUpscale", tag: "Skills",
|
|
225
|
+
body: named("UpscaleRequest", upscaleRequest), responses: { 200: named("UpscaleQuote", upscaleQuote) } },
|
|
226
|
+
"POST /v1/skills/upscale/run": { exposure: "public", operationId: "upscale", tag: "Skills",
|
|
227
|
+
body: named("UpscaleRequest", upscaleRequest), responses: { 202: Run, 200: Run } },
|
|
223
228
|
"POST /v1/reference-analyses/quote": { exposure: "public", operationId: "quoteAnalysis", tag: "Reference analysis",
|
|
224
229
|
body: named("AnalyzeReferenceRequest", analyzeReferenceRequest), responses: { 200: named("AnalysisQuote", analysisQuoteResponse) } },
|
|
225
230
|
"POST /v1/reference-analyses": { exposure: "public", operationId: "analyzeReference", tag: "Reference analysis",
|
|
@@ -10,6 +10,11 @@ export declare const OWN_VOICE_CREDITS_PER_SECOND = 2;
|
|
|
10
10
|
export declare const OWN_STILLS_MAX_PER_CALL = 24, OWN_FILM_MAX_SECONDS = 120, OWN_VOICE_MAX_SECONDS = 120;
|
|
11
11
|
export declare const OWN_STILLS_SINGLE_MAX = 8;
|
|
12
12
|
export declare const OWN_HERO_POSE_CREDITS = 9, OWN_HERO_POSES = 9;
|
|
13
|
+
export declare const OWN_HERO_HEAD_CREDITS = 120;
|
|
14
|
+
export declare const OWN_HEAD_FAILED_PER_DAY = 3;
|
|
15
|
+
export declare const OWN_HERO_SPRITE_CREDITS = 8;
|
|
16
|
+
export declare const OWN_HERO_TALKING_POSES: readonly ["neutral", "palm", "point", "up"];
|
|
17
|
+
export declare const OWN_HERO_MAX_SPRITES: number;
|
|
13
18
|
export declare const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
14
19
|
export declare const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
15
20
|
export declare const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
@@ -18,6 +23,8 @@ export declare const HERO_RUNS_PER_HOUR = 10;
|
|
|
18
23
|
export declare const OWN_HERO_FREE_POSES_PER_DAY = 27;
|
|
19
24
|
export declare const OWN_HERO_FREE_POSES_WINDOW_HOURS = 24;
|
|
20
25
|
export declare const CUT_PREVIEWS_PER_HOUR = 20;
|
|
26
|
+
export declare const CUTS_IN_FLIGHT_PER_ACCOUNT = 4;
|
|
27
|
+
export declare const CUT_BUSY_RETRY_SECONDS = 120;
|
|
21
28
|
export declare const OWN_TAKE_CHECK_CREDITS = 10;
|
|
22
29
|
export declare const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
23
30
|
export declare const OWN_TAKE_CHECK_PICTURE_LONG_CREDITS = 38, TAKE_PICTURE_SHORT_TIER_SECONDS = 4.1;
|
|
@@ -45,8 +52,11 @@ export declare const ownAgentTerms: z.ZodObject<{
|
|
|
45
52
|
extra_second_credits: z.ZodNumber;
|
|
46
53
|
voice_credits_per_second: z.ZodNumber;
|
|
47
54
|
pose_credits: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
head_credits: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
sprite_credits: z.ZodOptional<z.ZodNumber>;
|
|
48
57
|
edit_credits: z.ZodOptional<z.ZodNumber>;
|
|
49
58
|
music_credits: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
film_music_credits: z.ZodOptional<z.ZodNumber>;
|
|
50
60
|
take_check_credits: z.ZodOptional<z.ZodNumber>;
|
|
51
61
|
picture_check_credits: z.ZodOptional<z.ZodNumber>;
|
|
52
62
|
picture_check_long_credits: z.ZodOptional<z.ZodNumber>;
|
|
@@ -60,12 +70,13 @@ export declare const ownAgentTerms: z.ZodObject<{
|
|
|
60
70
|
free_stills_window_hours: z.ZodOptional<z.ZodNumber>;
|
|
61
71
|
}, z.core.$strict>;
|
|
62
72
|
export type OwnAgentTerms = z.infer<typeof ownAgentTerms>;
|
|
63
|
-
export declare const ownAgentTermsNow: (
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
export declare const ownAgentTermsNow: (options?: {
|
|
74
|
+
sprites?: boolean;
|
|
75
|
+
}) => OwnAgentTerms;
|
|
76
|
+
export declare function ownFilmRenderCredits(s: number, terms?: OwnAgentTerms, music?: boolean): number;
|
|
66
77
|
export declare const ownVoiceCredits: (s: number, terms?: OwnAgentTerms) => number;
|
|
67
78
|
export declare function ownStillsCredits(n: number, terms?: OwnAgentTerms, free?: number): number;
|
|
68
|
-
export declare function ownHeroCredits(n: number, terms?: OwnAgentTerms): number;
|
|
79
|
+
export declare function ownHeroCredits(n: number, terms?: OwnAgentTerms, sprites?: number, head?: boolean): number;
|
|
69
80
|
export declare function ownEditCredits(s: number, terms?: OwnAgentTerms, music?: boolean): number;
|
|
70
81
|
export type OwnAgentDelivery = {
|
|
71
82
|
skill: "film_stills";
|
|
@@ -81,9 +92,12 @@ export type OwnAgentDelivery = {
|
|
|
81
92
|
} | {
|
|
82
93
|
skill: "film_render";
|
|
83
94
|
seconds: number;
|
|
95
|
+
music?: boolean;
|
|
84
96
|
} | {
|
|
85
97
|
skill: "film_hero";
|
|
86
98
|
poses: number;
|
|
99
|
+
sprites?: number;
|
|
100
|
+
head?: boolean;
|
|
87
101
|
} | {
|
|
88
102
|
skill: "film_edit";
|
|
89
103
|
seconds: number;
|
package/dist/own-agent-price.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FACELESS_EXPLAINER_POSE_PICTURES } from "./faceless-price.js";
|
|
3
|
-
import { MUSIC_BED_CREDITS } from "./music.js";
|
|
3
|
+
import { FILM_MUSIC_BED_CREDITS, MUSIC_BED_CREDITS } from "./music.js";
|
|
4
4
|
export const OWN_AGENT_TARIFF = "own-agent-v2";
|
|
5
5
|
export const OWN_AGENT_TARIFF_V1 = "own-agent-v1";
|
|
6
6
|
export const OWN_AGENT_SKILLS = ["film_stills", "film_voice", "film_render", "film_hero", "film_edit", "film_take_frames", "film_take_check",
|
|
@@ -12,6 +12,11 @@ export const OWN_VOICE_CREDITS_PER_SECOND = 2;
|
|
|
12
12
|
export const OWN_STILLS_MAX_PER_CALL = 24, OWN_FILM_MAX_SECONDS = 120, OWN_VOICE_MAX_SECONDS = 120;
|
|
13
13
|
export const OWN_STILLS_SINGLE_MAX = 8;
|
|
14
14
|
export const OWN_HERO_POSE_CREDITS = 9, OWN_HERO_POSES = FACELESS_EXPLAINER_POSE_PICTURES;
|
|
15
|
+
export const OWN_HERO_HEAD_CREDITS = 120;
|
|
16
|
+
export const OWN_HEAD_FAILED_PER_DAY = 3;
|
|
17
|
+
export const OWN_HERO_SPRITE_CREDITS = 8;
|
|
18
|
+
export const OWN_HERO_TALKING_POSES = ["neutral", "palm", "point", "up"];
|
|
19
|
+
export const OWN_HERO_MAX_SPRITES = OWN_HERO_TALKING_POSES.length * 3;
|
|
15
20
|
export const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
16
21
|
export const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
17
22
|
export const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
@@ -20,6 +25,8 @@ export const HERO_RUNS_PER_HOUR = 10;
|
|
|
20
25
|
export const OWN_HERO_FREE_POSES_PER_DAY = 27;
|
|
21
26
|
export const OWN_HERO_FREE_POSES_WINDOW_HOURS = 24;
|
|
22
27
|
export const CUT_PREVIEWS_PER_HOUR = 20;
|
|
28
|
+
export const CUTS_IN_FLIGHT_PER_ACCOUNT = 4;
|
|
29
|
+
export const CUT_BUSY_RETRY_SECONDS = 120;
|
|
23
30
|
export const OWN_TAKE_CHECK_CREDITS = 10;
|
|
24
31
|
export const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
25
32
|
export const OWN_TAKE_CHECK_PICTURE_LONG_CREDITS = 38, TAKE_PICTURE_SHORT_TIER_SECONDS = 4.1;
|
|
@@ -39,8 +46,11 @@ export const ownAgentTerms = z.strictObject({
|
|
|
39
46
|
extra_second_credits: z.number().int().nonnegative(),
|
|
40
47
|
voice_credits_per_second: z.number().int().nonnegative(),
|
|
41
48
|
pose_credits: z.number().int().nonnegative().optional(),
|
|
49
|
+
head_credits: z.number().int().nonnegative().optional(),
|
|
50
|
+
sprite_credits: z.number().int().nonnegative().optional(),
|
|
42
51
|
edit_credits: z.number().int().nonnegative().optional(),
|
|
43
52
|
music_credits: z.number().int().nonnegative().optional(),
|
|
53
|
+
film_music_credits: z.number().int().nonnegative().optional(),
|
|
44
54
|
take_check_credits: z.number().int().nonnegative().optional(),
|
|
45
55
|
picture_check_credits: z.number().int().nonnegative().optional(),
|
|
46
56
|
picture_check_long_credits: z.number().int().nonnegative().optional(),
|
|
@@ -56,13 +66,15 @@ export const ownAgentTerms = z.strictObject({
|
|
|
56
66
|
.refine(t => new Set(CUT_TERMS.map(key => t[key] === undefined)).size === 1, "a cut's prices come all together or not at all");
|
|
57
67
|
const CUT_TERMS = ["cut_credits", "cut_included_seconds", "cut_extra_second_credits", "cut_bed_credits", "cut_take_sound_credits_per_second",
|
|
58
68
|
"cut_music_credits"];
|
|
59
|
-
export const ownAgentTermsNow = () => ({ tariff: OWN_AGENT_TARIFF, still_credits: OWN_STILL_CREDITS,
|
|
69
|
+
export const ownAgentTermsNow = (options = {}) => ({ tariff: OWN_AGENT_TARIFF, still_credits: OWN_STILL_CREDITS,
|
|
70
|
+
render_credits: OWN_FILM_RENDER_CREDITS,
|
|
60
71
|
included_seconds: OWN_FILM_INCLUDED_SECONDS, extra_second_credits: OWN_FILM_EXTRA_SECOND_CREDITS, voice_credits_per_second: OWN_VOICE_CREDITS_PER_SECOND,
|
|
61
|
-
pose_credits: OWN_HERO_POSE_CREDITS,
|
|
72
|
+
pose_credits: OWN_HERO_POSE_CREDITS, head_credits: OWN_HERO_HEAD_CREDITS, ...(options.sprites ? { sprite_credits: OWN_HERO_SPRITE_CREDITS } : {}),
|
|
73
|
+
edit_credits: OWN_EDIT_CREDITS, music_credits: MUSIC_BED_CREDITS, film_music_credits: FILM_MUSIC_BED_CREDITS,
|
|
74
|
+
take_check_credits: OWN_TAKE_CHECK_CREDITS,
|
|
62
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,
|
|
63
76
|
cut_extra_second_credits: OWN_CUT_EXTRA_SECOND_CREDITS, cut_bed_credits: OWN_CUT_BED_CREDITS,
|
|
64
77
|
cut_take_sound_credits_per_second: OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, cut_music_credits: MUSIC_BED_CREDITS });
|
|
65
|
-
export const isOwnAgentEnabled = (env) => env.CLIPWRIGHT_OWN_AGENT === "1";
|
|
66
78
|
const seconds = (s, max, what) => {
|
|
67
79
|
if (!Number.isFinite(s) || s <= 0 || s > max)
|
|
68
80
|
throw new Error(`${what} of ${s} s is outside 0–${max} s`);
|
|
@@ -73,19 +85,35 @@ const frames = (n) => {
|
|
|
73
85
|
throw new Error(`${n} stills is outside 0–${OWN_STILLS_MAX_PER_CALL}`);
|
|
74
86
|
return n;
|
|
75
87
|
};
|
|
76
|
-
export
|
|
88
|
+
export function ownFilmRenderCredits(s, terms = ownAgentTermsNow(), music = false) {
|
|
89
|
+
const film = terms.render_credits + terms.extra_second_credits * Math.max(0, seconds(s, OWN_FILM_MAX_SECONDS, "a film") - terms.included_seconds);
|
|
90
|
+
if (music && terms.film_music_credits === undefined)
|
|
91
|
+
throw new Error("these terms price no film music");
|
|
92
|
+
return film + (music ? terms.film_music_credits : 0);
|
|
93
|
+
}
|
|
77
94
|
export const ownVoiceCredits = (s, terms = ownAgentTermsNow()) => terms.voice_credits_per_second * seconds(s, OWN_VOICE_MAX_SECONDS, "a take");
|
|
78
95
|
export function ownStillsCredits(n, terms = ownAgentTermsNow(), free = 0) {
|
|
79
96
|
if (!Number.isSafeInteger(free) || free < 0 || free > (terms.free_stills ?? 0))
|
|
80
97
|
throw new Error(`${free} free stills is outside these terms`);
|
|
81
98
|
return terms.still_credits * Math.max(0, frames(n) - free);
|
|
82
99
|
}
|
|
83
|
-
export function ownHeroCredits(n, terms = ownAgentTermsNow()) {
|
|
100
|
+
export function ownHeroCredits(n, terms = ownAgentTermsNow(), sprites = 0, head = false) {
|
|
101
|
+
if (head) {
|
|
102
|
+
if (terms.head_credits === undefined)
|
|
103
|
+
throw new Error("these terms price no head");
|
|
104
|
+
if (n !== 0 && n !== 1)
|
|
105
|
+
throw new Error(`${n} heads is outside 0–1`);
|
|
106
|
+
return terms.head_credits * n;
|
|
107
|
+
}
|
|
84
108
|
if (!Number.isSafeInteger(n) || n < 0 || n > OWN_HERO_POSES)
|
|
85
109
|
throw new Error(`${n} poses is outside 0–${OWN_HERO_POSES}`);
|
|
86
110
|
if (terms.pose_credits === undefined)
|
|
87
111
|
throw new Error("these terms price no hero pose");
|
|
88
|
-
|
|
112
|
+
if (!Number.isSafeInteger(sprites) || sprites < 0 || sprites > OWN_HERO_MAX_SPRITES)
|
|
113
|
+
throw new Error(`${sprites} sprites is outside 0–${OWN_HERO_MAX_SPRITES}`);
|
|
114
|
+
if (sprites > 0 && terms.sprite_credits === undefined)
|
|
115
|
+
throw new Error("these terms price no sprite");
|
|
116
|
+
return terms.pose_credits * n + (terms.sprite_credits ?? 0) * sprites;
|
|
89
117
|
}
|
|
90
118
|
export function ownEditCredits(s, terms = ownAgentTermsNow(), music = false) {
|
|
91
119
|
seconds(s, OWN_EDIT_MAX_SECONDS, "an edit");
|
|
@@ -121,11 +149,11 @@ export function ownTakeFramesCredits(sheets) {
|
|
|
121
149
|
export function ownAgentCharge(delivery, terms, heldCredits) {
|
|
122
150
|
const charge = delivery.skill === "film_stills" || delivery.skill === "film_cut_preview" ? ownStillsCredits(delivery.frames, terms, delivery.free)
|
|
123
151
|
: delivery.skill === "film_voice" ? ownVoiceCredits(delivery.seconds, terms)
|
|
124
|
-
: delivery.skill === "film_hero" ? ownHeroCredits(delivery.poses, terms)
|
|
152
|
+
: delivery.skill === "film_hero" ? ownHeroCredits(delivery.poses, terms, delivery.sprites ?? 0, delivery.head === true)
|
|
125
153
|
: delivery.skill === "film_edit" ? ownEditCredits(delivery.seconds, terms, delivery.music === true)
|
|
126
154
|
: delivery.skill === "film_take_frames" ? ownTakeFramesCredits(delivery.sheets)
|
|
127
155
|
: delivery.skill === "film_take_check" ? ownTakeCheckCredits(delivery.checks, terms, delivery.against, delivery.long === true)
|
|
128
|
-
: delivery.skill === "film_cut" ? ownCutCredits(delivery, terms) : ownFilmRenderCredits(delivery.seconds, terms);
|
|
156
|
+
: delivery.skill === "film_cut" ? ownCutCredits(delivery, terms) : ownFilmRenderCredits(delivery.seconds, terms, delivery.music === true);
|
|
129
157
|
if (!Number.isSafeInteger(heldCredits) || charge > heldCredits)
|
|
130
158
|
throw new Error(`${delivery.skill} charge ${charge} is over its hold ${heldCredits}`);
|
|
131
159
|
return charge;
|
package/dist/own-agent-runs.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export declare const TAKE_CHECKS_QUOTE_PATH = "/v1/take-checks/quote";
|
|
|
16
16
|
export declare const TAKE_CHECKS_PATH = "/v1/take-checks";
|
|
17
17
|
export declare const FILM_RUN_PATH = "/v1/film-runs/:id";
|
|
18
18
|
export declare const OWN_AGENT_FILM_TASK = "own-agent-film";
|
|
19
|
+
export declare const OWN_AGENT_CUT_TASK = "own-agent-cut";
|
|
20
|
+
export declare const OWN_AGENT_CUT_PREVIEW_TASK = "own-agent-cut-preview";
|
|
19
21
|
export declare const FILM_STILL_FPS = 30, FILM_RENDER_FPS = 25;
|
|
20
22
|
export declare const FILM_STILL_ANCHOR_LAG_SEC = 0.25;
|
|
21
23
|
export declare const FILM_TAIL_SEC = 0.8;
|
|
@@ -36,34 +38,18 @@ export declare const filmStillsInput: z.ZodObject<{
|
|
|
36
38
|
occurrence: z.ZodOptional<z.ZodNumber>;
|
|
37
39
|
}, z.core.$strict>]>;
|
|
38
40
|
}, z.core.$strict>>>;
|
|
41
|
+
scene_video: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
asset_id: z.ZodOptional<z.ZodString>;
|
|
43
|
+
run_id: z.ZodOptional<z.ZodString>;
|
|
44
|
+
from: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
}, z.core.$strict>>;
|
|
39
46
|
max_credits: z.ZodOptional<z.ZodNumber>;
|
|
40
47
|
}, z.core.$strict>;
|
|
41
48
|
export type FilmStillsInput = z.infer<typeof filmStillsInput>;
|
|
42
49
|
export type FilmStillsRequest = z.input<typeof filmStillsInput>;
|
|
43
50
|
export declare const filmVoiceInput: z.ZodObject<{
|
|
44
51
|
text: z.ZodString;
|
|
45
|
-
voice: z.ZodOptional<z.
|
|
46
|
-
narrator_en_brisk_man: "narrator_en_brisk_man";
|
|
47
|
-
narrator_en_deep_gentleman: "narrator_en_deep_gentleman";
|
|
48
|
-
narrator_en_firm_lady: "narrator_en_firm_lady";
|
|
49
|
-
narrator_en_gentle_man: "narrator_en_gentle_man";
|
|
50
|
-
narrator_en_kind_girl: "narrator_en_kind_girl";
|
|
51
|
-
narrator_en_storyteller: "narrator_en_storyteller";
|
|
52
|
-
narrator_en_wise_lady: "narrator_en_wise_lady";
|
|
53
|
-
narrator_es_serene_woman: "narrator_es_serene_woman";
|
|
54
|
-
narrator_es_storyteller: "narrator_es_storyteller";
|
|
55
|
-
narrator_fr_classic_man: "narrator_fr_classic_man";
|
|
56
|
-
narrator_it_calm_woman: "narrator_it_calm_woman";
|
|
57
|
-
narrator_it_classic_man: "narrator_it_classic_man";
|
|
58
|
-
narrator_pt_storyteller: "narrator_pt_storyteller";
|
|
59
|
-
narrator_pt_wise_lady: "narrator_pt_wise_lady";
|
|
60
|
-
narrator_ru_ambitious_woman: "narrator_ru_ambitious_woman";
|
|
61
|
-
narrator_ru_bright_queen: "narrator_ru_bright_queen";
|
|
62
|
-
narrator_ru_deep_man: "narrator_ru_deep_man";
|
|
63
|
-
narrator_ru_reliable_man: "narrator_ru_reliable_man";
|
|
64
|
-
narrator_tr_confident_woman: "narrator_tr_confident_woman";
|
|
65
|
-
narrator_tr_mature_man: "narrator_tr_mature_man";
|
|
66
|
-
}>>;
|
|
52
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
67
53
|
cut_id: z.ZodOptional<z.ZodString>;
|
|
68
54
|
max_credits: z.ZodOptional<z.ZodNumber>;
|
|
69
55
|
}, z.core.$strict>;
|
|
@@ -82,6 +68,72 @@ export declare const filmRenderInput: z.ZodObject<{
|
|
|
82
68
|
occurrence: z.ZodOptional<z.ZodNumber>;
|
|
83
69
|
}, z.core.$strict>]>;
|
|
84
70
|
}, z.core.$strict>>>;
|
|
71
|
+
scene_video: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
asset_id: z.ZodOptional<z.ZodString>;
|
|
73
|
+
run_id: z.ZodOptional<z.ZodString>;
|
|
74
|
+
from: z.ZodDefault<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
music: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
track: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
acoustic_calm: "acoustic_calm";
|
|
79
|
+
acoustic_driving: "acoustic_driving";
|
|
80
|
+
acoustic_piano: "acoustic_piano";
|
|
81
|
+
ambient_calm: "ambient_calm";
|
|
82
|
+
ambient_driving: "ambient_driving";
|
|
83
|
+
ambient_medium: "ambient_medium";
|
|
84
|
+
ambient_shimmer: "ambient_shimmer";
|
|
85
|
+
beauty_dreamy: "beauty_dreamy";
|
|
86
|
+
beauty_driving: "beauty_driving";
|
|
87
|
+
beauty_medium: "beauty_medium";
|
|
88
|
+
bright_pop: "bright_pop";
|
|
89
|
+
cinematic_calm: "cinematic_calm";
|
|
90
|
+
cinematic_driving: "cinematic_driving";
|
|
91
|
+
cinematic_medium: "cinematic_medium";
|
|
92
|
+
cinematic_tension: "cinematic_tension";
|
|
93
|
+
corporate_bright: "corporate_bright";
|
|
94
|
+
corporate_calm: "corporate_calm";
|
|
95
|
+
corporate_driving: "corporate_driving";
|
|
96
|
+
corporate_medium: "corporate_medium";
|
|
97
|
+
fashion_calm: "fashion_calm";
|
|
98
|
+
fashion_disco: "fashion_disco";
|
|
99
|
+
fashion_driving: "fashion_driving";
|
|
100
|
+
fashion_luxe: "fashion_luxe";
|
|
101
|
+
food_bossa: "food_bossa";
|
|
102
|
+
food_calm: "food_calm";
|
|
103
|
+
food_driving: "food_driving";
|
|
104
|
+
food_medium: "food_medium";
|
|
105
|
+
hiphop_calm: "hiphop_calm";
|
|
106
|
+
hiphop_driving: "hiphop_driving";
|
|
107
|
+
hiphop_funky: "hiphop_funky";
|
|
108
|
+
hiphop_medium: "hiphop_medium";
|
|
109
|
+
lofi_calm: "lofi_calm";
|
|
110
|
+
lofi_jazzy: "lofi_jazzy";
|
|
111
|
+
lofi_medium: "lofi_medium";
|
|
112
|
+
lofi_rainy: "lofi_rainy";
|
|
113
|
+
luxe_cinematic: "luxe_cinematic";
|
|
114
|
+
playful_calm: "playful_calm";
|
|
115
|
+
playful_cartoon: "playful_cartoon";
|
|
116
|
+
playful_quirky: "playful_quirky";
|
|
117
|
+
runway_house: "runway_house";
|
|
118
|
+
sport_calm: "sport_calm";
|
|
119
|
+
sport_drive: "sport_drive";
|
|
120
|
+
sport_epic: "sport_epic";
|
|
121
|
+
sport_medium: "sport_medium";
|
|
122
|
+
tech_calm: "tech_calm";
|
|
123
|
+
tech_driving: "tech_driving";
|
|
124
|
+
tech_future: "tech_future";
|
|
125
|
+
tech_minimal: "tech_minimal";
|
|
126
|
+
tech_synthwave: "tech_synthwave";
|
|
127
|
+
warm_acoustic: "warm_acoustic";
|
|
128
|
+
}>>;
|
|
129
|
+
generate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodObject<{
|
|
130
|
+
mood: z.ZodString;
|
|
131
|
+
}, z.core.$strict>]>>;
|
|
132
|
+
volume: z.ZodDefault<z.ZodNumber>;
|
|
133
|
+
at: z.ZodDefault<z.ZodNumber>;
|
|
134
|
+
fade_out: z.ZodDefault<z.ZodNumber>;
|
|
135
|
+
duck: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
+
}, z.core.$strict>>;
|
|
85
137
|
max_credits: z.ZodOptional<z.ZodNumber>;
|
|
86
138
|
}, z.core.$strict>;
|
|
87
139
|
export type FilmRenderInput = z.infer<typeof filmRenderInput>;
|
|
@@ -292,6 +344,7 @@ export declare const takeCheckInput: z.ZodObject<{
|
|
|
292
344
|
fashion: "fashion";
|
|
293
345
|
product: "product";
|
|
294
346
|
}>>;
|
|
347
|
+
speed: z.ZodOptional<z.ZodBoolean>;
|
|
295
348
|
max_credits: z.ZodOptional<z.ZodNumber>;
|
|
296
349
|
}, z.core.$strict>;
|
|
297
350
|
export type TakeCheckInput = z.infer<typeof takeCheckInput>;
|
|
@@ -392,10 +445,11 @@ export declare const filmHeroInput: z.ZodObject<{
|
|
|
392
445
|
script: z.ZodOptional<z.ZodString>;
|
|
393
446
|
voice_run_id: z.ZodOptional<z.ZodString>;
|
|
394
447
|
mascot_id: z.ZodOptional<z.ZodString>;
|
|
448
|
+
head: z.ZodOptional<z.ZodBoolean>;
|
|
395
449
|
max_credits: z.ZodOptional<z.ZodNumber>;
|
|
396
450
|
}, z.core.$strict>;
|
|
397
451
|
export type FilmHeroInput = z.infer<typeof filmHeroInput>;
|
|
398
|
-
export declare function ownVoiceCeilingSeconds(text: string): number;
|
|
452
|
+
export declare function ownVoiceCeilingSeconds(text: string, tempo?: number): number;
|
|
399
453
|
export declare const ownFilmFrames: (voiceSeconds: number) => number;
|
|
400
454
|
export declare const ownFilmSeconds: (voiceSeconds: number) => number;
|
|
401
455
|
export declare const ownAgentQuoteLine: z.ZodObject<{
|
package/dist/own-agent-runs.js
CHANGED
|
@@ -5,13 +5,13 @@ import { cutId } from "./cut-ids.js";
|
|
|
5
5
|
import { diyBlocked, diyNext } from "./diy-next.js";
|
|
6
6
|
import { editMusic } from "./edit-music.js";
|
|
7
7
|
import { EXPLAINER_MAX_PRODUCT_PICTURES, facelessCustomerSceneImage, qualifiedImageUrl } from "./faceless-public.js";
|
|
8
|
-
import { FACELESS_VOICE_NAMES } from "./faceless-voices.js";
|
|
9
8
|
import { filmCutPicture } from "./film-cut.js";
|
|
10
|
-
import { filmDraftId } from "./film-drafts.js";
|
|
9
|
+
import { filmDraftId, filmSceneVideo } from "./film-drafts.js";
|
|
11
10
|
import { MASCOT_POSES } from "./mascots.js";
|
|
12
11
|
import { maxCreditsField } from "./max-credits.js";
|
|
13
12
|
import { OWN_AGENT_SKILLS, OWN_FREE_STILLS, OWN_FREE_STILLS_WINDOW_HOURS, OWN_STILLS_MAX_PER_CALL, OWN_STILLS_SINGLE_MAX, OWN_VOICE_MAX_SECONDS } from "./own-agent-price.js";
|
|
14
13
|
import { runId } from "./runs.js";
|
|
14
|
+
import { VOICE_NAME_PATTERN } from "./voices.js";
|
|
15
15
|
export const FILM_STILLS_QUOTE_PATH = "/v1/film-stills/quote";
|
|
16
16
|
export const FILM_STILLS_PATH = "/v1/film-stills";
|
|
17
17
|
export const FILM_VOICES_QUOTE_PATH = "/v1/film-voices/quote";
|
|
@@ -28,6 +28,8 @@ export const TAKE_CHECKS_QUOTE_PATH = "/v1/take-checks/quote";
|
|
|
28
28
|
export const TAKE_CHECKS_PATH = "/v1/take-checks";
|
|
29
29
|
export const FILM_RUN_PATH = "/v1/film-runs/:id";
|
|
30
30
|
export const OWN_AGENT_FILM_TASK = "own-agent-film";
|
|
31
|
+
export const OWN_AGENT_CUT_TASK = "own-agent-cut";
|
|
32
|
+
export const OWN_AGENT_CUT_PREVIEW_TASK = "own-agent-cut-preview";
|
|
31
33
|
export const FILM_STILL_FPS = 30, FILM_RENDER_FPS = 25;
|
|
32
34
|
export const FILM_STILL_ANCHOR_LAG_SEC = 0.25;
|
|
33
35
|
export const FILM_TAIL_SEC = 0.8;
|
|
@@ -46,11 +48,15 @@ export const filmStillsInput = z.strictObject({
|
|
|
46
48
|
sheet: z.boolean().default(false)
|
|
47
49
|
.describe(`Also tile the stills, in order, into one picture (3 across); always on for more than ${OWN_STILLS_SINGLE_MAX} stills`),
|
|
48
50
|
scene_images: sceneImages,
|
|
51
|
+
scene_video: filmSceneVideo.optional(),
|
|
49
52
|
max_credits: maxCreditsField,
|
|
50
53
|
});
|
|
51
54
|
export const filmVoiceInput = z.strictObject({
|
|
52
55
|
text: z.string().trim().min(1).max(OWN_VOICE_MAX_CHARS).describe("The script, spoken exactly as written"),
|
|
53
|
-
voice: z.
|
|
56
|
+
voice: z.string({ error: "voice must be a voice name from list_voices, as a string" })
|
|
57
|
+
.regex(VOICE_NAME_PATTERN, "voice is not a voice name: take one from list_voices with skill=make_faceless").optional()
|
|
58
|
+
.describe("A narrator (list_voices with skill=make_faceless); the fastest of the script's language when omitted. The API refuses a name " +
|
|
59
|
+
"list_voices does not return, before any charge"),
|
|
54
60
|
cut_id: cutId.optional().describe("The cut record this voice is for: the record then names it as its voice and says what comes next"),
|
|
55
61
|
max_credits: maxCreditsField,
|
|
56
62
|
});
|
|
@@ -59,6 +65,9 @@ export const filmRenderInput = z.strictObject({
|
|
|
59
65
|
revision: z.number().int().min(0).describe("The draft revision to render; a draft that moved on is refused with 409"),
|
|
60
66
|
voice_run_id: runId.describe("A delivered make_voice run of this account: the film is cut to its length and its words time the captions"),
|
|
61
67
|
scene_images: sceneImages,
|
|
68
|
+
scene_video: filmSceneVideo.optional(),
|
|
69
|
+
music: editMusic.optional().describe("Music under the film from at to the end: a library track (free) or one made for the film (paid on " +
|
|
70
|
+
"delivery); under the voice it plays lower"),
|
|
62
71
|
max_credits: maxCreditsField,
|
|
63
72
|
});
|
|
64
73
|
export const FILM_EDIT_WIDTH = 720, FILM_EDIT_HEIGHT = 1280, FILM_EDIT_FPS = 25;
|
|
@@ -78,11 +87,10 @@ const editClip = z.strictObject({
|
|
|
78
87
|
"words. speech and volume say how it sits in the mix"),
|
|
79
88
|
speech: z.boolean().optional().describe("With sound: true. true: the window's sound is someone speaking, so it plays at the level of " +
|
|
80
89
|
"speech and the music goes lower under it as under the voice. false: room sound or effects, which never lower the music. Omitted: " +
|
|
81
|
-
"what the clip's latest check_take heard, else false"),
|
|
90
|
+
"what the clip's latest check_take heard, if one ran, else false"),
|
|
82
91
|
volume: z.number().min(EDIT_CLIP_MIN_VOLUME_DB).max(EDIT_CLIP_MAX_VOLUME_DB).optional()
|
|
83
92
|
.describe("With sound: true. dB from the level the edit gives this window's sound: 0 (the default) near the voice, -10 well under it"),
|
|
84
|
-
slot: adSlotId.optional().describe("With ad_id: the slot of the ad this clip fills
|
|
85
|
-
"check_take in that slot; your own footage needs no check"),
|
|
93
|
+
slot: adSlotId.optional().describe("With ad_id: the slot of the ad this clip fills"),
|
|
86
94
|
}).refine(clip => (clip.run_id === undefined) !== (clip.asset_id === undefined), "name the clip by run_id or by asset_id, one of them")
|
|
87
95
|
.refine(clip => clip.to > clip.from, "to must be after from")
|
|
88
96
|
.refine(clip => clip.sound !== true || clip.run_id !== undefined, { path: ["sound"], message: "a clip's own sound is kept only from a generate_video run made with audio: true" })
|
|
@@ -141,8 +149,7 @@ export const filmEditInput = z.strictObject({
|
|
|
141
149
|
ambience: editAmbience.optional().describe("Free: the place's quiet room sound, a stretch of one of your clips' own sound repeated " +
|
|
142
150
|
"smoothly under the whole cut whatever its windows and their speed, so every window can play silent and sped up. It never lowers the " +
|
|
143
151
|
"music and the voice stays on top of it; it goes with a voice, music or a clip's own sound"),
|
|
144
|
-
ad_id: adId.optional().describe("The ad record this cut belongs to: every clip then names its slot,
|
|
145
|
-
"that has not passed check_take in its slot is refused before any credits, unless the slot is people_only; your own footage needs no check"),
|
|
152
|
+
ad_id: adId.optional().describe("The ad record this cut belongs to: every clip then names its slot"),
|
|
146
153
|
max_credits: maxCreditsField,
|
|
147
154
|
}).refine(edit => edit.ad_id !== undefined || edit.clips.every(clip => clip.slot === undefined), "a clip's slot needs ad_id")
|
|
148
155
|
.refine(edit => edit.ad_id === undefined || edit.clips.every(clip => clip.slot !== undefined), "with ad_id, every clip names its slot");
|
|
@@ -187,7 +194,7 @@ export const pictureTakeAsk = z.strictObject({
|
|
|
187
194
|
locks: z.array(words(200)).max(TAKE_PICTURE_MAX_LOCKS).default([]).describe("What must stay as the picture shows it"),
|
|
188
195
|
});
|
|
189
196
|
const hexColour = z.string().regex(/^#[0-9a-fA-F]{6}$/, "a colour is #RRGGBB");
|
|
190
|
-
const PICTURE_ONLY = ["look", "picture", "cut_id"], MOTION_ONLY = ["product_image", "moves", "format", "ad_id"];
|
|
197
|
+
const PICTURE_ONLY = ["look", "picture", "cut_id"], MOTION_ONLY = ["product_image", "moves", "format", "ad_id", "speed"];
|
|
191
198
|
export const takeCheckInput = z.strictObject({
|
|
192
199
|
...takeSource,
|
|
193
200
|
against: z.enum(TAKE_CHECK_AGAINST).optional().describe("motion (an ad shot, the default) or picture: the take against the picture it was " +
|
|
@@ -210,6 +217,7 @@ export const takeCheckInput = z.strictObject({
|
|
|
210
217
|
slot: adSlotId.optional().describe("With ad_id or cut_id: the slot of the record this take is for; on a cut record, a slot that needs a take"),
|
|
211
218
|
format: z.enum(TAKE_MOTION_FORMATS).optional().describe("What the take's motion is measured against: fashion (people and clothes in " +
|
|
212
219
|
"motion: fashion, lifestyle, sport) or product (a product worked in the hands); omitted, product"),
|
|
220
|
+
speed: z.boolean().optional().describe("true: also look for things hanging in the air (slow motion), same price; off by default"),
|
|
213
221
|
max_credits: maxCreditsField,
|
|
214
222
|
}).refine(oneTake, ONE_TAKE)
|
|
215
223
|
.superRefine((v, ctx) => {
|
|
@@ -268,11 +276,17 @@ export const filmHeroInput = z.strictObject({
|
|
|
268
276
|
voice_run_id: runId.optional().describe("With no character and no script: a delivered make_voice run of this account, whose text is the script"),
|
|
269
277
|
mascot_id: assetId.optional().describe("Alone, instead of the fields above: a saved mascot of this account (list_assets with mascot true) that lacks " +
|
|
270
278
|
"poses. Only the poses it lacks are drawn, in its look, and added to it, so the same mascot_id then has them"),
|
|
279
|
+
head: z.boolean().optional().describe("true with character_reference, your own photo saved as an asset with rights_confirmed (create_asset) or " +
|
|
280
|
+
"your actor's picture (list_actors): draws only the head as a cartoon that talks, blinks, " +
|
|
281
|
+
"smiles, looks surprised and looks aside, saved as a mascot whose mascot_id a film's actor wears; one price per head, charged only when the " +
|
|
282
|
+
"head is saved with all its pictures"),
|
|
271
283
|
max_credits: maxCreditsField,
|
|
272
284
|
}).refine(value => value.mascot_id !== undefined || FILM_HERO_SOURCE_FIELDS.some(field => value[field] !== undefined), "name the hero with character_reference or character_details, pass script or voice_run_id, or pass mascot_id")
|
|
273
|
-
.refine(value => value.mascot_id === undefined || FILM_HERO_SOURCE_FIELDS.every(field => value[field] === undefined), `mascot_id completes a saved mascot and takes no other field: drop ${FILM_HERO_SOURCE_FIELDS.join(", ")}`)
|
|
274
|
-
|
|
275
|
-
|
|
285
|
+
.refine(value => value.mascot_id === undefined || FILM_HERO_SOURCE_FIELDS.every(field => value[field] === undefined), `mascot_id completes a saved mascot and takes no other field: drop ${FILM_HERO_SOURCE_FIELDS.join(", ")}`)
|
|
286
|
+
.refine(value => value.head !== true || (value.character_reference !== undefined && value.script === undefined
|
|
287
|
+
&& value.voice_run_id === undefined && value.mascot_id === undefined), "head is drawn from character_reference (with character_details if you like): pass it, and drop script, voice_run_id and mascot_id");
|
|
288
|
+
export function ownVoiceCeilingSeconds(text, tempo = 1) {
|
|
289
|
+
return Math.ceil(text.length / (OWN_VOICE_SLOWEST_CHARS_PER_SECOND * tempo)) + 2;
|
|
276
290
|
}
|
|
277
291
|
export const ownFilmFrames = (voiceSeconds) => Math.ceil((voiceSeconds + FILM_TAIL_SEC) * FILM_RENDER_FPS);
|
|
278
292
|
export const ownFilmSeconds = (voiceSeconds) => +(ownFilmFrames(voiceSeconds) / FILM_RENDER_FPS).toFixed(2);
|
package/dist/parts-pricing.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type FaceBillingInterval, type PartsFaceTariff, type
|
|
2
|
+
import { type FaceBillingInterval, type PartsFaceTariff, type ShortPresenterEngine, type ShotEngine, type TakeEngine } from "./face-billing.js";
|
|
3
3
|
import type { Resolution } from "./skills.js";
|
|
4
|
-
export declare const PARTS_PRICING_VERSION = "parts-
|
|
5
|
-
export declare const PRESENTER_CREDITS_PER_SECOND: Readonly<Record<
|
|
4
|
+
export declare const PARTS_PRICING_VERSION = "parts-v5";
|
|
5
|
+
export declare const PRESENTER_CREDITS_PER_SECOND: Readonly<Record<ShortPresenterEngine, number>>;
|
|
6
6
|
export declare const PRODUCTION_CREDITS_PER_SECOND = 1;
|
|
7
7
|
export declare const LIVE_AVATAR_STILL_CREDITS = 400;
|
|
8
8
|
export declare const DELIVERED_VIDEO_MINIMUM_CREDITS = 50;
|
|
9
9
|
export declare const SCENE_CREDITS = 25;
|
|
10
|
-
export declare const PRESENTER_ENGINE_LABELS: Readonly<Record<
|
|
10
|
+
export declare const PRESENTER_ENGINE_LABELS: Readonly<Record<ShortPresenterEngine, string>>;
|
|
11
11
|
type MethodShotEngine = "shot_omni" | "shot_seedance" | "shot_omni_no_text" | "shot_seedance_no_text";
|
|
12
12
|
export declare const METHOD_SHOT_CREDITS_PER_SECOND: Readonly<Record<Exclude<Resolution, "4k">, Readonly<Record<MethodShotEngine, number>>>>;
|
|
13
13
|
export declare const SHOT_CREDITS_PER_SECOND: Readonly<Record<ShotEngine, number>>;
|
|
14
14
|
export declare const SHOT_ENGINE_LABELS: Readonly<Record<ShotEngine, string>>;
|
|
15
|
+
export declare const PARTS_V2_FACE_TARIFF: PartsFaceTariff;
|
|
15
16
|
export declare const PARTS_FACE_TARIFF: PartsFaceTariff;
|
|
16
17
|
export declare const PARTS_OMNI_PRICING_VERSION = "parts-v3";
|
|
17
18
|
export declare const PARTS_OMNI_FACE_TARIFF: PartsFaceTariff;
|
|
@@ -24,12 +25,18 @@ export declare const durationPartsTariffSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
24
25
|
presenterCreditsPerSecond: z.ZodReadonly<z.ZodObject<{
|
|
25
26
|
heygen: z.ZodNumber;
|
|
26
27
|
omnihuman: z.ZodNumber;
|
|
28
|
+
heygen_avatar6_turbo: z.ZodOptional<z.ZodNumber>;
|
|
27
29
|
}, z.core.$strict>>;
|
|
28
30
|
productionCreditsPerSecond: z.ZodNumber;
|
|
29
31
|
minimumCredits: z.ZodNumber;
|
|
32
|
+
presenterEngine: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
heygen: "heygen";
|
|
34
|
+
heygen_avatar6_turbo: "heygen_avatar6_turbo";
|
|
35
|
+
}>>;
|
|
30
36
|
}, z.core.$strict>>;
|
|
31
37
|
export type DurationPartsTariff = z.infer<typeof durationPartsTariffSchema>;
|
|
32
38
|
export declare const PARTS_DURATION_TARIFF: DurationPartsTariff;
|
|
39
|
+
export declare function durationPartsTariffFor(engine: "heygen" | "heygen_avatar6_turbo"): DurationPartsTariff;
|
|
33
40
|
export declare const partsLineSchema: z.ZodObject<{
|
|
34
41
|
label: z.ZodString;
|
|
35
42
|
unit: z.ZodEnum<{
|
|
@@ -61,7 +68,9 @@ export interface PartsMeasure {
|
|
|
61
68
|
liveAvatarStills: number;
|
|
62
69
|
}
|
|
63
70
|
export declare function calculatePartsCharge(measure: PartsMeasure, tariffInput: PartsFaceTariff, delivered: boolean): PartsCharge;
|
|
64
|
-
export declare
|
|
71
|
+
export declare const PRODUCTION_LINE = "production (voice and render)";
|
|
72
|
+
export declare const PRODUCTION_RENDER_LINE = "production (render)";
|
|
73
|
+
export declare function calculateDurationPartsCharge(durationSec: number, engine: ShortPresenterEngine, tariffInput: DurationPartsTariff, delivered: boolean, heldSec?: number, deliveredVoice?: boolean): PartsCharge;
|
|
65
74
|
export declare const partsBillingSummarySchema: z.ZodReadonly<z.ZodObject<{
|
|
66
75
|
pricingVersion: z.ZodString;
|
|
67
76
|
lines: z.ZodArray<z.ZodObject<{
|